Agentic commerce (UCP)
The storefront implements the Universal Commerce Protocol (version 2026-08-25): an open, vendor-neutral standard that lets any conformant AI agent platform find products, build a cart, check out and follow the order afterwards. Nothing in it is specific to one vendor.
The protocol code lives in the engine (@magenxcommerce/engine/agentic/ucp); the theme’s app/api/ucp/** routes only re-export its handlers, so every shop runs one upgradeable copy. See the Engine API: Agentic UCP reference.
Capabilities
Section titled “Capabilities”| Capability | What it does |
|---|---|
| Discovery | GET /.well-known/ucp publishes the business profile: capabilities, transports and endpoints, legal links, signing keys. |
| Catalog | search_catalog (free text, category and price filters, cursor pagination), lookup_catalog (up to 20 ids) and get_product (option selection, per-value availability). Product and variant ids are SKUs, so a variant id goes straight into a checkout line. Only plain-text descriptions are published, never merchant HTML. |
| Cart | Create, get, update (full replacement of line_items), cancel: basket building before purchase intent, with estimated totals. A cart is the same Magento quote a checkout is: create_checkout with cart_id converts it in place. |
| Checkout | Create, get, update, complete, cancel, over the same Magento quote as the human checkout. The session id is the Magento masked quote id. Shipping rates come through the fulfillment extension. |
| Order | Get Order returns the current state of an order placed through complete: per-line quantities and status, one shipped event per shipment (with tracking), one refund adjustment per credit memo. An order is served only to the platform that placed it; any other reads as not_found, so order numbers can’t be enumerated. |
Payment is escalated, not delegated, unless delegated payment is configured: a ready session returns requires_escalation with a continue_url to the normal checkout, where the buyer pays.
Transports
Section titled “Transports”| Binding | Status | Endpoint |
|---|---|---|
| REST | implemented | /api/ucp/checkout-sessions, /api/ucp/catalog/*, /api/ucp/carts, /api/ucp/orders/{id} |
| MCP | implemented | POST /api/ucp/mcp (JSON-RPC 2.0; tools create_checkout, get_checkout, update_checkout, complete_checkout, cancel_checkout, search_catalog, lookup_catalog, get_product, create_cart, get_cart, update_cart, cancel_cart, get_order) |
| A2A, Embedded | not implemented |
Both implemented transports share one authentication check; neither is a weaker door.
Authentication
Section titled “Authentication”Platforms authenticate by signing. A platform publishes public keys in its own profile, names that profile in UCP-Agent: profile="https://…", and signs every request with RFC 9421 HTTP Message Signatures. The store fetches the profile, finds the key and verifies; nothing is registered in advance. The verified profile URL is the caller’s identity: logs, rate-limit bucket, and owner of the orders it places.
- Covered components:
@method,@authority(this store’s public host),@path,@querywhen present,ucp-agent,idempotency-keywhen sent, andcontent-digest+content-typefor a body. Content-Digest: sha-256=:…:over the exact body bytes.- ES256 (P-256) always works; ES384 and Ed25519 are accepted.
- Replay protection is the signed
Idempotency-Key.
Profile fetches are HTTPS-only, never follow redirects, refuse private addresses, are capped at 5 s and 256 KB, and are cached for 10 minutes. An unknown key makes the store refetch the profile once (key rotation), at most once a minute.
Optional pre-shared API keys for platforms onboarded out of band: UCP_PLATFORM_KEYS="label:secret,…", sent as Authorization: Bearer or X-API-Key. Each label must be bound to the profile(s) it may claim in UCP_PLATFORM_PROFILES; an unbound label is refused.
Negotiation
Section titled “Negotiation”On every authenticated request, the platform’s ucp.version must equal the store’s, and capabilities are intersected by exact version. Capability entries whose schema isn’t served from the domain their name claims are dropped. Each response lists only the capabilities relevant to that operation.
| Refusal | REST | MCP |
|---|---|---|
No signature and no API key (signature_missing) | 401 | -32000 |
Bad signature (signature_invalid), unknown key (key_not_found) | 401 | -32000 |
Body doesn’t match Content-Digest (digest_mismatch) | 400 | -32600 |
UCP-Agent missing or not a public https URL (invalid_profile_url) | 400 | -32001 |
Profile unreachable (profile_unreachable) | 424 | -32001 |
Version mismatch (version_unsupported) | 422 | -32001 |
API key not bound to the profile (profile_not_authorized) | 403 | -32000 |
Discovery budget spent (discovery_deferred) | 503 + Retry-After | -32000 |
Response signing
Section titled “Response signing”With UCP_SIGNING_KEY set, every response carries RFC 9421 signature headers and a Content-Digest. The public key is published in the profile’s keys[].
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out ucp-signing.pemRotation (every 90 days): move the old PEM into UCP_SIGNING_PREVIOUS_KEYS and set the new one as UCP_SIGNING_KEY. Both are published; only the new one signs. Remove the old one after 7 days, or at once on compromise. Signed responses are sent with Cache-Control: no-transform: exclude /api/ucp from any compression in nginx or a CDN.
Order webhooks
Section titled “Order webhooks”A platform declares a webhook_url for dev.ucp.shopping.order in its own profile. Every order it places is then watched: the store re-reads it from Magento (every minute in the first hour, then 5 minutes, 30 minutes, 6 hours; for 90 days) and POSTs the full order whenever it changes. Shipments, credit memos and cancellations made in the admin reach the platform within one poll, with no Magento module involved.
- Webhooks are signed, so nothing is sent without
UCP_SIGNING_KEY. - Delivery is at-least-once, with exponential backoff; each state has one stable id.
- URLs must be HTTPS and resolve to public addresses; redirects are not followed.
Delegated payment (Stripe)
Section titled “Delegated payment (Stripe)”With UCP_DELEGATED_PAYMENT=1 and the three Stripe variables set, the profile declares Stripe’s com.stripe.payments handler and complete really charges:
- The platform collects card details at Stripe and sends a scoped
stripe_payment_token. - The storefront converts it to a Stripe PaymentMethod and uses the same
setPaymentMethodOnCart+placeOrderpath as the browser checkout. - Magento charges the quote total it computed. No amount is ever sent, so nothing in the request can change what is charged.
Idempotency-Key becomes mandatory on complete. A 3-D Secure challenge returns complete_in_progress.
Set up
Section titled “Set up”- Set
UCP_ENABLE=1on the storefront. - Run Redis (
UCP_REDIS_URLorREDIS_URL). Cancelled-cart records, order ownership and idempotency keys live there; without it, a restart or a second replica forgets which platform placed an order. - Optional: set
UCP_SIGNING_KEY(needed for order webhooks), andUCP_DELEGATED_PAYMENT=1withSTRIPE_SECRET_KEY,STRIPE_PUBLISHABLE_KEYandSTRIPE_MERCHANT_ID. - In nginx, keep
/.well-known/ucpcacheable for 5 minutes with itsETag, and/api/ucp/neither cached nor gzipped, as the nginx config in magenxcommerce-docker does. Put a rate limit in front of/api/ucpif you run several instances.
environment: UCP_ENABLE: "1" UCP_RATE_LIMIT: "120" UCP_SIGNING_KEY: "${UCP_SIGNING_KEY}" # Optional, for platforms onboarded with a pre-shared key: UCP_PLATFORM_KEYS: "platform-a:${UCP_KEY_PLATFORM_A}" UCP_PLATFORM_PROFILES: "platform-a=https://agent.platform-a.example"All variables are listed in the environment reference.