Skip to main content
One checkout can buy several products from one merchant. List every item in the task. The checkout builds one cart, and your user approves one payment for the total.

Prerequisites

  • Agent Checkouts integration — complete the quickstart.
  • Server key — a production key with agent-checkouts.create, agent-checkouts.read, agent-checkouts.update, and agent-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 maxCost for the total of the order, with shipping and tax.
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.
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

One checkout buys from one merchant. Start one checkout for each merchant.
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