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.
Get the Total
1
Start the checkout
Give the product and its options in the task. Set
maxCost above the price that you expect, so that the checkout can reach the payment step. A buyer profile gives the shipping address that the total depends on.2
Read the total from the payment request
Follow the checkout and answer its questions. When it reaches the payment step, the status is When
awaiting_input and the question is a payment request. When interaction.amount.kind is "exact", interaction.amount.value is the total:amount.kind is "maximum", amount.value is your spending cap, not the total: the merchant did not show a final total before the payment. Do not show it as the price.3
Cancel the checkout
Do not answer the payment request. Cancel the checkout:The cancel request returns
202 Accepted. Keep reading the checkout until its status is cancelled.4
Show the total
Show the total to the user. To buy later, start a new checkout and pay with an order intent. See Pay for a Checkout.
Common Gotchas
The total changes before the purchase
The total changes before the purchase
Prices, shipping, and stock can change. The total of a later purchase can be different. Set
maxCost on the purchase to the highest total that the user accepts.Each check costs a checkout
Each check costs a checkout
Crossmint bills each checkout that starts, also when you cancel it.
Next Steps
Buy When the Price Drops
Buy automatically under a limit
Pay for a Checkout
Answer a payment request with an order intent
Create a Checkout
Review the complete create request schema

