Agentic commerce protocols
Snappy Agents speaks the open agentic commerce protocols next to its own connector, so an agent platform can sell the Snappy Marketplace without a per-user OAuth connection:
| Protocol | Who | Discovery | Endpoints | Payment |
|---|---|---|---|---|
ACP – Agentic Commerce Protocol (spec 2026-04-17, older 2026-01-30 accepted) |
OpenAI (ChatGPT Instant Checkout), Stripe | GET /.well-known/acp.json |
POST /acp/checkout_sessions, GET /acp/checkout_sessions/:id, POST /acp/checkout_sessions/:id, POST …/complete, POST …/cancel; MCP tools create_checkout_session … |
Stripe Shared Payment Token (spt_… / vt_…) charged with a PaymentIntent |
UCP – Universal Commerce Protocol (spec 2026-08-25, Google native checkout 2026-04-08) with the AP2 mandate extension |
Google (AI Mode, Gemini), Shopify (Shop app, Shop MCP, Global Catalog), partner platforms | GET /.well-known/ucp (+ GET /.well-known/jwks.json) |
POST /ucp/v1/checkout-sessions, GET, PUT, POST …/complete, POST …/cancel, GET /ucp/v1/orders/:id; MCP tools create_checkout, update_checkout, complete_checkout, get_order … |
Google Pay token issued for the Stripe gateway, charged with a PaymentIntent |
| Product feeds | ChatGPT (feed spec), Google Merchant Center (supplemental feed), Shopify Catalog (Agentic plan) | – | GET /feeds/products.jsonl, GET /feeds/google.csv, GET /feeds/products.csv (feed token) |
– |
Shopify does not publish a merchant-side protocol of its own for stores that are not on Shopify; it backs UCP, and its agent surfaces consume UCP. The path for Snappy is the UCP implementation above plus the catalog feed for the Shopify Agentic plan (products sync by external product URL, checkout on Snappy).
Both protocols map onto one protocol checkout session (pcs_…): the platform builds a cart, Snappy prices it live (item + shipping + duties + service fee per unit), the platform completes it with a scoped payment credential, and the session becomes an internal checkout (chk_…) that places one Snappy order per unit, exactly like the connector. Everything downstream (confirmation emails, tracking, cancellation, support, admin portal) is shared.
sequenceDiagram autonumber participant P as Agent platform (ChatGPT, Google, Shop) participant S as agents.snappy.com participant PSP as Stripe participant SN as Snappy API P->>S: GET /.well-known/acp.json or /.well-known/ucp (profile, keys, payment handlers) P->>S: create checkout session (line items = Snappy variant ids, buyer, address) + API key / client_credentials token + Idempotency-Key S->>SN: variant, product, availability for the ship-to country S-->>P: session with live totals, fulfillment options, messages (missing buyer info, out of stock) and links, UCP adds ap2.merchant_authorization P->>S: update (address, items) as the buyer decides P->>S: complete with the payment credential (ACP payment_data.instrument.credential spt_, UCP payment.instruments[].credential Google Pay token and ap2.checkout_mandate) S->>S: verify AP2 mandate (UCP), re-price, create guest user + quotes S->>PSP: PaymentIntent confirm (shared_payment_granted_token / card token) S->>SN: POST /v3/orders per unit (idempotent) S-->>P: completed session with order (id, number, permalink) S-->>P: order webhooks, ACP order_create and order_update (Merchant-Signature HMAC), UCP order entity to Google's order endpoint (API key) or the platform URL (RFC 9421)
Authentication of platforms
Register each platform in admin → Protocols. It receives an API key (shown once) sent as Authorization: Bearer <key> (or X-API-Key). A UCP platform can instead use OAuth client_credentials: register a confidential client with grant_types: ["client_credentials"] and scope dev.ucp.shopping.checkout:manage (or ucp:checkout), link it to the platform (oauthClientId), and exchange at POST /oauth/token. Platform tokens are refused on the user endpoints (/v1), and user tokens on the protocol endpoints; the one shared read is GET /ucp/v1/orders/:id, which a linked user's token with dev.ucp.shopping.order:read (alias of orders:read) may call for its own orders (UCP identity linking: see OAuth).
A protocol can be switched off in Settings (protocol_disabled, 503).
ACP: checkout sessions
Headers: API-Version (required; supported_versions is returned on a mismatch), Idempotency-Key (required on every POST: same key + same body replays with Idempotent-Replayed: true, same key + other body is idempotency_conflict 422, in flight is 409 with Retry-After), Request-Id (echoed), Timestamp (checked within 5 minutes when present).
Create: line_items: [{ item: { id: "<variant id>" }, quantity }] (items from the older examples is accepted), currency (usd), buyer, fulfillment_details { name, email, phone_number, address { line_one, city, state, postal_code, country } }. The response is the full session: status (not_ready_for_payment until buyer email, phone and a deliverable address are known, then ready_for_payment; complete_in_progress, completed, canceled, expired), line_items[].totals, totals (items_base_amount, subtotal, fulfillment, fee, total), fulfillment_options (one shipping option, shipping and duties are included in the price; digital for gift cards), messages (missing with param, out_of_stock, region_restricted, payment_declined, price_change…), links, capabilities.payment.handlers (one handler, dev.acp.tokenized.card, psp stripe, requires_delegate_payment: true).
Complete: payment_data: { handler_id: "stripe_spt", instrument: { type: "card", credential: { type: "spt", token: "spt_…" } }, billing_address } plus buyer. Snappy charges the token with a Stripe PaymentIntent (payment_method_data[shared_payment_granted_token], Stripe-Version 2026-09-30.preview), places the Snappy orders in the same call and answers status: completed with order { id, order_number, permalink_url, confirmation }. A declined token leaves the session open with a payment_declined message so the platform may try another instrument; a changed price is reported as a price_change warning without charging.
Order webhooks (order_create, order_update) are posted to the platform's webhook URL with the full ACP Order (status created → confirmed → processing → shipped → completed, or canceled; fulfillments[] per unit with carrier and tracking; adjustments[] for refunds and cancellations; totals including amount_refunded), signed Merchant-Signature: t=<unix>,v1=<hex hmac-sha256(secret, "<t>.<body>")>.
The MCP binding registers create_checkout_session, get_checkout_session, update_checkout_session, complete_checkout_session, cancel_checkout_session on /mcp for a platform token, with { meta: { api_version, idempotency_key }, id, payload } arguments; ACP errors come back as isError tool results whose structuredContent is the ACP error object ({type, code, message, param}); only server faults are JSON-RPC -32000 errors.
UCP: checkouts and orders
Profile: GET /.well-known/ucp lists the dev.ucp.shopping service (REST at /ucp/v1, MCP at /mcp), the capabilities dev.ucp.shopping.checkout, dev.ucp.shopping.order, dev.ucp.shopping.fulfillment, dev.ucp.common.identity_linking, dev.ucp.common.payment.ap2_mandate, the com.google.pay payment handler (Stripe gateway, publishable key from Integrations, environment and merchant from Settings) and the business keys (JWK Set, also at /.well-known/jwks.json).
Headers: UCP-Agent: profile="https://…" (required), Idempotency-Key (required on POST and PUT; a different body under the same key is 409), Request-Id. Requests signed with RFC 9421 (Signature, Signature-Input, Content-Digest) are verified against the keys of the profile URL an operator registered for the platform (never the profile the UCP-Agent header names) and refused with 401 signature_invalid when they do not verify, or when the platform has no registered profile. Responses are signed with the business key (@status, content-digest, content-type) when Sign UCP responses is on.
Create: line_items: [{ item: { id: "<variant id>" }, quantity }], buyer, fulfillment.methods[].destinations[] (Google sends city, region and postal code first, the full address on the hydration PUT). Statuses: incomplete (messages missing_buyer_info, missing_fulfillment_info, out_of_stock, address_undeliverable with JSONPath path and severity), ready_for_complete, complete_in_progress, completed (with order { id, label, permalink_url }), canceled. PUT replaces the platform-writable fields. Every response carries ap2.merchant_authorization: a detached JWS (ES256, kid from the profile keys) over the JCS form of the checkout without ap2.
Complete: payment.instruments[0] = { id, handler_id, type: "card", selected: true, credential: { type: "PAYMENT_GATEWAY", token: "<Google Pay token>" } }. With Stripe as the Google Pay gateway the token is a Stripe card token (tok_…), which Snappy charges with a PaymentIntent. When the platform sends ap2.checkout_mandate (SD-JWT+KB), or Require AP2 mandate is on, Snappy verifies the platform signature (against the registered profile's keys; agent_missing_key without one) and the key binding (typ: kb+jwt, iat within 10 minutes), verifies its own merchant authorization on the embedded checkout, and checks that id, currency, total, line items, the selected ship-to destination and the buyer match. A complete that carries a mandate may not move the destination or change the buyer; update the checkout and present a new mandate instead (mandate_required, mandate_invalid_signature, mandate_expired, mandate_scope_mismatch, merchant_authorization_invalid are returned as ucp.status: error messages). The response is the completed checkout with order.
Orders: GET /ucp/v1/orders/:id (the checkout id or the internal order id) returns the UCP order entity: line_items[].quantity { original, total, fulfilled }, fulfillment.expectations[] and append-only fulfillment.events[] (processing, shipped, in_transit, delivered, canceled, with tracking_number and tracking_url), adjustments[] (refund, cancellation), totals. The same entity is pushed on every change: to Google's order endpoint (shoppingdataintegration.googleapis.com/v1/webhooks/partners/<partner id>/events/order, X-Goog-Api-Key from Integrations) for a platform with a Google partner id, or to the platform's webhook URL with Webhook-Id, Webhook-Timestamp, UCP-Agent and an RFC 9421 signature.
The MCP binding registers create_checkout, get_checkout, update_checkout, complete_checkout, cancel_checkout, get_order with meta["ucp-agent"].profile and meta["idempotency-key"].
Product feeds
All feeds use the Snappy variant id as the item id (item_id / id / merchant_item_id), the id the checkouts take, and link to the public product page /p/<productId>?variant=<variantId> (or the base URL configured in Settings). They are protected by the feed token from Integrations → Product feeds (?token=… or Authorization: Bearer …) and cached for 30 minutes.
| Feed | For | Notes |
|---|---|---|
/feeds/products.jsonl |
ChatGPT (Business Hub → product feed, hosted URL) | is_eligible_checkout: true, seller_privacy_policy, seller_tos, target_countries, store_country, shipping_price from Snappy's breakdown |
/feeds/google.csv |
Google Merchant Center supplemental feed | native_commerce(checkout_eligibility)=TRUE, merchant_item_id = variant id |
/feeds/products.csv |
Shopify Catalog sync (Agentic plan), partners | one offer per variant with the external product URL |
Errors
Every protocol endpoint authenticates before it validates: a request without a valid platform key is 401 whatever its body carries, and a key issued for the other protocol is 403 platform_protocol_mismatch. Schema failures and malformed JSON are 400. Each protocol answers in its own shape; every code is on the Error codes page.
| Protocol | Shape | Example |
|---|---|---|
| ACP | { type, code, message, param? } with type one of invalid_request, rate_limit_exceeded, processing_error, service_unavailable |
{ "type": "invalid_request", "code": "missing", "message": "line_items is required", "param": "$.line_items" }; a validation failure is code: invalid, an unknown handler or version code: unsupported |
| UCP | the checkout envelope with ucp.status: "error", a top-level code and content, and one messages[] entry (type: error, severity: unrecoverable) |
{ "ucp": { "version": "2026-08-25", "status": "error" }, "code": "signature_invalid", "content": "…", "messages": [ … ] } |
Buyer-facing problems are not errors: a session that cannot be paid yet (not_ready_for_payment / incomplete), a declined token (payment_declined), an unavailable item (out_of_stock) or a changed price (price_change) come back as 200 with the session and its messages[], so the platform can tell the buyer what to change. Only complete on a session that is already completing (409 checkout_session_in_progress) or no longer open (409 checkout_session_not_open) refuses outright.
Session lifetime, idempotency and retries
- A session is open for Session TTL minutes (Settings, default 60). Reading an expired session returns it as
expired; theexpire-protocol-sessionsjob (Cloud Scheduler, every 10 minutes) expires the rest and purges idempotency keys older than 48 hours. - An
Idempotency-Keyis scoped to the platform and the endpoint. The same key with the same body replays the stored response (ACP addsIdempotent-Replayed: true); the same key with a different body is422 idempotency_conflictunder ACP and409under UCP; a key whose first request is still running is409 idempotency_in_flightwithRetry-After. completeis one call: the charge, the guest user, the quotes and the Snappy orders all happen inside it, and the session iscomplete_in_progresswhile it runs. Retryingcompletewith the same key replays the result and never charges twice (the PaymentIntent carries its own key scoped to the checkout). A platform that lost the response reads the session back and polls while it iscomplete_in_progress.- A charge that is declined or needs authentication leaves the session open with a
payment_declinedorrequires_3dsmessage; a token that succeeds but whose orders Snappy rejects follows the connector's path (the item is refunded and the order webhook reports it). - Order webhooks run as the
protocol-order-eventtask on Cloud Tasks (12 attempts, 5 s to 10 min back-off). Every attempt is recorded with its URL, response status and error (protocol_deliveries, listed by the admin APIGET /admin/api/protocols/deliveries), and a session's latest order webhook can be resent from admin → Protocols.
Public pages
Two pages that need no sign-in back the protocols. /p/<productId>?variant=<variantId> is the product page the feeds link to (Settings → Product page base URL points the feeds at Snappy's own pages instead). /o/<checkoutId>?t=<token> is the permalink_url returned in a completed session and in every order webhook: a signed link (HMAC of the checkout id) that shows the items, order numbers, status and tracking of that purchase. Neither is in the OpenAPI document.
Operating it
admin → Protocols shows the state of each protocol with its discovery URL and the payment provider in use, and holds everything a platform needs:
| Section | What you do there |
|---|---|
| Agent platforms | Register a platform (name, protocol, webhook URL and secret; for UCP also its profile URL and, for Google, the partner id). The API key is shown once on creation and on Rotate key; only its last four characters are kept. Disable refuses the key at once. Check profile fetches a UCP platform's profile and caches its signing keys (used to verify its request signatures and AP2 mandates); link an OAuth client id for client_credentials access. |
| Business signing keys | The ES256 keys published at /.well-known/jwks.json. Generate new signing key makes the new key current for merchant authorizations and response signatures; the previous one stays published for 14 days so in-flight mandates still verify. |
| Recent protocol checkouts | Every session with protocol, status, buyer, lines, total, the internal checkout it became and the failure reason; Resend webhook re-delivers the latest order event. Delivery attempts (URL, status, error) are on the admin API, GET /admin/api/protocols/deliveries. |
Settings → Agentic commerce protocols carries the switches (ACP, UCP, feeds), the ACP Stripe merchant id and accepted brands, Require AP2 mandate, Sign UCP responses, the Google Pay environment, merchant id and name, the feed seller name, target countries and product page base URL, the policy links advertised in discovery, and the session TTL. Integrations holds the credentials: the Stripe secret and publishable keys, Google's UCP partner id and order-webhook API key, and the feed token. Nothing on these pages needs a deploy.
Sandbox
On the sandbox (and locally) without Stripe keys the payment provider is the fake one: the ACP handler advertises psp fake, the UCP profile advertises com.snappy.fake_pay (handler id fake-pay), and the credential token picks the outcome: fake_ok succeeds (visa 4242), fake_declined is declined, fake_3ds needs authentication (refused), fake_processing completes asynchronously. With Stripe test keys, use Stripe's test helper to mint Shared Payment Tokens (POST /v1/test_helpers/shared_payment/granted_tokens) and Google Pay's TEST environment for wallet tokens.
A complete ACP purchase against the sandbox, with a key from admin → Protocols and a variant id from the feed (/feeds/products.csv) or the product pages:
BASE=https://sandbox.agents.snappy.com
H=(-H "authorization: Bearer $ACP_KEY" -H "api-version: 2026-04-17" -H "content-type: application/json")
# 1. create: not_ready_for_payment until phone and address are known (see messages[])
curl -sS "${H[@]}" -H "idempotency-key: $(uuidgen)" -X POST $BASE/acp/checkout_sessions -d '{
"line_items": [ { "item": { "id": "'$VARIANT_ID'" }, "quantity": 1 } ],
"currency": "usd",
"buyer": { "first_name": "Dana", "last_name": "Levi", "email": "dana@example.com" }
}'
# 2. update with the address: ready_for_payment, totals and fulfillment_options filled in
curl -sS "${H[@]}" -H "idempotency-key: $(uuidgen)" -X POST $BASE/acp/checkout_sessions/$SESSION_ID -d '{
"fulfillment_details": { "name": "Dana Levi", "email": "dana@example.com", "phone_number": "+15551234567",
"address": { "name": "Dana Levi", "line_one": "123 Main St", "city": "New York", "state": "NY", "postal_code": "10001", "country": "US" } }
}'
# 3. complete with the fake token: completed, order.permalink_url opens the order page
curl -sS "${H[@]}" -H "idempotency-key: $(uuidgen)" -X POST $BASE/acp/checkout_sessions/$SESSION_ID/complete -d '{
"payment_data": { "handler_id": "stripe_spt", "instrument": { "type": "card", "credential": { "type": "spt", "token": "fake_ok" } } }
}'
The same purchase over UCP, with a UCP platform key (the UCP-Agent profile URL names the calling platform; it does not have to resolve for the fake provider):
H=(-H "authorization: Bearer $UCP_KEY" -H 'ucp-agent: profile="https://my-platform.example/.well-known/ucp"' -H "content-type: application/json")
curl -sS "${H[@]}" -H "idempotency-key: $(uuidgen)" -X POST $BASE/ucp/v1/checkout-sessions -d '{
"line_items": [ { "item": { "id": "'$VARIANT_ID'" }, "quantity": 1 } ],
"buyer": { "first_name": "Dana", "last_name": "Levi", "email": "dana@example.com", "phone_number": "+15551234567" },
"fulfillment": { "methods": [ { "type": "shipping", "selected_destination_id": "dest_1", "destinations": [
{ "id": "dest_1", "first_name": "Dana", "last_name": "Levi", "street_address": "123 Main St", "address_locality": "New York", "address_region": "NY", "postal_code": "10001", "address_country": "US" } ] } ] }
}'
# -> status ready_for_complete, ap2.merchant_authorization set
curl -sS "${H[@]}" -H "idempotency-key: $(uuidgen)" -X POST $BASE/ucp/v1/checkout-sessions/$CHECKOUT_ID/complete -d '{
"payment": { "instruments": [ { "id": "instr_1", "handler_id": "fake-pay", "type": "card", "selected": true, "credential": { "type": "PAYMENT_GATEWAY", "token": "fake_ok" } } ] }
}'
curl -sS "${H[@]}" $BASE/ucp/v1/orders/$CHECKOUT_ID # the UCP order entity, also pushed to the webhook URL on every change
The outcome of the whole purchase is visible in admin → Protocols (session, deliveries) and, like any connector purchase, under Checkouts and Orders.
Going live
Everything on Snappy's side ships with this service; the rest is onboarding with each platform. Until it is done the discovery documents still answer, and the feeds answer 503 feeds_not_configured without a feed token.
| Platform | Ready in this service | Still done outside, in this order |
|---|---|---|
| ChatGPT Instant Checkout (ACP) | discovery, checkout sessions, Shared Payment Token charging, order webhooks, MCP binding, JSONL feed | Stripe: enable Shared Payment Tokens (agentic commerce preview) on the account and enter the secret key, publishable key and the merchant id (Settings → ACP). OpenAI Business Hub: claim the business, submit /feeds/products.jsonl?token=… as the hosted feed, enter the discovery URL; OpenAI returns the webhook URL and secret → register the platform in admin → Protocols and give OpenAI the API key. |
| Google AI Mode and Gemini (UCP, native checkout) | profile and keys, Google Pay handler through Stripe, AP2 mandates, signed responses, order webhooks to Google, MCP binding, CSV feed | Merchant Center: join the UCP integration, publish /feeds/google.csv?token=… as a supplemental feed. Google Pay & Wallet console: merchant id (Settings → Google Pay, environment PRODUCTION). Google's onboarding mail: partner id and order-webhook API key → Integrations → Google; register the platform with Google's profile URL and the partner id. |
| Shopify (Shop app, Shop MCP, Global Catalog) | the UCP implementation above, generic CSV feed | Shopify Agentic plan: sync /feeds/products.csv?token=… as the external catalog (products link to the product pages). Register the platform with Shopify's UCP profile URL once Shopify provides it. |
| Any other UCP platform | profile, checkout, orders | Exchange profile URLs; register the platform (API key or an OAuth client with client_credentials) and Check profile to load its keys. |
Two things apply to every platform. First, prod is behind the network gate: agents.snappy.com answers only from Snappy's Twingate addresses, so platforms can only be pointed at sandbox.agents.snappy.com until the gate is lifted (see Operations). Second, the feed token, every platform key and the Google webhook key are entered once in the admin portal and are never shown again; rotate them from there when a platform asks.