Prerequisites
- Agent Checkouts integration — complete the quickstart and Pay for a Checkout.
- A scheduler — a cron job or a queue in your backend that starts a checkout at fixed times.
- Keys — a production server key with the Agent Checkouts scopes, and a client key with
order-intents.createandorder-intents.read.
Watch the Price and Buy
1
Ask the user to approve the limit
Create an order intent for the limit, for as long as you watch the price. The user approves it one time, in your app. Omit Verify the card rail if it is
merchant: Agent Checkouts gives the merchant when it pays.pending_verification, and store the orderIntentId. See Approve an Order Intent.2
Start a checkout on a schedule
On each run of your scheduler, start a checkout with A buyer profile gives the shipping address, so that the checkout does not stop to ask for it.
maxCost equal to the limit:3
Act on the result
Follow the checkout and act on what happens. Run only one checkout at a time for this purchase: do not start the next scheduled checkout while one is still active.
Common Gotchas
Two checkouts can buy the product twice
Two checkouts can buy the product twice
Each checkout that reaches the payment step can use the order intent while its available amount covers the total. Run one checkout at a time, stop the schedule before you answer a payment request, and cancel the order intent after the purchase.
Each check costs a checkout
Each check costs a checkout
Crossmint bills each checkout that starts, also when it ends as
blocked. Check at a reasonable interval, for example once a day.The limit includes shipping and tax
The limit includes shipping and tax
maxCost applies to the total of the order. Tell the user that the limit includes shipping and tax.The order intent expired
The order intent expired
The payment answer fails after the order intent’s
expiresAt. Ask the user to approve a new order intent, or stop the schedule.Next Steps
Check a Price Without Buying
Get the exact total of an order
Statuses, Results, and Errors
Handle every result of a checkout
Create a Checkout
Review the complete create request schema

