task, and a browser profile keeps the cart at the merchant for the next checkout.
Prerequisites
- Agent Checkouts integration — complete the quickstart.
- Browser profile — create one for the user. See Sign In to Stores. Many merchants keep the cart only for a signed-in user.
- Server key — a production key with
agent-checkouts.create,agent-checkouts.read,agent-checkouts.update, andagent-checkouts.cancel.
Change the Cart
1
Start a checkout that only changes the cart
Write the change in the task, and tell the checkout not to pay. Start at the product page to add an item. Start at the merchant’s cart page to remove items, to empty the cart, or to list it.
constraints.maxCost is required. Set it to a value that is higher than the cart total.2
Answer questions and stop any payment request
Follow the checkout and answer its questions, such as a size or a sign-in. See Answer Questions.If a payment request arrives, do not answer it. Cancel the checkout with
POST /api/unstable/agent-checkouts/{runId}/cancel.3
Show the cart to the user
When the checkout ends, read
result.summary. It lists the items in the cart, with the prices and the total. Show it to your user.Check Out Later
When the user is ready to buy, start a normal checkout with the samebrowser.profileId. Start at the merchant’s cart page, with a task such as “Check out the items in the cart. Use standard shipping.” Then answer the payment request with an order intent. See Pay for a Checkout.
Common Gotchas
The cart is empty on the next checkout
The cart is empty on the next checkout
The checkout ran without a browser profile, or the merchant keeps the cart only for a signed-in user. Attach the same
browser.profileId to each checkout, and sign in once. Some merchants also clear a cart after some time.Each cart change is a checkout
Each cart change is a checkout
Crossmint bills each checkout that starts. Group several changes in one task when you can, for example “Add the socks and remove the hat”.
Next Steps
Buy Several Items in One Order
Buy a full cart with one payment
Buy When the Price Drops
Check out later, when the price is right
Create a Checkout
Review the complete create request schema

