Skip to Content
🚀Agentic Commerce Protocol is now live! Instant Checkout is available in ChatGPT. Learn more →
DocumentationAPI SpecificationsAgentic Checkout Spec

Agentic Checkout Specification

The Agentic Checkout Specification (ACS) defines a standardized REST API that merchants implement to support checkout through AI agents.

The merchant remains the system of record for all orders, payments, taxes, and compliance.

Required Endpoints

MethodEndpointDescription
POST/checkout_sessionsCreate a new checkout session
POST/checkout_sessions/{id}Update an existing session
POST/checkout_sessions/{id}/completeComplete the checkout
POST/checkout_sessions/{id}/cancelCancel the session
GET/checkout_sessions/{id}Get session state

Request Headers

HeaderRequiredDescription
AuthorizationYesAPI key authentication
SignatureYesHMAC Base64-encoded signature
TimestampYesRFC 3339 timestamp
Idempotency-KeyYesUnique request identifier

Create Session

POST /checkout_sessions

Request Body

interface CreateSessionRequest { cart_items: Array<{ product_id: string; variant_id?: string; quantity: number; }>; buyer_context?: { shipping_address?: Address; email?: string; }; currency: string; }

Response (201 Created)

interface CreateSessionResponse { checkout_session_id: string; state: 'not_ready_for_payment' | 'ready_for_payment'; cart: { items: LineItem[] }; totals: Totals; fulfillment_options: FulfillmentOption[]; expires_at: string; }

Complete Checkout

POST /checkout_sessions/{id}/complete

Request Body

interface CompleteCheckoutRequest { payment_data: { token: string; // Shared Payment Token provider: 'stripe'; billing_address?: Address; }; }

Response (200 OK)

interface CompleteCheckoutResponse { checkout_session_id: string; state: 'completed'; order: { order_id: string; order_number: string; permalink_url: string; status: 'confirmed'; }; }

Data Types

Totals

All amounts in minor currency units (cents for USD).

interface Totals { items_base_amount: number; items_discount: number; subtotal: number; discount: number; fulfillment: number; tax: number; fee: number; total: number; }

Address

interface Address { line1: string; line2?: string; city: string; state?: string; postal_code: string; country: string; }

Signature Verification

import crypto from 'crypto'; function verifySignature( payload: string, signature: string, timestamp: string, secret: string ): boolean { const message = `${timestamp}.${payload}`; const expected = crypto .createHmac('sha256', secret) .update(message) .digest('base64'); return crypto.timingSafeEqual( Buffer.from(signature), Buffer.from(expected) ); }

Error Handling

CodeMeaning
400Invalid request
401Authentication failed
404Session not found
405Invalid state transition
429Rate limited

See Error Codes for details.

Specification maintained by OpenAI and Stripe

AboutPrivacyTermsRSS

Apache 2.0 · Open Source