Integrations
Better Data provides a robust, production-ready integration for Shopify using the Storefront API. This allows any AI to search your catalog, check stock, and create draft orders.
@commercegateway/commerce-gateway package installed1import { ShopifyBackend } from '@commercegateway/commerce-gateway/shopify';2 3const shopify = new ShopifyBackend({4 domain: process.env.SHOPIFY_DOMAIN!, "cmt">// e.g. mystore.myshopify.com5 accessToken: process.env.SHOPIFY_STOREFRONT_TOKEN!,6 apiVersion: '2024-01',7});1const gateway = new LLMGateway({2 backends: {3 products: shopify,4 cart: shopify,5 orders: shopify,6 },7});Supports natural language searching, filtering by collections, and tag-based discovery.
The backend automatically queries Shopify's internal inventory levels to provide accurate "Available to Promise" quantities to the LLM.
When a user is ready to checkout, the gateway creates a Shopify Draft Order and provides a secure link for the user to complete payment on your Shopify-hosted checkout page.
1interface ShopifyConfig {2 domain: string;3 accessToken: string;4 apiVersion?: string;5 "cmt">// Optional: Only include specific collections6 collections?: string[];7 "cmt">// Optional: Map custom metafields to product attributes8 metafieldMap?: Record<string, string>;9}unauthenticated_read_product_listings and unauthenticated_write_checkouts scopes.