Skip to main content

Checkout API

2.1 Capability Identifier

The checkout capability namespace is dev.ucp.shopping.checkout. It is UCP’s most essential transaction capability, defining the complete flow from creating a shopping session to completing payment.

2.2 Checkout Session State Machine

A checkout session transitions through 6 well-defined states during its lifecycle:
Key design decisions: The requires_escalation state allows merchants to hand control to a human when the AI cannot process a scenario automatically (e.g., legal compliance confirmation for high-value goods). The fallback path from complete_in_progress to incomplete handles exceptions such as payment failures.

2.3 Five Operations

Create — Create Checkout Session

Response:

Get — Query Checkout Session

Returns the complete current state of the session, including all line items, pricing, buyer information, and shipping options.

Update — Update Checkout Session

The Update operation can be called multiple times to incrementally provide information. Once all required information is present, the status automatically transitions to ready_for_complete.

Complete — Submit for Completion

Can only be called when the status is ready_for_complete. After invocation, the status changes to complete_in_progress as the merchant asynchronously processes payment and order creation. On success, the status changes to completed; on failure, it falls back to incomplete. Response:
Final response after completion (retrieved via Get or webhook callback):

Cancel — Cancel Session

Cancellation is allowed from any state except the two terminal states (completed and canceled).

2.4 ISO 4217 Amount Handling

UCP strictly requires all monetary amounts to be expressed in ISO 4217 minor units, avoiding floating-point precision issues:
Developer note: Different currencies have different minor-unit exponents. USD and EUR use 2 digits (divide by 100), JPY uses 0 digits (use directly), and KWD uses 3 digits (divide by 1000). Always consult the ISO 4217 exponent definition during implementation.

2.5 Embedded Checkout UI

When an AI agent cannot complete checkout in pure API mode (e.g., complex payment verification, 3D Secure authentication), UCP supports an embedded UI mode: The embedded UI is triggered via the requires_escalation state. The merchant returns a UI URL in the response:
The embedded UI supports bidirectional communication. After the user completes the required action on the merchant’s page, the session status updates automatically.

2.6 Price Transparency Requirements

UCP mandates complete price transparency. The pricing object in a checkout session must include: Before calling the Complete operation, the AI agent must present the full price breakdown to the consumer and obtain confirmation.
Next chapter: Identity Linking — OAuth 2.0 Authorization Code flow, token revocation, and scope management