Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Commerce Orchestrator

Let AI shopping agents check out against the commerce APIs you already run.

The Commerce Orchestrator is an open-source Rust service. It speaks the agentic commerce protocols to agents (UCP, ACP, A2A, MCP, AP2 and MPP) and plain HTTP to your catalog, pricing, tax, geo, payment and receipt backends. You deploy it next to your platform instead of building every new agent protocol into it.

flowchart LR
    subgraph Agents["AI agents and clients"]
        G["Shopping agents<br/>(UCP / ACP)"]
        A["Agent platforms<br/>(A2A / MCP)"]
        R["Your apps<br/>(REST)"]
    end
    subgraph O["Commerce Orchestrator"]
        D["Discovery<br/>/.well-known/ucp, agent card"]
        F["Cart and checkout<br/>state machine"]
        S["Signatures, idempotency,<br/>outbox, metrics"]
    end
    subgraph B["Your existing backends"]
        C[Catalog]
        P[Pricing]
        T[Tax]
        Ge[Geo]
        Pa[Payment]
        Re[Receipt]
    end
    G --> O
    A --> O
    R --> O
    O --> C & P & T & Ge & Pa & Re

Start here

  • Getting started: run a full checkout and call the server the way an agent would, in about ten minutes.
  • FAQ: what it is and is not, which protocol versions it supports, and whether it is ready for your production.
  • Architecture: the crates, the request flow, the cart and checkout state machines, idempotency, the outbox and message signing.

Integrate

  • Consumer integration: the integration model. Your clients call HTTP; there is no library to embed.
  • Consumption guide: every endpoint with request and response shapes, authentication, signing, errors and configuration.
  • MCP binding: connect an MCP client, with version negotiation, tools and resources.
  • Plug and deploy: connect your backends and deploy to staging and production.
  • Provider API: the HTTP API your backends expose to the orchestrator, as an OpenAPI 3.1 spec.

Reference and operations

Project

The source, issues and discussions are on GitHub. The project is dual-licensed under MIT or Apache-2.0. Changes in each release are in the changelog.

Getting started

This page takes you from a fresh clone to a running orchestrator that answers agent requests, in about ten minutes. Most of that is the first compile. Nothing here needs a database, Docker or any backend of your own: development mode runs against built-in mock providers.

What you need

  • Rust 1.94 or newer (rustc --version to check).
  • git and curl.

1. Clone the repository

git clone https://github.com/AncientiCe/commerce-orchestrator-api.git
cd commerce-orchestrator-api

2. Watch a full checkout run

The happy_path example drives one complete purchase through the orchestrator: create a cart, add an item, reprice, compute tax, check geography, authorize and capture payment, and generate a receipt. Every backend is a mock, so there is nothing to configure.

cargo run -p happy_path

The first build compiles the whole workspace and takes a few minutes. The run itself ends with a line like this:

INFO happy_path: Checkout completed cart_id=… transaction_id=txn_… status=Completed

status=Completed means every step of the checkout flow passed.

3. Start the server

cargo run -p orchestrator-http --bin orchestrator-server

With no configuration file and no ENV=production, the server starts in development mode on 0.0.0.0:8080, with mock providers, in-memory storage and a demo catalog of three items: demo-tee (25.00), demo-mug (12.00) and demo-cap (18.00). Leave it running and open a second terminal.

Check that it is up:

curl -s localhost:8080/health/live

If that prints nothing, another program may be listening on port 8080 too. Use 127.0.0.1:8080 in place of localhost:8080 in the commands below.

4. Shop the way an agent would

The commands below go from discovery to a paid order. Set two shell variables first to keep them short:

API=localhost:8080/api/v1; JSON='content-type: application/json'

Discover the merchant. An agent’s first request is the UCP business profile. It lists the supported UCP versions, the services and their endpoints, the signing keys and the payment handlers. A2A agents read /.well-known/agent-card.json instead.

curl -s localhost:8080/.well-known/ucp

Find a product.

curl -s -X POST $API/ucp/catalog/search -H "$JSON" -d '{"query":"tee"}'

The response lists demo-tee with "price_minor":2500. Money is always an integer in minor units, so 2500 is 25.00 USD.

Create a cart. Cart operations all go through one command endpoint:

curl -s -X POST $API/cart/commands -H "$JSON" \
  -d '{"command":{"kind":"create_cart","merchant_id":"demo","currency":"USD"},"cart_id":null}'

The response is the cart, at "version":1. Copy its cart_id and use it in place of <cart_id> from here on.

Add two T-shirts.

curl -s -X POST $API/cart/commands -H "$JSON" \
  -d '{"command":{"kind":"add_item","item_id":"demo-tee","quantity":2},"cart_id":"<cart_id>"}'

Adding the item priced the line, computed tax and checked geography against the mock providers. The cart is now at "version":2 with "subtotal_minor":5000, "tax_minor":500 and "total_minor":5500.

Start checkout. This locks the cart at the version you saw, so it cannot change under you:

curl -s -X POST $API/cart/commands -H "$JSON" \
  -d '{"command":{"kind":"start_checkout","cart_id":"<cart_id>","cart_version":2},"cart_id":"<cart_id>"}'

The cart moves to "status":"checkout_ready" at "version":3.

Pay. The payment intent states the amount the agent expects to pay, and it must equal the cart total:

curl -s -X POST $API/checkout/execute -H "$JSON" \
  -d '{"tenant_id":"dev","merchant_id":"demo","cart_id":"<cart_id>","cart_version":3,"currency":"USD",
       "payment_intent":{"amount_minor":5500,"token_or_reference":"tok_demo"},"idempotency_key":"demo-1"}'

The response is the transaction: "status":"completed", "payment_state":"captured", a receipt and an order_id.

Two things to try, both described in the architecture page:

  • Pay the wrong amount. Send "amount_minor":5400 with a new idempotency_key and checkout is refused with "code":"AMOUNT_MISMATCH" before any payment call.
  • Send the same request again. The same idempotency_key returns the original transaction_id instead of charging twice.

5. Try the other protocols

List the MCP tools. The same operations are available to MCP clients as tools:

curl -s -X POST localhost:8080/api/v1/mcp/message \
  -H 'content-type: application/json' \
  -H 'MCP-Protocol-Version: 2026-07-28' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Get the REST contract. The full REST API is published as OpenAPI 3.1:

curl -s localhost:8080/api/v1/openapi.json

6. Run the tests

cargo test --workspace

This runs the unit, integration and protocol conformance suites, all against mocks. Tests that need PostgreSQL skip themselves unless DATABASE_URL is set.

Where to go next

You want to…Read
Understand how it works insideArchitecture
Connect your catalog, pricing, tax, geo, payment and receipt servicesPlug and deploy and the provider API
Call every endpoint, with request and response shapesConsumption guide
Connect an MCP clientMCP binding
Check what each protocol coversConformance matrix
Decide whether it fits your caseFAQ

FAQ

What is the Commerce Orchestrator?

An open-source Rust service that sits between AI agents and your existing commerce backends. Agents talk to it over the agentic commerce protocols (UCP, ACP, A2A, MCP, AP2, MPP). It talks to your catalog, pricing, tax, geo, payment and receipt services over plain HTTP. In between it runs one cart and checkout model with idempotency, amount and geo checks, signed messages, retries and an outbox.

You deploy it next to your platform. Your backends do not change and do not need an SDK.

What is it not?

  • Not a storefront or a commerce platform. It holds no product catalog, prices or tax rules of its own. Those stay in your systems; it calls them.
  • Not a payment processor. It authorizes, captures, voids and refunds through your payment provider. Checkout carries a payment token or reference, and the provider does the money movement.
  • Not an agent. It does not decide what to buy. It is the merchant side that agents buy from.
  • Not a library you embed. The supported integration is the HTTP service. The consumer example shows the in-process facade, but the HTTP API is the contract.

Which protocols does it support?

ProtocolVersion
UCP (Universal Commerce Protocol)2026-08-25, with older profiles served through supported_versions
ACP (Agentic Commerce Protocol)2026-04-17
A2A (Agent2Agent)1.0, with 0.3 envelopes accepted
MCP (Model Context Protocol)2026-07-28, plus 2025-11-25 and 2024-11-05
AP2 (Agent Payments Protocol)0.2
MPP (Machine Payments Protocol)draft-httpauth-payment-01
HTTP Message SignaturesRFC 9421 with RFC 9530 Content-Digest
Web Bot Authdraft-ietf-webbotauth-httpsig-protocol-01

Coverage is not all-or-nothing. The conformance matrix lists every requirement of each protocol as supported, optional or not supported yet, with the test that proves each supported row.

How does it compare with implementing each protocol myself?

Each protocol brings its own discovery document, message shapes, error model, signature scheme and versioning, and several of them revise every few months. Building them into your platform means doing that work once per protocol and again for every revision, inside the system that also takes your money.

With the orchestrator:

  • One integration. You implement six small HTTP endpoints once (see the provider API). Every protocol reaches them through the same cart and checkout model.
  • One place for money rules. Idempotency keys, the amount the agent expects to pay, the geo verdict and the cart version are enforced in one code path for every protocol, instead of once per protocol.
  • Spec tracking is in the open. Protocol versions, schema checks and conformance tests live in this repository and run in CI on every change.

Building it yourself is the better choice when you only need one protocol, have no plans to add others, and want it inside an existing service rather than as a separate deployment.

Do I need to change my backends?

Usually not much. Each backend needs to expose the endpoints in the provider API: for example POST /tax/resolve returning { "total_tax_minor": 160 }. If your services have different shapes, put a thin adapter in front of them. Every provider can use bearer tokens, API keys, OAuth 2.0 client credentials or mutual TLS.

Is it production ready?

What is in place:

  • PostgreSQL persistence with migrations, required when ENV=production.
  • Production startup fails closed: without a database, API authentication, signing keys and all six backend URLs, the server refuses to start.
  • Idempotent checkout, amount and geo integrity checks, tenant isolation, retries with circuit breakers, an outbox with dead-letter replay, and payment reconciliation.
  • Prometheus metrics, a Grafana dashboard, Kubernetes manifests with HPA, PDB and NetworkPolicy, and runbooks.
  • CI runs formatting, Clippy with warnings denied, the full test suite, protocol conformance tests, a live PostgreSQL job, a Docker smoke test and a dependency advisory audit.

What to weigh:

  • It is pre-1.0 (0.13.0). Minor versions can change behaviour; the changelog says what changed and how to upgrade.
  • Releases are source-only. Nothing is published to crates.io; you build from a pinned tag, or build the Docker image from the Dockerfile.
  • Some protocol features are not implemented yet, such as ACP’s MCP transport binding. The conformance matrix has the full list.

Run your own staging validation before taking real orders. Plug and deploy ends with a checklist for it.

Does it store personal or payment data?

It stores carts, orders, idempotency results and outbox messages in your database. A checkout can carry a customer email and name and a shipping address, and those are part of the cart and are forwarded to your backends. Logs redact PII. Payment data is whatever token or reference your payment provider issued; the orchestrator passes it to that provider. See SECURITY.md.

Can it run more than one replica?

Yes, with PostgreSQL. Idempotency claims, outbox claims (FOR UPDATE SKIP LOCKED), inbox dedupe and orders all live in the database, so replicas coordinate through it. The Kubernetes manifests include an HPA.

How is it licensed?

Dual-licensed under MIT or Apache-2.0, at your option. You can run it commercially, modify it and keep your modifications private.

How do I report a bug or a security issue?

Open an issue on GitHub. Report security issues privately, as described in SECURITY.md.

Architecture

The orchestrator is a single Rust service. Agents and apps call it over one of several protocols; it maps every protocol onto one cart and checkout model, runs that model through a deterministic state machine, and calls your existing backends over plain HTTP.

This page explains how the pieces fit together. For the HTTP surface see the consumption guide; for the calls it makes to your backends see the provider API.

Crates

The workspace is split so that the domain model has no I/O, the runtime has no HTTP, and every protocol shim sits at the edge.

flowchart TB
    http["orchestrator-http<br/>axum server, routes, auth,<br/>RFC 9421 signing, MPP 402"]
    mcp["orchestrator-mcp<br/>MCP JSON-RPC tool server"]
    api["orchestrator-api<br/>facade, authz, AP2 checks,<br/>UCP and ACP mapping, signing keys"]
    runtime["orchestrator-runtime<br/>runner, idempotency, outbox,<br/>dead-letter, inbox, persistence"]
    core["orchestrator-core<br/>domain types, state machines,<br/>policy, validation"]
    contracts["provider-contracts<br/>provider traits"]
    adapters["integration-adapters<br/>HTTP clients for your backends"]
    mocks["provider-mocks<br/>in-memory providers for dev and tests"]
    obs["orchestrator-observability<br/>tracing, Prometheus metrics"]

    http --> mcp
    http --> api
    mcp --> api
    api --> runtime
    runtime --> core
    runtime --> contracts
    contracts --> core
    adapters --> contracts
    mocks --> contracts
    http --> adapters
    http --> mocks
    http -.-> obs
    runtime -.-> obs
    adapters -.-> obs
CrateRole
orchestrator-coreDomain types (CartProjection, CheckoutRequest, TransactionResult), the cart and checkout state machines, the policy engine (maximum totals, blocked geographies, payment constraints) and request validation. Pure logic, no I/O.
provider-contractsThe traits a backend implements: CatalogProvider, PricingProvider, TaxProvider, GeoProvider, PaymentProvider, ReceiptProvider, plus optional fulfillment, payment delegation and identity linking.
integration-adaptersHTTP implementations of those traits. Shared client with timeouts, retries, circuit breakers, outbound auth (bearer, API key, OAuth 2.0 client credentials) and mTLS.
provider-mocksDeterministic in-memory providers. Development mode and the test suite run on these.
orchestrator-runtimeThe Runner: cart command dispatch, checkout execution, idempotency, inventory reservations, orders, the outbox and its background processor, dead-letter, inbox dedupe, webhooks and reconciliation. Store traits with in-memory, file-backed and PostgreSQL implementations.
orchestrator-apiOrchestratorFacade, the one entry point every transport calls. Tenant-scoped authorization, AP2 mandate verification, UCP and ACP mapping, signing keys and HTTP message signature primitives, PII redaction.
orchestrator-mcpMCP tool definitions and the JSON-RPC handler, mapped onto the facade.
orchestrator-httpThe orchestrator-server binary: axum routes for REST, UCP, ACP, A2A and MCP, discovery documents, authentication, signature middleware, Web Bot Auth, the MPP 402 challenge flow, config loading and the OpenAPI document.
orchestrator-observabilityTracing setup and the metrics helpers every crate uses.

Request flow

Every transport ends in the same facade call, so a cart created over UCP can be checked out over A2A and behaves the same way.

sequenceDiagram
    autonumber
    participant Agent
    participant HTTP as orchestrator-http
    participant Facade as OrchestratorFacade
    participant Runner
    participant Providers as Your backends

    Agent->>HTTP: POST /api/v1/... (UCP, ACP, A2A, MCP or REST)
    HTTP->>HTTP: Authenticate (bearer or JWT) and resolve tenant
    HTTP->>HTTP: Verify RFC 9421 signature and Content-Digest (when agent keys are configured)
    HTTP->>Facade: Protocol shape mapped to a CartCommand or CheckoutRequest
    Facade->>Facade: Authorize for the tenant, verify AP2 mandate (strict mode)
    Facade->>Runner: dispatch_cart_command / execute_checkout
    Runner->>Providers: catalog, pricing, tax, geo, payment, receipt
    Providers-->>Runner: results
    Runner-->>Facade: CartProjection or TransactionResult
    Facade-->>HTTP: domain result
    HTTP-->>Agent: protocol response, signed when signing keys are configured

Tenancy always comes from the authenticated caller, never from the request body. A cart remembers its owning tenant, and a caller authenticated for another tenant cannot read or check it out.

Cart lifecycle

Each cart mutation (add, update or remove an item, apply a code, select fulfillment) bumps the cart version and recalculates the cart against your backends in a fixed order: catalog lookup for a new item, pricing, tax, discounts, then the geo check. Each step appends an event to the cart’s event stream and advances the cart state machine.

stateDiagram-v2
    [*] --> CartCreated
    CartCreated --> ItemsMutated: item changed
    ItemsMutated --> ItemsMutated: item changed
    ItemsMutated --> Repriced: pricing resolved
    Repriced --> Retaxed: tax resolved
    Retaxed --> GeoChecked: geo validated
    GeoChecked --> ItemsMutated: item changed
    GeoChecked --> CheckoutReady: start checkout
    CheckoutReady --> ItemsMutated: item changed
    CartCreated --> CheckoutReady: start checkout
    ItemsMutated --> CheckoutReady: start checkout
    Repriced --> CheckoutReady: start checkout
    Retaxed --> CheckoutReady: start checkout
    CartCreated --> Cancelled: cancel
    ItemsMutated --> Cancelled: cancel
    Repriced --> Cancelled: cancel
    Retaxed --> Cancelled: cancel
    GeoChecked --> Cancelled: cancel
    CheckoutReady --> Cancelled: cancel
    Cancelled --> [*]

Any transition not drawn here is rejected. The state machine lives in orchestrator-core (next_cart_state) and has no side effects, so it is tested exhaustively on its own.

Checkout

Checkout is where money moves, so it re-reads everything instead of trusting the cart snapshot.

flowchart TD
    A[Checkout request] --> B{Valid request?}
    B -- no --> X1[400 validation error]
    B -- yes --> C{Claim idempotency key<br/>tenant + merchant + key}
    C -- completed before --> R1[Return the stored result]
    C -- in flight --> X2[409 already in flight]
    C -- claimed --> D{Cart owned by caller's tenant<br/>and version matches?}
    D -- no --> X3[Release key, return error]
    D -- yes --> E[Reprice: pricing, tax, discounts]
    E --> F{Geo provider allows it?}
    F -- no --> X4[Release key, GEO_BLOCKED]
    F -- yes --> G{Payment amount equals<br/>the repriced total?}
    G -- no --> X5[Release key, AMOUNT_MISMATCH]
    G -- yes --> H[Reserve inventory]
    H --> I{Policy engine allows it?}
    I -- no --> R2[Rejected result, stored]
    I -- yes --> J[Authorize payment<br/>Idempotency-Key forwarded]
    J -- declined --> R3[AuthFailed result, stored]
    J -- 3DS2 required --> P[Pause: AuthenticationRequired<br/>stored under the key]
    P -. result from provider or agent .-> Q{Authenticated and<br/>cart unchanged?}
    Q -- no --> R3
    Q -- yes --> J2[Authorize with the result]
    J2 -- declined --> R3
    J2 -- authorized --> K
    J -- authorized --> K[Commit, capture payment]
    K --> L[Create order]
    L --> M[Generate receipt]
    M --> N[Enqueue order.created in the outbox]
    N --> R4[Completed result, stored under the key]

The checkout state machine (next_checkout_state) walks Received → Validated → Priced → Taxed → GeoChecked → PaymentAuthorized → Committed → ReceiptGenerated → Completed, with the terminal failures Rejected, AuthFailed, CommitFailed and TimedOut. Each terminal state maps to the status of the TransactionResult.

stateDiagram-v2
    [*] --> Received
    Received --> Validated
    Validated --> Priced
    Priced --> Taxed
    Taxed --> GeoChecked
    GeoChecked --> PaymentAuthorized: authorized
    GeoChecked --> AuthenticationPending: provider asks for 3DS2
    AuthenticationPending --> PaymentAuthorized: authenticated, then authorized
    AuthenticationPending --> AuthFailed: denied, declined or cart changed
    AuthenticationPending --> TimedOut: not finished in time
    GeoChecked --> AuthFailed: declined
    PaymentAuthorized --> Committed
    PaymentAuthorized --> CommitFailed
    Committed --> ReceiptGenerated
    ReceiptGenerated --> Completed
    Received --> Rejected
    Validated --> Rejected
    Priced --> Rejected
    Completed --> [*]

AuthenticationPending is the one state a checkout can stop in without finishing: the payment provider asked for 3DS2 step-up (see conformance: payment authentication). Its status is AuthenticationRequired, and the checkout’s request and pause are kept in the checkout_authentication store (and the cart’s event stream) until the result arrives. Reading the checkout asks the provider for the result; an ACP agent can also submit it. Either way the checkout resumes once, from the stored request.

Three checks guard the money:

  • Amount integrity. The agent states the amount it expects to pay. If the repriced total differs, checkout fails with AMOUNT_MISMATCH before any payment call, so a stale cart is never charged a different amount.
  • Geo is binding. The geo verdict is taken again at checkout, from the cart’s own destination, and a blocked destination stops the checkout.
  • Version check. The request names the cart version it saw. A cart that changed since then fails with a version conflict.

Idempotency

Checkout is keyed on (tenant_id, merchant_id, idempotency_key).

  • The first request claims the key and marks it in flight. A concurrent duplicate gets a conflict instead of a second charge.
  • When the checkout reaches a result (completed, rejected or declined), the result is stored under the key. Replays return that stored result without calling any backend.
  • A checkout paused for 3DS2 stores the pause under the key, so a replay returns the same pending step-up. When it resumes, the final result replaces the pause under the same key. The resume itself is claimed under <key>#authentication, so two replicas reading the checkout at once cannot both place the order.
  • If checkout fails before anything was charged (validation, version conflict, geo block, amount mismatch), the key is released, so the caller can fix the request and retry with the same key.
  • The key is forwarded to your payment provider as the Idempotency-Key header on authorize, capture, void and refund, so a retry inside the orchestrator cannot double-charge either.

With PostgreSQL persistence the claim is a row in the database, so it holds across replicas.

Outbox, dead-letter and inbox

Side effects that leave the system, such as webhooks to subscribers, never happen inline with checkout. Checkout writes an order.created message to the outbox in the same flow that records the order, and a background processor delivers it.

flowchart LR
    CO[Checkout completes] --> OB[(Outbox)]
    OB --> P[Outbox processor<br/>claim, deliver]
    P -- delivered --> ACK[Ack, remove]
    P -- failed, attempts left --> BO[Back off, release] --> OB
    P -- attempts exhausted --> DL[(Dead-letter)]
    DL -- POST /api/v1/ops/dead-letter/replay --> OB
    WH[Incoming event] --> IN{Inbox:<br/>seen message id?}
    IN -- new --> ACC[Accept]
    IN -- duplicate --> IGN[Ignore]
  • Claim, then ack. The processor claims a message rather than removing it, and acknowledges it only once it is delivered or dead-lettered. A process that dies mid-delivery costs a retry, not the event. On PostgreSQL the claim uses FOR UPDATE SKIP LOCKED, so every replica can run the processor.
  • Backoff. Failed deliveries back off exponentially, so a down endpoint does not burn the whole attempt budget in milliseconds.
  • Dead-letter. After the maximum attempts the message moves to the dead-letter store. Operators list it and replay it, which resets the attempt count. See dead-letter handling and retries and outbox.
  • Inbox. POST /api/v1/events/incoming accepts an event id at most once, so a provider that redelivers a webhook does not apply it twice.
  • Webhooks. Subscribers register per tenant and only receive their own tenant’s events. Deliveries are signed (RFC 9421) when signing keys are configured.

Persistence

All stores sit behind traits in orchestrator-runtime, with three implementations:

BackendWhenUse it for
In-memoryDefault in developmentTests, demos, local work
File-backed (JSON)PERSISTENCE_PATH set in developmentA local instance that must survive restarts
PostgreSQLDATABASE_URL set, required with ENV=productionProduction and anything with more than one replica

The PostgreSQL schema is applied by orchestrator-server --migrate, which the Kubernetes manifests run as a Job before rollout.

Signing and verification

The orchestrator implements HTTP Message Signatures (RFC 9421) with Content-Digest (RFC 9530), as UCP requires.

  • Inbound. When agent public keys are configured (UCP_AGENT_KEYS or UCP_AGENT_JWKS), every /api/v1 request must carry Signature-Input and Signature headers that verify against one of them, and a matching Content-Digest when it has a body.
  • Outbound. When a signing key is configured (UCP_SIGNING_KEY_ID, UCP_SIGNING_KEY), every response is signed over @status and its body digest, and so is every webhook delivery.
  • Keys. Ed25519 or ES256. Public keys are published in the UCP business profile at /.well-known/ucp. Previous keys stay verifiable by kid during rotation (UCP_SIGNING_PREVIOUS_KEYS).
  • Agent identity. Web Bot Auth can additionally identify the agent operator from a signed request.

AP2 mandates and MPP payment credentials are verified separately, on checkout: AP2 in the facade (AP2_STRICT=1 fails closed), MPP through a 402 challenge bound to the request’s amount and body digest. Details are in the consumption guide.

Observability

Every provider call, checkout step, outbox delivery and signature check records Prometheus metrics through orchestrator-observability, labelled by outcome. The metrics are served at /metrics, and a Grafana dashboard ships in deploy/grafana. Logs are structured tracing output with PII redacted.

Consumer integration: REST API

Integrate with the Commerce Orchestrator by calling its deployed HTTP service. No library dependency in your app; use any HTTP client and the JSON API.

Integration surface

Deploy the orchestrator as an HTTP service (orchestrator-server). Your app (Agent, backend, or other clients) calls REST endpoints under /api/v1. The service runs the orchestration logic and routes to your catalog, pricing, tax, geo, payment, and receipt APIs via its own configuration (see Config reference and deploy/README.md).

Endpoints

AreaEndpoints
DiscoveryGET /.well-known/ucp (UCP 2026-08-25 business profile with keys[] and payment_handlers; ACP/MCP/A2A/AP2 metadata under the top-level orchestrator member)
Cart & checkoutPOST /api/v1/cart/commands, /api/v1/ucp/cart and /api/v1/ucp/checkout routes, POST /api/v1/checkout/execute, POST /api/v1/a2a/cart, POST /api/v1/a2a/checkout
ACP/api/v1/acp/checkout_sessions (+ complete/cancel), POST /api/v1/acp/delegate_payment — require API-Version: 2026-04-17
Catalog & ordersGET /api/v1/catalog/items/:id, /api/v1/ucp/catalog routes, GET /api/v1/orders/:id, GET /api/v1/ucp/orders/:id
Identity linkingPOST /api/v1/a2a/identity/link (A2A-Version: 1.0 or 0.3)
A2A 1.0GET /.well-known/agent-card.json, POST /api/v1/a2a/message:send, POST /api/v1/a2a/message:stream (SSE), POST /api/v1/a2a/jsonrpc (JSON-RPC, including UCP’s A2A checkout binding)
PaymentsPOST /api/v1/payments/capture, void, refund; GET /api/v1/ucp/payment-handlers
MCPPOST /api/v1/mcp/message (dual-era: 2026-07-28 + legacy initialize)
EventsPOST /api/v1/events/incoming (idempotent ingest)
OperationsPOST /api/v1/ops/outbox/process, GET /api/v1/ops/dead-letter, POST /api/v1/ops/dead-letter/replay, POST /api/v1/ops/reconciliation
HealthGET /health/live, GET /health/ready, GET /metrics

In production the service requires a Bearer token; send Authorization: Bearer <token> on every request. The token is the value configured as AUTH_BEARER_TOKEN on the server.

Do not modify this repository

  • Do not fork to change orchestrator behavior. Consume the deployed API; fixes and features belong upstream.
  • Pin to a released tag (e.g. v0.11.0) for the deployment you use. Upgrade using release notes and CHANGELOG.md.

Summary

You doYou do not
Call the deployed REST API with HTTP + JSONFork or patch this repo
Configure the orchestrator service to point at your catalog (and other backends) via its env/configImplement provider code in your app; the service owns adapters
Send Bearer token when the service is in production modeCall without auth in production

For request/response shapes, error handling, and deployment, see Consumption guide (REST API) and deploy/README.md.

Consumption guide: REST API only

Integrate with the Commerce Orchestrator by calling its deployed HTTP service. No library dependency is required; use any HTTP client and the JSON request/response shapes below.

See consumer-integration.md for the high-level integration model.

Base URL and auth

  • Base URL: The orchestrator service URL (e.g. https://orchestrator.example.com).
  • Prefix: All API routes are under /api/v1.
  • Auth (production): When the service is run with ENV=production, auth mode is controlled by AUTH_MODE:
    • AUTH_MODE=static: send a fixed bearer token (AUTH_BEARER_TOKEN).
    • AUTH_MODE=jwt: send a signed JWT bearer token (AUTH_JWT_HS256_SECRET used for verification). In both modes, protected endpoints return 401 Unauthorized on missing/invalid credentials.
    Authorization: Bearer <your-token>
    

Message signing (UCP, RFC 9421)

Bearer auth answers who is calling; message signing answers was this exact message altered. The two are independent — a signed request still needs its Authorization header.

Signatures follow RFC 9421 HTTP Message Signatures with an RFC 9530 Content-Digest, as the UCP signatures specification requires. Ed25519 (EdDSA) and ECDSA P-256 (ES256) keys are supported in both directions. ES256 is the one algorithm every UCP verifier must accept, so operators whose counterparties are unknown should prefer it (UCP_SIGNING_KEY_ALG=ES256). The algorithm is always derived from the key named by keyid, never from the message.

sequenceDiagram
    participant A as Agent / platform
    participant O as Orchestrator
    A->>O: GET /.well-known/ucp (unsigned)
    O-->>A: profile + public JWKs
    A->>O: POST /api/v1/... with Content-Digest, Signature-Input, Signature
    O->>O: digest matches body, required components covered, keyid known, signature valid
    O-->>A: response with Content-Digest, Signature-Input, Signature over @status

Verifying our responses

When the deployment is configured with UCP_SIGNING_KEY_ID and UCP_SIGNING_KEY (mandatory in production), every response carries:

Content-Digest: sha-256=:<base64 SHA-256 of the body>:
Signature-Input: sig1=("@status" "content-digest" "content-type");created=1760000000;keyid="orch-2026-a"
Signature: sig1=:<base64 signature>:

Bodyless responses cover only "@status". Rebuild the RFC 9421 signature base from those components and verify it with the JWK whose kid matches keyid, fetched from the keys[] JWK Set of /.well-known/ucp (kty: OKP/crv: Ed25519, or kty: EC/crv: P-256). A deployment with no signing material advertises no keys and sets no dev.ucp.security.signatures capability flag — there is no default key, so an unsigned deployment is honest about being unsigned rather than publishing a key everybody shares.

Signing your requests

If the operator has configured your public key (UCP_AGENT_JWKS as a JWK Set, or UCP_AGENT_KEYS as Ed25519 kid:x pairs), every /api/v1 request must be signed; unsigned calls get 401. Discovery and health endpoints stay open, because you must read discovery before you can sign anything.

Use the label sig1 and cover at least:

ComponentWhen
"@method", "@authority", "@path"Always
"@query"The request has a query string
"content-digest", "content-type"The request has a body (send a matching Content-Digest)
"idempotency-key", "ucp-agent", "signature-agent"That header is present
POST /api/v1/ucp/cart HTTP/1.1
Host: orchestrator.example.com
Content-Type: application/json
Content-Digest: sha-256=:<base64 SHA-256 of the body>:
Signature-Input: sig1=("@method" "@authority" "@path" "content-digest" "content-type");created=1760000000;keyid="agent-1"
Signature: sig1=:<base64 signature>:

created is optional, but when present it must be within 300 seconds of the orchestrator’s clock; expires, when present, must not have passed. Replay protection otherwise comes from idempotency keys. A request may carry several signatures (for example one added by a proxy); it is accepted when any one of them verifies.

Rotation

Both directions are keyed by kid. To rotate ours, set the new key as UCP_SIGNING_KEY_ID/UCP_SIGNING_KEY and list the old one in UCP_SIGNING_PREVIOUS_KEYS (kid:seed, or kid:ES256:secret); both appear in discovery until you drop the old entry. To rotate yours, ask the operator to list both keys, switch, then have the old one removed.

Signature errors

Codes follow the UCP signatures specification:

HTTPCodeMeaning
401signature_missingNo Signature-Input/Signature on a deployment that requires them.
401signature_invalidVerification failed, a required component is not covered, created is outside the 300s window, expires has passed, or a header is malformed. The error text says which.
401key_not_foundThe keyid is not configured on this deployment.
400digest_mismatchThe body does not match the sha-256 Content-Digest, or the digest is missing.
400algorithm_unsupportedAn alg parameter disagrees with the key’s algorithm.

Endpoints

Discovery (UCP-style)

MethodPathDescription
GET/.well-known/ucpUCP 2026-08-25 business profile: ucp.services (rest, mcp and, when configured, embedded transports for dev.ucp.shopping), ucp.capabilities, ucp.payment_handlers, the keys[] JWK Set, and an orchestrator member with the MCP endpoint, ACP discovery URL, neighbouring protocol versions and feature flags. ucp.supported_versions links ?ucp_version=2026-04-08 (previous shape) and the 2026-01-23 / 2026-01-11 legacy manifests. Cached public, max-age=300. No auth required.
GET/.well-known/acp.jsonACP discovery document: protocol (name/version/supported_versions), api_base_url, transports (rest, mcp), and capabilities.services (checkout, carts, delegate_payment). No auth required.

Cart and checkout

MethodPathDescription
POST/api/v1/cart/commandsDispatch a cart command (create, add item, update qty, remove item, apply adjustment, get cart, start checkout). Body: CartCommandRequest (see request shapes).
POST/api/v1/ucp/cartsUCP REST binding: cart create with line_items; returns a UCP cart envelope. /api/v1/ucp/cart is the older alias.
GET/api/v1/ucp/carts/:idUCP cart lookup (alias /ucp/cart/:id).
PUT/api/v1/ucp/carts/:idUCP cart line replacement/update (alias /ucp/cart/:id).
POST/api/v1/ucp/carts/:id/cancelUCP cart cancellation (alias /ucp/cart/:id/cancel).
POST/api/v1/ucp/cart/:id/fulfillmentUCP fulfillment extension (dev.ucp.shopping.fulfillment): quote shipping/pickup options for a destination, or select one. Returns the UCP cart envelope with fulfillment and fulfillment_minor.
POST/api/v1/ucp/checkout-sessionsUCP REST binding: checkout session create. The envelope’s root capability is dev.ucp.shopping.checkout. /api/v1/ucp/checkout is the older alias.
GET/api/v1/ucp/checkout-sessions/:idUCP checkout session lookup (alias /ucp/checkout/:id).
PUT/api/v1/ucp/checkout-sessions/:idUCP checkout session line update (alias /ucp/checkout/:id).
POST/api/v1/ucp/checkout-sessions/:id/completeComplete UCP checkout (execute checkout) (alias /ucp/checkout/:id/complete). May answer status: authentication_required; see 3DS2 step-up.
POST/api/v1/ucp/checkout-sessions/:id/cancelCancel UCP checkout session (alias /ucp/checkout/:id/cancel).
POST/api/v1/ucp/checkout/:id/embedded-linkUCP embedded transport: returns a short-lived handoff URL (embedded_url, checkout_session_id, expires_at) on the merchant’s hosted page (EMBEDDED_CHECKOUT_URL). The token query parameter is an Ed25519 signature over ucp-embedded-checkout:{session}:{expires}, verifiable with the discovery JWK named by kid. 404 if the checkout does not exist; 501 NOT_CONFIGURED when no hosted page or signing key is configured.
POST/api/v1/ucp/checkout/:id/fulfillmentUCP fulfillment extension for a checkout session; same request/response shape as the cart fulfillment endpoint.
GET/api/v1/ucp/payment-handlersList configured payment handlers.
GET/api/v1/ucp/payment-handlers/:idGet a payment handler by id.
POST/api/v1/acp/checkout_sessionsACP create checkout session: CheckoutSessionCreateRequest in, 201 CheckoutSession out. Requires API-Version: 2026-04-17 and Idempotency-Key. See ACP REST bodies.
GET/api/v1/acp/checkout_sessions/:idACP get checkout session.
POST/api/v1/acp/checkout_sessions/:idACP update checkout session (CheckoutSessionUpdateRequest; line_items replace the items). Requires Idempotency-Key. PUT is accepted too.
POST/api/v1/acp/checkout_sessions/:id/completeACP complete session: CheckoutSessionCompleteRequest in, CheckoutSessionWithOrder out (or the session with status: authentication_required; send authentication_result to finish, see 3DS2 step-up). Requires Idempotency-Key.
POST/api/v1/acp/checkout_sessions/:id/cancelACP cancel session, optional CancelSessionRequest body; 405 if already canceled. Requires Idempotency-Key.
POST/api/v1/acp/delegate_paymentACP delegate payment token exchange, performed by the configured PSP. Requires Idempotency-Key. Returns 501 NOT_CONFIGURED when no delegation adapter is configured.
POST/api/v1/acp/cartsACP Cart capability: CartCreateRequest in, 201 Cart out, priced in UCP_CATALOG_CURRENCY. Requires API-Version: 2026-04-17 and Idempotency-Key.
GET/api/v1/acp/carts/:idACP get cart; a canceled cart is 404 not_found.
PUT/api/v1/acp/carts/:idACP replace cart contents (CartUpdateRequest). Requires Idempotency-Key.
POST/api/v1/acp/carts/:id/cancelACP cancel cart. Requires Idempotency-Key.
POST/api/v1/checkout/executeExecute checkout for a cart. Body: CheckoutRequestDto. Requires auth in production.
POST/api/v1/a2a/message:sendA2A 1.0 SendMessage (HTTP+JSON binding, A2A-Version: 1.0 required). See A2A 1.0.
GET/POST/api/v1/a2a/tasks/:id, /api/v1/a2a/tasks/:id:cancelA2A task operations; always 404 TASK_NOT_FOUND, because this agent replies with messages and never creates tasks.
POST/api/v1/a2a/checkoutA2A envelope checkout. Send A2A-Version: 1.0 (or 0.3).
POST/api/v1/a2a/cartA2A envelope cart command. Send A2A-Version: 1.0 (or 0.3).
POST/api/v1/a2a/identity/linkA2A envelope: { "capability": "dev.ucp.common.identity_linking", "payload": { "tenant_id": "...", "merchant_id": "...", "agent_id": "...", "link_token": "...", "user_reference": "..."? } }. Legacy identity capability names remain accepted. Returns 501 NOT_CONFIGURED when no identity provider is configured.

Catalog and orders

MethodPathDescription
GET/api/v1/catalog/items/:idLegacy catalog item lookup.
POST/api/v1/ucp/catalog/searchUCP-native catalog search. Body: { "query": "..." }.
POST/api/v1/ucp/catalog/lookupUCP-native batch lookup. Body: { "ids": ["SKU-1"] }; misses are returned as UCP messages.
POST/api/v1/ucp/catalog/productUCP-native product lookup. Body: { "id": "SKU-1" }.
GET/api/v1/orders/:idLegacy order lookup with tenant isolation.
GET/api/v1/ucp/orders/:idUCP order: checkout_id, currency, permalink_url, line_items[] (with quantity: {original, total, fulfilled} and status), fulfillment, and totals[].

Payments

MethodPathDescription
POST/api/v1/payments/captureCapture an authorized payment. Body: PaymentLifecycleRequestDto. Tenant in body must match auth context.
POST/api/v1/payments/voidVoid a payment. Body: PaymentLifecycleRequestDto.
POST/api/v1/payments/refundRefund a payment. Body: PaymentLifecycleRequestDto.

Events and operations

MethodPathDescription
POST/api/v1/events/incomingIdempotent event ingest (e.g. webhooks). Body: { "message_id": "..." }.
POST/api/v1/ops/outbox/processProcess one outbox message. Body: { "max_attempts": 3 }.
GET/api/v1/ops/dead-letterList dead-letter entries.
POST/api/v1/ops/dead-letter/replayReplay a message from dead-letter. Body: { "message_id": "..." }.
POST/api/v1/ops/reconciliationRun payment reconciliation. Body: { "transaction_ids": ["..."] }.
GET/api/v1/openapi.jsonOpenAPI 3.1 document for REST clients and tooling. No auth required.

Health and metrics

MethodPathDescription
GET/health/liveLiveness probe.
GET/health/readyReadiness probe.
GET/metricsPrometheus text metrics including orchestrator_events_total, provider call counts, and provider latency histograms.

Request and response shapes

All request/response bodies are JSON.

Cart command (POST /api/v1/cart/commands)

Request: { "command": { "kind": "<command_kind>", ... }, "cart_id": "<uuid or null>" }

A cart belongs to the tenant that created it, taken from your access token and not from the request body. Reading, changing, cancelling, starting checkout on, or checking out a cart that belongs to another tenant returns 403 with code: TENANT_MISMATCH — a cart id on its own grants nothing. This applies to every surface: REST, UCP, ACP, A2A and the MCP tools.

Command kinds and their fields:

  • create_cart: merchant_id, currency
  • add_item: item_id, quantity
  • update_item_qty: line_id, quantity
  • remove_item: line_id
  • apply_adjustment: code
  • get_cart: cart_id
  • start_checkout: cart_id, cart_version
  • cancel_cart: cart_id

Response (success): Cart projection with cart_id, version, currency, lines, subtotal_minor, tax_minor, fulfillment_minor, discount_minor, discounts, total_minor, geo_ok, status.

Discounts (apply_adjustment)

An apply_adjustment code is stored on the cart and re-evaluated by your pricing provider on every reprice, via PricingProvider::resolve_discounts. The provider decides what a code is worth; the orchestrator never invents a discount.

  • The provider returns zero or more discounts, each with code, optional description, amount_minor and optional line_id.
  • Returning an error rejects the code, and the apply_adjustment command fails with a pricing error. Use this for expired or ineligible campaigns.
  • discount_minor is the sum of granted discounts, clamped so that total_minor can never go below zero.
  • total_minor = subtotal_minor + tax_minor + fulfillment_minor - discount_minor.
  • Because codes are re-evaluated on every reprice, a discount that stops being valid after a cart change disappears from the next projection.

A provider that does not implement resolve_discounts grants nothing, so codes are accepted and recorded but change no money. UCP cart responses carry discount_minor plus a discounts array, and advertise dev.ucp.shopping.discount when at least one discount applies; ACP session and cart totals[] carry a discount entry.

Checkout execute (POST /api/v1/checkout/execute)

Request: CheckoutRequestDto — tenant_id, merchant_id, cart_id, cart_version, currency, optional customer, optional location, payment_intent (e.g. amount_minor, token_or_reference), idempotency_key.

MPP note:

  • For machine payments, set payment_intent.payment_method_type to mpp.
  • Include payment_intent.mpp_method (a lowercase method name, for example stripe or tempo) and payment_intent.mpp_intent (for example charge).
  • Do not mix AP2 fields (ap2_consent_proof, payment_handler_id) with payment_method_type = mpp.
  • When the operator has not set MPP_CHALLENGE_SECRET, put the credential in payment_intent.token_or_reference. The payment provider gets it as sent.

MPP Payment challenges

With MPP_CHALLENGE_SECRET set, an MPP checkout is paid through the Payment HTTP authentication scheme (draft-httpauth-payment):

  1. Send the checkout without a credential. The answer is 402 Payment Required with Cache-Control: no-store, an RFC 9457 problem body (type: https://paymentauth.org/problems/payment-required), and a challenge:

    WWW-Authenticate: Payment id="…", realm="shop.example.com", method="tempo", intent="charge",
      request="<base64url JSON>", expires="2026-11-26T12:05:00Z", digest="sha-256=:…:",
      header="Payment-Authorization", opaque="…"
    
    • request decodes to {"amount": "<amount_minor>", "currency": "<lowercase ISO 4217>"}.
    • digest is the RFC 9530 Content-Digest of the exact body you sent.
    • id is an HMAC over every other parameter, so none of them can be edited.
  2. Pay, then resend the same body. Send the byte-identical body with Payment-Authorization: Payment <base64url JSON>. The JSON is { "challenge": { …the parameters echoed… }, "payload": { …method-specific proof… }, "source": "…" }, as the draft defines. The credential goes in Payment-Authorization because Authorization already carries your API bearer token.

  3. The orchestrator checks the credential. The challenge must be bound by this deployment, unexpired, issued for this body, and unused. The orchestrator then claims its id once and hands the credential to your payment provider as token_or_reference. The provider verifies the method-specific proof.

  4. On success, you get 200 with the transaction result, Cache-Control: private, and Payment-Receipt: <base64url JSON> (status, method, timestamp, reference, challengeId).

Refusals are 402 with a fresh challenge and one of these problem types:

Problem type (under https://paymentauth.org/problems/)Cause
malformed-credentialThe credential is not base64url JSON of the draft’s shape.
invalid-challengeThe challenge was not issued by this deployment for this body, its parameters were edited, or its id was already used.
payment-expiredThe challenge’s expires has passed.
verification-failedThe payment provider did not accept the proof.

Sending more than one Payment-Authorization header is 400 (bad-request). Authentication runs first, so a bad bearer token is 401 and the credential is not consumed.

sequenceDiagram
  participant Agent
  participant Orchestrator
  participant PSP as Payment provider
  Agent->>Orchestrator: POST /checkout/execute (payment_method_type=mpp)
  Orchestrator-->>Agent: 402 WWW-Authenticate: Payment (bound to body, amount, expiry)
  Agent->>Agent: pay with the method, build credential
  Agent->>Orchestrator: same body + Payment-Authorization: Payment …
  Orchestrator->>Orchestrator: verify binding, expiry and digest, then claim the id once
  Orchestrator->>PSP: authorize (credential as token_or_reference)
  alt proof accepted
    Orchestrator-->>Agent: 200 + Payment-Receipt
  else proof refused
    Orchestrator-->>Agent: 402 verification-failed + fresh challenge
  end

MPP over MCP

The native MCP server (POST /api/v1/mcp/message) runs the same flow for the execute_checkout tool, in the MPP MCP transport’s JSON form, whenever MPP_CHALLENGE_SECRET is set:

  • Without a credential the call fails with JSON-RPC error -32042 (Payment Required). error.data.challenges[0] is the challenge as a JSON object, error.data.problem the RFC 9457 problem. The challenge has no header parameter, and its digest covers the JCS-canonical tool arguments instead of an HTTP body.
  • Retry with the same arguments and the credential object (not base64url) in params._meta["org.paymentauth/credential"].
  • On success the transaction result carries _meta["org.paymentauth/receipt"] with the same fields as Payment-Receipt.
  • Refusals are -32042 with a fresh challenge and the problem types above; a proof your payment provider refuses is -32043.

The MCP binding has the full wire shapes. MPP is not available on the UCP, ACP or A2A checkout bindings: none of those specifications defines an MPP handler, instrument or message part (conformance matrix).

Response (success): Transaction result with transaction_id, status, totals_breakdown, payment_reference, receipt_payload, correlation_id, payment_state, order_id.

Amount integrity

Before anything is authorized, the orchestrator re-runs pricing, tax and discount resolution against your providers and refreshes the cart snapshot. The refreshed total — not the total the cart happened to be carrying — is what may be charged.

  • payment_intent.amount_minor must equal that total exactly. Anything else is refused with 422 and code AMOUNT_MISMATCH; the message states the amount the cart actually costs.
  • A rejected request does not consume its idempotency_key, so the caller can immediately retry with the corrected amount under the same key.
  • A stale price is therefore caught at checkout rather than silently under-collected. Re-read the cart (get_cart) to see the refreshed totals; cart_version is unchanged because the cart’s contents did not change.
sequenceDiagram
  participant Agent
  participant Orchestrator
  participant Providers as Pricing / Tax
  Agent->>Orchestrator: POST /checkout/execute (amount_minor)
  Orchestrator->>Providers: re-price, re-tax, re-discount
  Providers-->>Orchestrator: current total
  alt amount_minor == current total
    Orchestrator->>Orchestrator: authorize and capture
    Orchestrator-->>Agent: 200 transaction result
  else mismatch
    Orchestrator-->>Agent: 422 AMOUNT_MISMATCH (idempotency key released)
  end

ACP REST bodies (2026-04-17)

/api/v1/acp/checkout_sessions and /api/v1/acp/carts take and return the ACP 2026-04-17 bodies exactly; requests are validated against the official ACP JSON Schema and anything outside it (including the orchestrator’s earlier merchant_id, tenant_id and amount_minor fields) is 400 invalid_payload. The same code serves the ACP MCP binding.

POST /api/v1/acp/checkout_sessions
API-Version: 2026-04-17
Idempotency-Key: 7f3c...

{ "currency": "usd", "line_items": [{ "id": "demo-tee" }, { "id": "demo-tee" }], "capabilities": {} }
  • Items. ACP items carry no quantity: each line_items[] entry is one unit, so the example is one line with quantity: 2.
  • Merchant and tenant. ACP bodies name neither: the session belongs to the authenticated caller’s tenant and to UCP_DEFAULT_MERCHANT_ID (400 merchant_required when unset).
  • Responses. A CheckoutSession with protocol.version, capabilities, status (ready_for_payment with items, not_ready_for_payment without, canceled), line_items[] (item.id, quantity, unit_amount, totals[]), totals[] (subtotal, discount, fulfillment, tax, total), fulfillment_options, messages and links.
  • Complete. Send payment_data.handler_id and payment_data.instrument.credential.token, optional buyer. The amount is the session’s total, the idempotency key is the Idempotency-Key header, and the answer is CheckoutSessionWithOrder (status: completed, order { id, checkout_session_id, permalink_url }). The same key replays the same order; a key spent on another session is 422 idempotency_conflict.
  • Carts. CartCreateRequest / CartUpdateRequest hold line_items (and optional buyer); a Cart has id, currency (UCP_CATALOG_CURRENCY; 400 currency_required when unset), line_items and totals. A canceled cart is gone (404), since ACP carts have no status.
  • Errors. Every failure is an ACP Error: { "type": "invalid_request", "code": "session_not_found", "message": "...", "param": "$.id" }. Codes: missing_api_version / unsupported_api_version (with supported_versions), idempotency_key_required, invalid_json, invalid_payload (with a JSONPath param), merchant_required, currency_required, session_not_found / not_found (404), forbidden (403, another tenant’s session), session_not_cancelable (405), idempotency_conflict (422), payment_declined (402, processing_error), unsupported_payment_method.
  • Headers. The Idempotency-Key is echoed on success.

MCP transport rules (all MCP endpoints)

POST /api/v1/mcp/message, POST /api/v1/ucp/mcp and POST /api/v1/acp/mcp follow MCP 2026-07-28 Streamable HTTP. A client on 2026-07-28 sends MCP-Protocol-Version: 2026-07-28, Mcp-Method (the body’s method) on every request and Mcp-Name (the tool name, or the resource URI) on tools/call and resources/read; a missing or different value is HTTP 400 with JSON-RPC -32020, an unsupported version 400 with -32022, an unknown method 404 with -32601. Clients on 2025-11-25 or 2024-11-05 (or sending no version header) are served as before. A request carrying an Origin header is refused with 403 unless that origin is listed in MCP_ALLOWED_ORIGINS; server-side agents send no Origin and are unaffected. GET and DELETE are 405. See MCP binding.

UCP MCP binding (POST /api/v1/ucp/mcp)

UCP platforms that use MCP (UCP’s services/shopping/mcp.openrpc.json) call the checkout, cart, catalog and order operations as MCP tools at POST /api/v1/ucp/mcp, listed in /.well-known/ucp as the mcp transport of dev.ucp.shopping. The tools run the same code as the REST binding and return the same UCP bodies, in result.structuredContent. Each call carries arguments.meta["ucp-agent"].profile; complete_checkout, cancel_checkout and cancel_cart also need a UUID meta["idempotency-key"]. See MCP binding for tools, errors and metrics.

3DS2 step-up (UCP actions and ACP delegate authentication)

When the payment provider wants the buyer authenticated with 3DS2 before it authorizes, the checkout pauses instead of failing. Nothing is charged until the authentication result is known, and the idempotency key keeps answering with the pending step-up. This only happens when the deployment’s payment provider supports it, which discovery says: dev.ucp.common.payment.authentication in /.well-known/ucp, capabilities.intervention_types: ["3ds"] in /.well-known/acp.json. Test it in development with the mock tokens tok_3ds_challenge (challenge, then authenticated), tok_3ds_device_data (device data collection, then authenticated), tok_3ds_pending (never finishes) and tok_3ds_denied.

UCP (REST, MCP and A2A). complete_checkout (MCP and A2A) returns the checkout with status: complete_in_progress and an action; REST complete returns status: authentication_required and payment_state: authentication_pending with an authentication object, and Get Checkout shows the same UCP checkout:

{
  "status": "complete_in_progress",
  "actions": {
    "dev.ucp.common.payment.three_ds_challenge": [
      { "id": "three_ds_challenge-3ds_...", "config": { "payment_instrument_id": "pi_card_1", "url": "https://psp.example/3ds/..." } }
    ]
  },
  "payment": { "instruments": [ { "id": "pi_card_1", "handler_id": "card", "type": "card", "selected": true } ] }
}

Open config.url in the surface the extension describes (invisible for device_data_collection, buyer-facing for three_ds_challenge). After action.done, call Get Checkout (GET /api/v1/ucp/checkout-sessions/:id or get_checkout): it asks the provider for the result and answers completed with the order, or keeps complete_in_progress while the provider is still waiting, or returns the cart status with a payment_failed message if authentication failed. Do not call complete again while it is in progress. To point the action at your instrument over REST, send payment_instrument_id in the complete body. When the deployment negotiates platform profiles (UCP_PROFILE_NEGOTIATION lenient or strict), declare dev.ucp.common.payment.authentication (extending dev.ucp.shopping.checkout) in your profile: without it the actions are withheld and the checkout answers with a recoverable payment_failed message instead, so complete again with another instrument.

ACP (REST and MCP). Complete Checkout Session returns the CheckoutSession with status: authentication_required, authentication_metadata (acquirer_details, directory_server) and a requires_3ds message, and Retrieve shows the same. Run delegate authentication with your authentication provider, then complete again (new Idempotency-Key, or a new meta.idempotency_key over MCP) with the result:

{
  "payment_data": {
    "handler_id": "card_tokenized",
    "instrument": { "type": "card", "credential": { "type": "spt", "token": "spt_..." } }
  },
  "authentication_result": {
    "outcome": "authenticated",
    "outcome_details": { "three_ds_cryptogram": "AAAB...", "electronic_commerce_indicator": "05", "transaction_id": "...", "version": "2.2.0" }
  }
}

Only authenticated and attempt_acknowledged lead to an order (completed, with order); other outcomes answer 402 payment_declined, and Retrieve then shows a payment_declined message. outcome_details is required for authenticated, attempt_acknowledged and informational (400 invalid_payload otherwise). Sending a result when nothing is pending is 409 authentication_not_pending. Repeating the result returns the same outcome.

A pause expires after 15 minutes (timed_out). A cart changed while the buyer authenticates is not charged (auth_failed).

Platform profile negotiation (UCP-Agent)

UCP platforms name their own profile on every request: the UCP-Agent header on the REST binding, and meta["ucp-agent"].profile on the MCP binding.

POST /api/v1/ucp/checkout-sessions
UCP-Agent: profile="https://platform.example/profiles/shopping-agent.json"

The header is an RFC 8941 dictionary; only its profile string is read. What the orchestrator does with it depends on UCP_PROFILE_NEGOTIATION:

ModeBehaviour
off (default)Nothing is fetched. Responses list every capability the operation uses, as before. The MCP binding still requires an http(s) profile URL.
lenientThe profile is fetched and negotiated. When that works, responses list only negotiated capabilities. When it fails (no header, unreachable, malformed, unsupported version, operation outside the intersection), the failure is counted and the request proceeds unnegotiated. Use it to see what strict would refuse before you switch.
strictUCP 2026-08-25 behaviour: every failure refuses the request with the errors below.
sequenceDiagram
  participant P as UCP platform
  participant O as Orchestrator
  participant PP as Platform profile host
  P->>O: request + UCP-Agent profile URL
  alt profile cached (60 s to 1 h)
    O->>O: reuse cached profile
  else
    O->>PP: GET profile (HTTPS, public address, no redirects, 5 s, 256 KiB)
    PP-->>O: profile + Cache-Control max-age
  end
  O->>O: check ucp.version, intersect capabilities
  O-->>P: response whose ucp.capabilities lists only negotiated capabilities

Version. The platform’s ucp.version must be 2026-08-25 or one of the older versions in our profile’s supported_versions (2026-04-08, 2026-01-23, 2026-01-11). Capabilities match only at equal versions, and this deployment serves its capabilities at 2026-08-25, so a platform must list 2026-08-25 capability versions to negotiate any.

Intersection. A capability is negotiated when both profiles declare it with a common version; the highest common version is used. Extensions (discount, fulfillment) are dropped when none of the capabilities they extend survived, repeatedly until nothing changes. An operation whose own capability (checkout, cart, order, catalog.search, catalog.lookup) is not negotiated gets a capabilities_incompatible error in strict mode.

Errors (strict):

SituationRESTMCP
No UCP-Agent header, malformed header, URL not HTTPS, or a host resolving to a private or special-use address400 {"code":"invalid_profile_url","content":"..."}HTTP 400, -32001, data.code: invalid_profile_url
Profile cannot be fetched (DNS, connect, timeout, non-200, redirect)424, profile_unreachableHTTP 424, -32001
Profile is not a platform profile (ucp.version, ucp.services, ucp.payment_handlers required) or too large422, profile_malformedHTTP 422, -32001
Platform’s ucp.version not supported422, version_unsupportedHTTP 422, -32001
The operation’s capability is not in the intersection200 with a UCP error response: ucp.status: error, messages[0].code: capabilities_incompatibleResult with the same UCP error response

Caching. A profile is reused for its Cache-Control: max-age, at least 60 s and at most 1 h; a failed fetch is retried after 15 s. Up to 256 profile URLs are cached per replica.

Fetch safety. Profile URLs come from callers, so the fetch accepts only https URLs without credentials or fragments, resolves the host once and refuses loopback, private, link-local (including 169.254.169.254), CGNAT, documentation, multicast and other special-use addresses, then connects only to the checked addresses. It follows no redirects, uses no proxy, times out after 3 s (connect) / 5 s (total), and stops reading at 256 KiB. Requests that fail authentication never cause a fetch. The pod needs egress on port 443 to platforms’ profile hosts (the shipped NetworkPolicy allows it).

Metrics. orchestrator_operation_calls_total / orchestrator_operation_latency_seconds with operation="ucp_negotiation_rest" or "ucp_negotiation_mcp" and status = negotiated, invalid_profile_url, profile_unreachable, profile_malformed or version_unsupported; operation="ucp_profile_fetch" with status = success, invalid_url, prohibited_address, unreachable, http_status, too_large (fetch latency); counters ucp_negotiation_total, ucp_profile_cache_hit_total, ucp_profile_cache_miss_total, ucp_negotiation_capabilities_incompatible_total and ucp_negotiation_lenient_bypass_total.

ACP MCP binding (POST /api/v1/acp/mcp)

ACP agents that use MCP (ACP 2026-04-17 openrpc.agentic_checkout.json) call create_checkout_session, get_checkout_session, update_checkout_session, complete_checkout_session and cancel_checkout_session at POST /api/v1/acp/mcp; /.well-known/acp.json lists the mcp transport, and the URL is given out of band. Arguments are meta (api_version required, idempotency_key for complete, optional merchant_id), id and payload (the ACP 2026-04-17 request body, validated against the ACP schema). Results are ACP CheckoutSession objects; errors are JSON-RPC -32000 with the ACP Error in data. Sessions are shared with the REST binding. See MCP binding.

Completed and canceled checkouts

A checkout that placed its order is final, and so is a canceled one. Reading it back answers completed with the order (UCP order.id / permalink_url; ACP order on the CheckoutSession) or canceled. Changing it is refused on every binding:

BindingCompletedCanceled
UCP REST (update, cancel, complete)409 CHECKOUT_COMPLETED409 CART_CANCELED
UCP MCP and A2A (incl. add_to_checkout)error response, checkout_completed, severity: unrecoverablecart_canceled, unrecoverable
ACP REST and MCP (update, complete)409 checkout_session_completed409 checkout_session_canceled
ACP cancel405 session_not_cancelable405 session_not_cancelable

A retry of the original complete with its own idempotency key still replays the outcome. Start a new checkout to buy again.

UCP response bodies

Cart, checkout session, and order bodies validate against the UCP 2026-08-25 schemas (shopping/cart.json, shopping/checkout.json, shopping/order.json):

  • line_items[]: item: { id, title, price } (unit price in minor units), quantity, and totals[]. title, unit_price_minor and total_minor remain on cart and checkout lines as aliases.
  • totals[]: typed integer amounts in minor units — exactly one subtotal and one total, plus discount (negative, only when something was taken off), fulfillment (when a paid option is selected) and tax. The *_minor fields remain as aliases.
  • Checkout status: incomplete (empty or not yet started), ready_for_complete, complete_in_progress (paused for 3DS2, with actions), completed (after a 3DS2 checkout finished, with order), or canceled. Checkout responses also carry links[] and the deployment’s ucp.payment_handlers. Cart responses keep the orchestrator’s draft / checkout_ready / canceled.
  • Orders: checkout_id names the checkout session; each line has quantity: { original, total, fulfilled } and status (processing, fulfilled, or removed for a cancelled order); fulfillment is present with empty expectations/events (order history is in events).

Fulfillment selection (POST /api/v1/ucp/cart/:id/fulfillment)

Request: method_type (shipping or pickup), destination, optional line_item_ids (defaults to all lines), optional selected_option_id.

  • Shipping destination: { "id": "dest_1", "street_address": "...", "address_locality": "...", "address_region": "...", "address_country": "...", "postal_code": "..." }.
  • Pickup (retail) destination: { "id": "dest_1", "name": "<store name>" }.

Calling without selected_option_id returns quoted options for the method type without changing total_minor. Calling again with selected_option_id set to one of the quoted option ids selects it, adds its amount_minor to total_minor via fulfillment_minor, and replaces any prior selection for that method type.

The selected destination is also the location your geo provider sees. Setting or changing a destination re-runs the geo check immediately, and every later reprice passes the cart’s destination country, region and postal code — along with the cart’s tenant and merchant — so a blocked destination shows up as geo_ok: false rather than passing unnoticed.

The verdict is binding. execute_checkout re-takes it and refuses a blocked destination with 403 and code: GEO_BLOCKED; nothing is authorized and the cart keeps geo_ok: false.

{
  "method_type": "shipping",
  "destination": {
    "id": "dest_1",
    "street_address": "1 Market St",
    "address_locality": "San Francisco",
    "address_region": "CA",
    "address_country": "US",
    "postal_code": "94105"
  },
  "selected_option_id": "express"
}

Response (success): UCP cart envelope whose fulfillment object follows the UCP 2026-08-25 fulfillment schema: each method carries destinations[] (type: shipping_address with the postal fields, or type: business_location with name and optional address) and selected_destination_id; each option carries title, description: { "plain": … }, and totals: [{ "type": "total", "amount": <minor units> }] (plus amount_minor, an orchestrator alias of the same amount); groups[].selected_option_id is set once selected. Selecting an option id that was not part of the quoted set returns an error rather than a silent no-op.

"fulfillment": {
  "methods": [{
    "id": "shipping", "type": "shipping", "line_item_ids": ["line_1"],
    "destinations": [{ "type": "shipping_address", "id": "dest_1", "postal_code": "94105", "address_country": "US" }],
    "selected_destination_id": "dest_1",
    "groups": [{
      "id": "group_1", "line_item_ids": ["line_1"], "selected_option_id": "express",
      "options": [{ "id": "express", "title": "Express Shipping",
                    "description": { "plain": "Arrives in 2-3 business days" },
                    "totals": [{ "type": "total", "amount": 1000 }], "amount_minor": 1000 }]
    }]
  }]
}

A2A 1.0: Agent Card and SendMessage

GET /.well-known/agent-card.json (public, cacheable) is the A2A 1.0 Agent Card. It lists three interfaces — {base}/api/v1/a2a (HTTP+JSON, 1.0) and {base}/api/v1/a2a/jsonrpc (JSONRPC, 1.0 and 0.3) — capabilities.streaming: true, the UCP extension (see UCP’s A2A binding), and the skills this deployment can run: cart, checkout, order-lookup, ucp-checkout, and identity-linking when an identity provider is configured. When the deployment requires bearer auth, the card says so in securitySchemes/securityRequirements. /.well-known/ucp links it as orchestrator.a2a_agent_card.

POST /api/v1/a2a/message:send carries one of the existing capability envelopes in a DataPart and answers synchronously with an agent Message whose DataPart holds the result (the same body the matching /a2a/* route returns). Which skill runs is read from the envelope: an identity capability links identity, payload.order_id looks up an order, payload.command runs a cart command, anything else is a checkout. Pass contextId to thread several messages; a new one is assigned otherwise.

sequenceDiagram
    participant C as A2A client
    participant O as Orchestrator
    C->>O: GET /.well-known/agent-card.json
    O-->>C: AgentCard (HTTP+JSON interface, skills)
    C->>O: POST /api/v1/a2a/message:send (A2A-Version: 1.0, DataPart envelope)
    O->>O: same normalizer, authz, idempotency as /a2a/* routes
    O-->>C: {"message": {"role": "ROLE_AGENT", "parts": [{"data": result}]}}
POST /api/v1/a2a/message:send HTTP/1.1
A2A-Version: 1.0
Content-Type: application/a2a+json
Authorization: Bearer <token>

{"message": {"messageId": "msg-1", "role": "ROLE_USER", "contextId": "ctx-7",
  "parts": [{"mediaType": "application/json", "data": {
    "capability": "dev.ucp.shopping.checkout",
    "payload": {"command": {"kind": "create_cart", "merchant_id": "m1", "currency": "USD"}}}}]}}

Errors use A2A’s google.rpc.Status shape, {"error": {"code", "status", "message", "details": [{"@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason", "domain"}]}}:

HTTPreasonWhen
400VERSION_NOT_SUPPORTEDA2A-Version is missing (A2A reads that as 0.3) or not 1.0
400INVALID_PARAMSNot JSON, no messageId, role not ROLE_USER, or no DataPart
400UNSUPPORTED_OPERATIONAn operation other than message:send / message:stream, or GET /extendedAgentCard
400PUSH_NOTIFICATION_NOT_SUPPORTEDAny /tasks/{id}/pushNotificationConfigs operation
404TASK_NOT_FOUNDGetTask, CancelTask, SubscribeToTask, or a message that names a taskId
4xx/5xxorchestrator code (e.g. NOT_FOUND, AMOUNT_MISMATCH), domain commerce-orchestratorThe operation itself failed; the HTTP status matches the REST route

GET /api/v1/a2a/tasks (ListTasks) is always empty: the agent never creates tasks. Push notifications, the extended card, the gRPC binding and Agent Card signatures are not offered; the card says so.

Streaming (SendStreamingMessage)

POST /api/v1/a2a/message:stream takes the same request as message:send and answers text/event-stream. Because the agent replies with a Message, the stream holds exactly one event and then closes, as A2A 1.0 §3.1.2 requires:

HTTP/1.1 200 OK
Content-Type: text/event-stream

data: {"message":{"messageId":"…","contextId":"ctx-7","role":"ROLE_AGENT","parts":[{"data":{…},"mediaType":"application/json"}]}}

Errors (wrong version, bad message, a failed operation) are found before the stream opens and come back as the ordinary application/a2a+json error above, never as an event. Each stream is counted in the orchestrator_open_streams{stream="a2a_message_stream"} gauge while it is open.

JSON-RPC binding

POST /api/v1/a2a/jsonrpc takes one JSON-RPC 2.0 request per POST:

  • With A2A-Version: 1.0: SendMessage (result {"message": …}), SendStreamingMessage (one SSE event whose data is a full JSON-RPC response), GetTask / CancelTask / SubscribeToTask (-32001), ListTasks (empty), the push config methods (-32003) and GetExtendedAgentCard (-32004).
  • With no A2A-Version (A2A 0.3): message/send and message/stream with 0.3 messages ("kind": "message", "role": "user", parts {"kind": "data", "data": …}), and tasks/get / tasks/cancel (-32001).

A 1.0 method without A2A-Version: 1.0 is -32009; an unknown method -32601; a bad message -32602. Refusals (401, 403, 409) keep their HTTP status; other errors come back in a 200, with error.data.reason and error.data.domain as in the HTTP+JSON ErrorInfo.

UCP’s A2A binding (checkout)

UCP platforms that speak A2A drive checkout with UCP’s own message shapes (specification/shopping/checkout/a2a). /.well-known/ucp lists the binding as {"transport": "a2a", "endpoint": "{base}/.well-known/agent-card.json"} under dev.ucp.shopping, and the Agent Card advertises the extension https://ucp.dev/2026-08-25/specification/reference with params.capabilities["dev.ucp.shopping.checkout"].

Send every request with UCP-Agent: profile="https://…" (required) and X-A2A-Extensions (or A2A-Extensions) naming the extension URI, which is echoed back. A message is UCP when a DataPart has an action or a2a.ucp.* keys; anything else is the orchestrator’s own envelope as above. The binding is written against JSON-RPC message/send, which the JSON-RPC endpoint serves when no A2A-Version is sent; the same DataParts also work over HTTP+JSON and JSON-RPC SendMessage with A2A-Version: 1.0.

actionDataPart fieldsDoes
add_to_checkoutproduct_id, quantity (default 1), optional currency, merchant_idAdds the product to the context’s checkout, or starts one
create_checkouta2a.ucp.checkout: {currency, line_items[], merchant_id?}New checkout
get_checkout—Reads the context’s checkout
update_checkouta2a.ucp.checkoutReplaces the line items
cancel_checkout—Cancels; cancelling again returns the cancelled checkout
complete_checkouta2a.ucp.checkout.payment (an instrument, or {instruments: [...]}), optional a2a.ucp.checkout.signals, optional a2a.ucp.checkout: {buyer}Pays and places the order; the checkout comes back completed with order {id, permalink_url}

The reply’s DataPart holds the checkout under a2a.ucp.checkout, and its contextId is the checkout id: send it back for the next turn. A checkout made over REST or MCP is driven over A2A by sending its id as the contextId (or as id in the DataPart), and an A2A checkout reads back over the others. add_to_checkout carries no merchant or currency, so configure UCP_DEFAULT_MERCHANT_ID and UCP_CATALOG_CURRENCY (or send merchant_id / currency).

sequenceDiagram
    participant P as UCP platform
    participant O as Orchestrator
    P->>O: GET /.well-known/ucp
    O-->>P: dev.ucp.shopping a2a → agent card URL
    P->>O: message/send {action: add_to_checkout, product_id, quantity} (UCP-Agent, X-A2A-Extensions)
    O->>O: run_ucp_create_checkout (same code as REST and MCP)
    O-->>P: message {contextId: checkout id, data: {a2a.ucp.checkout}}
    P->>O: message/send contextId, {action: complete_checkout} + {a2a.ucp.checkout.payment}
    O->>O: run_ucp_complete_checkout
    O-->>P: a2a.ucp.checkout {status: completed, order {id, permalink_url}}
{"jsonrpc": "2.0", "id": 3, "method": "message/send", "params": {"message": {
  "role": "user", "kind": "message", "messageId": "e94a8c10-69f4-4c4c-b988-21a298302da6",
  "contextId": "<checkout id>",
  "parts": [
    {"kind": "data", "data": {"action": "complete_checkout"}},
    {"kind": "data", "data": {
      "a2a.ucp.checkout.payment": {"id": "instr_1", "handler_id": "card", "type": "card",
        "credential": {"type": "token", "token": "tok_visa"}},
      "a2a.ucp.checkout.signals": {"dev.ucp.buyer_ip": "203.0.113.42"}}}]}}}
  • Idempotency: messageId is the idempotency key. A retried message is answered with the first reply and not applied again; reusing a messageId for a different message is -32000 / HTTP 409 (IDEMPOTENCY_CONFLICT). Each replica remembers its last 10,000 messages; completion is also guarded by the checkout runner’s durable key.
  • Business errors (unknown checkout, validation, payment failure) are a normal reply whose a2a.ucp.checkout is a UCP error response: {"ucp": {"status": "error"}, "messages": [{"type": "error", "code": "not_found", …}]}.
  • Protocol errors: missing or invalid UCP-Agent profile -32001 (data.code: invalid_profile_url); another tenant’s checkout -32000 with HTTP 403 (data.reason: TENANT_MISMATCH); an unknown action or an AP2 mandate (ap2.checkout_mandate, not supported here) -32602.
  • Cart, catalog and order have no UCP A2A binding; use the REST or MCP bindings.
  • Metrics: orchestrator_operation_calls_total / orchestrator_operation_latency_seconds with operation="a2a_ucp_<action>".

Identity linking (POST /api/v1/a2a/identity/link)

Request: A2A envelope with capability and payload:

  • capability: dev.ucp.common.identity_linking (legacy dev.ucp.identity.linking remains accepted)
  • payload: tenant_id, merchant_id, agent_id, link_token, optional user_reference

Response (success): { "ucp": { "version": "...", "supported_versions": [...] }, "link_id": "...", "status": "linked" }.

Payment lifecycle (capture / void / refund)

Request: tenant_id, merchant_id, transaction_id, amount_minor, idempotency_key (and any other fields required by the DTO).

Response: { "success": true/false, "reference": "..." }.


Errors

Failed requests return JSON:

{ "error": "<message>", "code": "<CODE>" }

Common codes: BAD_REQUEST, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, VALIDATION_ERROR, IDEMPOTENCY_CONFLICT, PAYMENT_ERROR, AMOUNT_MISMATCH, TENANT_MISMATCH (403, the cart or resource belongs to another tenant), GEO_BLOCKED (403, your geo provider refused the cart’s destination), MERCHANT_REQUIRED (400, a UCP cart or checkout named no merchant_id and UCP_DEFAULT_MERCHANT_ID is unset; ACP answers merchant_required), STORE_ERROR, RUNNER_ERROR, NOT_CONFIGURED (501, the deployment does not offer that capability), PAYMENT_DELEGATION_ERROR (502, the PSP failed). Use the HTTP status code (4xx/5xx) and code for handling.

ACP-specific: ACP checkout session and cart routes answer with ACP Error bodies instead (see ACP REST bodies). Every mutating ACP route (checkout_sessions create/update/complete/cancel, delegate_payment, carts create/update/cancel) requires a non-empty Idempotency-Key header; a missing or blank header returns 400 with code: idempotency_key_required.


Config reference (server-side)

The orchestrator is a middleware API layer. Operators configure where each downstream service lives. In production the server requires all of the following (see deploy/README.md):

VariableDescription
ENVproduction to enable auth and real adapters.
PUBLIC_BASE_URLPublic base URL advertised in discovery (e.g. https://orchestrator.example.com).
DATABASE_URLPostgreSQL connection string (e.g. postgres://orchestrator:secret@localhost:5432/orchestrator).
AUTH_MODEstatic (default) or jwt.
AUTH_BEARER_TOKENRequired when AUTH_MODE=static; clients send Authorization: Bearer <token>.
AUTH_JWT_HS256_SECRETRequired when AUTH_MODE=jwt; JWT HS256 verification secret.
CATALOG_BASE_URLCatalog service base URL (e.g. http://catalog-service:8080).
PRICING_BASE_URLPricing service base URL.
TAX_BASE_URLTax service base URL.
GEO_BASE_URLGeo service base URL.
PAYMENT_BASE_URLPayment service base URL.
RECEIPT_BASE_URLReceipt service base URL.
UCP_SIGNING_KEY_ID, UCP_SIGNING_KEYSigning material (Ed25519 seed, or P-256 scalar with UCP_SIGNING_KEY_ALG=ES256); production will not start without them.

Optional: AUTH_TENANT_ID, AUTH_CALLER_ID (default prod for static mode), AP2_TRUSTED_ISSUERS (comma-separated allowlist for strict AP2 issuer checks and JWT issuer checks), UCP_SIGNING_KEY_ALG, UCP_SIGNING_PREVIOUS_KEYS, UCP_AGENT_KEYS, UCP_AGENT_JWKS, and UCP_PAYMENT_HANDLERS (see Message signing), FULFILLMENT_BASE_URL, PAYMENT_DELEGATION_BASE_URL, IDENTITY_LINK_BASE_URL, EMBEDDED_CHECKOUT_URL, UCP_DEFAULT_MERCHANT_ID (the default merchant for every protocol whose payloads carry none: UCP carts and checkouts without a merchant_id, and ACP checkout sessions and carts, REST and MCP; a request value wins), UCP_CATALOG_CURRENCY (ISO 4217 currency for UCP catalog prices when the request has no context.currency, and for ACP carts) and MCP_ALLOWED_ORIGINS (comma-separated browser origins, or *, allowed to call the MCP endpoints; unset, any request with an Origin header is refused with 403), and UCP_PROFILE_NEGOTIATION (off, lenient or strict; see Platform profile negotiation). Capabilities backed by an optional service are advertised only when that service is configured; the endpoint returns 501 with code: NOT_CONFIGURED otherwise. Config can be loaded from a file (CONFIG_FILE or config.yaml) with env overrides.

AP2 note: this release aligns with AP2 0.2 (closed mandates plus optional open/HNP mandates with amount and currency constraints). Strict mode remains fail-closed.

Next steps

  • Deploy the orchestrator using deploy/README.md and configure all six component base URLs so the service can call your catalog, pricing, tax, geo, payment, and receipt APIs.
  • In production, set ENV=production, PUBLIC_BASE_URL, DATABASE_URL, and auth variables for your selected AUTH_MODE (AUTH_BEARER_TOKEN or AUTH_JWT_HS256_SECRET).

Web Bot Auth agent identity

Web Bot Auth is an optional identity layer based on draft-ietf-webbotauth-httpsig-protocol-01, a work-in-progress specification. It identifies an agent operator; customer consent, tenant authorization and payment authority remain separate checks.

Configure server.web_bot_auth_directory_urls as a list of HTTPS key-directory URLs, or set the comma-separated environment override WEB_BOT_AUTH_DIRECTORY_URLS. An empty list disables this layer. With it enabled, all /api/v1/ requests need Web Bot Auth in addition to configured bearer/UCP checks. Discovery and health stay open. Deploy behind HTTPS, configure PUBLIC_BASE_URL, and preserve the public Host and request path at proxies.

Requests carry dictionary-form Signature-Agent, Signature-Input and Signature. Each accepted signature covers its own Signature-Agent dictionary member and either @authority or @target-uri. Its tag is web-bot-auth, its keyid is the JWK SHA-256 thumbprint, and created/expires are required. The local freshness policy permits at most 300 seconds of clock skew. Expired/not-yet-valid keys are rejected. Ed25519 and P-256 are supported. A supplied Content-Digest must match the body. Applications receive WebBotIdentity in request extensions.

Discovery fetches the configured HTTPS URL directly. Redirects, URL credentials, queries in configured URLs, private/special addresses and responses over 64 KiB are rejected. DNS is checked before connecting and pinned for TLS. Proxies are disabled. DNS/connect/read operations have timeouts. Cache lifetime follows max-age capped at 300 seconds; no-store/no-cache are honored. Key removal takes effect after cache expiry. Caches hold at most 64 URLs and each response at most 128 keys. Configure only operator-controlled directory URLs. Unknown URLs fail without an outbound request.

Missing/failed signatures return 403 with Accept-Signature. A valid signature proves control of a key published at the resolved URL; it grants no commerce scopes. Authority-only signatures remain reusable until expiry. For request-specific replay resistance, sign method, path/query, body digest and idempotency key, and use existing commerce idempotency. This layer has no durable nonce registry.

Metrics use orchestrator-observability: web_bot_auth_verified_total, web_bot_auth_rejected_total, and counts/errors/latency for web_bot_auth_verify and web_bot_auth_discovery. Credentials and keys are not logged. RSA, legacy bare-string Signature-Agent, directory redistribution proofs and Signed-Agent-Metadata policy are outside this profile.

MCP binding

The orchestrator speaks Model Context Protocol over a single JSON-RPC 2.0 endpoint, so an agent can drive the whole cart-to-checkout lifecycle as tool calls instead of hand-rolling REST.

POST /api/v1/mcp/message

Everything on this page runs through the same OrchestratorFacade as the REST and A2A surfaces: identical policy, idempotency, provider calls, and metrics. MCP is a transport, not a second implementation.

Transport

PropertyValue
EndpointPOST /api/v1/mcp/message (advertised as orchestrator.mcp_endpoint in /.well-known/ucp; this is the orchestrator’s own tool server. UCP’s MCP binding is at /api/v1/ucp/mcp and ACP’s at /api/v1/acp/mcp, see UCP’s and ACP’s sections)
PayloadJSON-RPC 2.0 request object (jsonrpc, id, method, params)
AuthSame as every other API route: Authorization: Bearer <token>
Version headerMCP-Protocol-Version
Request headers (2026-07-28)Mcp-Method on every request; Mcp-Name on tools/call, resources/read and prompts/get
Browser originsAn Origin header, when sent, must be listed in MCP_ALLOWED_ORIGINS
Content typeapplication/json
GET / DELETE405 Method Not Allowed (no SSE stream, no sessions)

There is no SSE or stdio transport. One request, one response.

Streamable HTTP rules

Every MCP endpoint the orchestrator serves (/api/v1/mcp/message, /api/v1/ucp/mcp, /api/v1/acp/mcp) applies the MCP 2026-07-28 Streamable HTTP rules through one shared check, before authentication and before the endpoint reads the message.

flowchart TD
  P[POST] --> O{Origin header?}
  O -->|absent| V
  O -->|listed in MCP_ALLOWED_ORIGINS| V
  O -->|anything else| F["403, JSON-RPC error without id"]
  V{MCP-Protocol-Version} -->|unsupported value| U["400, -32022 supported / requested"]
  V -->|absent, but _meta names a version| H["400, -32020"]
  V -->|absent, 2025-11-25 or 2024-11-05| L[Legacy: served as before]
  V -->|2026-07-28| M{"Mcp-Method = body method?<br/>Mcp-Name = params.name / uri?<br/>header = _meta version?"}
  M -->|no| H
  M -->|yes| D[Dispatch]
  D --> R["result: resultType, ttlMs, cacheScope<br/>unknown method: 404, -32601<br/>notification: 202, no body"]

Origin (DNS-rebinding protection). A request without an Origin header is served: agents calling from servers send none, and refusing them would break every non-browser client. A request with an Origin is served only when that origin is listed in MCP_ALLOWED_ORIGINS (comma-separated scheme://host[:port], compared after lower-casing and dropping default ports). The default list is empty, so a web page that gets a browser to call a local or internal deployment is refused with 403. Same-origin is not accepted implicitly: under DNS rebinding the attacker’s page and the Host header carry the same attacker-controlled name, so only an explicit list protects. List the origins of browser-based clients (the MCP Inspector runs at http://localhost:6274), or set MCP_ALLOWED_ORIGINS=* when a gateway in front already enforces an origin policy.

Headers. Under 2026-07-28:

  • MCP-Protocol-Version must be a supported version (else 400, -32022, with data.supported and data.requested) and must match params._meta["io.modelcontextprotocol/protocolVersion"] when that is present (else 400, -32020). A body that names a version in _meta without sending the header is also 400, -32020.
  • Mcp-Method must equal the body’s method on every request.
  • Mcp-Name must equal params.name for tools/call and prompts/get, and params.uri for resources/read. Values in the =?base64?…?= form are decoded before comparing.
  • A missing or different value is 400 with -32020 (HeaderMismatch), answering the request’s id. The revision does not define headers for notifications, so a notification is held only to the headers it sends.

Responses. Under 2026-07-28 an unknown method is HTTP 404 with -32601; every result carries resultType: "complete"; server/discover, tools/list and the other list methods carry ttlMs: 300000 and cacheScope: "private" (results depend on the caller’s credentials), and resources/read carries ttlMs: 0. Notifications get 202 with no body. No Mcp-Session-Id is issued, and one sent by a client is ignored.

Back-compat. A request whose MCP-Protocol-Version is 2025-11-25 or 2024-11-05, or that carries no version at all (clients older than 2025-06-18, which the spec lets a server treat as legacy), is served exactly as before: no Mcp-Method/Mcp-Name requirement, unknown methods stay HTTP 200, results are not decorated, and initialize works. Only the Origin check applies to every client.

Authentication and tenancy

The bearer token resolves to an AuthContext (caller, tenant, scopes) before dispatch. Tool arguments never carry tenancy: a tenant_id in a tool call is used for lookups scoped to the caller’s own tenant, never to cross into another one. execute_checkout additionally requires the checkout:execute scope.

Signatures

If the deployment configures agent keys (UCP_AGENT_JWKS or UCP_AGENT_KEYS), requests to /api/v1 — including /api/v1/mcp/message — must carry valid RFC 9421 Signature-Input/Signature headers and a matching Content-Digest, and responses are signed back. See message signing.

Version negotiation

The server is dual-era: it supports the modern discovery handshake and the legacy initialize handshake at once.

VersionEraHandshake
2026-07-28modernserver/discover, then a version on every request
2025-11-25legacyinitialize
2024-11-05legacyinitialize

Modern clients declare the version per request, either as the MCP-Protocol-Version header or in params._meta:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientInfo": { "name": "my-agent", "version": "1.0" }
    }
  }
}

Rules the server enforces (the header checks are in Streamable HTTP rules):

  • If both the header and _meta carry a version and they disagree, the request is rejected with HTTP 400, -32020.
  • An unsupported version returns HTTP 400, -32022 with data.supported listing what is accepted, and data.requested echoing what you sent.
  • Under 2026-07-28, every result carries _meta with io.modelcontextprotocol/serverInfo and io.modelcontextprotocol/protocolVersion.
  • Under 2026-07-28, initialize is rejected with -32601: call server/discover instead.
  • A request with no version at all is treated as 2024-11-05 for backward compatibility, except server/discover, which implies the modern version.
flowchart TD
  R[Request] --> V{Version declared?}
  V -->|header or _meta| S{Supported?}
  V -->|no, server/discover| M[2026-07-28]
  V -->|no, anything else| L[2024-11-05]
  S -->|yes| U[Use it]
  S -->|no| E["-32022 with supported list"]
  U --> C{header vs _meta agree?}
  C -->|no| E2["400, -32020"]
  C -->|yes| D[Dispatch]

Methods

MethodPurpose
server/discoverModern handshake: supported versions, capabilities, server info
initializeLegacy handshake; rejected under 2026-07-28
notifications/initializedLegacy no-op acknowledgement
tools/listTool catalogue with JSON Schema inputs
tools/callInvoke a tool by name with arguments
resources/listReadable resource URI templates
resources/readRead one resource by uri

Tools

Seventeen tools cover the lifecycle. Every one maps to a facade operation that the REST API also exposes.

Cart

ToolRequired argumentsNotes
create_cartmerchant_id, currencyTenancy comes from the bearer token
add_itemcart_id, item_id, quantity
update_item_qtycart_id, line_id, quantity
remove_itemcart_id, line_id
apply_adjustmentcart_id, codePriced by your pricing provider; an unknown code changes nothing
set_fulfillment_selectioncart_id, method_type, destinationQuotes options, and selects one if selected_option_id is given
get_cartcart_id

Checkout and orders

ToolRequired arguments
start_checkoutcart_id, cart_version
execute_checkouttenant_id, merchant_id, cart_id, cart_version, currency, payment_intent, idempotency_key
get_orderorder_id
list_orderstenant_id

MPP payments on execute_checkout

With MPP_CHALLENGE_SECRET set, an execute_checkout call whose payment_intent.payment_method_type is mpp is paid through the MPP MCP transport, the JSON-RPC form of the Payment authentication scheme the REST checkout uses (consumption guide):

  1. Call without a credential. The answer is HTTP 200 with JSON-RPC error -32042 Payment Required:

    {
      "jsonrpc": "2.0", "id": 9,
      "error": {
        "code": -32042, "message": "Payment Required",
        "data": {
          "httpStatus": 402,
          "challenges": [{
            "id": "…", "realm": "shop.example.com", "method": "tempo", "intent": "charge",
            "request": "<base64url JSON>", "expires": "2026-12-01T12:05:00Z",
            "digest": "sha-256=:…:", "opaque": "…"
          }],
          "problem": { "type": "https://paymentauth.org/problems/payment-required", "title": "Payment Required", "status": 402, "detail": "…" }
        }
      }
    }
    

    request decodes to {"amount": "<amount_minor>", "currency": "<lowercase ISO 4217>"}. digest is the RFC 9530 digest of the JCS-canonical (RFC 8785) arguments object, so the retry must send the same arguments.

  2. Pay, then call again with the same arguments and the credential as a JSON object in params._meta["org.paymentauth/credential"]: { "challenge": { …echoed… }, "payload": { …method-specific proof… }, "source": "…" }.

  3. On success the result is the transaction result with _meta["org.paymentauth/receipt"]: { "status": "success", "method", "timestamp", "reference", "challengeId" }. Under 2026-07-28 it sits beside the server’s own _meta keys.

The credential is checked and claimed exactly as over HTTP, then handed to the payment provider base64url-encoded in token_or_reference, the same bytes a REST Payment-Authorization credential carries. Refusals carry a fresh challenge:

CodeProblem type (under https://paymentauth.org/problems/)Cause
-32042malformed-credentialThe _meta credential is not the draft’s JSON shape
-32042invalid-challengeNot issued by this deployment for these arguments, edited (amount, realm, …), or already used
-32042payment-expiredThe challenge’s expires has passed
-32043verification-failedThe payment provider did not accept the proof (Payment Verification Failed)

Other tools, other payment methods and deployments without MPP_CHALLENGE_SECRET are not challenged, and a _meta credential sent to them is ignored. server/discover and tools/list do not advertise MPP, because no MPP MCP transport source defines a key for it; the -32042 challenge is the signal. UCP’s and ACP’s MCP bindings do not take MPP: their complete_checkout tools pay through the protocol’s own payment handlers, and neither protocol defines an MPP handler.

sequenceDiagram
  participant Agent
  participant Orchestrator
  participant PSP as Payment provider
  Agent->>Orchestrator: tools/call execute_checkout (payment_method_type=mpp)
  Orchestrator-->>Agent: error -32042, data.challenges (bound to the arguments)
  Agent->>Agent: pay with the method, build credential
  Agent->>Orchestrator: same arguments + _meta org.paymentauth/credential
  Orchestrator->>Orchestrator: verify binding, expiry and digest, then claim the id once
  Orchestrator->>PSP: authorize (credential as token_or_reference)
  alt proof accepted
    Orchestrator-->>Agent: result + _meta org.paymentauth/receipt
  else proof refused
    Orchestrator-->>Agent: error -32043 + fresh challenge
  end

Payments

capture_payment, void_payment, and refund_payment all take tenant_id, merchant_id, transaction_id, amount_minor, idempotency_key and return { success, reference }.

Catalog

lookup_catalog_item (item_id), lookup_catalog_items (item_ids), and search_catalog_items (optional query).

Fulfillment selection

set_fulfillment_selection covers the UCP dev.ucp.shopping.fulfillment extension. It takes the same flat destination shape as POST /api/v1/ucp/cart/:id/fulfillment, so an agent learns one contract for both transports.

Omit selected_option_id to quote without committing:

{
  "jsonrpc": "2.0",
  "id": 7,
  "method": "tools/call",
  "params": {
    "name": "set_fulfillment_selection",
    "arguments": {
      "cart_id": "6f1c…",
      "method_type": "shipping",
      "destination": {
        "id": "dest_1",
        "street_address": "1 Market St",
        "address_locality": "San Francisco",
        "address_region": "CA",
        "address_country": "US",
        "postal_code": "94105"
      }
    }
  }
}

The result is the cart projection; quoted options live under fulfillment.methods[].groups[].options[], and fulfillment_minor stays 0 until something is selected. Call again with selected_option_id to commit, which adds the option’s amount to the cart total and triggers a reprice and geo re-check against the new destination.

For pickup, send "method_type": "pickup" and include name on the destination for the retail location.

selected_option_id must be an id the merchant actually quoted for this cart. Anything else is an error — an agent cannot invent a shipping price.

Resources

URI templateContent
order://{id}Order as JSON
cart://{id}Cart projection as JSON

resources/read returns contents[0].text holding the JSON document, with mimeType: application/json.

Errors

Tool and dispatch failures come back as JSON-RPC errors with HTTP 200; transport-rule failures carry their own HTTP status.

HTTPCodeMeaning
404 (2026-07-28), 200 (legacy)-32601Unknown method, or initialize under 2026-07-28
400-32020A required header (MCP-Protocol-Version, Mcp-Method, Mcp-Name) is missing or disagrees with the body
400-32022Unsupported protocol version; data.supported lists what works
403-32600Origin not allowed (the error has no id)
400-32700 / -32600Body is not JSON / not a JSON-RPC request
200-32603Tool failure: unknown tool, missing argument, or a facade error such as a rejected fulfillment option or a failed provider call
200-32042 / -32043MPP payment required / payment verification failed on execute_checkout (MPP payments)

Other transport-level problems (a missing or invalid bearer token, a missing or stale signature) are ordinary HTTP errors and never reach the JSON-RPC layer.

Observability

Every message records orchestrator_operation_calls_total{operation="mcp_tool_call"} and the matching latency histogram, split by success/error, plus a per-tool counter and a counter for the negotiated protocol version. Unsupported version requests increment mcp_version_unsupported_total.

MPP on execute_checkout counts the shared mpp_challenge_issued_total, mpp_receipt_issued_total and mpp_credential_rejected_<problem>_total, and the same counters with an mpp_mcp_ prefix for this transport alone; orchestrator_operation_calls_total{operation="mpp_mcp_credential_check"} and its histogram time the credential check, split by accepted/challenged/error.

Requests refused by the Streamable HTTP rules, on any MCP endpoint, increment mcp_transport_rejected_<reason>_total with reason origin, unsupported_protocol_version or header_mismatch.

MCP registry metadata

server.json at the repository root describes this server in the format of the MCP Registry (schema 2025-12-11), as io.github.AncientiCe/commerce-orchestrator:

  • OCI package: the published image ghcr.io/ancientice/commerce-orchestrator-api, reached at http://localhost:8080/api/v1/mcp/message once it runs. Without configuration it starts in development mode against mock providers. The image carries the io.modelcontextprotocol.server.name label the registry uses to check ownership.
  • Remote: https://{orchestrator_host}/api/v1/mcp/message with a bearer token, because every merchant runs its own deployment and there is no shared hosted endpoint.

The registry lists the transport as streamable-http: one POST, one application/json response, and 405 for GET and DELETE, following the Streamable HTTP rules. The OCI package lists MCP_ALLOWED_ORIGINS for clients that run in a browser.

UCP’s MCP binding

UCP defines its own MCP transport for the shopping service (services/shopping/mcp.openrpc.json). The orchestrator serves it on a separate endpoint:

POST /api/v1/ucp/mcp

It is separate because both servers define create_cart, get_cart and get_order with different arguments. A UCP platform finds it in /.well-known/ucp:

"dev.ucp.shopping": [
  { "version": "2026-08-25", "transport": "rest", "endpoint": "https://orchestrator.example.com/api/v1/ucp", ... },
  {
    "version": "2026-08-25",
    "spec": "https://ucp.dev/2026-08-25/specification/overview",
    "transport": "mcp",
    "schema": "https://ucp.dev/2026-08-25/services/shopping/mcp.openrpc.json",
    "endpoint": "https://orchestrator.example.com/api/v1/ucp/mcp"
  }
]

Tools run the same code as the UCP REST binding (/api/v1/ucp/*), so a checkout created over MCP can be read over REST and vice versa. Auth, tenancy and RFC 9421 signatures work as on every other /api/v1 route.

sequenceDiagram
  participant Agent as UCP platform (MCP client)
  participant MCP as POST /api/v1/ucp/mcp
  participant Core as run_ucp_* (shared with REST)
  participant Facade as OrchestratorFacade
  Agent->>MCP: tools/call create_checkout {meta, checkout}
  MCP->>MCP: meta.ucp-agent.profile is a URL?
  opt UCP_PROFILE_NEGOTIATION lenient or strict
    MCP->>MCP: fetch or reuse platform profile, intersect capabilities
  end
  MCP->>Core: run_ucp_create_checkout
  Core->>Facade: create cart, add lines, start checkout
  Facade-->>Core: projection
  Core-->>MCP: UCP checkout
  MCP-->>Agent: result {structuredContent: checkout, content: [text]}
  Agent->>MCP: tools/call complete_checkout {meta + idempotency-key, id, checkout.payment}
  MCP->>Facade: execute_checkout (key = idempotency-key)
  Facade-->>MCP: transaction + order
  MCP-->>Agent: checkout {status: completed, order {id, permalink_url}}

Tools

tools/list is generated from the official OpenRPC file: each tool’s inputSchema is the method’s params (with the meta schema inlined) and its outputSchema is the method’s result schema.

ToolArgumentsResult
create_checkoutmeta, checkout (currency, line_items[]; optional merchant_id, see below)Checkout (ready_for_complete when it has lines)
get_checkoutmeta, idCheckout
update_checkoutmeta, id, checkout (full replacement of line_items[]; lines keep their id)Checkout
complete_checkoutmeta with idempotency-key, id, checkout.payment.instruments[0] (handler_id, credential.token), optional checkout.buyerCheckout with status: completed and order { id, permalink_url }
cancel_checkoutmeta with idempotency-key, idCheckout with status: canceled
create_cartmeta, cart (currency, line_items[]; optional merchant_id)Cart
get_cartmeta, idCart
update_cartmeta, id, cartCart
cancel_cartmeta with idempotency-key, idCart with status: canceled
get_ordermeta, idOrder
search_catalogmeta, catalog (query, optional context.currency)Search response: products[]
lookup_catalogmeta, catalog (ids[], optional context.currency)Lookup response: products[], each variant with inputs[]; ids that match nothing are not_found warnings in messages[]
get_productmeta, catalog (id, optional context.currency)product, or a not_found error response

Merchant. UCP has no merchant field, so a cart or checkout is created for the body’s merchant_id when it has one (an orchestrator extension), else for UCP_DEFAULT_MERCHANT_ID. With neither, the result is a UCP error response with code merchant_required (REST: 400 MERCHANT_REQUIRED).

Catalog currency. Each catalog item becomes a UCP product with one variant whose price is the item’s minor-unit amount. The catalog provider returns no currency, so prices are given in the request’s context.currency when present, else UCP_CATALOG_CURRENCY. With neither, the result is a UCP error response with code currency_required; a context.currency that is not a three-letter code gets invalid_currency. Search filters and pagination are not applied: every match is returned.

Every request carries meta:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "complete_checkout",
    "arguments": {
      "meta": {
        "ucp-agent": { "profile": "https://platform.example/profiles/shopping-agent.json" },
        "idempotency-key": "550e8400-e29b-41d4-a716-446655440000"
      },
      "id": "6d1f3c6e-8a5e-4a43-9a43-6a1d3f1f2b10",
      "checkout": {
        "payment": {
          "instruments": [{
            "id": "pi_1", "handler_id": "card", "type": "card",
            "credential": { "type": "token", "token": "tok_visa" }
          }]
        }
      }
    }
  }
}

With UCP_PROFILE_NEGOTIATION set to lenient or strict, the platform profile is fetched (HTTPS only), cached, and negotiated exactly as on the REST binding: the result’s ucp.capabilities lists only capabilities in the intersection. With the default off, the profile URL is checked for shape only and not fetched. See Platform profile negotiation.

Results

A result holds the UCP payload twice: as structuredContent, and serialized as content[0].text for clients without structured content.

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "structuredContent": { "ucp": { "version": "2026-08-25", ... }, "id": "...", "status": "completed", "order": { ... } },
    "content": [{ "type": "text", "text": "{\"ucp\":{...},...}" }]
  }
}

Idempotency

complete_checkout, cancel_checkout and cancel_cart require meta["idempotency-key"], a UUID.

  • Retrying complete_checkout with the same key returns the first outcome; the payment is not taken twice.
  • Using a key already spent on another checkout is a conflict: HTTP 409, -32000.
  • Cancelling something already canceled returns it unchanged.

Errors

SituationResponse
Unknown checkout, cart or orderResult; structuredContent is a UCP error response: ucp.status: error, messages[0].code: not_found, severity: unrecoverable
Validation or payment failureResult with a UCP error response, severity: recoverable (payment_failed, validation_error, …)
meta["ucp-agent"].profile missing or not a URLHTTP 400, -32001, data.code: invalid_profile_url
Negotiation enabled, profile not HTTPS or resolving to a private addressHTTP 400, -32001, data.code: invalid_profile_url (strict only)
Negotiation enabled, profile cannot be fetchedHTTP 424, -32001, data.code: profile_unreachable (strict only)
Negotiation enabled, profile is not a valid platform profileHTTP 422, -32001, data.code: profile_malformed (strict only)
Negotiation enabled, platform’s ucp.version not supportedHTTP 422, -32001, data.code: version_unsupported (strict only)
Negotiation enabled, the tool’s capability is not in the intersectionResult; structuredContent is a UCP error response with code: capabilities_incompatible (strict only)
Missing argument, missing or non-UUID idempotency key, unknown tool-32602
No or invalid bearer tokenHTTP 401, -32000
Another tenant’s cart, checkout or orderHTTP 403, -32000, data.code: TENANT_MISMATCH (FORBIDDEN for orders)
Idempotency key reused for another checkoutHTTP 409, -32000, data.code: IDEMPOTENCY_CONFLICT
Server or provider faultHTTP 5xx, -32603
Unknown method-32601 (HTTP 404 under 2026-07-28)
Unsupported MCP-Protocol-Version headerHTTP 400, -32022, data.supported
Missing or mismatched Mcp-Method, Mcp-Name or version headerHTTP 400, -32020

Lifecycle

initialize answers with the requested protocolVersion when it is one of 2026-07-28, 2025-11-25, 2024-11-05 (else 2025-11-25); ping, server/discover, tools/list and tools/call work without it. Notifications such as notifications/initialized get HTTP 202 with no body. Responses are single JSON bodies; there is no SSE stream. The Streamable HTTP rules (Origin, Mcp-Method, Mcp-Name) apply as on the native endpoint.

Metrics

Each tool call records orchestrator_operation_calls_total and orchestrator_operation_latency_seconds with operation="ucp_mcp_<tool>" and status set to success or the error kind (not_found, tenant_mismatch, invalid_params, invalid_profile_url, profile_unreachable, version_unsupported, idempotency_conflict, …). Negotiation itself is recorded as operation="ucp_negotiation_mcp" (see the consumption guide). Counters ucp_mcp_tools_list_total, ucp_mcp_initialize_total, ucp_mcp_idempotency_conflict_total, ucp_mcp_parse_error_total and the shared mcp_transport_rejected_<reason>_total cover the rest. Tool calls also increment the same ucp_cart_* / ucp_checkout_* / ucp_order_* counters as the REST binding.

ACP’s MCP binding

ACP 2026-04-17 defines an MCP transport for checkout (spec/2026-04-17/openrpc/openrpc.agentic_checkout.json, binding). The orchestrator serves it on its own endpoint:

POST /api/v1/acp/mcp

It is separate from the native and UCP servers because ACP has its own error model (every ACP error is -32000 with the ACP Error object in data) and an ACP agent should see exactly the five ACP tools. ACP passes the endpoint URL out of band: /.well-known/acp.json lists "transports": ["rest", "mcp"] but carries no URL, so give agents https://<host>/api/v1/acp/mcp.

The tools run the same run_acp_* code as the ACP REST binding (/api/v1/acp/checkout_sessions, which takes the same 2026-04-17 bodies), so a session created over MCP can be read over REST. Auth, tenancy, RFC 9421 signatures and the Streamable HTTP rules work as on every other MCP endpoint.

sequenceDiagram
  participant Agent as ACP agent (MCP client)
  participant MCP as POST /api/v1/acp/mcp
  participant Core as run_acp_* (shared with REST)
  participant Facade as OrchestratorFacade
  Agent->>MCP: tools/call create_checkout_session {meta.api_version, payload}
  MCP->>MCP: api_version supported? payload valid against the ACP schema?
  MCP->>Core: run_acp_create_session
  Core->>Facade: create cart, add items
  Facade-->>MCP: projection
  MCP-->>Agent: result = CheckoutSession (+ structuredContent, content)
  Agent->>MCP: tools/call complete_checkout_session {meta.idempotency_key, id, payload.payment_data}
  MCP->>Core: run_acp_complete_session (start checkout if draft)
  Core->>Facade: execute_checkout (key = idempotency_key)
  Facade-->>MCP: transaction + order
  MCP-->>Agent: CheckoutSessionWithOrder {status: completed, order}

Tools

tools/list is generated from the official OpenRPC file. Each tool’s inputSchema holds meta, id and payload as the OpenRPC params define them, with every referenced ACP schema bundled into the tool’s own $defs (the binding requires $ref targets to be resolved), and its outputSchema is the method’s result schema.

ToolArgumentsResult
create_checkout_sessionmeta, payload (CheckoutSessionCreateRequest: currency, line_items[] of { id }, capabilities)CheckoutSession
get_checkout_sessionmeta, idCheckoutSession
update_checkout_sessionmeta, id, payload (CheckoutSessionUpdateRequest; line_items[] replaces the session’s items)CheckoutSession
complete_checkout_sessionmeta, id, payload (CheckoutSessionCompleteRequest: payment_data.handler_id, payment_data.instrument.credential.token, optional buyer)CheckoutSessionWithOrder (status: completed, order { id, checkout_session_id, permalink_url })
cancel_checkout_sessionmeta, id, optional payload (CancelSessionRequest)CheckoutSession with status: canceled

ACP’s delegate payment API is out of scope for the binding (the ACP spec leaves it to a later proposal); it stays on REST at /api/v1/acp/delegate_payment.

meta. meta.api_version (the API-Version header) is required and must be 2026-04-17. meta.idempotency_key keys complete_checkout_session. Other meta fields are accepted and ignored, except merchant_id, below.

Merchant. ACP payloads name no merchant, so a session belongs to meta.merchant_id when sent, else to UCP_DEFAULT_MERCHANT_ID. With neither, the call fails with merchant_required.

Items. An ACP Item carries no quantity: each line_items[] entry is one unit, so [{ "id": "sku-1" }, { "id": "sku-1" }] is a line with quantity 2. Fields of the payload the orchestrator has no backend for (fulfillment_details, selected_fulfillment_options, discounts, intent_trace, …) are validated and then ignored. Purchase-order payments (payment_data.purchase_order_number) are refused with unsupported_payment_method.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_checkout_session",
    "arguments": {
      "meta": { "api_version": "2026-04-17", "idempotency_key": "idem_1" },
      "payload": { "currency": "usd", "line_items": [{ "id": "demo-tee" }], "capabilities": {} }
    }
  }
}

Results

ACP returns the CheckoutSession itself as the JSON-RPC result. MCP clients read tool output from structuredContent and content[], so the result carries both views as well:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "id": "cs_...", "protocol": { "version": "2026-04-17" }, "status": "ready_for_payment",
    "currency": "usd", "line_items": [...], "totals": [...], "capabilities": {},
    "fulfillment_options": [], "messages": [], "links": [],
    "structuredContent": { "id": "cs_...", ... },
    "content": [{ "type": "text", "text": "{\"id\":\"cs_...\",...}" }]
  }
}

Without the two MCP members the result validates against ACP’s CheckoutSession / CheckoutSessionWithOrder schema, and structuredContent always does. A session with items is ready_for_payment (complete starts checkout itself), one without is not_ready_for_payment.

Idempotency

  • complete_checkout_session replays its first outcome for the same meta.idempotency_key; the payment is not taken twice.
  • Without a key the session itself is the key (a session can be paid for once), so a retried complete still replays.
  • A key already spent on another session is invalid_request / idempotency_conflict.
  • Cancelling a canceled session is invalid_request / session_not_cancelable (REST answers 405).

Errors

SituationResponse
Unknown or malformed session id-32000, data.type: invalid_request, data.code: session_not_found, data.param: $.id
Payload that breaks the ACP schema-32000, invalid_request, invalid_payload, data.param a JSONPath into $.payload
Missing or unsupported meta.api_version-32000, invalid_request, missing_api_version / unsupported_api_version with data.supported_versions
No merchant-32000, invalid_request, merchant_required
Another tenant’s session-32000, invalid_request, forbidden
Session already canceled-32000, invalid_request, session_not_cancelable
Idempotency key spent on another session-32000, invalid_request, idempotency_conflict
Declined payment-32000, processing_error, payment_declined
Provider unavailable / server fault-32000, service_unavailable / processing_error
Missing meta, id or payload argument, unknown tool-32602
No or invalid bearer tokenHTTP 401 from the MCP server, outside the ACP error model

data is always a valid ACP Error (type, code, message, optional param), and the JSON-RPC message repeats data.message.

Metrics

Each tool call records orchestrator_operation_calls_total and orchestrator_operation_latency_seconds with operation="acp_mcp_<tool>" and status set to success or the ACP error code (session_not_found, invalid_payload, forbidden, idempotency_conflict, …; invalid_params for malformed calls). Counters acp_mcp_tools_list_total, acp_mcp_initialize_total and acp_mcp_parse_error_total cover the rest, and tool calls increment the same acp_checkout_session_*_total counters as the REST binding.

See also

Plug Your APIs and Deploy

This guide walks from zero to a running Commerce Orchestrator calling your six downstream APIs, with local smoke tests and deployment validation.

Prerequisites

  • Rust toolchain (for local run and tests).
  • Docker (for container build).
  • Kubernetes cluster or Docker Compose for deployment (or run the server locally and point it at stub/mock URLs for development).
  • An operating-system CA trust store on the host or image. Outbound HTTPS (providers, OAuth token endpoints, Web Bot Auth key directories) is verified against the platform’s trust store, not a bundled root list. The provided image installs ca-certificates. If you build a custom image, install it too, or add your private CA there.

1. Downstream API Contracts

The orchestrator calls your services over HTTP. Each base URL must not have a trailing slash. Implement the following endpoints so the integration adapters can call them.

The machine-readable version of this section is the OpenAPI 3.1 spec providers/openapi.yaml. Generate server stubs from it, or load it into your API tooling. A test in the integration-adapters crate checks it against the adapters on every CI run, so it does not drift from what the orchestrator actually sends.

Catalog

MethodPathRequestResponse (200)
GET{base}/items/{item_id}—{ "id": "<string>", "title": "<string>", "price_minor": <integer> }
POST{base}/catalog/lookup{ "ids": ["<string>"] }{ "products": [ { "id", "title", "price_minor" } ] }
POST{base}/catalog/search{ "query": "<string>"? }{ "products": [ { "id", "title", "price_minor" } ] }
  • 404 or non-2xx: item not found or error.

Pricing

MethodPathRequest (JSON body)Response (200)
POST{base}/prices/resolveCart projection (see adapter){ "prices": [ { "line_id": "<string>", "unit_price_minor": <int>, "total_minor": <int> } ] }
POST{base}/discounts/resolve{ "cart": <cart projection>, "codes": ["<string>"] }{ "discounts": [ { "code": "<string>", "description": "<string>"?, "amount_minor": <int>, "line_id": "<string>"? } ] }
  • Request body is the orchestrator’s cart projection; your service returns one price entry per line.
  • discounts/resolve prices the buyer’s adjustment codes. Return only the codes you grant; a non-2xx rejects the codes (use it for expired or ineligible campaigns), and amount_minor is positive and is clamped to the amount owed. It is only called when the cart carries at least one code.

Tax

MethodPathRequest (JSON body)Response (200)
POST{base}/tax/resolveCart projection{ "total_tax_minor": <integer> }

Geo

MethodPathRequest (JSON body)Response (200)
POST{base}/geo/check{ "cart": <CartProjection>, "request": <CheckoutRequest> }{ "allowed": <boolean> }
  • Return allowed: true if the cart/request is allowed in the given geography; otherwise false.

Payment

MethodPathRequest (JSON body)Response (200)
POST{base}/authorizeCheckout request{ "authorized": <boolean>, "reference": "<string>" }
POST{base}/capturePayment lifecycle request{ "success": <boolean>, "reference": "<string>" }
POST{base}/voidPayment lifecycle request{ "success": <boolean>, "reference": "<string>" }
POST{base}/refundPayment lifecycle request{ "success": <boolean>, "reference": "<string>" }
GET{base}/state/{transaction_id}—Optional: `{ “state”: “<authorized
  • For reconciliation, implement GET .../state/{transaction_id}; if you don’t, the orchestrator treats provider state as unknown.

3DS2 step-up (optional). Set PAYMENT_AUTHENTICATION_ENABLED=true only if your payment service implements these:

MethodPathRequest (JSON body)Response (200)
POST{base}/authorizeCheckout requestAdd "authentication_required": { "authentication_id", "device_data_collection_url"?, "challenge_url"?, "acquirer_details"?, "directory_server"? } with "authorized": false when the issuer wants 3DS2 first
GET{base}/authentication/{authentication_id}—{ "status": "pending" } or { "status": "completed", "result": { "outcome", "electronic_commerce_indicator"?, "three_ds_cryptogram"?, "transaction_id"?, "version"? } }
POST{base}/authentication/{authentication_id}/authorize{ "checkout": <CheckoutRequest>, "result": <AuthenticationResult> }, Idempotency-Key: <checkout key>:authenticated{ "authorized": <boolean>, "reference": "<string>" }
  • The URLs are pages you host that run the 3DS Method and the challenge in the buyer’s browser; EMV 3DS messages never pass through the orchestrator.
  • acquirer_details (acquirer_bin, acquirer_country, acquirer_merchant_id, merchant_name) and directory_server (visa, mastercard, american_express) are what ACP agents need for delegate authentication; without both, ACP sessions show no authentication_metadata.
  • outcome uses ACP’s values (authenticated, attempt_acknowledged, denied, rejected, abandoned, …). The orchestrator only calls /authorize on the authentication for authenticated and attempt_acknowledged.
  • Without the flag, an authentication_required answer is treated as a decline and 3DS2 is not advertised.

Receipt

MethodPathRequest (JSON body)Response (200)
POST{base}/receipts/generate{ "cart": <CartProjection>, "result": <TransactionResult> }{ "content": "<string>" }
  • content is the receipt text or payload your system returns (e.g. PDF URL or plain text).

Fulfillment (optional)

MethodPathRequest (JSON body)Response (200)
POST{base}/fulfillment/quote{ "cart": <CartProjection>, "method_type": "shipping"|"pickup", "destination": <destination>, "line_item_ids": ["<string>"] }{ "options": [ { "id", "title", "description"?, "carrier"?, "earliest_fulfillment_time"?, "latest_fulfillment_time"?, "amount_minor" } ] }
  • Without FULFILLMENT_BASE_URL, the orchestrator quotes its built-in standard, express and pickup options.

Payment delegation (optional)

MethodPathRequest (JSON body)Response (200)
POST{base}/delegate_payment{ "tenant_id": "<string>", "token": "<caller token>", "method_type": "<string>?", "max_amount_minor": <int>?, "metadata": { } }{ "id": "<string>", "token": "<delegated token>", "status": "delegated", "expires_at": "<rfc3339>?" }
  • The returned token must be a new, scoped credential — returning the caller’s own token grants nothing and is not delegation.
  • The orchestrator forwards Idempotency-Key so a retry cannot mint two tokens.
  • Without PAYMENT_DELEGATION_BASE_URL, POST /api/v1/acp/delegate_payment returns 501 NOT_CONFIGURED and the ACP discovery document omits the delegate_payment service.

Identity linking (optional)

MethodPathRequest (JSON body)Response (200)
POST{base}/identity/link{ "tenant_id": "<string>", "merchant_id": "<string>", "agent_id": "<string>", "link_token": "<string>" }{ "link_id": "<string>", "status": "linked", "expires_at": "<rfc3339>?" }
  • Without IDENTITY_LINK_BASE_URL, POST /api/v1/a2a/identity/link returns 501 NOT_CONFIGURED and dev.ucp.common.identity_linking is absent from discovery.
  • Without EMBEDDED_CHECKOUT_URL (or without signing keys), POST /api/v1/ucp/checkout/:id/embedded-link returns 501 NOT_CONFIGURED and the embedded transport is absent from discovery.

For exact request shapes, see the integration adapter types in the repo (integration-adapters crate) and the wiremock tests under crates/integration-adapters/tests/ (e.g. catalog_http_test.rs, adapters_http_test.rs).

2. Environment Variables

Configure the server with these (see also Consumption guide – Config reference and deploy/README.md).

VariableRequired (production)DescriptionExample
ENVYesproduction enables auth and real adapters.production
PUBLIC_BASE_URLYesPublic base URL advertised in /.well-known/ucp; required in production to avoid localhost discovery output.https://orchestrator.example.com
DATABASE_URLYesPostgreSQL connection string for durable runtime state.postgres://orchestrator:secret@postgres:5432/orchestrator
AUTH_MODEYesstatic or jwt.static
AUTH_BEARER_TOKENYes (when AUTH_MODE=static)Secret token; clients send Authorization: Bearer <token>.(secret)
AUTH_JWT_HS256_SECRETYes (when AUTH_MODE=jwt)HS256 secret used to verify JWT tokens.(secret)
CATALOG_BASE_URLYesCatalog service base URL, no trailing slash.http://catalog-service:8080
PRICING_BASE_URLYesPricing service base URL.http://pricing-service:8080
TAX_BASE_URLYesTax service base URL.http://tax-service:8080
GEO_BASE_URLYesGeo service base URL.http://geo-service:8080
PAYMENT_BASE_URLYesPayment service base URL.http://payment-service:8080
RECEIPT_BASE_URLYesReceipt service base URL.http://receipt-service:8080
UCP_SIGNING_KEY_IDYesKey id advertised in discovery and sent as keyid in Signature-Input.orch-2026-a
UCP_SIGNING_KEYYesBase64 32 bytes for the active signing key: an Ed25519 seed, or a P-256 private scalar with UCP_SIGNING_KEY_ALG=ES256. Production refuses to start without it.(secret)
UCP_SIGNING_KEY_ALGNoEdDSA (default) or ES256. ES256 is the algorithm every UCP verifier must support.ES256
UCP_SIGNING_PREVIOUS_KEYSNoRetired keys still published for verification during rotation, kid:seed or kid:ES256:secret, comma-separated.orch-2025-b:<seed>
UCP_AGENT_JWKSNoAgent public keys as a JWK Set JSON ({"keys":[...]}, Ed25519 or P-256), as agents publish them in their UCP profile. Setting this or UCP_AGENT_KEYS makes inbound RFC 9421 signatures mandatory on /api/v1.{"keys":[{"kid":"agent-1","kty":"EC",...}]}
UCP_AGENT_KEYSNoEd25519 agent public keys, kid:base64-public-key comma-separated.agent-1:<public key>
PAYMENT_DELEGATION_BASE_URLNoPSP delegation service. Without it POST /api/v1/acp/delegate_payment returns 501 and the ACP delegate_payment service is not advertised.http://psp-delegation:8080
PAYMENT_AUTHENTICATION_ENABLEDNotrue when the payment service implements 3DS2 step-up (authentication_required and the /authentication endpoints). Off by default: UCP dev.ucp.common.payment.authentication and the ACP 3ds intervention are not advertised, and a step-up answer is a decline.true
IDENTITY_LINK_BASE_URLNoIdentity system for agent identity linking. Without it identity linking returns 501 and dev.ucp.common.identity_linking is not advertised.http://identity:8080
EMBEDDED_CHECKOUT_URLNoYour hosted embedded checkout page. Handoff links point here with session, expires, kid and token query parameters; verify token as an Ed25519 signature over ucp-embedded-checkout:{session}:{expires} using the JWK named by kid in /.well-known/ucp. Requires signing keys.https://shop.example.com/checkout/embedded
MPP_CHALLENGE_SECRETNoHMAC key that binds MPP Payment challenges. Set, MPP checkouts must answer a 402 challenge and get a Payment-Receipt. Unset, they are not challenged. Keep it in the Secret, and use the same value on every replica.32+ random bytes
MPP_REALMNoRealm named in MPP challenges. Defaults to the host of PUBLIC_BASE_URL; startup fails if neither is set while MPP_CHALLENGE_SECRET is.shop.example.com
MPP_CHALLENGE_TTL_SECSNoHow long an MPP challenge stays answerable, 1–3600. Default 300.300
UCP_PAYMENT_HANDLERSNoYour payment providers’ UCP handlers, published as ucp.payment_handlers: JSON object keyed by reverse-DNS handler name, each an array of entries with id and a YYYY-MM-DD version (plus spec, schema, available_instruments, config as the handler defines). Validated at startup; unset publishes {}.{"com.example.tokenizer":[{"id":"tok","version":"2026-08-25",...}]}
UCP_DEFAULT_MERCHANT_IDNoThe default merchant for every protocol whose payloads carry none: UCP carts and checkouts without a merchant_id, and ACP checkout sessions and carts (REST and MCP; over MCP meta.merchant_id wins). A request value wins. Unset, such requests get MERCHANT_REQUIRED.shop-main
UCP_CATALOG_CURRENCYNoISO 4217 currency for UCP catalog prices on the MCP binding when the request has no context.currency (which wins), and for ACP carts (ACP lets the seller pick it). Validated at startup. Unset, such requests get a currency_required error.USD
UCP_PROFILE_NEGOTIATIONNoUCP platform profile negotiation on /api/v1/ucp/* and /api/v1/ucp/mcp: off (default, nothing fetched), lenient (fetch and negotiate, never refuse) or strict (refuse as UCP requires: invalid_profile_url, profile_unreachable, profile_malformed, version_unsupported, capabilities_incompatible). Needs egress on 443 to platforms’ profile hosts. See negotiation.lenient
MCP_ALLOWED_ORIGINSNoBrowser origins allowed to call the MCP endpoints (scheme://host[:port], comma-separated), or *. Validated at startup. Unset, a request carrying an Origin header is refused with 403 (DNS-rebinding protection); agents calling from servers send no Origin and are unaffected.http://localhost:6274
FULFILLMENT_BASE_URLNoShipping rate service. Without it the built-in static rate table is used.http://fulfillment:8080
MIGRATE_ONLYNotrue applies pending migrations and exits, same as passing --migrate. Used by the migration Job.true
BIND_ADDRNoListen address.0.0.0.0:8080
RUST_LOGNoLog level.info
OUTBOX_INTERVAL_MSNoOutbox processor poll interval.1000
OUTBOX_BATCH_SIZENoMessages dequeued per poll.50
OUTBOX_MAX_ATTEMPTSNoAttempts before a message is dead-lettered.8
OUTBOX_DRAIN_TIMEOUT_SECSNoShutdown drain budget; keep below the pod’s termination grace period.30
OUTBOX_RETRY_BACKOFF_MSNoPause after a failed delivery, doubled per attempt.500
OUTBOX_MAX_RETRY_BACKOFF_SECSNoCeiling for that pause.30
PROVIDER_CIRCUIT_PROBE_TIMEOUT_SECSNoHow long a half-open probe may stay in flight before another is admitted.60
AUTH_TENANT_IDNoDefault tenant for auth context.prod
AUTH_CALLER_IDNoDefault caller id.prod
AP2_TRUSTED_ISSUERSNoComma-separated allowlist for strict AP2 issuer checks.issuer.example

Example .env for local runs (replace with your stub or real URLs):

ENV=production
PUBLIC_BASE_URL=https://orchestrator.example.com
DATABASE_URL=postgres://orchestrator:secret@localhost:5432/orchestrator
AUTH_MODE=static
AUTH_BEARER_TOKEN=dev-token-change-in-prod
CATALOG_BASE_URL=http://localhost:9001
PRICING_BASE_URL=http://localhost:9002
TAX_BASE_URL=http://localhost:9003
GEO_BASE_URL=http://localhost:9004
PAYMENT_BASE_URL=http://localhost:9005
RECEIPT_BASE_URL=http://localhost:9006
UCP_SIGNING_KEY_ID=orch-2026-a
UCP_SIGNING_KEY=$(openssl rand -base64 32)

3. Local Smoke Test (no deployment)

Without ENV=production the orchestrator runs in development mode: it uses built-in mock providers with a demo catalog (demo-tee, demo-mug, demo-cap), accepts unauthenticated calls as tenant dev, and ignores the *_BASE_URL settings. That is enough to try the API (see the README quick start). To smoke-test against your providers, run with ENV=production and the full production configuration from step 2.

  1. Start your six downstream services (or stubs) so they listen on the URLs you set in step 2.
  2. Start local Postgres (or point to an existing instance):
    docker compose up -d postgres
    
  3. Start the orchestrator:
    cargo run -p orchestrator-http --bin orchestrator-server
    
  4. Health:
    curl -s http://localhost:8080/health/live
    curl -s http://localhost:8080/health/ready
    
  5. Create cart and run checkout (use your tenant/merchant IDs and payment token as needed):
    # Create cart
    curl -s -X POST http://localhost:8080/api/v1/cart/commands \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer dev-token-change-in-prod" \
      -d '{"command":{"kind":"create_cart","merchant_id":"m1","currency":"USD"},"cart_id":null}'
    
    # Add item (use cart_id and line IDs from create_cart response)
    # Then start_checkout, then POST /api/v1/checkout/execute with cart_id, cart_version, payment_intent, idempotency_key, etc.
    
    See Consumption guide for full request/response shapes.
  6. Payment lifecycle (after a successful checkout):
    curl -s -X POST http://localhost:8080/api/v1/payments/capture \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer dev-token-change-in-prod" \
      -d '{"tenant_id":"t1","merchant_id":"m1","transaction_id":"<tx_id>","amount_minor":1000,"idempotency_key":"cap-1"}'
    
  7. Ops: Hit POST /api/v1/ops/outbox/process, GET /api/v1/ops/dead-letter, POST /api/v1/ops/reconciliation as needed (see runbooks).

4. Staging Deployment (Kubernetes)

  1. Get the image. Each release tag publishes a multi-arch (linux/amd64, linux/arm64) image to GitHub Container Registry, with an SBOM and build provenance attached. The manifests already reference it:
    docker pull ghcr.io/ancientice/commerce-orchestrator-api:0.13.0
    
    To run your own build instead, build from the repo root, push it to your registry, and override the image in step 5:
    docker build -t <your-registry>/commerce-orchestrator-api:<tag> .
    docker push <your-registry>/commerce-orchestrator-api:<tag>
    
    With Helm, install the chart in deploy/helm/commerce-orchestrator instead of steps 2 to 5; see deployment.
  2. Edit manifests under deploy/kubernetes/:
    • configmap.yaml: Set all six *_BASE_URL to your staging service URLs, plus any optional providers you run (FULFILLMENT_BASE_URL, PAYMENT_DELEGATION_BASE_URL, IDENTITY_LINK_BASE_URL).
    • secret.yaml or create the secret manually: Set DATABASE_URL, auth variables based on AUTH_MODE (AUTH_BEARER_TOKEN or AUTH_JWT_HS256_SECRET), the signing key pair (UCP_SIGNING_KEY_ID, UCP_SIGNING_KEY), and optional AUTH_TENANT_ID, AUTH_CALLER_ID.
  3. Migrate before the new image serves traffic:
    kubectl apply -f deploy/kubernetes/job-migrate.yaml
    kubectl wait --for=condition=complete job/orchestrator-api-migrate --timeout=5m
    
    The Job runs the server image with --migrate, which applies pending migrations and exits. Replicas also migrate on startup under a PostgreSQL advisory lock, so a missed Job is recoverable — but a broken migration then fails once here instead of crash-looping every pod.
  4. Apply (ensure namespace exists):
    kubectl apply -f deploy/kubernetes/
    
  5. Override image to pin a different tag or run your own build:
    kubectl set image deployment/orchestrator-api orchestrator-server=ghcr.io/ancientice/commerce-orchestrator-api:0.13.0
    
  6. Ensure database reachability from the orchestrator pod (network policy, DNS, credentials, and TLS as required by your platform). The shipped NetworkPolicy allows egress to TCP 5432.
  7. Scale safely: the manifests ship two replicas. All durable state is in PostgreSQL, outbox dequeue uses FOR UPDATE SKIP LOCKED, and idempotency keys are stored centrally, so replicas neither double-deliver nor double-charge. Tune the connection pool and database capacity as you scale.
  8. Wire up monitoring: apply servicemonitor.yaml (Prometheus Operator) and import deploy/grafana/orchestrator-dashboard.json. See deployment.

5. Post-Deploy Validation Checklist

Run these after deployment to confirm the system is ready for traffic:

  • Liveness: GET /health/live returns 200.
  • Readiness: GET /health/ready returns 200.
  • Auth: Request without Authorization: Bearer <token> to a protected endpoint returns 401.
  • Cart: Create cart, add item, get cart; responses successful and cart projection looks correct.
  • Checkout: Execute checkout with valid cart and payment intent; response includes transaction_id and success status.
  • Payment lifecycle: Capture (and optionally void/refund) using transaction_id from checkout; responses indicate success.
  • Events: POST /api/v1/events/incoming with a message_id returns 200 (idempotent).
  • Outbox: POST /api/v1/ops/outbox/process with body e.g. {"max_attempts":3} returns 200.
  • Dead-letter: GET /api/v1/ops/dead-letter returns 200 (list may be empty).
  • Reconciliation: POST /api/v1/ops/reconciliation with body {"transaction_ids":["<tx_id>"]} returns 200; check response for mismatches if your payment provider supports state.
  • Metrics: GET /metrics returns Prometheus text and the Grafana dashboard populates.
  • Discovery honesty: GET /.well-known/ucp advertises a signing key you control, and lists dev.ucp.common.identity_linking only if you configured IDENTITY_LINK_BASE_URL.

If any step fails, check server logs, downstream connectivity, and runbooks (e.g. dead-letter handling, reconciliation).

Next Steps

Provider API (OpenAPI)

The orchestrator does not hold your catalog, prices, tax rules or payments. It calls your services for them. This page describes the HTTP API those services expose to the orchestrator.

Spec: openapi.yaml (OpenAPI 3.1). Load it into your API tooling, generate server stubs from it, or validate your service’s responses against it.

Services

Each service has its own base URL, set in the orchestrator’s configuration. The paths in the spec are appended to that base URL.

ServiceBase URL settingEndpointsRequired
CatalogCATALOG_BASE_URLGET /items/{item_id}, POST /catalog/lookup, POST /catalog/searchYes
PricingPRICING_BASE_URLPOST /prices/resolve, POST /discounts/resolveYes
TaxTAX_BASE_URLPOST /tax/resolveYes
GeoGEO_BASE_URLPOST /geo/checkYes
PaymentPAYMENT_BASE_URLPOST /authorize, /capture, /void, /refund, GET /state/{transaction_id}Yes
ReceiptRECEIPT_BASE_URLPOST /receipts/generateYes
FulfillmentFULFILLMENT_BASE_URLPOST /fulfillment/quoteNo: built-in rates are used without it
Payment delegationPAYMENT_DELEGATION_BASE_URLPOST /delegate_paymentNo: ACP delegated payment returns 501 without it
Identity linkingIDENTITY_LINK_BASE_URLPOST /identity/linkNo: UCP identity linking is not advertised without it
3DS2 step-up (payment)PAYMENT_BASE_URL + PAYMENT_AUTHENTICATION_ENABLED=trueauthentication_required on POST /authorize, GET /authentication/{id}, POST /authentication/{id}/authorizeNo: without it 3DS2 is not advertised and a step-up answer is a decline
sequenceDiagram
    participant O as Orchestrator
    participant C as Catalog
    participant Pr as Pricing
    participant T as Tax
    participant G as Geo
    participant Pa as Payment
    participant R as Receipt

    Note over O: Agent adds an item
    O->>C: GET /items/{item_id}
    O->>Pr: POST /prices/resolve
    O->>T: POST /tax/resolve
    O->>Pr: POST /discounts/resolve (only with codes)
    O->>G: POST /geo/check
    Note over O: Agent checks out
    O->>Pr: POST /prices/resolve
    O->>T: POST /tax/resolve
    O->>Pr: POST /discounts/resolve (only with codes)
    O->>G: POST /geo/check
    O->>Pa: POST /authorize (Idempotency-Key)
    O->>Pa: POST /capture (Idempotency-Key)
    O->>R: POST /receipts/generate

Rules every provider should follow

  • Money is an integer in minor units (cents for USD), never a float.
  • Honour Idempotency-Key on authorize, capture, void, refund and delegate payment. A repeat with the same key must return the first outcome without moving money again. The orchestrator relies on this to retry safely.
  • Answer non-2xx for failures. Any non-2xx response fails that step. Transient statuses (408, 425, 429, 500, 502, 503, 504) are retried for GETs and idempotency-keyed requests, honouring Retry-After up to 30 seconds.
  • Ignore fields you do not need. The orchestrator sends its full cart projection; new optional fields can appear in later versions.

How the spec stays accurate

crates/integration-adapters/tests/openapi_spec_test.rs runs in CI. It answers the real adapters with the spec’s own response examples, then checks that every request they sent goes to a documented path, carries the headers the spec requires, and validates against the documented request schema. Request schemas reject unknown fields, so a field added to the wire without updating the spec fails the build.

For the same contracts as tables, with notes on each endpoint’s behaviour, see plug and deploy.

Agentic Commerce Standards Conformance Matrix

This document records target protocol versions and the Commerce Orchestrator’s conformance status. Conformance is verified by tests referenced in the Evidence column.

Target Protocol Versions

ProtocolTarget VersionSpec / Reference
UCP business profile2026-08-25 (with 2026-04-08, 2026-01-23 and 2026-01-11 profiles linked from supported_versions)UCP spec; profile validated against the official profile.json#/$defs/business_schema; UCP REST binding; RFC 9421 signatures
A2A (Agent-to-Agent)1.0 (patch 1.0.1; 0.3 envelopes and JSON-RPC message/send retained)A2A spec; Agent Card, HTTP+JSON and JSON-RPC SendMessage / SendStreamingMessage (SSE); A2A-Version negotiation on the envelope routes
MCP (Model Context Protocol)Dual-era: 2026-07-28 modern + 2025-11-25 / 2024-11-05 legacyserver/discover + per-request version meta; legacy initialize retained
AP2 (Agent Payments Protocol)0.2AP2 spec; closed + open (HNP) mandates, VDCs
ACP (Agentic Commerce Protocol)2026-04-17ACP OpenAPI; merchant-hosted checkout sessions, Cart capability, delegate payment, mandatory Idempotency-Key, and /.well-known/acp.json discovery
MPP (Machine Payments Protocol)draft-httpauth-payment-01 (charge intent: draft-payment-intent-charge-00)MPP protocol, Payment auth drafts; HTTP 402 challenge/credential/receipt on REST checkout, the MCP transport (-32042, _meta credential/receipt) on the native MCP execute_checkout tool, and method/intent metadata

Conformance Matrix

Status values: required (must pass for claimed alignment), optional (supported when implemented), not_supported_yet (planned or out of scope).

Discovery (UCP)

CapabilityStatusAcceptance CriteriaEvidence
Well-known discovery endpointrequiredDefault GET /.well-known/ucp returns a 2026-08-25 business profile that validates against the official UCP JSON Schema (vendored in crates/orchestrator-http/tests/fixtures/ucp/2026-08-25), configured or not; it is served with Cache-Control: public, max-age=300ucp_profile_schema_test::an_unconfigured_deployment_publishes_a_valid_profile, ucp_profile_schema_test::a_fully_configured_deployment_publishes_a_valid_profile, ucp_profile_schema_test::the_profile_is_publicly_cacheable_for_at_least_a_minute
Older protocol versionsrequiredsupported_versions maps 2026-04-08, 2026-01-23 and 2026-01-11 to ?ucp_version= profile URIs; each linked profile declares that version and carries no supported_versions of its own. The 2026-04-08 profile keeps its previous shape (in-ucp signing_keys, handler list, acp/mcp transports) for platforms still on itucp_profile_schema_test::older_versions_link_to_self_contained_profiles, authz_and_adapters::the_2026_04_08_profile_keeps_its_shape_for_platforms_still_on_it
Version-match rulerequiredEvery dev.ucp.* service and capability entry declares the profile’s own versionucp_profile_schema_test::every_ucp_entry_declares_the_profile_version
Only implemented bindings listedrequireddev.ucp.shopping lists rest, mcp (UCP’s MCP binding at /api/v1/ucp/mcp), a2a (UCP’s A2A binding, endpoint = the Agent Card) and embedded (when configured) only. The orchestrator’s native MCP server is not UCP’s MCP binding and ACP is its own protocol, so their endpoints move to the top-level orchestrator member (mcp_endpoint, mcp_supported_versions, acp_discovery, acp_api_version, a2a_profile_version, ap2_protocol_version, capability_flags) — only UCP core may define members inside ucpucp_profile_schema_test::only_bindings_we_implement_are_listed_as_ucp_transports
Payment handler registryrequireducp.payment_handlers is always present, as a reverse-DNS keyed registry; it is {} unless the operator publishes their providers’ handlers via UCP_PAYMENT_HANDLERS (validated at startup). Payment handlers are not a capabilityucp_profile_schema_test::payment_handlers_are_always_present_and_published_as_configured, ucp_profile_schema_test::payment_handlers_are_not_a_capability, config tests
Capability IDsrequiredLatest profile advertises checkout, cart, catalog.lookup/search, order, discount, and fulfillment, with 2026-08-25 spec URLs; identity_linking appears only when an identity provider is configuredSame; honest_discovery_test::discovery_hides_identity_linking_until_a_provider_is_configured
Multi-parent extensionsrequireddev.ucp.shopping.discount extends both checkout and cart in the latest profilediscovery tests
Advertised capabilities map to implemented routesrequiredEvery latest advertised capability has a corresponding executable REST, A2A, or MCP operationConformance test: capability_route_parity
Signing keys advertisementrequiredDiscovery publishes the operator’s real public JWKs (Ed25519 and/or P-256) as the top-level keys[] JWK Set beside ucp (signing_keys was removed in 2026-08-25) and sets dev.ucp.security.signatures only when signing material is configured; an unsigned deployment advertises neither. Agent JWK Sets tolerate unknown key typesucp_profile_schema_test::signing_keys_are_a_top_level_jwk_set, ucp_signing::a_jwks_key_of_an_unknown_type_is_skipped_not_fatal, discovery_test::discovery_advertises_acp_signing_and_payment_handlers, discovery_test::discovery_omits_signing_keys_when_no_keyring_is_configured; orchestrator_api::SigningKeyring
Response signingrequiredEvery response carries RFC 9530 Content-Digest and RFC 9421 Signature-Input/Signature (label sig1) covering @status, content-digest, and content-type, verifiable with the advertised JWKucp_signature_test::responses_are_signed_with_the_active_key, ucp_signature_test::rejections_are_signed_too_so_clients_can_trust_them
Request signature verificationrequiredWith agent keys configured (UCP_AGENT_JWKS / UCP_AGENT_KEYS), /api/v1 requests must carry an RFC 9421 signature covering @method, @authority, @path, @query (when present), content-digest + content-type (with a body), and idempotency-key/ucp-agent/signature-agent (when present); the body must match Content-Digest; created within 300s and expires honoured; any one valid signature authenticates. Failures return UCP codes signature_missing/signature_invalid/key_not_found (401) or digest_mismatch/algorithm_unsupported (400)ucp_signature_test suite; ucp_signing suite incl. rfc_9421_ed25519_test_vector_signature_base_and_value
Signature algorithmsrequiredES256 (mandatory-to-verify baseline) and Ed25519 accepted for verification and usable for signing (UCP_SIGNING_KEY_ALG); algorithm derived from the key, alg parameter cross-checkeducp_signing::es256_signed_request_verifies, ucp_signature_test::an_es256_signed_request_is_accepted
Key rotation by kidrequiredBoth signing and verification accept a retired and a current kid simultaneously (UCP_SIGNING_PREVIOUS_KEYS, multiple agent keys) so counterparties can switch without downtimeucp_signing::both_kids_verify_during_a_rotation, ucp_signature_test::both_kids_are_accepted_during_rotation
Web Bot Auth signaturesoptionalOpt-in draft-ietf-webbotauth-httpsig-protocol-01: HTTPS directory resolution, URL-bound caches, thumbprint key selection, required tag/timestamps, key validity and Ed25519/P-256 verification. Configure WEB_BOT_AUTH_DIRECTORY_URLS or server.web_bot_auth_directory_urls. This establishes operator identity, independent of account authorization. RSA, legacy bare-string headers, directory redistribution and Signed-Agent-Metadata policy are outside this profilewebbot_components, webbot_identity, webbot_http
Platform profile negotiation (UCP-Agent)required (opt-in: UCP_PROFILE_NEGOTIATION)With lenient or strict, the profile named by the UCP-Agent header (RFC 8941 dictionary, profile="https://...") on /api/v1/ucp/* or by meta["ucp-agent"].profile on /api/v1/ucp/mcp is fetched (HTTPS only, no redirects, special-use addresses refused and the connection pinned to the checked address, 3 s connect / 5 s total, 256 KiB cap) and cached per URL for its max-age clamped to 60 s–1 h (failures 15 s, 256 URLs). The platform’s ucp.version must be 2026-08-25 or a supported_versions key; capabilities are intersected (shared names, highest mutual version, orphaned extensions pruned until stable) and each response’s ucp.capabilities lists only negotiated ones. strict refuses with invalid_profile_url (400), profile_unreachable (424), profile_malformed (422), version_unsupported (422) as {code, content} on REST and -32001 on MCP, and an operation outside the intersection with a 200 capabilities_incompatible UCP error response; lenient counts the failure and proceeds unnegotiated; off (default) fetches nothing. Unauthenticated requests never trigger a fetch``ucp_negotiation_test::rest_responses_list_only_negotiated_capabilities, ucp_negotiation_test::strict_rest_refuses_each_negotiation_failure_with_the_specified_status, ucp_negotiation_test::a_malformed_ucp_agent_header_is_an_invalid_profile_url, ucp_negotiation_test::an_operation_outside_the_intersection_is_capabilities_incompatible, ucp_negotiation_test::lenient_rest_proceeds_without_negotiation_when_it_fails, ucp_negotiation_test::an_unnegotiated_deployment_lists_every_capability, ucp_negotiation_test::profiles_are_fetched_once_and_then_served_from_the_cache, ucp_negotiation_test::mcp_reports_negotiation_failures_as_discovery_errors, ucp_negotiation_test::mcp_reports_capabilities_incompatible_as_a_result, ucp_negotiation_test::rest_and_mcp_negotiate_the_same_capabilities, ucp_negotiation_test::negotiation_is_counted_timed_and_labelled_by_outcome, ucp_negotiation_test::unauthenticated_requests_never_trigger_a_profile_fetch, ucp_negotiation::tests::the_profile_member_is_read_from_an_rfc_8941_dictionary, ucp_negotiation::tests::intersection_keeps_shared_capabilities_at_the_highest_mutual_version, ucp_negotiation::tests::orphaned_extensions_are_pruned_transitively, ucp_negotiation::tests::platform_profiles_must_have_the_required_registries, ucp_negotiation::tests::strict_negotiation_reports_each_failure_with_its_code, ucp_negotiation::tests::profiles_and_failures_are_cached_per_url, ucp_negotiation::tests::the_cache_is_bounded, outbound::tests::private_and_special_addresses_are_not_public, outbound::tests::loopback_and_private_hosts_are_refused_before_connecting, outbound::tests::only_https_urls_without_credentials_or_fragments_are_accepted, outbound::tests::cache_lifetime_honours_max_age_within_the_cap`
Embedded transportoptionalWhen EMBEDDED_CHECKOUT_URL and signing keys are configured, shopping services advertise a transport: embedded binding and the dev.ucp.shopping.checkout.embedded flag, and POST /api/v1/ucp/checkout/:id/embedded-link returns a short-lived handoff URL on the merchant’s hosted page whose token is an Ed25519 signature verifiable with the discovery JWK (404 for an unknown checkout). Unconfigured, neither is advertised and the endpoint returns 501 NOT_CONFIGUREDdiscovery tests: well_known_ucp_advertises_embedded_transport, embedded_transport_is_not_advertised_without_a_hosted_checkout_url, embedded_transport_is_not_advertised_without_signing_keys, ucp_checkout_embedded_link_points_at_the_hosted_page_with_a_verifiable_token, ucp_checkout_embedded_link_returns_501_when_not_configured; ucp_mapping::tests::embedded_checkout_token_cannot_be_moved_to_another_session

Negotiation decisions the specification leaves open. Each takes the conservative option: existing clients keep working, failures close, and nothing is advertised that is not served.

  • Default mode off. The specification makes negotiation a business MUST, but before this the REST binding never required UCP-Agent, so enforcing it by default would break existing clients and add outbound calls from every replica. Operators opt in; lenient lets them watch what strict would refuse before switching. Discovery does not change with the mode.
  • version_unsupported body. The specification shows two shapes. REST uses the error table’s flat {code, content} with 422, like the other negotiation errors.
  • Cache lifetime. Only a 60 s floor is specified. Profiles are capped at 1 h so a changed profile is picked up. Failed fetches are cached for 15 s, so a dead URL does not turn every request into a fetch. At most 256 URLs are cached per replica.
  • Limits and timeouts. The specification gives no numbers. Profiles are capped at 256 KiB (the specification requires at least 128 KiB); connect times out after 3 s, the whole fetch after 5 s.
  • Order of checks. Authentication comes before negotiation, so unauthenticated callers cannot trigger outbound fetches.
  • Fetch-safety failures. A non-HTTPS URL, or a host that resolves to a private or special-use address, is invalid_profile_url (400). A redirect or any other non-200 status is profile_unreachable (424). A body over the size cap is profile_malformed (422).
  • Version scope. A platform version must exactly equal 2026-08-25 or a supported_versions key. Capabilities are served only at 2026-08-25, so a platform listing only older capability versions negotiates none, and in strict mode its operations get capabilities_incompatible.
  • Lenient on an incompatible operation. The request runs without negotiation and the full envelope is returned, rather than an envelope that omits the operation’s own capability.

UCP 2026-08-25 features not yet implemented

These are part of the current UCP release and are not advertised in discovery. Each is a real gap, not out of scope.

CapabilityStatusNotes
$requestConstraints, PAN / network-token credential splitnot_supported_yetCheckout uses the orchestrator-native payment_intent
Split payments, payment terms (dev.ucp.common.payment.*)not_supported_yetSingle instrument per checkout
dev.ucp.common.payment.ap2_mandatesnot_supported_yetAP2 mandates are verified via payment_intent.ap2_consent_proof, not the UCP extension. Over UCP’s A2A binding a message carrying ap2.checkout_mandate is refused (-32602) rather than completed without the check, and no ap2.merchant_authorization is returned
Location search / lookup (dev.ucp.common.location.*)not_supported_yetNo store-location provider contract
Fractional quantities (measure.json, sale basis)not_supported_yetQuantities are integers
Buyer consent (dev.ucp.consent.*), loyalty, policies, attribution, permalinknot_supported_yet

UCP A2A binding

UCP’s A2A transport for checkout (specification/shopping/checkout/a2a) is carried by the A2A endpoints: JSON-RPC message/send at /api/v1/a2a/jsonrpc (the A2A 0.3 shape the binding’s examples and transports/a2a_message.json use) and HTTP+JSON / JSON-RPC SendMessage with A2A-Version: 1.0. Every action runs the same run_ucp_* code as the REST and MCP bindings. See consumption guide.

CapabilityStatusImplementationTests
Discovery entryrequireducp.services["dev.ucp.shopping"] lists transport: a2a with the profile version, the overview spec and endpoint {base}/.well-known/agent-card.json, and no schema (UCP defines none for A2A). Always served, so always listeducp_a2a_binding_test::discovery_lists_the_a2a_transport_pointing_at_the_agent_card, ucp_profile_schema_test::only_bindings_we_implement_are_listed_as_ucp_transports
Agent Card extensionrequiredcapabilities.extensions[] carries uri: https://ucp.dev/2026-08-25/specification/reference with params.capabilities["dev.ucp.shopping.checkout"] = [{version}] (validates against transports/a2a_message.json#/$defs/agent_card), plus a ucp-checkout skill. The extension is not required, so the native envelopes keep workingucp_a2a_binding_test::the_agent_card_advertises_the_ucp_extension_and_checkout_skill
Extension activationrequiredA2A-Extensions or X-A2A-Extensions naming the UCP URI is echoed on the response under the same nameucp_a2a_binding_test::the_activated_extension_is_echoed, ucp_a2a_binding_test::the_http_json_binding_carries_ucp_checkouts_too
Actionsrequiredadd_to_checkout (product_id, quantity) and complete_checkout (a2a.ucp.checkout.payment, a2a.ucp.checkout.signals) as the binding defines them; create_checkout, get_checkout, update_checkout, cancel_checkout mirror the MCP tool names with the body under a2a.ucp.checkout (the binding names no other actions). The reply’s DataPart holds the checkout under a2a.ucp.checkout; completion adds order { id, permalink_url }. Replies validate against transports/a2a_message.json#/$defs/message_response and shopping/checkout.jsonucp_a2a_binding_test::a_checkout_built_over_a2a_completes_and_reads_back_over_rest_and_mcp, ucp_a2a_binding_test::create_update_and_cancel_take_a_ucp_checkout_body
Session modelrequiredThe business agent generates contextId: it is the checkout id, so a checkout is one resource across REST, MCP and A2A, and a checkout created over REST is driven over A2A by sending its id as contextId (or id in the DataPart). add_to_checkout on a context with no checkout (or a cancelled one) starts a new oneucp_a2a_binding_test::a_checkout_created_over_rest_is_driven_over_a2a
Merchant and currencyrequiredadd_to_checkout carries neither: the merchant is UCP_DEFAULT_MERCHANT_ID (or merchant_id in the DataPart), the currency currency in the DataPart else UCP_CATALOG_CURRENCY, else a currency_required error responseucp_a2a_binding_test suite (deployment with both set)
Platform profilerequiredUCP-Agent: profile="..." must be an http(s) URL, else -32001 (data.code: invalid_profile_url), or HTTP 400 INVALID_PROFILE_URL (domain ucp.dev) on HTTP+JSON. The profile is not fetcheducp_a2a_binding_test::a_missing_platform_profile_is_a_discovery_error
IdempotencyrequiredmessageId is the idempotency key: a retried mutating message is answered with the first reply (per replica, last 10,000 messages per process); the same messageId with a different message is -32000 / HTTP 409 IDEMPOTENCY_CONFLICT. Completion also uses the checkout runner’s durable key a2a-ucp:<messageId>ucp_a2a_binding_test::a_retried_message_is_applied_once
Business errorsrequiredUnknown checkout and validation or payment failures: a normal reply whose a2a.ucp.checkout is a UCP error response (ucp.status: error, messages[]), valid against common/types/error_response.jsonucp_a2a_binding_test::an_unknown_checkout_is_a_ucp_error_response
Protocol errorsrequired401/403/409 → -32000 with the HTTP status kept, server faults → -32603; an unknown action, a message with no action, or an AP2 mandate → -32602ucp_a2a_binding_test::messages_the_binding_does_not_define_are_invalid_params, ucp_a2a_binding_test::a_retried_message_is_applied_once
Tenant isolationrequiredAnother tenant’s checkout (get, add, cancel, complete) → HTTP 403, -32000, data.reason: TENANT_MISMATCH; add_to_checkout never starts a new checkout over itucp_a2a_binding_test::another_tenants_checkout_is_refused
Metricsrequiredorchestrator_operation_calls_total / orchestrator_operation_latency_seconds with operation="a2a_ucp_<action>" and status = success or the error kind; counters a2a_ucp_replay_total, a2a_ucp_idempotency_conflict_total, a2a_ucp_invalid_profile_total, a2a_ucp_extension_activated_total, a2a_ucp_signals_received_total, a2a_ucp_ap2_mandate_refused_totalucp_a2a_binding_test::ucp_actions_are_counted_timed_and_errors_labelled_by_kind
Cart, catalog and order over A2Anot_supported_yetUCP defines A2A bindings for checkout only; cart, catalog and order have REST and MCP bindingsconformance review
Risk signalsoptionala2a.ucp.checkout.signals is accepted and counted, not forwarded: no provider contract takes itconformance review
Tasks in UCP’s A2A bindingoptionalThe binding allows Task objects; this agent always replies with a Messageconformance review

UCP MCP binding

UCP’s MCP transport (services/shopping/mcp.openrpc.json, vendored in crates/orchestrator-http/tests/fixtures/ucp/2026-08-25/services/shopping) is served at POST /api/v1/ucp/mcp, apart from the orchestrator’s native MCP server, because both define create_cart, get_cart and get_order with different arguments. See MCP binding.

CapabilityStatusImplementationTests
Discovery entryrequireducp.services["dev.ucp.shopping"] lists transport: mcp with the profile version, the overview spec, the official OpenRPC schema and endpoint {base}/api/v1/ucp/mcp. The binding is always served, so it is always listeducp_mcp_binding_test::discovery_lists_the_mcp_transport_under_dev_ucp_shopping, ucp_profile_schema_test::only_bindings_we_implement_are_listed_as_ucp_transports
Tool definitionsrequiredtools/list is derived from the vendored OpenRPC: one tool per method, inputSchema = the method’s params (with meta inlined), outputSchema = its result schemaucp_mcp_binding_test::tools_list_matches_the_openrpc_methods_and_param_schemas
Checkout toolsrequiredcreate_checkout, get_checkout, update_checkout, complete_checkout, cancel_checkout run the same run_ucp_* code as the REST binding; complete_checkout pays with checkout.payment.instruments[0] and returns the checkout with status: completed and order { id, permalink_url }ucp_mcp_binding_test::checkout_lifecycle_returns_ucp_checkouts_and_an_order
Cart and order toolsrequiredcreate_cart, get_cart, update_cart, cancel_cart, get_orderucp_mcp_binding_test::cart_lifecycle_returns_ucp_carts, ucp_mcp_binding_test::checkout_lifecycle_returns_ucp_checkouts_and_an_order
Result shaperequiredThe UCP payload is in structuredContent and serialized in content[0].text; payloads validate against shopping/{checkout,cart,order}.jsonevery lifecycle test (assert_valid)
Request metadatarequiredmeta["ucp-agent"].profile must be an http(s) URL, else -32001 with data.code: invalid_profile_url and HTTP 400. With UCP_PROFILE_NEGOTIATION enabled the profile is fetched and negotiated as on REST (see Platform profile negotiation)ucp_mcp_binding_test::a_missing_platform_profile_is_a_discovery_error, ucp_negotiation_test::mcp_reports_negotiation_failures_as_discovery_errors
Idempotencyrequiredcomplete_checkout, cancel_checkout and cancel_cart require a UUID meta["idempotency-key"] (-32602 otherwise). A completed checkout replays its outcome for the same key; a key already spent on another checkout is -32000 with HTTP 409; cancelling twice returns the canceled resourceucp_mcp_binding_test::complete_checkout_needs_a_uuid_idempotency_key, ucp_mcp_binding_test::reusing_a_key_for_another_checkout_is_a_conflict, ucp_mcp_binding_test::cancel_checkout_is_idempotent_and_needs_a_key, ucp_mcp_binding_test::cart_lifecycle_returns_ucp_carts
Business errorsrequiredUnknown checkout, cart or order: a result whose structuredContent is a UCP error response (ucp.status: error, messages[] with code: not_found, severity: unrecoverable); validation and payment failures likewise, recoverableucp_mcp_binding_test::an_unknown_resource_is_a_ucp_error_response
Protocol errorsrequired401/403/409 → -32000, server faults → -32603, each with the matching HTTP status and data.code; bad tool arguments or an unknown tool → -32602; unknown method → -32601; unsupported MCP-Protocol-Version → HTTP 400, -32022ucp_mcp_binding_test::a_caller_without_credentials_gets_a_json_rpc_401, ucp_mcp_binding_test::arguments_that_break_the_binding_are_invalid_params, ucp_mcp_binding_test::initialize_ping_and_notifications_follow_mcp
Tenant isolationrequiredAnother tenant’s cart or checkout → HTTP 403, -32000, data.code: TENANT_MISMATCH; another tenant’s order → 403, -32000ucp_mcp_binding_test::another_tenants_cart_checkout_and_order_are_refused
MCP lifecyclerequiredinitialize (echoes a supported protocolVersion), ping, server/discover, tools/list, tools/call; notifications get HTTP 202ucp_mcp_binding_test::initialize_ping_and_notifications_follow_mcp
MetricsrequiredEvery tool call is counted and timed as orchestrator_operation_calls_total / orchestrator_operation_latency_seconds with operation="ucp_mcp_<tool>" and status = success or the error kind (not_found, tenant_mismatch, invalid_params, invalid_profile_url, …)ucp_mcp_binding_test::tool_calls_are_counted_timed_and_errors_labelled_by_kind
Native MCP server unchangedrequired/api/v1/mcp/message keeps its own toolsucp_mcp_binding_test::the_native_mcp_server_keeps_its_own_tools
Catalog toolsrequiredsearch_catalog, lookup_catalog and get_product return UCP products (one variant per catalog item) that validate against shopping/catalog_search.json / catalog_lookup.json; lookup variants carry inputs[] and misses are not_found warnings; an unknown product is a not_found error response. Prices are in context.currency, else UCP_CATALOG_CURRENCY, else a currency_required error responseucp_mcp_binding_test::search_catalog_returns_ucp_products_priced_in_the_request_or_configured_currency, ucp_mcp_binding_test::lookup_catalog_correlates_inputs_and_reports_misses, ucp_mcp_binding_test::get_product_returns_one_product_or_not_found, config::tests::catalog_currency_is_an_upper_case_iso_code_or_unset
Merchant for UCP carts and checkoutsrequiredUCP has no merchant field: the body’s merchant_id wins, then UCP_DEFAULT_MERCHANT_ID; with neither, merchant_required (MCP error response) / 400 MERCHANT_REQUIRED (REST)ucp_mcp_binding_test::a_default_merchant_lets_platforms_omit_merchant_id, v1::tests::a_body_merchant_wins_over_the_default, v1::tests::the_default_merchant_fills_in_when_the_body_has_none, v1::tests::without_either_the_error_names_the_setting
Catalog search filters and paginationnot_supported_yetIgnored; every match is returned. Variants, options, media and availability beyond one priced variant per item are not modelled by the catalog provider contract
Streaming (SSE) responsesnot_supported_yetEvery response is a single JSON body; no text/event-stream

Fulfillment (UCP)

CapabilityStatusAcceptance CriteriaEvidence
Fulfillment capability discoveryrequireddev.ucp.shopping.fulfillment extends both dev.ucp.shopping.checkout and dev.ucp.shopping.cart in the latest profile, and is flagged in orchestrator.capability_flags["dev.ucp.shopping.fulfillment"]discovery_test::well_known_ucp_advertises_fulfillment_extension
Fulfillment selection commandrequiredSetFulfillmentSelection cart command quotes shipping/pickup options for a destination and, when selected_option_id is provided, selects an option and adds its amount_minor into total_minor via fulfillment_minororchestrator-core fulfillment unit tests; runner.rs
REST fulfillment endpointrequiredPOST /api/v1/ucp/cart/:id/fulfillment and POST /api/v1/ucp/checkout/:id/fulfillment accept a destination + optional selected_option_id and return the updated UCP cart envelope with a fulfillment object and fulfillment_minorapi_integration_test::ucp_cart_fulfillment_quotes_and_selects_shipping_option
Fulfillment wire shaperequiredThe fulfillment object on cart and checkout responses validates against UCP 2026-08-25 shopping/types/fulfillment.json: typed destinations[] (shipping_address / business_location), option description object and totals[]ucp_fulfillment_schema_test suite
Unknown option rejectedrequiredSelecting an selected_option_id not present in the quoted options for the method type returns an error, not a silent no-oporchestrator-http fulfillment tests
Fulfillment metricsrequiredFulfillment selection increments cart_fulfillment_selection_total and is recorded under the generic cart_set_fulfillment operation counter/latency histogramapi_integration_test::ucp_cart_fulfillment_quotes_and_selects_shipping_option (/metrics assertions)

Payment authentication (3DS2)

3DS2 step-up needs the payment provider: it answers authorize with authentication_required and serves the buyer-facing pages (see providers and docs/providers/openapi.yaml). The orchestrator pauses the checkout, shows the step-up to the agent in each protocol’s own shape, and resumes when the result is known.

sequenceDiagram
    participant A as Agent / platform
    participant O as Orchestrator
    participant P as Payment provider
    A->>O: complete (UCP REST/MCP, ACP)
    O->>P: POST /authorize
    P-->>O: authorized=false, authentication_required
    O-->>A: UCP complete_in_progress + actions / ACP authentication_required
    Note over A,P: Buyer finishes device data collection or the challenge on the provider's page
    alt UCP
        A->>O: Get Checkout (after action.done)
        O->>P: GET /authentication/{id}
        P-->>O: completed, result
    else ACP
        A->>O: complete with authentication_result
    end
    O->>P: POST /authentication/{id}/authorize
    P-->>O: authorized
    O-->>A: completed + order
CapabilityStatusAcceptance CriteriaEvidence
Provider contractoptionalPaymentProvider gains defaulted supports_authentication, authorize_with_authentication, authentication_status, authorize_authenticated; existing providers are unchanged and never step up. The HTTP adapter reads authentication_required on /authorize and calls GET /authentication/{id} and POST /authentication/{id}/authorize (key <checkout key>:authenticated), only with PAYMENT_AUTHENTICATION_ENABLED=truepayment_authentication_http_test, openapi_spec_test
Paused checkoutrequiredA step-up stops the checkout in AuthenticationPending (TransactionStatus::AuthenticationRequired, PaymentState::AuthenticationPending), records the request and the pause (event store PaymentAuthenticationRequired, checkout_authentication store: memory, file, Postgres migration 0013), keeps the reservation, and answers the idempotency key with the pending step-uppayment_authentication::a_challenge_pauses_checkout_with_the_step_up_and_no_order, payment_authentication::retrying_the_same_key_while_waiting_returns_the_pending_action, payment_authentication::a_pending_authentication_survives_a_restart
ResumerequiredThe provider’s result (read when the checkout is read) or an agent-submitted result resumes the checkout once: authorize, commit, capture, order, receipt; the original key then replays the final outcome. Resumes are claimed in the idempotency store, so replicas cannot place two orderspayment_authentication::the_provider_result_resumes_checkout_to_an_order, payment_authentication::a_submitted_result_resumes_checkout_once
Fail closedrequiredOutcomes other than authenticated / attempt_acknowledged, an expired pause (15 minutes), a cart changed during authentication, or a step-up from a provider that did not declare 3DS2 support end the checkout unpaid (AuthFailed / TimedOut)payment_authentication::a_denied_authentication_fails_the_checkout, an_expired_authentication_times_out, a_cart_changed_during_authentication_is_not_charged, step_up_from_a_provider_that_does_not_support_it_fails_closed
UCP actionsoptionaldev.ucp.common.payment.authentication (extends checkout) is advertised only with a 3DS-capable provider. A paused checkout is complete_in_progress with actions["dev.ucp.common.payment.device_data_collection"] and/or ["dev.ucp.common.payment.three_ds_challenge"] (id, config.payment_instrument_id, config.url), payment.instruments[], and the extension listed in ucp.capabilities, on REST, MCP and A2A (shared run_ucp_complete_checkout / run_ucp_get_checkout); Get Checkout completes it (completed + order) or reports payment_failed. Responses validate against the vendored common/payment_authentication.jsonucp_payment_authentication_test, ucp_a2a_binding_test::a_3ds_step_up_is_a_payment_authentication_action_over_a2a
Actions follow negotiationrequiredWith UCP_PROFILE_NEGOTIATION lenient or strict, REST and MCP responses carry the actions only when the platform negotiated dev.ucp.common.payment.authentication; otherwise, and on a lenient fallback, the actions, payment and the extension are removed and the checkout shows its cart status with a recoverable payment_failed message. The A2A binding does not negotiate profiles, so it behaves as offucp_negotiation_test::payment_actions_are_sent_when_the_extension_is_negotiated, payment_actions_are_withheld_when_the_extension_is_not_negotiated, a_lenient_fallback_does_not_send_payment_actions_either
ACP delegate authenticationoptionalComplete Checkout Session (REST and ACP MCP, shared routes/acp.rs) returns the CheckoutSession with status: authentication_required, authentication_metadata and a requires_3ds message; Retrieve shows the same. Completing again with authentication_result resumes it: completed with the order, or 402 payment_declined (Retrieve then shows a payment_declined message). A result with nothing pending is 409 authentication_not_pendingacp_delegate_authentication_test
Metricsrequiredpayment_authentication_challenges_total, payment_authentication_outcome_<outcome>_total (incl. expired), payment_authentication_unsupported_total, payment_authentication_cart_changed_total, time to authenticate as orchestrator_operation_latency_seconds{operation="payment_authentication"}, plus checkout_outcome / checkout_authentication_submit operationspayment_authentication::outcomes_and_time_to_authenticate_are_recorded

Decisions where the specs leave room (conservative by design):

  • UCP extension negotiation. UCP says a business must not emit these actions unless the extension is active for the checkout. With negotiation lenient or strict they are withheld unless negotiated (and on a lenient fallback, which negotiates nothing). With negotiation off (the default) and on the A2A binding, which does not negotiate, the extension counts as active whenever it is advertised.
  • Withheld actions. A checkout whose platform did not negotiate the extension cannot finish its 3DS2 step-up, so it is shown at its cart status with a recoverable payment_failed message rather than complete_in_progress; completing again with another instrument starts a new checkout attempt. The paused attempt expires after 15 minutes.
  • UCP action failures. The spec defers the status after a failed authentication to its general fallback rules. A failed, denied or expired authentication leaves the checkout at its cart status with a payment_failed error (severity: recoverable); the platform may complete again with another instrument.
  • No continue_url fallback. A provider that asks for 3DS2 without declaring support declines the payment rather than handing off with requires_escalation.
  • Instrument id. Actions point at the instrument id from the complete request (MCP payment.instruments[0].id, REST payment_instrument_id), echoed under payment.instruments; without one, instrument_1.
  • ACP outcomes. Only authenticated and attempt_acknowledged authorize; informational and every failure outcome decline. outcome_details is required for authenticated, attempt_acknowledged and informational, and an ECI must be one of 01, 02, 05, 06, 07.
  • ACP metadata. authentication_metadata is shown only when the provider sent both acquirer_details and directory_server; flow_preference is never set, leaving the flow to the issuer.
  • Timeout. A pause expires after 15 minutes (OrchestratorFacade::with_payment_authentication_ttl); the inventory reservation is refreshed on resume.

Final checkouts

CapabilityStatusAcceptance CriteriaEvidence
Terminal status read backrequiredA completed checkout reads back completed with its order (UCP REST, MCP, A2A; ACP REST and MCP); a canceled one canceled. The cart records it (CartStatus::Completed, order_id, CheckoutCompleted event)checkout_terminal_status_test::a_completed_ucp_checkout_reads_back_completed_on_rest_and_mcp, a_completed_acp_session_reads_back_completed_with_its_order, a2a_add_to_checkout_after_completion_is_refused
No changes after the endrequiredUpdates, adds, cancel and a second complete under a new key are refused for completed and canceled checkouts: UCP REST 409 CHECKOUT_COMPLETED / CART_CANCELED; UCP MCP and A2A an unrecoverable business error checkout_completed / cart_canceled; ACP 409 checkout_session_completed / checkout_session_canceled, cancel after completion 405 session_not_cancelable. A retry with the original key still replays the outcomecheckout_terminal_status_test

Transport: REST

CapabilityStatusAcceptance CriteriaEvidence
Cart commandsrequiredPOST /api/v1/cart/commands accepts create_cart, add_item, update_item_qty, remove_item, apply_adjustment, get_cart, start_checkoutIntegration tests, consumption-guide
UCP cart shimrequiredPOST/GET/PUT /api/v1/ucp/cart paths create, retrieve, update, and cancel carts with UCP envelopesapi_integration_test
UCP REST binding pathsrequiredEvery operation in UCP services/shopping/rest.openapi.json is reachable relative to the advertised /api/v1/ucp endpoint: /checkout-sessions (+ /{id}, /complete, /cancel), /carts (+ /{id}, /cancel), /catalog/{search,lookup,product}, /orders/{id}. The older /ucp/checkout and /ucp/cart paths remain as aliasesucp_rest_binding_test suite
UCP checkout lifecyclerequiredCheckout sessions create/get/update/complete/cancel map to cart + checkout execute, and their envelopes name dev.ucp.shopping.checkout (not cart) as the root capabilityucp_rest_binding_test::checkout_sessions_lifecycle_is_served_at_the_binding_paths
Checkout executerequiredPOST /api/v1/checkout/execute with cart_id, cart_version, payment_intent, idempotency_key returns transaction resulthappy_path, authz tests
Payment lifecyclerequiredPOST /api/v1/payments/{capture,void,refund} with tenant_id, transaction_id, idempotency_keyAPI tests
Payment-handler registryrequiredDiscovery advertises handlers; GET /api/v1/ucp/payment-handlers lists/gets configured handlersdiscovery tests
Auth and tenant isolationrequiredBearer auth in production; tenant_id and scope checks; cross-tenant idempotency isolation; carts are stamped with the caller’s tenant at creation and cross-tenant read/mutate/cancel/checkout returns 403 TENANT_MISMATCH; payment delegation and identity linking take the tenant from the auth context, not the bodyauthz_and_adapters, cross_tenant_idempotency, cart_tenancy, honest_discovery_test::delegate_payment_refuses_a_tenant_the_caller_is_not
UCP response bodiesrequiredCart, checkout session and order bodies validate against UCP 2026-08-25 shopping/{cart,checkout,order}.json: line item {id,title,price} + totals[], integer totals[] with one subtotal and one total, checkout status vocabulary + links[] + ucp.payment_handlers, order checkout_id, fulfillment, line quantity object and statusucp_response_schema_test suite

Transport: A2A / MCP (adapter layer)

CapabilityStatusAcceptance CriteriaEvidence
A2A envelope normalizationrequiredIncoming A2A envelope (capability + payload) normalizes to CheckoutRequest / CartCommand; same authz and idempotency rules applya2a_adapter tests
A2A-Version negotiationrequiredAccept A2A-Version (1.0, 0.3); reject unsupported with supported listauthz_and_adapters, discovery_test
Identity-linking envelope normalizationrequiredIncoming identity-linking envelope normalizes into identity-link request and rejects unsupported capabilitiesauthz_and_adapters
A2A order query enveloperequiredPOST /api/v1/a2a/orders accepts A2A envelope with payload.order_id and returns order detailsapi_integration_test
MCP dual-era tool serverrequiredLegacy initialize (2024-11-05/2025-11-25); modern server/discover + MCP-Protocol-Version / _meta for 2026-07-28orchestrator-mcp tests
MCP Streamable HTTP: Originrequired2026-07-28: an Origin header not listed in MCP_ALLOWED_ORIGINS (default: none; * allows any) is refused with 403 and a JSON-RPC error without id, before authentication, on every MCP endpoint. Requests without Origin (server-side agents) are servedmcp_transport_test::a_foreign_origin_is_refused_with_403_by_default, mcp_transport_test::a_listed_origin_is_served, mcp_transport_test::origin_is_checked_before_authentication, mcp_transport_test::a_request_without_origin_is_served, config::tests::mcp_allowed_origins_default_to_none_and_are_validated
MCP Streamable HTTP: request headersrequired2026-07-28: MCP-Protocol-Version must be supported (400, -32022 with supported/requested) and match _meta (400, -32020); Mcp-Method must equal method and Mcp-Name must equal params.name (tools/call, prompts/get) or params.uri (resources/read), Base64 sentinel form decoded; missing or different → 400, -32020mcp_transport_test suite
MCP Streamable HTTP: responsesrequired2026-07-28: unknown method → 404, -32601; notifications → 202, no body; results carry resultType, list/discovery results ttlMs and cacheScope; GET/DELETE → 405; no Mcp-Session-Id issuedmcp_transport_test::a_modern_unknown_method_is_404_with_32601, mcp_transport_test::a_notification_is_accepted_with_202_and_no_body, mcp_transport_test::a_conforming_modern_request_is_served_as_a_complete_cacheable_result, mcp_transport_test::get_and_delete_are_405
MCP Streamable HTTP: back-compatrequired2025-11-25, 2024-11-05 and version-less requests need no Mcp-Method/Mcp-Name, keep HTTP 200 for unknown methods and undecorated results; a client Mcp-Session-Id is ignoredmcp_transport_test::legacy_clients_need_no_mcp_method_or_name, mcp_transport_test::a_legacy_unknown_method_keeps_its_200, mcp_transport_test::a_session_id_from_a_legacy_client_is_ignored
MCP tool definitionsrequiredAll facade operations exposed as MCP tools with JSON Schema input definitions, including set_fulfillment_selection (quote-only when selected_option_id is omitted). See MCP bindingtools::tests::tools_list_includes_set_fulfillment_selection, tools::tests::set_fulfillment_selection_with_an_option_prices_the_cart
MCP resource definitionsrequiredorder://{id} and cart://{id} resources readable via resources/readorchestrator-mcp tests
MCP endpoint in discoveryrequired/.well-known/ucp → orchestrator.mcp_endpoint and orchestrator.mcp_supported_versionsdiscovery tests
A2A 1.0 Agent CardrequiredGET /.well-known/agent-card.json carries every required AgentCard field, three interfaces (HTTP+JSON 1.0 at /api/v1/a2a, JSONRPC 1.0 and JSONRPC 0.3 at /api/v1/a2a/jsonrpc), capabilities.streaming: true, only the skills this deployment can run, and Bearer securitySchemes/securityRequirements when auth is required; linked from /.well-known/ucp as orchestrator.a2a_agent_carda2a_binding_test::the_agent_card_has_every_required_field, a2a_binding_test::the_agent_card_lists_only_skills_this_deployment_can_run, a2a_binding_test::the_agent_card_declares_bearer_auth_when_the_deployment_requires_it
A2A 1.0 SendMessage (HTTP+JSON)requiredPOST /api/v1/a2a/message:send requires A2A-Version: 1.0, takes a ROLE_USER message whose DataPart carries a capability envelope, runs it through the same normalizers and policy as /a2a/*, and replies application/a2a+json with a ROLE_AGENT message (contextId preserved). Errors are google.rpc.Status with ErrorInfo (VERSION_NOT_SUPPORTED, INVALID_PARAMS, UNSUPPORTED_OPERATION, TASK_NOT_FOUND)a2a_binding_test suite
A2A task operationsrequiredThe agent never creates tasks, so GetTask, CancelTask and SubscribeToTask (POST as the spec text says, GET as a2a.proto says) return 404 TASK_NOT_FOUND, and ListTasks (GET /api/v1/a2a/tasks) is always emptya2a_binding_test::tasks_are_never_created_so_task_operations_report_not_found, a2a_binding_test::list_tasks_is_always_empty
A2A streaming (SendStreamingMessage)requiredPOST /api/v1/a2a/message:stream (and JSON-RPC SendStreamingMessage / 0.3 message/stream) runs the same operation as SendMessage and answers text/event-stream with one data: event holding a StreamResponse {"message": ...}, then closes: A2A 1.0 §3.1.2 says a Message stream “MUST contain exactly one Message object and then close immediately”, so no task lifecycle is needed. Failures are found before the stream opens and answered as ordinary error responses (A2A 1.0 defines no in-stream error for HTTP+JSON). Metrics: operation="a2a_send_streaming_message", gauge orchestrator_open_streams{stream="a2a_message_stream"}a2a_binding_test::send_streaming_message_streams_exactly_one_agent_message_then_closes, a2a_binding_test::send_streaming_message_reports_failures_before_the_stream_opens, a2a_binding_test::streams_are_counted_timed_and_tracked_as_open_streams, a2a_binding_test::jsonrpc_send_streaming_message_wraps_the_one_event_in_a_response
A2A JSON-RPC bindingrequiredPOST /api/v1/a2a/jsonrpc: A2A 1.0 methods (SendMessage, SendStreamingMessage, GetTask, ListTasks, CancelTask, SubscribeToTask, push config methods, GetExtendedAgentCard) with A2A-Version: 1.0, and the 0.3 methods (message/send, message/stream, tasks/*) with 0.3 message shapes when no version is sent. Codes per A2A 1.0 §5.4: -32001 task not found, -32003 push notifications, -32004 unsupported operation, -32009 version, plus JSON-RPC -32700/-32600/-32601/-32602. Metrics: operation="a2a_jsonrpc_<method>"a2a_binding_test::jsonrpc_send_message_answers_with_an_agent_message, a2a_binding_test::jsonrpc_speaks_the_a2a_0_3_message_shape_on_message_send, a2a_binding_test::jsonrpc_errors_use_the_a2a_error_codes, a2a_binding_test::jsonrpc_calls_are_counted_by_method_and_error_kind
A2A push notificationsnot_supported_yetPush configs are keyed by task and this agent creates none; declared pushNotifications: false, and every /tasks/{id}/pushNotificationConfigs operation answers 400 PUSH_NOTIFICATION_NOT_SUPPORTED (§3.3.4)a2a_binding_test::push_notification_configs_are_not_supported
A2A extended agent cardnot_supported_yetEverything is on the public card; declared extendedAgentCard: false, and GET /api/v1/a2a/extendedAgentCard answers 400 UNSUPPORTED_OPERATIONa2a_binding_test::the_extended_agent_card_is_not_offered
A2A gRPC bindingnot_supported_yetNeeds a protobuf/gRPC server stack beside axum for no new capability; HTTP+JSON and JSON-RPC cover the same operationsconformance review
A2A card signaturesnot_supported_yetNeeds RFC 8785 canonicalization with proto3 default-stripping over the card, which no test vector pins down; the card is served over TLS and signed responses carry RFC 9421 signaturesconformance review
Delegated capability in handoffoptionalA2AHandoffProfile carries protocol, selected profile version, delegated_capability, and supported profile versionsadapters.rs, authz_and_adapters

ACP (Agentic Commerce Protocol)

CapabilityStatusAcceptance CriteriaEvidence
API-Version headerrequiredRequire API-Version: 2026-04-17; mismatch/missing returns error with supported_versionsapi_integration_test
Mandatory Idempotency-Key headerrequiredEvery mutating ACP route (checkout_sessions create/update/complete/cancel, delegate_payment, carts create/update/cancel) requires a non-empty Idempotency-Key header; missing/blank returns 400 with code: idempotency_key_required; the key is echoed on successacp_rest_binding_test::headers_are_required_and_errors_are_acp_errors, api_integration_test::acp_delegate_payment_requires_an_idempotency_key
Checkout session bodies (2026-04-17)requiredPOST /checkout_sessions (201), GET and POST /checkout_sessions/{id} (update; PUT kept) take CheckoutSessionCreateRequest / CheckoutSessionUpdateRequest and return CheckoutSession, all validated against the vendored 2026-04-17 schema; items are { id } units; tenant from authentication, merchant UCP_DEFAULT_MERCHANT_ID; earlier non-ACP fields are invalid_payloadacp_rest_binding_test::create_returns_201_and_a_checkout_session, acp_rest_binding_test::get_and_update_return_checkout_sessions, acp_rest_binding_test::a_pre_2026_04_17_body_is_an_invalid_request, acp_rest_binding_test::without_a_default_merchant_a_session_is_refused, acp_rest_binding_test::the_tenant_comes_from_authentication
Complete sessionrequiredPOST .../complete takes CheckoutSessionCompleteRequest (payment_data.handler_id, instrument.credential.token), pays the session total under the Idempotency-Key, and returns CheckoutSessionWithOrder; same key replays, a key spent on another session is 422 idempotency_conflictacp_rest_binding_test::complete_returns_the_session_with_its_order_and_replays_by_key
Cancel sessionrequiredOptional CancelSessionRequest body; a canceled session is 405 session_not_cancelableacp_rest_binding_test::cancel_takes_an_optional_body_and_refuses_a_second_cancel
ACP errorsrequiredCheckout session and cart failures are ACP Error bodies (type, code, message, param) with the matching status (404 session_not_found, 403 forbidden, 405, 422, …)acp_rest_binding_test::headers_are_required_and_errors_are_acp_errors, acp_rest_binding_test::an_unknown_session_is_404_session_not_found
ACP REST metricsrequiredorchestrator_operation_calls_total / _latency_seconds with operation="acp_rest_<operation>", status = success or the ACP error code, plus the acp_checkout_session_*_total / acp_cart_*_total countersacp_rest_binding_test::rest_calls_are_counted_timed_and_errors_labelled_by_code
Delegate paymentoptionalPOST /api/v1/acp/delegate_payment calls the configured PSP delegation adapter and returns the PSP’s delegated token (never the caller’s own); returns 501 with code: NOT_CONFIGURED when PAYMENT_DELEGATION_BASE_URL is unsethonest_discovery_test::delegate_payment_returns_the_psp_token_when_configured, honest_discovery_test::delegate_payment_returns_501_when_no_psp_delegation_is_configured
Cart CapabilityrequiredPOST/GET/PUT /api/v1/acp/carts (+ POST .../cancel) take CartCreateRequest / CartUpdateRequest and return Cart (validated against the vendored schema.cart.json), cart_-prefixed ids, priced in UCP_CATALOG_CURRENCY (400 currency_required when unset); PUT replaces the contents; a canceled cart is 404 not_foundacp_rest_binding_test::cart_lifecycle_uses_the_acp_cart_shapes, acp_rest_binding_test::a_cart_needs_a_configured_currency
Discovery documentrequiredGET /.well-known/acp.json returns protocol (name/version/supported_versions), api_base_url, transports (rest, mcp), and capabilities.services with checkout and carts; delegate_payment appears only when a delegation adapter is configureddiscovery_test::well_known_acp_returns_200_and_manifest, honest_discovery_test::acp_discovery_hides_delegate_payment_until_a_psp_is_configured
Discovery advertisement (UCP)required/.well-known/ucp → orchestrator.acp_discovery points at /.well-known/acp.json (the 2026-04-08 profile still lists a transport: acp binding)discovery_test::discovery_advertises_acp_signing_and_payment_handlers
ACP MCP transport binding: toolsrequiredPOST /api/v1/acp/mcp serves exactly the five tools of the vendored spec/2026-04-17/openrpc/openrpc.agentic_checkout.json; inputSchema = the OpenRPC params with every $ref bundled into the tool’s $defs, outputSchema = the result schema. Delegate payment stays REST-only, as the binding scopes it outacp_mcp_binding_test::tools_list_matches_the_openrpc_methods_with_bundled_schemas, acp_mcp_binding_test::the_input_schemas_accept_the_official_examples
ACP MCP transport binding: lifecyclerequiredcreate, get, update, complete and cancel run the shared run_acp_* code of the REST binding; results are the ACP CheckoutSession / CheckoutSessionWithOrder (validated against the vendored 2026-04-17 schema), also given as MCP structuredContent and content[]; sessions are readable over RESTacp_mcp_binding_test::checkout_lifecycle_returns_acp_sessions_and_an_order, acp_mcp_binding_test::a_session_created_over_mcp_is_readable_over_rest, acp_mcp_binding_test::cancel_is_idempotent_and_takes_an_optional_payload
ACP MCP transport binding: inputsrequiredmeta.api_version negotiated like API-Version; payload validated against the ACP request schema (invalid_request / invalid_payload with a JSONPath param); merchant from meta.merchant_id, else UCP_DEFAULT_MERCHANT_ID, else merchant_requiredacp_mcp_binding_test::a_payload_that_breaks_the_acp_schema_is_an_invalid_request, acp_mcp_binding_test::an_unsupported_api_version_lists_the_supported_ones, acp_mcp_binding_test::without_a_merchant_the_session_is_refused
ACP MCP transport binding: idempotencyrequiredcomplete replays by meta.idempotency_key, or by session when absent; a key spent on another session is idempotency_conflict; cancel is idempotentacp_mcp_binding_test::completing_again_with_the_same_key_replays_the_order, acp_mcp_binding_test::completing_without_a_key_is_still_idempotent_per_session, acp_mcp_binding_test::a_key_spent_on_another_session_is_an_idempotency_conflict
ACP MCP transport binding: errors and tenancyrequiredACP errors are JSON-RPC -32000 with a schema-valid ACP Error in data; malformed calls -32602; another tenant’s session forbidden; MCP server auth failures are HTTP 401acp_mcp_binding_test::an_unknown_session_is_session_not_found, acp_mcp_binding_test::malformed_tool_calls_are_invalid_params, acp_mcp_binding_test::another_tenants_session_is_forbidden, acp_mcp_binding_test::a_caller_without_credentials_is_refused_at_the_mcp_server
ACP MCP transport binding: discoveryrequired/.well-known/acp.json lists transports: ["rest", "mcp"] and validates against the vendored DiscoveryResponse schema; the endpoint URL is out of band, as ACP specifiesacp_mcp_binding_test::acp_discovery_lists_the_mcp_transport
ACP MCP transport binding: metricsrequiredorchestrator_operation_calls_total / _latency_seconds with operation="acp_mcp_<tool>", status = success or the ACP error codeacp_mcp_binding_test::tool_calls_are_counted_timed_and_errors_labelled_by_code
Delegate payment body (2026-04-17)not_supported_yetPOST /api/v1/acp/delegate_payment keeps its earlier token-exchange body. The 2026-04-17 DelegatePaymentRequest carries raw card data (payment_method.number) and an allowance, which is the PSP’s vault API: a merchant-side orchestrator should not receive card numbersconformance review
AP2 / MPP on ACP completenot_supported_yet2026-04-17 PaymentData has no room for the earlier payment_method_type, ap2_consent_proof and mpp_* fields, so ACP completes pay by handler token only; AP2 and MPP stay on /api/v1/checkout/executeconformance review
Idempotent replay of create/update/cancelnot_supported_yetIdempotency-Key is required and echoed on every mutating route, but only complete replays a stored outcome (Idempotent-Replayed is never sent); a retried create makes a new sessionconformance review
Feed APInot_supported_yetAgent-hosted feed push is out of scope for merchant middlewareconformance review
Native Orders enrichmentnot_supported_yetACP’s order-enrichment fields (carrier tracking, fulfillment events pushed back into ACP orders) are not implemented; order data remains orchestrator-native via /api/v1/orders and /api/v1/ucp/ordersconformance review
Delegate authentication (3DS2), seller sideoptionalSee Payment authentication (3DS2): authentication_required + authentication_metadata + requires_3ds on REST and ACP MCP, then complete with authentication_result; intervention_types: ["3ds"] in acp.json only with a 3DS-capable payment provideracp_delegate_authentication_test
Delegate authentication provider API (/delegate_authentication)not_supported_yetThe authentication-provider endpoints (create / authenticate / retrieve an authentication session with raw card data) belong to the agent’s authentication provider, typically a PSP; the orchestrator is the seller and does not proxy card numbersconformance review

Decisions where the specs are silent

Choices made where MCP 2026-07-28 or ACP 2026-04-17 leave the behaviour open, each the conservative one (fail closed, keep existing clients working, advertise only what is served):

TopicDecision
MCP request without OriginServed: server-side agents send none. A present Origin must be listed in MCP_ALLOWED_ORIGINS (default: none); same-origin is not trusted, as DNS rebinding controls Host
MCP request without MCP-Protocol-VersionTreated as a pre-2025-06-18 client and served as before (the spec allows it), unless _meta names a version, which is 400, -32020
MCP notification headersNot defined by the revision: a notification is held only to the headers it sends
MCP cache hintsttlMs: 300000, cacheScope: "private" on list/discover results (they depend on credentials); ttlMs: 0 on resources/read
ACP merchantACP has no merchant field: meta.merchant_id (MCP only), else UCP_DEFAULT_MERCHANT_ID, else merchant_required
ACP cart currencyACP lets the seller choose: UCP_CATALOG_CURRENCY, else currency_required
ACP canceled cartACP carts have no status, so a canceled cart is 404 not_found
ACP MCP complete without meta.idempotency_keyThe session id is the key (acp-mcp-complete:{id}), so a retry replays instead of paying twice
ACP MCP resultsThe CheckoutSession is the result (ACP) and is repeated as structuredContent and content[] (MCP)
ACP payload fields without a backendfulfillment_details, selected_fulfillment_options, discounts, intent_trace, buyer on create/update are validated, then ignored; purchase-order payments are unsupported_payment_method
ACP payment declined402, processing_error / payment_declined
ACP REST session updatePOST as specified; the earlier PUT stays as an alias

Order Query API

CapabilityStatusAcceptance CriteriaEvidence
Order retrieval by IDrequiredGET /api/v1/orders/:id returns order with tenant isolationapi_integration_test
Tenant-scoped order listingrequiredGET /api/v1/orders returns orders for the authenticated tenant, most recent firstapi_integration_test
OrderStore list_by_tenantrequiredAll store implementations (InMemory, FileBacked, Postgres) support list_by_tenantorder.rs tests

Webhook Event Delivery

CapabilityStatusAcceptance CriteriaEvidence
Webhook registrationrequiredPOST /api/v1/webhooks registers a webhook with URL, secret, and optional event filterapi_integration_test
Webhook listingrequiredGET /api/v1/webhooks returns tenant-scoped webhook registrationsapi_integration_test
Webhook unregistrationrequiredDELETE /api/v1/webhooks/:id removes a webhookapi_integration_test
HMAC-SHA256 signingrequiredWebhookDeliverer signs payloads with X-Webhook-Signature using the registration secretwebhooks.rs HMAC test
RFC 9421 signed webhooks (UCP)required when signing keys are configuredWith UCP signing keys configured, every delivery also carries Content-Digest and an RFC 9421 Signature-Input/Signature (sig1) by the active key, covering @method, @authority, @path, @query (when present), content-digest and content-type. It verifies against the discovery keys[] JWK. A delivery that cannot be signed is not sent and counts webhook_signing_failure_totalsigned_webhooks::webhooks_carry_signatures_verifiable_with_the_published_keys, ucp_signing::a_signed_webhook_verifies_under_the_published_keys, ucp_signing::a_signed_webhook_covers_the_query_when_the_url_has_one, webhook_delivery_metrics_test::a_configured_signer_adds_message_signatures_beside_the_hmac, webhook_delivery_metrics_test::a_delivery_that_cannot_be_signed_is_not_sent_unsigned
Outbox delivery via webhooksrequiredWebhookDeliverer implements OutboxDeliverer and delivers to matching registrations of the tenant that owns the event; the topic lookup is tenant-scoped in every storewebhooks.rs::a_topic_lookup_never_crosses_tenants, webhook_delivery_metrics_test::another_tenants_endpoint_is_not_called

Catalog

CapabilityStatusAcceptance CriteriaEvidence
Catalog item lookuprequiredGET /api/v1/catalog/items/:id and POST /api/v1/ucp/catalog/product return catalog item detailsapi_integration_test
Catalog batch lookuprequiredPOST /api/v1/ucp/catalog/lookup returns found products and UCP messages for missesapi_integration_test
Catalog searchrequiredPOST /api/v1/ucp/catalog/search returns matching products through provider-backed searchapi_integration_test, catalog_http_test
Discovery capabilityrequiredLatest discovery advertises dev.ucp.shopping.catalog.lookup and dev.ucp.shopping.catalog.searchdiscovery_test

AP2 (Agent Payments Protocol)

CapabilityStatusAcceptance CriteriaEvidence
Payment intent fieldsrequiredCheckoutRequest.payment_intent accepts payment_handler_id and ap2_consent_proof; validation rejects empty handler_id when providedcontract.rs, validation.rs, authz_and_adapters
AP2 metadata extractionrequiredextract_ap2_metadata(request) returns handler_id and consent_proof for logging/audit without PIIadapters.rs, pii.rs, authz_and_adapters
Mandate/credential verification (strict mode)required when AP2 mode enabledWhen AP2_STRICT=1: verify structured consent proof fields, signature presence, issuer trust policy, expiry, and payment_handler binding; reject on invalid or missing required artifactsap2_verification tests
AP2 0.2 HNP open/closed mandatesrequiredOpen mandate (mandate.checkout.open.1) + closed payment mandate with amount/currency constraints; fail closed on constraint mismatchauthz_and_adapters
Replay protection for mandatesrequiredMandate ID deduplication prevents AP2 consent proof replay until mandate expiryauthz_and_adapters replay test; runtime MandateDedupeStore

MPP (Machine Payments Protocol)

CapabilityStatusAcceptance CriteriaEvidence
Payment intent MPP fieldsrequiredCheckoutRequest.payment_intent accepts payment_method_type="mpp", mpp_method, and mpp_intent; MPP credentials are supplied in token_or_referencecontract.rs, validation.rs, authz_and_adapters
MPP metadata extraction for auditrequiredAdapter extraction provides method/intent metadata without exposing credential payloads in logsadapters.rs, authz_and_adapters
MPP capability flag in discoveryrequiredDiscovery capability flags include dev.ucp.payments.mpp=true for staged rollout signalingucp_mapping.rs, discovery_test
Downstream payment adapter forwarding hintsoptionalHTTP payment adapter forwards MPP context to downstream payment services (X-Payment-Method, X-Mpp-Method, X-Mpp-Intent) when payment method is MPPintegration-adapters/src/payment.rs, adapters_http_test
Payment challenge binding primitivesoptionalMppChallenge binds with HMAC-SHA256 over the published draft-httpauth-payment vectors; credentials and receipts encode/decode as base64url JCSorchestrator-api/src/mpp.rs, mpp_wire
402 Payment challenge on checkoutoptionalWith MPP_CHALLENGE_SECRET set, an MPP POST /api/v1/checkout/execute without a credential gets 402, Cache-Control: no-store, an RFC 9457 payment-required problem, and WWW-Authenticate: Payment. The challenge is bound to realm, method, intent, a charge request (amount string, lowercase currency), expires, the body’s RFC 9530 digest, header="Payment-Authorization" and a nonce in opaque. Unconfigured, MPP checkouts are not challengedmpp_checkout_test::an_mpp_checkout_without_a_credential_is_challenged, mpp_checkout_test::without_a_challenge_secret_mpp_checkout_is_not_challenged, mpp_checkout_test::other_payment_methods_are_not_challenged
Credential verification and single useoptionalThe credential is read only from Payment-Authorization (one header, else 400). Its echoed challenge must match this request and verify under the secret; an unexpired, unused id is claimed once in the persisted replay store. Refusals are 402 with a fresh challenge: malformed-credential, invalid-challenge (edited, other body, reused), payment-expired, verification-failed (provider refused the proof)mpp_checkout_test::a_credential_is_accepted_only_once, …::a_credential_cannot_pay_for_a_different_request, …::an_edited_challenge_is_refused, …::an_expired_challenge_is_refused, …::a_malformed_credential_is_refused_with_a_fresh_challenge, …::a_declined_proof_is_refused_with_a_fresh_challenge
Payment-ReceiptoptionalA completed MPP checkout carries Payment-Receipt (status: success, method, RFC 3339 timestamp, reference, challengeId) and Cache-Control: private; errors never carry one. Metrics: mpp_challenge_issued_total, mpp_receipt_issued_total, mpp_credential_rejected_<problem>_total, mpp_credential_check operation latencympp_checkout_test::a_valid_credential_completes_checkout_with_a_receipt, mpp_checkout_test::challenges_receipts_and_rejections_are_counted
MPP over MCP: payment requiredoptionalWith MPP_CHALLENGE_SECRET set, an execute_checkout tools/call on the native MCP server (/api/v1/mcp/message) whose payment_intent.payment_method_type is mpp and that carries no params._meta["org.paymentauth/credential"] gets JSON-RPC error -32042 Payment Required with data.httpStatus: 402, data.challenges[] (the challenge as a JSON object, no header) and data.problem (RFC 9457). The challenge’s digest is the RFC 9530 digest of the JCS-canonical tool arguments. Unconfigured, or for other payment methods and tools, nothing is challengedmpp_mcp_test::an_mpp_tool_call_without_a_credential_is_payment_required, …::without_a_challenge_secret_an_mpp_tool_call_is_not_challenged, …::other_payment_methods_are_not_challenged, …::other_tools_ignore_a_credential
MPP over MCP: credential and receiptoptionalThe credential is the draft’s JSON object in params._meta["org.paymentauth/credential"], checked and claimed once exactly as over HTTP and handed to the payment provider base64url-encoded. Refusals are -32042 with a fresh challenge (malformed-credential, invalid-challenge, payment-expired); a proof the provider refuses is -32043 Payment Verification Failed with a fresh challenge. A completed checkout carries result._meta["org.paymentauth/receipt"] (status, method, timestamp, reference, challengeId) beside the 2026-07-28 server _meta. Metrics: the mpp_* counters plus mpp_mcp_challenge_issued_total, mpp_mcp_receipt_issued_total, mpp_mcp_credential_rejected_<problem>_total, mpp_mcp_credential_check latencympp_mcp_test::a_valid_credential_completes_checkout_with_a_receipt_in_meta, …::a_credential_is_accepted_only_once, …::a_credential_cannot_pay_for_different_arguments, …::a_wrong_amount_is_refused, …::a_wrong_realm_is_refused, …::an_expired_challenge_is_refused, …::a_malformed_credential_is_refused_with_a_fresh_challenge, …::a_declined_proof_is_verification_failed_with_a_fresh_challenge, …::a_modern_client_gets_the_receipt_beside_the_server_meta, …::mcp_challenges_receipts_and_rejections_are_counted_per_transport
MPP over MCP: capability advertisementnot_supported_yetserver/discover and tools/list do not advertise MPP: no published MPP MCP transport source defines a capability or discovery key, so the -32042 challenge is the only signalconformance review
MPP on UCP (REST, MCP, A2A complete)not_supported_yetUCP 2026-08-25 pays through payment handlers and instruments, and no published handler specification defines MPP; complete_checkout takes no Payment credentialconformance review
MPP on ACP (REST and MCP complete)not_supported_yetACP 2026-04-17 PaymentData carries a handler token only and defines no MPP instrument or credential fieldconformance review
MPP on A2A (native checkout and SendMessage)not_supported_yetNeither A2A 1.0, AP2 0.2 nor the MPP drafts define a DataPart or metadata key for MPP challenges, credentials or receiptsconformance review

Acceptance Criteria (Summary)

  1. Discovery: A client can GET /.well-known/ucp and learn UCP profile, ACP/MCP/A2A/AP2 version metadata, signing keys, and payment handlers; every advertised capability is implemented.
  2. REST / UCP / ACP: Cart, checkout lifecycle, catalog, order, payment, and ACP session/cart endpoints behave as documented; auth and tenant checks enforced; ACP POST routes require Idempotency-Key; ACP discovery is published at /.well-known/acp.json.
  3. A2A/MCP: Adapter layer converts A2A (and MCP dual-era) requests into domain types and executes via the same facade; policy and idempotency unchanged.
  4. AP2 0.2: Payment intent carries AP2 fields; strict mode verifies closed and optional open (HNP) mandates with constraint binding.
  5. MPP: Payment intent can carry MPP method metadata; discovery advertises MPP capability flag; with a challenge secret configured, REST checkout runs the 402 Payment challenge / credential / receipt flow and the native MCP execute_checkout tool runs the MPP MCP transport (-32042, _meta credential and receipt).

Machine-Readable Conformance (for CI)

Conformance is asserted by the following tests; CI runs them in the “Conformance (discovery, REST binding, signatures, A2A, AP2, MPP)” step:

  • cargo test -p orchestrator-http --test discovery_test — discovery endpoint, advertised capabilities, capability-route parity, A2A/ACP routes
  • cargo test -p orchestrator-http --test ucp_negotiation_test — platform profile negotiation on the UCP REST and MCP bindings: errors, intersection, caching, metrics
  • cargo test -p orchestrator-http --test ucp_profile_schema_test — /.well-known/ucp validates against the official UCP 2026-08-25 business profile schema; profile rules the schema cannot express
  • cargo test -p orchestrator-http --test ucp_response_schema_test — cart, checkout and order bodies validate against the official UCP schemas
  • cargo test -p orchestrator-http --test ucp_fulfillment_schema_test — fulfillment objects validate against the official UCP fulfillment schema
  • cargo test -p orchestrator-http --test ucp_rest_binding_test — every UCP REST binding operation is routed at its spec path
  • cargo test -p orchestrator-http --test ucp_mcp_binding_test — UCP’s MCP binding: tools match the official OpenRPC, results validate against the UCP schemas, idempotency, tenancy, error mapping, discovery, metrics
  • cargo test -p orchestrator-http --test ucp_signature_test and cargo test -p orchestrator-api --test ucp_signing — RFC 9421 signatures, Content-Digest, ES256/Ed25519, UCP error codes, RFC 9421 test vector
  • cargo test -p orchestrator-api --test signed_webhooks — webhook deliveries verify against the discovery JWKs
  • cargo test -p orchestrator-http --test a2a_binding_test — A2A 1.0 Agent Card, SendMessage, SendStreamingMessage over SSE, the JSON-RPC binding, task operations, error shape
  • cargo test -p orchestrator-http --test ucp_a2a_binding_test — UCP’s A2A checkout binding: envelopes validate against the official transports/a2a_message.json, checkouts against shopping/checkout.json; idempotency, tenancy, error mapping, discovery, metrics
  • cargo test -p orchestrator-api --test authz_and_adapters — authz, AP2 0.2 HNP, A2A version negotiation, AP2 strict mode
  • cargo test -p orchestrator-http --test mpp_checkout_test — MPP 402 challenge, credential binding and single use, receipts, problem types
  • cargo test -p orchestrator-http --test mpp_mcp_test — MPP over MCP: -32042 challenge, _meta credential, single use, -32043, _meta receipt, per-transport metrics
  • cargo test -p orchestrator-http --test ucp_payment_authentication_test — UCP Payment Authentication actions validate against the official schema; discovery, resume, failure
  • cargo test -p orchestrator-http --test acp_delegate_authentication_test — ACP authentication_required, authentication_result, 3ds intervention advertisement
  • cargo test -p orchestrator-http --test checkout_terminal_status_test — completed and canceled checkouts read back terminal and refuse changes on UCP REST/MCP/A2A and ACP REST/MCP
  • cargo test -p orchestrator-api --test payment_authentication — 3DS2 pause, idempotent retry, resume, fail-closed paths, restart
  • cargo test -p orchestrator-mcp — MCP dual-era discover / version errors / legacy initialize
  • cargo test -p orchestrator-http --test acp_rest_binding_test — ACP REST checkout sessions and carts against the 2026-04-17 schemas: bodies, errors, idempotency, tenancy, metrics
  • cargo test -p orchestrator-http --test acp_mcp_binding_test — ACP’s MCP binding: tools match the official OpenRPC, results and errors validate against the ACP 2026-04-17 schemas, idempotency, tenancy, discovery, metrics
  • cargo test -p orchestrator-http --test mcp_transport_test — MCP 2026-07-28 Streamable HTTP rules (Origin, Mcp-Method/Mcp-Name, status codes, back-compat) on every MCP endpoint

CI must pass these before claiming alignment in release notes.

Runbooks

Operational procedures for a running orchestrator. Each one says when it applies, how to diagnose the problem, and what to do about it.

RunbookUse it when
Retries and outboxWebhooks are late or missing, the outbox is growing, or you need to tune delivery retries and backoff
Dead-letter handlingMessages exhausted their delivery attempts and need to be inspected and replayed
ReconciliationThe orchestrator’s payment state and your payment provider’s state may have drifted apart

The operations endpoints these runbooks use (/api/v1/ops/outbox/process, /api/v1/ops/dead-letter, /api/v1/ops/dead-letter/replay, /api/v1/ops/reconciliation) are described in the consumption guide. How the outbox, dead-letter and inbox fit together is shown in the architecture page.

Runbook: Outbox retries and webhook delivery

Overview

The orchestrator writes external side effects (for example order.created) to an outbox as part of committing a checkout. A background processor runs inside the server process and drains that outbox, delivering each message to every webhook registration whose topic filter matches.

Since v0.9.0 you do not need to call the processor yourself. Earlier releases exposed process_outbox_once but never ran it, so in a deployed server the outbox grew without bound and no webhook was ever delivered.

flowchart LR
  Checkout[execute_checkout] -->|enqueue| Outbox[(outbox)]
  Processor[Background processor] -->|dequeue| Outbox
  Processor -->|POST + HMAC + RFC 9421 when keys are set| Subscriber[Your webhook endpoint]
  Processor -->|attempts exhausted| DeadLetter[(dead_letter)]
  DeadLetter -->|replay| Outbox

Configuration

SettingEnv varDefaultMeaning
outbox.interval_msOUTBOX_INTERVAL_MS500Pause between polls when the queue is empty
outbox.batch_sizeOUTBOX_BATCH_SIZE32Messages handled per wake-up
outbox.max_attemptsOUTBOX_MAX_ATTEMPTS5Delivery attempts before dead-lettering
outbox.drain_timeout_secsOUTBOX_DRAIN_TIMEOUT_SECS10How long shutdown waits for the queue to drain
outbox.retry_backoff_msOUTBOX_RETRY_BACKOFF_MS500Pause after a failed delivery, doubled per attempt
outbox.max_retry_backoff_secsOUTBOX_MAX_RETRY_BACKOFF_SECS30Ceiling for that pause

When the queue is non-empty the processor keeps working without pausing, so interval_ms only controls idle polling. A failed delivery is the exception: it pauses for retry_backoff_ms doubled per attempt (capped), so an endpoint that is down is retried slowly instead of spending every attempt within milliseconds and dead-lettering messages that a later retry would have delivered.

Multi-replica operation

The Postgres outbox claims with FOR UPDATE SKIP LOCKED, so every replica can run its own processor without delivering the same message twice. No leader election or singleton deployment is required.

A claim is a lease, not a delete: the row keeps a locked_until stamp and is only removed once delivery has been acknowledged, so a replica that dies mid-delivery leaves the message for whoever claims it after the lease expires (60s). The trade-off is at-least-once delivery — a subscriber that received the request just before a crash can see it again, so webhook handlers should be idempotent on X-Webhook-Id.

Delivery is scoped per tenant: an event is offered only to the webhooks registered by the tenant that owns it.

Shutdown behaviour

On SIGTERM or SIGINT the server stops accepting new work, signals the processor to stop, and waits up to drain_timeout_secs for the queue to empty. If the drain times out, a warning is logged and the remaining messages stay in the outbox for the next process (or another replica) to pick up. Nothing is lost.

Metrics

MetricTypeWhat it tells you
orchestrator_queue_depth{queue="outbox"}gaugeCurrent backlog. Sustained growth means downstream failure or insufficient throughput.
orchestrator_queue_depth{queue="dead_letter"}gaugeMessages that exhausted their attempts and need investigation.
orchestrator_delivery_attempts{operation="outbox_delivery"}histogramAttempts consumed before a message settled, split by status.
orchestrator_events_total{name="webhook_delivery_success_total"}counterDeliveries accepted by a subscriber.
orchestrator_events_total{name="webhook_delivery_failure_total"}counterDeliveries rejected or unreachable.
orchestrator_events_total{name="outbox_dead_letter_total"}counterMessages moved to dead-letter.
orchestrator_operation_latency_seconds{operation="webhook_delivery"}histogramPer-subscriber delivery latency.
orchestrator_events_total{name="webhook_signing_failure_total"}counterDeliveries not sent because they could not be signed (counted as failed attempts).

Suggested alerts:

  • orchestrator_queue_depth{queue="outbox"} above a few hundred for more than five minutes — the backlog is not clearing.
  • Any increase in orchestrator_queue_depth{queue="dead_letter"} — a subscriber has been failing long enough to give up on.

Both are charted on the starter Grafana board at deploy/grafana/orchestrator-dashboard.json, scraped via deploy/kubernetes/servicemonitor.yaml.

Counter families are registered without a _total suffix and the Prometheus encoder appends it, so the names above are exactly what /metrics exposes.

Delivery contract

Each delivery is a POST with a JSON body of { id, topic, payload, correlation_id } and these headers:

  • X-Webhook-Id — the outbox message id, stable across retries. Use it to deduplicate on your side.
  • X-Webhook-Topic — the event topic.
  • X-Webhook-Signature — hex HMAC-SHA256 of the raw body using the secret you supplied at registration. Verify it before trusting the payload.
  • Content-Digest, Signature-Input, Signature — when the deployment has UCP signing keys (UCP_SIGNING_KEY), every delivery also carries an RFC 9421 message signature (label sig1) by the active key. It covers @method, @authority, @path, @query (when the URL has one), content-digest and content-type. Verify it with the JWK named by keyid in the top-level keys[] of /.well-known/ucp, as UCP requires for business-to-platform webhooks. Unlike the HMAC, this needs no shared secret. A delivery that cannot be signed is not sent unsigned; it fails and is retried.

Any 2xx is treated as accepted. Anything else, including a connection failure, counts as a failed attempt.

Operational steps

  1. Watch the depth gauges. A rising outbox means downstream unavailability or too small a batch size; a rising dead-letter count means a subscriber has been failing past max_attempts.
  2. Inspect dead-letter with facade.list_dead_letter().await; each entry carries id, topic, correlation_id, and attempts.
  3. Fix the cause first, then replay with facade.replay_from_dead_letter(&message_id).await, which returns the message to the outbox with attempts reset to zero.
  4. Registrations are durable. They live in the webhooks table under Postgres and in webhooks.json under file-backed persistence, so they survive restarts.

Failure behaviour

  • Deliverer returns Ok — the message is consumed and removed from the outbox.
  • Deliverer returns Err — attempts is incremented; the message is re-enqueued, or moved to dead-letter once attempts exceeds max_attempts.
  • No matching registration — delivery succeeds trivially and the message is consumed. An event with no subscriber is not an error.
  • Idempotency — checkout and payment lifecycle calls use idempotency keys, so a duplicate request with the same key returns the original result without re-running side effects.

Runbook: Dead-letter queue handling

When messages reach dead-letter

Messages are moved to the dead-letter queue when they exceed the configured max_attempts in process_outbox_once(max_attempts).

Diagnostics

  • List entries: facade.list_dead_letter().await returns all dead-letter messages with id, topic, payload, correlation_id, and attempts.
  • Use correlation_id to correlate with checkout/transaction logs and trace the original request.

Replay

  1. Identify the message id from list_dead_letter().
  2. Fix the root cause (e.g. downstream API availability, schema change, or configuration).
  3. Replay: facade.replay_from_dead_letter(&message_id).await. Returns true if the message was found and re-enqueued.
  4. The message is re-enqueued with attempts reset to 0 and will be processed again by the next process_outbox_once run.

Do not

  • Replay in a tight loop without fixing the cause; messages will fail again and return to dead-letter.
  • Delete or clear dead-letter without logging or archiving if you need an audit trail.

Runbook: Payment reconciliation

Overview

Reconciliation compares the orchestrator’s durable view of payment state (per transaction) with the payment provider’s view (when the provider implements get_payment_state). In v0.2.0, the persistent facade keeps payment state across restart for checkout outcomes and lifecycle transitions. Use reconciliation to detect drift (e.g. captured in our store but voided at the provider).

Running reconciliation

  1. Collect transaction IDs to reconcile (e.g. from your orders or time window).
  2. Call facade.run_reconciliation(&transaction_ids).await.
  3. Inspect report.mismatches: each entry has transaction_id, our_state, and provider_state (if the provider returned a state).
  4. If you need to inspect one transaction directly, read the stored state through the facade before or after a restart and compare it with provider telemetry.

Handling mismatches

  • Our state differs from provider: Investigate whether the provider was updated outside the orchestrator (e.g. manual void/refund) or a previous call failed after we updated our state. Align data or correct the provider state as per your policy.
  • Provider does not support get_payment_state: Default implementation returns None; reconciliation then never reports a mismatch for that provider. Implement get_payment_state on your payment provider adapter to enable drift detection.

Scheduling

Run reconciliation periodically (e.g. daily) over recent transaction IDs and alert on non-empty mismatches.

Release checklist

Before cutting a release (e.g. GitHub tag and release notes), complete the following.

Pre-release

  • All pipelines pass before push/release:
    • CI (.github/workflows/ci.yml): format, clippy, tests, Postgres backend, release-gate.
    • Audit (.github/workflows/audit.yml): cargo audit (dependency vulnerabilities).
  • For first version / branch protection: require both CI and Audit as status checks so no push or merge succeeds until both pass.
  • CHANGELOG.md is updated for the release version and date.
  • Version in root Cargo.toml (workspace.package) and any crate-specific overrides is set to the release version, and every pinned reference follows it: the README badge, the image tag in deploy/kubernetes/, README.md, deploy/README.md and docs/plug-and-deploy.md, the Helm chart’s appVersion, and version plus the image tag in server.json. deploy_manifests_test fails on any that lag.
  • Runbooks are up to date: docs/runbooks/retries-and-outbox.md, dead-letter-handling.md, reconciliation.md.
  • Production docs and config examples include PUBLIC_BASE_URL so discovery never advertises localhost in a release deployment.
  • Kubernetes manifests and deployment docs agree on the supported replica/storage topology for file-backed persistence.

Acceptance

  • cargo test --workspace passes locally.

  • Postgres backend tests pass against a live database — they skip silently without DATABASE_URL, so running them is not optional before a release:

    docker compose up -d postgres
    DATABASE_URL=postgres://orchestrator:secret@localhost:5432/orchestrator \
      cargo test -p orchestrator-runtime --test postgres_backend_test
    DATABASE_URL=postgres://orchestrator:secret@localhost:5432/orchestrator \
      cargo run -p orchestrator-http --bin orchestrator-server -- --migrate
    
  • Security and authz tests pass (authorize_checkout, tenant mismatch, missing scope, cross-tenant idempotency; API integration tests for 401 when auth required and missing/invalid token).

  • Conformance tests pass: cargo test -p orchestrator-http --test discovery_test and cargo test -p orchestrator-api --test authz_and_adapters (discovery, A2A, AP2 strict).

  • Persistent restart-recovery test passes (persistent_runner_restart_returns_same_idempotent_result).

  • Payment lifecycle persistence test passes (payment_lifecycle_state_survives_restart).

  • Payment reconciliation and lifecycle tests pass.

  • Outbox/dead-letter and duplicate-delivery tests pass.

Release

  • Push the release commit and wait until CI and Audit pass on that exact commit. Only then tag it.
  • Create and push an annotated tag (e.g. v0.13.0): git tag -a v0.13.0 -m "v0.13.0" then git push origin v0.13.0.
  • Nothing else to do for the GitHub release: pushing the tag runs the Release workflow (.github/workflows/release.yml), which publishes the release with that version’s CHANGELOG.md section copied verbatim as its notes. It fails, and publishes nothing, if CHANGELOG.md has no ## [x.y.z] section for the tag. The notes come from CHANGELOG.md as it is at the tagged commit, so get the section right before tagging, and use absolute links, because relative ones break on the release page.
  • The same tag push runs the Container image workflow (.github/workflows/image.yml): it builds linux/amd64 and linux/arm64 on native runners and publishes ghcr.io/ancientice/commerce-orchestrator-api:<version> and :latest with an SBOM and build provenance. It fails, and publishes nothing, if the tag does not match the Cargo.toml version. Check the run is green and docker pull ghcr.io/ancientice/commerce-orchestrator-api:<version> works. To publish an image for an older tag, run the workflow by hand with that tag.
  • First image only: the GHCR package starts private. Make it public in the package settings and link it to this repository so anyone can pull it.
  • No crates are published to crates.io; Rust consumers pin the tag (see consumer integration).

Post-release

  • Bump version to next development (e.g. 0.1.1 or 0.2.0) in Cargo.toml and add an [Unreleased] section in CHANGELOG.md if using Keep a Changelog.

Optional (supply chain)

  • Generate SBOM (e.g. cargo cyclonedx or cargo sbom) and attach to release.
  • Run a container image vulnerability scan before promoting to production (e.g. scan ghcr.io/ancientice/commerce-orchestrator-api:<version> with Trivy or your registry’s scanner).