# Implement the OpenAI module Architect and implement your commercetools integration with the OpenAI module to enable AI-powered product discovery in ChatGPT. Before following this guide, complete [Prepare your project for agentic commerce](/learning-prepare-for-agentic-commerce/prepare-for-agentic-commerce/overview.md) to ensure your Project meets the foundational configuration requirements. This guide covers OpenAI-specific implementation details including: - The commercetools AI Hub OpenAI module architecture - Product feed specification and delivery - Production readiness and testing ## The commercetools solution for OpenAI Instead of building a new commerce stack from the ground up, you can leverage your existing commercetools Project to power agentic commerce in ChatGPT. The commercetools AI Hub is an add-on product that enables you to make your products, pricing, and availability discoverable within GenAI channels like ChatGPT, while shoppers complete their purchases on your own storefront or app. AI Hub allows you to: - **Capitalize on your investment:** use your existing product data, business logic, and backend systems. - **Maintain a single source of truth:** your Project continues to manage all products, pricing, inventory, and orders. - **Add a new channel, not a new silo:** ChatGPT becomes another "head" consuming your Project, similar to a new website or mobile app. ### AI Hub modules AI Hub offers purpose-designed modules for leading GenAI channels such as OpenAI, Microsoft Copilot, and more. Each module follows the technical specification of its respective platform, allowing merchants to publish structured product, pricing, and inventory data that AI systems can understand and act on. Behind the scenes, AI Hub modules handle everything from data freshness to payment flow, turning AI conversations into trusted and revenue-ready commerce moments. This guide focuses on the **AI Hub OpenAI module.** The module manages OpenAI-specific feed integration requirements so ChatGPT can index your product data reliably. ### Solution architecture The commercetools solution for OpenAI agentic commerce is built on a composable architecture that leverages your existing setup. **Product discovery via feeds:** the AI Hub OpenAI module generates a structured product feed directly from your commercetools data. This product feed contains up-to-date information like titles, descriptions, prices, and inventory. This feed is the source of truth that enables ChatGPT to accurately index your products and match them to user queries. By using your existing product data, you ensure consistency across all channels and avoid data duplication. The quality of this feed is essential for visibility on the platform. **Merchant-owned purchase flow:** when a shopper decides to buy, ChatGPT sends them to your storefront or app to complete the purchase. The AI Hub OpenAI module supports this by publishing accurate product data, pricing, availability, and product URLs. Currently, the AI Hub OpenAI module supports embedded pricing with support for Standalone and External prices to follow. **Merchant-controlled conversion:** purchases complete on your own storefront or app so you keep your existing payment, fulfillment, and post-purchase processes. You remain the merchant of record for every transaction, and shoppers complete purchases on your own storefront or app. **Scalability and performance:** commercetools and the AI Hub OpenAI module are designed for enterprise-grade scale. The AI Hub OpenAI module efficiently manages product feed updates using batching and delta detection, enabling near-real-time synchronization with minimal performance impact. ## The end-to-end shopper journey This architecture enables a seamless shopper journey from discovery in ChatGPT to purchase on your own channel: ![ChatGPT conversation showing a customer asking for help finding blue running shoes in size 10.](https://docs.commercetools.com/agentic-commerce/images/chatgpt-shopping-request-1.png) 1. **Product discovery:** ChatGPT uses the product feed from your commercetools Project to find and display relevant items. Product results on ChatGPT are organic and unsponsored, ranked by relevance to the query. ![ChatGPT displaying three sneaker recommendations with product images, names, colorways, prices, and retailer information.](https://docs.commercetools.com/agentic-commerce/images/recommended-products-1.png) 2. **Comparing options:** The user clicks a product. ChatGPT shows a detailed view with information sourced from your catalog, including price, shipping estimates, and merchant details. Merchants are ranked by factors like availability, total price, and seller quality. ![Product detail view showing a sneaker with multiple retailer options, including prices, stock availability, and delivery estimates.](https://docs.commercetools.com/agentic-commerce/images/option-1-1.png) 3. **Purchase on your storefront:** when the shopper is ready to buy, ChatGPT sends them to your product page or storefront app to complete the purchase. You handle payment, confirmation emails, returns, and support through your existing storefront and customer service processes. ## OpenAI product feed The product feed is a structured file containing your catalog information, following OpenAI's [Product Feed Specification](https://developers.openai.com/commerce/specs/feed). OpenAI uses this feed to index your products in ChatGPT's search index, enabling the AI to answer customer queries correctly. ### Feed delivery and format - **Delivery:** You provide the secure endpoint OpenAI gave you during onboarding to the AI Hub OpenAI module, which pushes the feed to OpenAI. The system transfers data over HTTPS to an authorized URL or storage bucket. - **Format:** OpenAI supports multiple file formats: TSV, CSV, XML, or JSON. The AI Hub OpenAI module handles the format, allowing you to focus on the content of the feed. - **Frequency:** OpenAI's system accepts updates every 15 minutes. The AI Hub OpenAI module handles this automatically. ### Product Selections and the feed The AI Hub OpenAI module respects Product Selection assignments at the [Store](/api/projects/stores.md) level. When you configure a Store with a Product Selection, only products included in that selection appear in the generated feed for that Store. ### Product Tailoring for ChatGPT Product Tailoring enables you to customize product information for the ChatGPT channel without modifying your main product data. The AI Hub OpenAI module automatically prioritizes Product Tailoring over main product data when generating feeds. #### Context differences between channels | Your Website | ChatGPT | | :--- | :--- | | Your branding is visible throughout the interface. | Products from multiple brands appear together in search results. | | You can display product attributes as structured data with filters and facets. | Custom attributes cannot be displayed as structured data. | | You can render visual elements like color swatches and size charts. | Visual presentation is limited to images and text descriptions. | | The product context is clear from the navigation and page layout. | The AI agent relies entirely on text-based information to match products to queries. | #### Tailoring strategies for ChatGPT Use Product Tailoring to adapt your product presentation for ChatGPT without changing your main product data: **Title enhancement:** - Main product title: `Yoga Pants` - Tailored title for ChatGPT: `AcmeActive Yoga Pants Blue` The tailored title includes the brand name and color. This is essential for differentiation in a multi-brand environment where the customer cannot see color swatches. **Description enrichment:** - Main product description: `Fashionable outdoor jacket for every lifestyle` - Main product attributes: - Waterproof: Yes - Lightweight: Yes - Reflective Elements: Yes - Tailored description for ChatGPT: `Fashionable outdoor jacket for every lifestyle. It is waterproof, lightweight and has reflective elements.` The tailored description incorporates key attributes into the narrative text because ChatGPT cannot display custom attributes as structured fields. **Image prioritization:** Select specific images that work better in ChatGPT's presentation format, such as product shots on white backgrounds versus lifestyle imagery. #### Implementation workflow Follow this sequence to configure product selection and tailoring for ChatGPT: 1. **Create a Product Selection:** define which products should appear in ChatGPT based on brand, inventory, quality, region, or promotional criteria. 2. **Assign the Product Selection to your ChatGPT Store:** link the Product Selection to the Store you configured for ChatGPT integration. 3. **Identify products requiring tailoring:** review products where main data is optimized for your website but needs adaptation for ChatGPT's context. 4. **Create Store-specific Product Tailoring:** apply tailored titles, descriptions, and images to products in your ChatGPT Store. 5. **Validate transformations:** test sample products to ensure tailored content improves discoverability in AI-driven search. ### OpenAI feed field categories OpenAI's specification organizes fields into three categories based on when they're required: **Required fields** must be present for every product in your feed. These enable basic product discovery and evaluation. Examples include product ID, title, description, price, and availability. **Conditional fields** depend on your business model or product characteristics. For example, you must include the `condition` field if you sell refurbished or used goods. You must provide at least one product identifier: either `gtin` or `mpn`. **Optional fields** enhance the shopping experience but aren't mandatory. These include rich media (videos, additional images), advanced pricing details (unit pricing, pricing trends), dimensions, and fulfillment information. The AI Hub OpenAI module handles most field mappings automatically using your existing commercetools data structure. Your primary task is ensuring your product data model contains the necessary information and, where needed, adding custom attributes for specialized fields. [Stores](/learning-model-your-business-structure/stores-and-channels/overview.md) are the entry point for setting up your product feeds. You can have a product feed per Store. #### OpenAI-specific field details The following details are specific to OpenAI's feed specification: - **Brand** is required for most product categories, excluding movies, books, and musical recordings. - **Product category** ensures proper classification in OpenAI's taxonomy. Every product must be assigned to at least one category. The AI Hub OpenAI module automatically derives the category path from your Category assignments, using the deepest (most specific) path for products in multiple categories. - **GTIN** (Global Trade Item Number, including UPC, EAN, ISBN) is preferred, but you can use **MPN** (Manufacturer Part Number) if GTIN isn't available. - **Returns:** if you enable returns, you must provide `return_policy` (URL) and `return_window` (days). By default, these are mapped from Store Custom Fields, but you can modify the template to source them differently. - **Seller information:** `seller_name` and `seller_url` are required for all products. By default, these fields are mapped from your Store Custom Fields, but you can modify the template to source them differently. - The AI Hub OpenAI module automatically includes all variant images in the feed. - The AI Hub OpenAI module maps sale prices, unit pricing measures, and pricing trends from your [Embedded Prices](/api/pricing-and-discounts-overview.md#embedded-prices) and active discounts. - `item_group_id` and `item_group_title` fields are handled automatically using your Product structure, grouping Variants under their parent Product. - The AI Hub OpenAI module provides flexible attribute mapping. For example, you can map an existing attribute like `tradename` to the `brand` feed field without renaming it in your Product Type. #### Implement product attributes for the OpenAI feed To support the OpenAI feed, you may need to extend your [Product Types](/api/projects/productTypes.md) with new attributes: 1. Add new [Attribute Definitions](/api/projects/productTypes.md#attributedefinition) to your Product Types through the Merchant Center or API. 2. Backfill existing products with correct values before enabling the feed. 3. Mark critical attributes as required in commercetools to enforce data quality. 4. Configure attribute mappings in the AI Hub OpenAI module settings. When you add new attributes to your Product Type, ensure you backfill all existing products with correct values before enabling the feed. The AI Hub OpenAI module automatically excludes products missing required fields from the feed. #### Reference documentation For complete field-by-field mapping specifications including exact attribute names, data types, and format requirements, see: - [Product data mapping](/agentic-commerce/ai-hub/openai/product-data.md) — core product fields, identifiers, and variants - [Item information mapping](/agentic-commerce/ai-hub/openai/item-information.md) — physical attributes including brand, material, weight, and dimensions - [Price and promotions mapping](/agentic-commerce/ai-hub/openai/price-and-promotions.md) — pricing fields and discount handling - [Availability and inventory mapping](/agentic-commerce/ai-hub/openai/availability-and-inventory.md) — stock status and quantity - [Fulfillment and returns mapping](/agentic-commerce/ai-hub/openai/fulfillment-and-returns.md) — shipping and return policies - [Merchant information mapping](/agentic-commerce/ai-hub/openai/merchant-information.md) — seller details for OpenAI product discovery - [Performance and compliance mapping](/agentic-commerce/ai-hub/openai/performance-and-compliance.md) — performance signals and compliance fields ## Initial full feed load When you're ready to integrate, the first step is sending a full catalog feed to OpenAI. The AI Hub OpenAI module automates this export. ### What happens during the initial load 1. The AI Hub OpenAI module fetches all relevant products from your Store. It gathers all necessary fields for each product and formats them per the OpenAI spec. 2. The full feed is delivered to OpenAI's ingestion endpoint. Depending on your setup with OpenAI, the AI Hub OpenAI module might provide you with a feed-compatible file export, directly **PUT** the file to an S3 bucket, or make an API call to upload the data. All communication is over encrypted channels as required. 3. OpenAI processes this feed, validates the schema (ensures all required fields are present and properly formatted) and indexes the records. Depending on the catalog size, this might take from a few minutes to a couple of hours. OpenAI's team might coordinate with you during this step, and if they find errors (for example, a field has a wrong data type or a URL is broken), they'll ask for corrections. 4. The initial feed serves as a baseline. It ensures that even if subsequent incremental updates fail or miss something, OpenAI has a complete snapshot to fall back on. The agent won't surface your products until this initial indexing is done. In terms of performance, the AI Hub OpenAI module is optimized to handle large catalogs. For catalogs with 500K or 1M products, the full export is chunked. commercetools APIs and the AI Hub OpenAI module's batching ensures the load can complete in reasonable time. Full feed loads typically need to be done once. If you have a major resync (for example, if you made numerous structural changes), you might trigger another full export, but usually not frequently. Make sure all products you want discoverable are included and that the data is accurate. Check a few products in ChatGPT after indexing by doing test queries. ## Keep ChatGPT in sync with delta feeds After the initial feed is live, rely on delta updates to keep the information fresh. The AI Hub OpenAI module handles these incremental updates automatically, typically on a schedule (every 15 minutes). ### Product change tracking Any update to a product's relevant data constitutes a change: - **Price change:** a price discount activates or a price updates in commercetools. - **Inventory change:** stock quantity decreases, goes to zero, or gets restocked. - **New product added or removed:** a product launches or gets discontinued. - **Content change:** product description updates, new images are added, or other attributes change. The AI Hub OpenAI module automatically tracks changes since the last feed update using commercetools capabilities and manages the delta feed accordingly. ### Aggregation and deduplication If a product changes three times within 15 minutes (for example, the inventory drops from 5 to 4 to 3, and the price changes), the AI Hub OpenAI module consolidates that into one update in the next delta feed using the latest state (inventory 3 and new price). This deduplication prevents needless feed chatter and unnecessary delays. OpenAI's system ingests these delta feeds and updates the index for just those products, which is much faster than reprocessing everything. ## Merchant-owned purchase flow OpenAI shopping for this integration focuses on product discovery. When a shopper is ready to buy, ChatGPT sends them to your storefront or app to complete the purchase. This means you keep control of: - Payment processing through your current provider - Fulfillment, confirmation emails, returns, and support - Any custom logic already implemented in your storefront or backend ## Production readiness Before going live with the OpenAI integration, validate your setup thoroughly. ### Prerequisites Before you begin production readiness testing, ensure you have: - Completed the [Prepare your project for agentic commerce](/learning-prepare-for-agentic-commerce/prepare-for-agentic-commerce/overview.md) learning path. - A Project with the AI Hub OpenAI module installed and configured. - Your merchant application approved by OpenAI to provide product feeds. - A storefront or app that can receive shoppers from ChatGPT product results. ### Shared responsibility model The AI Hub OpenAI module manages: - Product feed generation and delivery - Product data mapping and synchronization - API calls to OpenAI for feed integration You are responsible for: - Ensuring your Product Data Model meets OpenAI product feed requirements - Installing and configuring the AI Hub OpenAI module - Testing discovery and referral workflows - Configuring business rules and operations for the ChatGPT channel on your own storefront or app ### Validate product feed compliance Your product catalog data must comply with the OpenAI Product Feed specification before you enable discoverability in ChatGPT. For common product data validations and testing procedures that apply across AI commerce integrations, see the [Readiness checklist and validation](/learning-prepare-for-agentic-commerce/prepare-for-agentic-commerce/production-readiness.md) page in the learning path. #### OpenAI-specific validation checks In addition to the generic product validation, verify the following for OpenAI compliance: - `seller_name` and `seller_url` values are configured in the AI Hub OpenAI module. - At least one product identifier (`gtin` or `mpn`) is present on each product. - Product categories are assigned so the AI Hub OpenAI module can derive category paths. ### Verify legal compliance In addition to the [general legal compliance checks](/learning-prepare-for-agentic-commerce/prepare-for-agentic-commerce/production-readiness.md#verify-legal-compliance), verify the following for OpenAI: - Confirm your product URLs resolve to the correct storefront pages and legal policies on your site. - OpenAI's production readiness requirements include feed quality, security, and compliance checks. ## The implementation path Your journey to launching agentic commerce is a structured process: 1. **Apply to OpenAI's program:** start by applying on [OpenAI's merchant portal](https://chatgpt.com/merchants). OpenAI onboards merchants in waves. 2. **Prepare your data:** ensure your [Products](/api/projects/products.md) and [Product Variants](/api/projects/products.md#productvariant) in commercetools contain the necessary [Attributes](/api/projects/productTypes.md#attributedefinition) for the product feed. This may involve adding or populating [Custom Fields](/api/projects/custom-fields.md) to provide rich data to OpenAI. 3. **Install and configure the AI Hub OpenAI module:** once approved by OpenAI, install the commercetools AI Hub OpenAI module. Configure it to map your product data to the required feed properties. 4. **Provide product feeds:** use the AI Hub OpenAI module to generate and push your initial product feed to the secure endpoint provided by OpenAI. The feed is validated for quality and completeness. 5. **Test and go live:** conduct end-to-end testing with OpenAI. Verify that products appear correctly and that product links send shoppers to the correct pages on your site or app. Once validated, OpenAI enables your integration for live users. As per OpenAI's merchant program announcement, product listings are free, and purchases completed on your site or app do not incur fees from OpenAI. ## Related pages - [Area overview page with navigation](/agentic-commerce.md)