Conversation patterns
Your API must handle tool calls arising from all three patterns below. Design your error messages with each flow in mind.Pattern 1: Direct purchase
Pattern 2: Comparison shopping
Pattern 3: Reorder
Failure state handling
Return structured error objects so the agent can relay a precise, actionable message to the user. A vague error is worse than no error — the user has no idea what to do next.Payment declined
Returnretryable: true so the agent offers to retry or switch payment methods.
Out of stock at confirmation
Includealternatives when available. The agent can present them immediately without a new search call.
Invalid shipping address
Flag the specific fields that failed validation so the agent can ask the user to correct only those fields.Checkout session expired
Sessions expire after 15 minutes. Returnretryable: true so the agent automatically creates a new session with the same items — the user should not need to start over.
initiate_checkout again with the original items and resume from the summary step.
Purchase summary requirements
The agent must surface all of the following fields to the user before callingconfirm_purchase. Your initiate_checkout response must include enough data to populate this summary.
| Field | Required | Example |
|---|---|---|
| Product name and variant | Yes | ”Running Shoes — Size 10 Black” |
| Quantity | Yes | ”× 1” |
| Unit price | Yes | ”$129.99” |
| Shipping cost and method | Yes | ”Standard Shipping — $5.99” |
| Tax | Yes | ”Tax — $11.70” |
| Total | Yes | ”$147.68” |
| Delivery estimate | Recommended | ”Arrives April 17” |
| Payment method | Yes | ”Visa ending 4242” |
The agent reads these values directly from your API response. If your
initiate_checkout response omits a required field, the agent cannot surface it — and the user may confirm a purchase without knowing the total.Confirmation flow design
The confirmation step is the most consequential part of the flow. Design it to be unambiguous. Explicit confirmation required. The agent must present the full purchase summary and wait for a clear affirmative response before callingconfirm_purchase.
Cancellation before confirmation. The user must be able to cancel at any point before the confirmation step. Your session state supports this — a session in pending_confirmation can be abandoned without charge.
One confirmation per session. A checkout_id may only be confirmed once. Attempts to re-confirm a confirmed session must return a session_already_confirmed error.
Timeout and expiry handling
Sessions expire 15 minutes after creation. Build your agent loop to handle expiry gracefully at each step:- If
initiate_checkoutis called on an expiredcheckout_id, returnsession_expiredimmediately — do not attempt payment - If the user takes longer than 15 minutes to confirm, the agent should detect the expiry error and automatically create a new session
- Display
expires_atin human-readable form if your UX surface supports it (“Your cart expires in 12 minutes”)
Rate limiting
Implement per-user rate limits on checkout and confirmation endpoints to prevent abuse:- Maximum 5 checkout initiations per user per hour
- Maximum 3 confirmation attempts per checkout session
- Flag unusual patterns — for example, the same item with multiple rapid attempts
Authentication
- Verify user identity through OpenAI’s user identity API when available
- Use short-lived checkout session tokens with a 15-minute expiry
- Log all purchase attempts with user ID, timestamp, and IP address
UX checklist
Before enabling ACP Instant Checkout in production, confirm all of the following:- Purchase summary is shown before any confirmation prompt
- The user must explicitly confirm before the purchase completes
- All error messages are human-readable and actionable
- Alternatives are suggested when a product is unavailable
- Order confirmation includes
order_idand a delivery estimate - Cancellation is possible at any point before confirmation
- Session expiry is handled automatically without user intervention
- Rate limits are enforced per user
Related
UCP checkout
UCP checkout flow for Google AI Mode and Gemini.
ACP tool endpoints reference
Full endpoint schema and response shapes.