Platform · Headless & custom

Agentic Commerce for Headless & Custom Stores

By Michael E.Updated Sources checked

Short answer

A headless or custom store becomes usable by AI agents by adding a thin layer beside its existing backend: an adapter that reads the source-of-truth catalog, a small set of agent tools (search, product detail, live availability, cart handoff), and observable error responses. Protocol work such as UCP or ACP is worth adding only when a target AI surface you qualify for requires it.

Key takeaways

  • You rarely need to replace your commerce backend; an adapter layer reads from it and writes carts through its existing APIs.
  • Check native routes first: Shopify Hydrogen 2026-10 gets WebMCP tools, BigCommerce Catalyst 1.12.0 proxies UCP, and Shopify's Agentic plan lists non-Shopify brands in Shopify Catalog (all as documented on 2026-11-29).
  • Validate price and stock live at the moment an agent acts; feeds and caches are for discovery, not purchase confirmation.
  • Return structured, explainable errors (out of stock, price changed, variant unavailable) instead of generic failures.
  • Google documents REST as the default UCP transport for Native Checkout, with MCP in early access, so protocol choice follows the target surface.

How do we make a headless storefront work with AI agents?

Give agents a structured way to read your catalog and act on carts, backed by the same systems your storefront already uses. Agent Commerce Optimization (ACO), our approach to connecting catalogs and commerce workflows to AI shopping experiences, treats this as an integration layer, not a replatform.

Headless commerce
An architecture where the storefront (for example a Next.js app) is separate from the commerce backend and talks to it through APIs.
Adapter
Code that translates between your backend's data model and the shape agent tools return.
MCP (Model Context Protocol)
An open protocol through which AI applications call tools a server exposes.
UCP (Universal Commerce Protocol)
An open protocol for agent catalog, cart, checkout, and order capabilities; see the UCP guide.
ACP (Agentic Commerce Protocol)
An open specification for programmatic checkout between buyers, their AI agents, and sellers, documented at agenticcommerce.dev.
Cart handoff
Passing an agent-built cart to the merchant's own checkout, usually as a URL, rather than completing payment inside the agent.

Not every headless store needs every component below. Many need only a better feed and structured data; some need tools for an on-site assistant; few need protocol checkout. We size the work to the surfaces you actually target.

What do headless platforms already provide before we build anything?

If your headless store runs on a commerce platform, part of the agent layer may already exist. Check these before writing custom tools.

Native headless options and custom work, as documented on 2026-11-29
CapabilityNative todayStatus / accessCustom work we do
Browser agent tools on a Shopify headless storefrontYes, WebMCP on Hydrogen 2026-10 storefronts that render ShopifyScriptsAgent support limited to Chromium browsersNon-Hydrogen frameworks such as a custom Next.js storefront on Shopify
Single-store catalog search for Shopify backendsYes, Storefront Catalog MCP at /api/ucp/mcp on the store domainUCP 2026-08-25; agent profile requiredAgents and assistants that consume it
UCP on a BigCommerce Catalyst storefrontYes, Catalyst 1.12.0 proxies /.well-known/ucp and /api/ucp/*Customized proxy files need a matcher updateProxy maintenance and version testing
WebMCP on BigCommerce headlessDefault for Catalyst on Cloudflare; custom headless on Cloudflare via SupportBrowser support limited and evolvingOther hosting setups: not verified as of 2026-11-29
Listing a non-Shopify brand in AI channels via ShopifyShopify Agentic plan adds products to Shopify Catalog without a Shopify online storeAgentic checkout off by default on that planCatalog sync from your backend and eligibility checks
Custom backend with no platform agent toolsNoNot applicableAdapter, tools, live validation, and cart handoff described below

What does a headless agentic commerce architecture look like?

Six components sit beside your existing storefront and backend: catalog source, adapter, agent tools, live inventory and price validation, cart handoff, and observability. The diagram uses a Next.js/TypeScript stack as the concrete example.

Reference architecture (illustrative). Existing systems are unchanged; the agent layer reads from them and writes carts through their APIs.
  AI surfaces / assistants                        Existing systems (unchanged)
  ───────────────────────                        ────────────────────────────
  On-site assistant ──┐                          Commerce backend (cart, checkout, orders)
  MCP client agent ───┼──► Agent tools (MCP / HTTP)        ▲
  UCP platform* ──────┘     search_products               │ create cart via backend API
                            get_product                   │
                            check_availability ──► Live inventory & price  ◄── ERP / OMS
                            create_cart_handoff ──────────┘
                                  │
                                  ▼
                            Catalog adapter (Next.js route handlers, TypeScript)
                                  │  normalizes IDs, variants, units
                                  ▼
                            Catalog source of truth ◄── PIM / backend catalog API
                                  │
                                  └──► Feed export (OpenAI, Google Merchant Center)

  Observability: every tool call logs {tool, inputs hash, source, latency, outcome, error_code}
  * UCP endpoints only when a target surface requires them and you are eligible
Components of the reference architecture
ComponentResponsibilityTypical implementationCan be skipped when
Catalog sourceAuthoritative products, variants, attributes, and IDsExisting backend catalog API or PIMNever; it already exists
AdapterNormalize IDs, variant options, units, and attribute names into one agent-facing shapeTypeScript module behind Next.js route handlersThe platform already exposes agent tools you can use as-is
Agent toolsSearch, product detail, availability, cart handoff, policy answersMCP server or plain HTTP tools; see MCP server developmentYou only need feeds for discovery
Inventory and price validationConfirm stock and price at action time from the system that owns themDirect backend or ERP call with short timeout; see inventory and pricing integrationNever skip when tools can add to cart
Cart handoffCreate a cart in the existing backend and return a checkout URLBackend cart API; merchant checkout unchangedDiscovery-only projects
Feed exportScheduled snapshots for AI shopping surfacesJob reading the adapter; see product feed integrationNo feed-based surface is targeted
ObservabilityMake failures visible and explainableStructured logs, error codes, freshness metrics; see monitoringNever

How should agent tools validate inventory and hand off carts?

Tools should read discovery data from the adapter but confirm price and stock live before any cart action, then hand off to the merchant's existing checkout. OpenAI's feed guide makes the same distinction: a feed does not update a cart or confirm a purchase, so the live site must check the current offer.

Synthetic TypeScript sketch of an adapter interface and a cart-handoff tool with live validation and structured errors.
// adapter.ts — one interface, one implementation per backend
export interface CatalogAdapter {
  search(q: string, filters: Filters, limit: number): Promise<ProductSummary[]>;
  getProduct(id: string): Promise<Product | null>;
  liveOffer(variantId: string): Promise<{ price: Money; available: number } | null>;
  createCart(lines: CartLine[]): Promise<{ cartId: string; checkoutUrl: string }>;
}

// tools/create-cart-handoff.ts
type ToolError =
  | { code: "OUT_OF_STOCK"; variantId: string; available: number }
  | { code: "PRICE_CHANGED"; variantId: string; quoted: Money; current: Money }
  | { code: "VARIANT_NOT_FOUND"; variantId: string }
  | { code: "UPSTREAM_TIMEOUT"; source: "inventory" | "cart" };

export async function createCartHandoff(
  adapter: CatalogAdapter,
  lines: { variantId: string; qty: number; quotedPrice: Money }[],
): Promise<{ ok: true; checkoutUrl: string } | { ok: false; errors: ToolError[] }> {
  const errors: ToolError[] = [];
  for (const l of lines) {
    const offer = await withTimeout(adapter.liveOffer(l.variantId), 1500);
    if (offer === "timeout") { errors.push({ code: "UPSTREAM_TIMEOUT", source: "inventory" }); continue; }
    if (!offer) { errors.push({ code: "VARIANT_NOT_FOUND", variantId: l.variantId }); continue; }
    if (offer.available < l.qty) errors.push({ code: "OUT_OF_STOCK", variantId: l.variantId, available: offer.available });
    if (!sameMoney(offer.price, l.quotedPrice)) errors.push({ code: "PRICE_CHANGED", variantId: l.variantId, quoted: l.quotedPrice, current: offer.price });
  }
  log({ tool: "create_cart_handoff", lines: lines.length, errors: errors.map((e) => e.code) });
  if (errors.length) return { ok: false, errors };
  const cart = await adapter.createCart(lines.map(({ variantId, qty }) => ({ variantId, qty })));
  return { ok: true, checkoutUrl: cart.checkoutUrl };
}
  • Stable IDs. Tools, feeds, and carts must use the same variant IDs; see stable product IDs for variants.
  • State handles. The MCP 2026-07-28 security guidance says servers must not treat possession of a state handle (such as a cart ID) as authentication, and should bind handles to the authenticated user where one exists.
  • Untrusted text. Product descriptions and reviews returned by tools are data, not instructions to the agent.

The full Next.js walkthrough, including caching and route layout, is in Next.js agentic commerce architecture. The catalog-to-cart demonstration is where we publish this pattern running against a synthetic catalog; check that page for its current status.

What can be added without replacing the existing commerce backend?

Almost all of it. The agent layer reads from your catalog and inventory systems and creates carts through the backend's existing cart API, so checkout, payments, tax, and order management stay where they are.

AdditionTouches backend howBackend change needed?
Feed exportReads catalogNo
Search and product detail toolsReads catalog via adapterNo
Live availability toolReads inventory and price APIsOnly if no low-latency read API exists
Cart handoff toolCalls existing cart API; returns checkout URLNo, if the backend supports API cart creation
Structured data on PDPsStorefront rendering onlyNo; see product schema implementation
UCP checkout endpointsCheckout session, payment handler, order webhooksOften yes; scoped separately

Can we add UCP without rebuilding checkout?

Sometimes. Google's UCP FAQ (checked 2026-11-29) describes UCP as modular, so you choose which capabilities to support, and says merchants can build on existing payment integrations through payment handlers. Your checkout logic still has to be exposed through UCP endpoints, which is real integration work.

  • Google lists AI Mode in Google Search and the Gemini apps as launch surfaces, and requires complete, up-to-date Merchant Center feeds, brand assets, return policies, and contact information.
  • REST is Google's recommended default transport for UCP Native Checkout; stateless MCP is in early access (beta) and needs onboarding and integration testing before production.
  • Your payment service provider must be able to process Google's tokens, and Google's AI surfaces support only PAN_ONLY for allowed_auth_methods.
  • Google recommends a separate endpoint for each new spec version, for isolation and rollback.

Before building, run the UCP integration checklist. A working UCP endpoint proves only that the endpoint works; each surface still decides eligibility and display.

When is UCP or ACP integration justified for a headless store?

SituationRecommendationWhy
You want discovery in AI shopping surfacesFeeds and structured data firstProtocol checkout is not needed for discovery
You run an on-site assistantAgent tools with cart handoffYou control both ends; no external protocol required
You target Google agentic checkout and qualify via Merchant CenterUCP over REST, scoped as a separate projectGoogle's documented default path
You are accepted into a ChatGPT checkout programFollow OpenAI's current spec for that programOpenAI documents its product checkout conversion plugins as a beta with approved partners
You need agents to call your backend from many clientsMCP server over your adapterOne tool surface, many clients

For protocol differences, see ACP vs UCP vs MCP and our UCP integration service, which starts with an eligibility check.

Should we build agent tools or use a platform or provider?

Use a provider when it covers your data model and target surfaces; build when your differentiation is in data or logic a provider cannot represent. Most projects mix the two.

FactorFavors provider or platformFavors custom build
Catalog shapeStandard products and variantsConfigurable, bundled, or fitment-dependent products
Data locationAll in one platformSplit across PIM, ERP, and OMS
Target surfacesThose the provider already supportsAn on-site assistant or surfaces the provider lacks
ControlAcceptable to follow provider release cyclesNeed your own error behavior, logging, and versions
MaintenanceNo in-house engineeringEngineers who can own an adapter

See build vs buy for AI shopping assistants for a fuller decision guide.

What does a headless agentic commerce project look like?

  1. 1

    Baseline

    A synthetic Next.js storefront on a custom backend sells 9,000 lighting SKUs, with stock in an ERP. We record current feeds, structured data, and cart APIs.

  2. 2

    Adapter

    Write a TypeScript adapter that joins backend catalog data with ERP stock and normalizes variant IDs.

  3. 3

    Feed

    Export a validated product feed from the adapter on a schedule.

  4. 4

    Tools

    Expose search, product, availability, and cart-handoff tools for the merchant's on-site assistant, with structured errors.

  5. 5

    Observability

    Log every tool call with outcome and error code, and alert on inventory timeouts and price mismatches.

  6. 6

    Protocol decision

    Defer UCP until the merchant confirms Merchant Center eligibility for Google agentic checkout.

Scope depends on the number of backends, data quality, and which surfaces are in scope. We quote after scoping.

How do we test headless agent integrations, and which versions do we pin?

We pin framework, protocol, and platform versions per project and test failure paths as carefully as success paths. These are our practices; no test results are reported here.

ItemPinWhat we test
Next.js and Node.jsExact versions in the lockfileRoute handler timeouts and caching behavior
MCP specification2026-07-28Tool schemas, state-handle binding, least-privilege scopes
UCP (if used)The version the target surface declares, e.g. 2026-08-25Version negotiation and separate endpoints per version
Platform APIsBackend API version (for example Hydrogen 2026-10 or Catalyst 1.12.0)Cart creation and checkout URL validity
Failure casesFixed synthetic fixturesOut of stock, price change, missing variant, upstream timeout

Frequently asked questions

Do we have to replatform to support AI shopping agents?

Usually not. An adapter layer can read your existing catalog and inventory and create carts through your current backend, leaving checkout and order management in place. Protocol checkout is the part most likely to need backend changes.

Does every headless store need an MCP server?

No. If you only want discovery in AI shopping surfaces, a validated feed and correct structured data may be enough. MCP tools make sense when you run an assistant or need several agent clients to act on your catalog.

Why validate inventory live if we already send a feed?

Feeds are snapshots for discovery. OpenAI's feed guide says the feed does not update a cart or confirm a purchase, so the live system must check the current price and stock when a customer acts.

Which UCP transport should we implement first?

For Google's UCP Native Checkout, Google's FAQ (checked 2026-11-29) recommends REST as the default, because Merchant Center self-serve checkout validation supports only REST. Stateless MCP is in early access and needs onboarding.

We use Shopify Hydrogen. What do we get natively?

Shopify documents WebMCP tools on Hydrogen 2026-10 storefronts that render ShopifyScripts or call initializeShopifyScripts, plus the Storefront Catalog MCP endpoint on the store domain. See the Shopify platform page for what remains custom.

What should agent tools return when something fails?

A structured error the agent can explain, such as out of stock with the available quantity, or price changed with old and new values. Generic failures lead agents to retry blindly or give shoppers wrong answers.

Plan the agent layer for your headless store

Tell us your storefront framework, commerce backend, where inventory lives, and which AI surfaces or assistant you're targeting.

Sources

  1. Shopify Help Center: Agentic storefronts — Checked 2026-11-29
  2. Shopify Help Center: Shopify Agentic plan — Checked 2026-11-29
  3. Shopify.dev: Storefront Catalog MCP — UCP 2026-08-25
  4. Shopify.dev: WebMCP tools — Hydrogen 2026-10
  5. Google Merchant: UCP FAQ — Checked 2026-11-29
  6. BigCommerce: Catalyst 1.12.0 release notes
  7. OpenAI: Submit product feeds
  8. Agentic Commerce Protocol docs
  9. OpenAI: Product checkout conversion spec — Beta with approved partners
  10. MCP security best practices (2026-07-28)

Platform capabilities, eligibility, and specifications change. Sources were checked on 2026-11-29; confirm the current primary documentation before scoping an implementation. See our editorial policy and methodology.