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

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.