Agentic checkout (UCP)

UCP: cancel a checkout

Cancel a checkout that is not yet completed; the response is the checkout with status: canceled. A checkout that is already completed or canceled is returned unchanged with an error message (conflict) and HTTP 200, per the UCP rule that business outcomes are not HTTP errors. Requires a bearer token and the UCP-Agent header; an Idempotency-Key is optional. Sandbox and production sessions behave the same.

post/api/ucp/checkout-sessions/{id}/cancel

Request

  • Base URL: https://www.adadiamonds.com
  • URL: https://www.adadiamonds.com/api/ucp/checkout-sessions/{id}/cancel
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://www.adadiamonds.com/oauth/authorize, token URL https://www.adadiamonds.com/api/oauth/token; client credentials, token URL https://www.adadiamonds.com/api/oauth/token, scopes: cart:write)

Path parameters

idstring required

Checkout session id returned by create.

Headers

UCP-Agentstring required

Platform profile, RFC 8941 dictionary syntax: profile="https://platform.example/.well-known/ucp".

Idempotency-Keystring

Optional but recommended on state-changing requests; a reused key with a different body is rejected with 409.

Request-Idstring

Trace id; echoed back when provided.

Response

Checkout resource inside the ucp envelope. Business outcomes, including not-found and cannot-cancel, are HTTP 200 with messages[].

idstring required
status'incomplete' | 'requires_escalation' | 'ready_for_complete' | 'complete_in_progress' | 'completed' | 'canceled' required
currency'USD' required
expires_atstring date-time
continue_urlstring uri
fulfillmentobject
paymentobject

Example response

{
  "ucp": {
    "version": "2026-04-08"
  },
  "id": "ucp_1f6a5b2e-4c3d-4e5f-8a9b-0c1d2e3f4a5b",
  "order": {
    "label": "#AD-2026-123456"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.