Agentic Commerce for Headless & Custom Stores
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.
| Capability | Native today | Status / access | Custom work we do |
|---|---|---|---|
| Browser agent tools on a Shopify headless storefront | Yes, WebMCP on Hydrogen 2026-10 storefronts that render ShopifyScripts | Agent support limited to Chromium browsers | Non-Hydrogen frameworks such as a custom Next.js storefront on Shopify |
| Single-store catalog search for Shopify backends | Yes, Storefront Catalog MCP at /api/ucp/mcp on the store domain | UCP 2026-08-25; agent profile required | Agents and assistants that consume it |
| UCP on a BigCommerce Catalyst storefront | Yes, Catalyst 1.12.0 proxies /.well-known/ucp and /api/ucp/* | Customized proxy files need a matcher update | Proxy maintenance and version testing |
| WebMCP on BigCommerce headless | Default for Catalyst on Cloudflare; custom headless on Cloudflare via Support | Browser support limited and evolving | Other hosting setups: not verified as of 2026-11-29 |
| Listing a non-Shopify brand in AI channels via Shopify | Shopify Agentic plan adds products to Shopify Catalog without a Shopify online store | Agentic checkout off by default on that plan | Catalog sync from your backend and eligibility checks |
| Custom backend with no platform agent tools | No | Not applicable | Adapter, 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.
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| Component | Responsibility | Typical implementation | Can be skipped when |
|---|---|---|---|
| Catalog source | Authoritative products, variants, attributes, and IDs | Existing backend catalog API or PIM | Never; it already exists |
| Adapter | Normalize IDs, variant options, units, and attribute names into one agent-facing shape | TypeScript module behind Next.js route handlers | The platform already exposes agent tools you can use as-is |
| Agent tools | Search, product detail, availability, cart handoff, policy answers | MCP server or plain HTTP tools; see MCP server development | You only need feeds for discovery |
| Inventory and price validation | Confirm stock and price at action time from the system that owns them | Direct backend or ERP call with short timeout; see inventory and pricing integration | Never skip when tools can add to cart |
| Cart handoff | Create a cart in the existing backend and return a checkout URL | Backend cart API; merchant checkout unchanged | Discovery-only projects |
| Feed export | Scheduled snapshots for AI shopping surfaces | Job reading the adapter; see product feed integration | No feed-based surface is targeted |
| Observability | Make failures visible and explainable | Structured logs, error codes, freshness metrics; see monitoring | Never |
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.
// 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.
| Addition | Touches backend how | Backend change needed? |
|---|---|---|
| Feed export | Reads catalog | No |
| Search and product detail tools | Reads catalog via adapter | No |
| Live availability tool | Reads inventory and price APIs | Only if no low-latency read API exists |
| Cart handoff tool | Calls existing cart API; returns checkout URL | No, if the backend supports API cart creation |
| Structured data on PDPs | Storefront rendering only | No; see product schema implementation |
| UCP checkout endpoints | Checkout session, payment handler, order webhooks | Often 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?
| Situation | Recommendation | Why |
|---|---|---|
| You want discovery in AI shopping surfaces | Feeds and structured data first | Protocol checkout is not needed for discovery |
| You run an on-site assistant | Agent tools with cart handoff | You control both ends; no external protocol required |
| You target Google agentic checkout and qualify via Merchant Center | UCP over REST, scoped as a separate project | Google's documented default path |
| You are accepted into a ChatGPT checkout program | Follow OpenAI's current spec for that program | OpenAI documents its product checkout conversion plugins as a beta with approved partners |
| You need agents to call your backend from many clients | MCP server over your adapter | One 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.
| Factor | Favors provider or platform | Favors custom build |
|---|---|---|
| Catalog shape | Standard products and variants | Configurable, bundled, or fitment-dependent products |
| Data location | All in one platform | Split across PIM, ERP, and OMS |
| Target surfaces | Those the provider already supports | An on-site assistant or surfaces the provider lacks |
| Control | Acceptable to follow provider release cycles | Need your own error behavior, logging, and versions |
| Maintenance | No in-house engineering | Engineers 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
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
Adapter
Write a TypeScript adapter that joins backend catalog data with ERP stock and normalizes variant IDs.
- 3
Feed
Export a validated product feed from the adapter on a schedule.
- 4
Tools
Expose search, product, availability, and cart-handoff tools for the merchant's on-site assistant, with structured errors.
- 5
Observability
Log every tool call with outcome and error code, and alert on inventory timeouts and price mismatches.
- 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.
| Item | Pin | What we test |
|---|---|---|
| Next.js and Node.js | Exact versions in the lockfile | Route handler timeouts and caching behavior |
| MCP specification | 2026-07-28 | Tool schemas, state-handle binding, least-privilege scopes |
| UCP (if used) | The version the target surface declares, e.g. 2026-08-25 | Version negotiation and separate endpoints per version |
| Platform APIs | Backend API version (for example Hydrogen 2026-10 or Catalyst 1.12.0) | Cart creation and checkout URL validity |
| Failure cases | Fixed synthetic fixtures | Out 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.
Related
- Next.js agentic commerce architectureThe full Next.js walkthrough.
- Catalog-to-cart demonstrationThe pattern on a synthetic catalog.
- MCP server developmentAgent tools over your adapter.
- Inventory and pricing integrationLive validation from ERP and OMS.
- UCP integrationProtocol checkout after an eligibility check.
- Product feed integrationFeeds for AI shopping surfaces.
Sources
- Shopify Help Center: Agentic storefronts — Checked 2026-11-29
- Shopify Help Center: Shopify Agentic plan — Checked 2026-11-29
- Shopify.dev: Storefront Catalog MCP — UCP 2026-08-25
- Shopify.dev: WebMCP tools — Hydrogen 2026-10
- Google Merchant: UCP FAQ — Checked 2026-11-29
- BigCommerce: Catalyst 1.12.0 release notes
- OpenAI: Submit product feeds
- Agentic Commerce Protocol docs
- OpenAI: Product checkout conversion spec — Beta with approved partners
- 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.