Prerequisites
- Agent Checkouts integration — complete the quickstart.
- Server key — a production key with
agent-checkouts.create,agent-checkouts.read,agent-checkouts.update, andagent-checkouts.cancel.
Buy the Items
1
List every item in the task
Give the quantity and the options of each item. When an item is not available, the checkout asks the user whether to replace it, skip it, or cancel. To decide in advance, say it in the task. Set Start at the merchant’s home page when the items are on different product pages. Start at the cart page to buy what is already in the user’s cart. See Manage a Store Cart.
maxCost for the total of the order, with shipping and tax.2
Answer the questions
The checkout can ask about each item, for example a size that the task did not give. See Answer Questions.
3
Approve one payment
The payment request gives the total of the order. Create one order intent for that total, and send its ID. See Pay for a Checkout.
Common Gotchas
The items come from different merchants
The items come from different merchants
One checkout buys from one merchant. Start one checkout for each merchant.
The total is more than the spending cap
The total is more than the spending cap
The checkout ends as
blocked with policy.max_cost_exceeded. result.summary gives the total. Ask the user for a higher limit, then start a new checkout.Next Steps
Manage a Store Cart
Build the cart first, and buy later
Pay for a Checkout
Answer the payment request with an order intent
Create a Checkout
Review the complete create request schema

