Production readiness

Verify that your commercetools Project is fully configured for agentic commerce by validating your product catalog, testing checkout workflows, and checking error handling.

Ask about this Page
Copy for LLM
View as Markdown

After completing this page, you should be able to:

  • Use a configuration checklist to verify all required setup is complete.

  • Validate product catalog data against common feed requirements.

  • Test checkout workflows including session creation, shipping, and payment.

  • Verify error handling for payment declines and out-of-stock scenarios.

  • Confirm legal compliance URLs are correctly configured.

Before connecting your Project to any AI commerce integration, verify that all configuration is complete.

Configuration checklist

Use the following checklist to confirm readiness:

  • Currencies, languages, countries, and zones are configured in your Project.
  • Tax Categories and Tax Rates are set up for all target markets.
  • A dedicated Store is created for the agentic channel.
  • Store Custom Fields (policy URLs, merchant info) are populated.
  • If you use Distribution Channels and Supply Channels, assign them to the Store.
  • Shipping Methods are configured with any Custom Fields required by your AI platform.
  • A Product Selection is created, activated, and linked to the Store.
  • Product data includes all required fields (SKU, title, description, price, availability, image).
  • Strongly recommended product attributes (brand, GTIN/MPN, category) are populated.
  • Product Types include the necessary attribute definitions.
  • Your PSP account is active with valid API credentials.
  • API Extensions are configured for custom order numbers or business rules (if needed).

Validate product catalog compliance

Your product catalog data must meet common data requirements before you enable discoverability in an AI commerce channel.

Required validations

Verify that all products include the following required attributes:

  • SKU identifiers
  • Product titles
  • Product descriptions
  • Pricing information
  • Availability status

Verify that all products include recommended attributes to improve search relevance:

  • Brand names
  • Product categories
  • Product images
  • Variant attributes (for example, size, color)

Feed validation process

AI commerce integrations typically perform an ingestion step to validate feed records and index your products:

  1. Submit your product feed to the AI platform.
  2. Review validation errors for formatting issues or invalid values.
  3. Fix identified issues in your product catalog.
  4. Resubmit the corrected feed.

After the AI platform accepts your product feed, run test queries to verify that products appear with correct data.

Each AI platform may have additional platform-specific validation requirements beyond the common checks listed here. Consult the documentation for your specific integration.

Automated validation script

Your developers can verify that all required attributes are present and in the right format. This helps your operations team ensure data readiness for the AI commerce feed. The following example shows one way to implement this:

Validate product feed compliancetypescript
import {
  ApiRoot,
  createApiBuilderFromCtpClient,
} from '@commercetools/platform-sdk';
import { ClientBuilder } from '@commercetools/ts-client';

// Assume we have a configured API client (with auth) and projectKey
const projectKey = 'YOUR_PROJECT_KEY';
const client = new ClientBuilder()
  .withProjectKey(projectKey)
  // ... add authMiddleware and httpMiddleware with your credentials and API URL ...
  .build();
const apiRoot: ApiRoot = createApiBuilderFromCtpClient(client);

async function checkProductFeedReadiness(storeKey: string) {
  const requiredAttributes = ['brand', 'material', 'weight']; // Add attributes as per your business requirement

  const pageSize = 500;
  let lastId: string | undefined;

  // See: https://docs.commercetools.com/learning-implement-product-discovery-and-presentation/category-queries-best-practices/performance-and-scalability#the-solution-efficient-fetching-with-cursor-based-pagination
  // Use cursor-based pagination for larger catalogs
  while (true) {
    const queryArgs: any = {
      limit: pageSize,
      sort: 'id asc',
    };

    if (lastId) {
      queryArgs.where = `id > "${lastId}"`;
    }

    const productsResponse = await apiRoot
      .inStoreKeyWithStoreKeyValue({ storeKey }) // Store-scoped endpoint
      .products()
      .get({ queryArgs })
      .execute();

    const productsPage = productsResponse.body.results;

    // Validate each page immediately instead of accumulating all products in memory
    for (const product of productsPage) {
      const prodName = product.masterData.current.name['en'] || product.id;
      const masterVariant = product.masterData.current.masterVariant;
      // Check basic fields
      let issues: string[] = [];
      if (!masterVariant.sku) {
        issues.push('Missing SKU (id)');
      }
      // Check required custom attributes
      for (const attrName of requiredAttributes) {
        const attr = masterVariant.attributes?.find(
          (a) => a.name === attrName
        );
        if (!attr || attr.value === null || attr.value === '') {
          issues.push(`Missing ${attrName}`);
        }
      }
      // Example: ensure at least one price is present
      if (!masterVariant.prices || masterVariant.prices.length === 0) {
        issues.push('No price');
      }
      // Example: ensure at least one image
      if (!masterVariant.images || masterVariant.images.length === 0) {
        issues.push('No image');
      }
      // Output any issues
      if (issues.length > 0) {
        sendIssueReports(issues); // Handle issue reporting with an appropriate function
      }
    }

    if (productsPage.length < pageSize) {
      break; // No more pages
    }

    lastId = productsPage[productsPage.length - 1].id;
  }
}

Test checkout workflows

Verify checkout session creation

Without shipping address

  1. Initiate a checkout session without providing a shipping address.
  2. Verify the response indicates pending shipping calculations.
  3. Verify the response indicates pending tax calculations.
  4. Confirm no shipping options are displayed.

With shipping address

  1. Initiate a checkout session with a valid shipping address.
  2. Verify available shipping options are returned with accurate costs.
  3. Verify tax totals are calculated correctly based on the shipping address.
  4. Verify the total order amount matches the sum of items, shipping, and taxes.

Verify shipping option updates

  1. Create a checkout session with a shipping address.
  2. Select a shipping method.
  3. Verify shipping costs update to reflect the selected method.
  4. Verify taxes are recalculated if the shipping method affects tax calculations.
  5. Verify the order total reflects all changes.

Verify payment authorization

Test the end-to-end payment workflow:

  1. Complete a checkout session with a test payment method.
  2. Verify the integration authorizes the payment with your PSP.
  3. Verify a Payment object is created in your commercetools Project.
  4. Verify the Payment object contains correct authorization details, including transaction ID and amount.
  5. Confirm the Payment includes an Authorization transaction with state Pending or Success.

Verify order completion

  1. Complete a checkout session.
  2. Verify an Order is created in your commercetools Project with the correct orderNumber.
  3. Verify the AI agent displays the order number to the customer.
  4. Verify the AI agent displays all line items with quantities and prices.
  5. Verify the AI agent displays accurate order totals, including shipping and taxes.
  6. Confirm the Order state is Open or Confirmed.

Test error scenarios

Payment declined

  1. Use a test payment method that triggers a decline.
  2. Verify the AI agent informs the customer that the payment was declined.
  3. Verify the AI agent prompts the customer to provide an alternative payment method.
  4. Confirm no Order is created in your commercetools Project.
  5. Verify the Payment object records the decline reason.

Out of stock

  1. Set inventory for an item to 0 before the customer completes checkout.
  2. Attempt to complete the checkout before the delta feed syncs the inventory change.
  3. Verify the AI agent informs the customer that the item is unavailable.
  4. Verify the Order is not created in your commercetools Project.
  5. Confirm the checkout session remains active for the customer to modify their cart.

Key takeaways

  • Use the configuration checklist to systematically verify all required setup before connecting to any AI commerce integration.
  • Validate that all products include required attributes (SKU, title, description, price, availability) and recommended attributes (brand, categories, images).
  • Test checkout workflows end-to-end: session creation with and without shipping address, shipping option updates, payment authorization, and order completion.
  • Verify error handling for payment declines and out-of-stock scenarios.
  • Confirm that Terms of Service and Privacy Policy URLs are publicly accessible and correctly configured.

Test your knowledge