Skip to main content
An agent checkout can change a user’s cart at a merchant without buying. Your agent can add items over several days, tell the user what is in the cart, and check out when the user is ready. The API has no cart endpoint. You write the cart change in the 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, and agent-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 same browser.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 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.
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