> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Test Agent Checkouts

> Test Agent Checkouts on real merchants at low cost, with or without a purchase

You test Agent Checkouts on real merchants from the first call, because each checkout runs real models and a real browser at a real merchant. Use production keys. The first 1,000 checkouts each month are free, you can test it without buying anything, and you choose what to buy and how much to spend. This guide shows how.

## Prerequisites

* **Production project** — Agent Checkouts runs on real merchants, so it uses production keys. Create all keys and settings below in one project in the <a href="https://www.crossmint.com/console" target="_blank">Crossmint Console</a>.
* **Server key** — for Agent Checkouts calls from your server. Scopes: `agent-checkouts.create`, `agent-checkouts.read`, `agent-checkouts.update`, and `agent-checkouts.cancel`. Add the `agent-checkouts.buyer-profiles.*` and `agent-checkouts.browser-profiles.*` scopes when you use profiles.
* **Client key** — for card and approval calls from your app. Scopes: `payment-methods.create`, `payment-methods.read`, `payment-methods.update`, `payment-methods.delete`, `order-intents.create`, `order-intents.read`, `order-intents.revoke`, and `protected-inputs.create`. Add your app's origins to the key.
* **Sign-in** — register the provider that signs in your users, such as Firebase, Auth0, Stytch, or Supabase, under **3P Auth providers**. See [Bring Your Own Auth](/wallets/guides/bring-your-own-auth).
* **One user ID** — with the server key, send the `x-crossmint-user-id` header with the user ID from the user's JWT: the claim that you set for your auth provider in the Console, `sub` by default. The checkout and the user's saved card then belong to the same user.

<Tip>Connect the [Crossmint MCP server](/mcp-server/connect) to your AI assistant, and it can create the production project and both keys for you. Ask it, for example: "In production, create a project for Agent Checkouts, a server key with the agent-checkouts scopes, and a web client key for my app's origin with the payment-methods, order-intents, and protected-inputs scopes."</Tip>

## What Costs Money

| What | Cost |
| - | - |
| A checkout that starts | The first 1,000 checkouts of each month are free. After that, each checkout costs 0.05 USD, also when it ends as `blocked` or `failed`. A create request that fails costs nothing. |
| A completed purchase | The merchant charges the user's card, as for any other online order. |
| A saved card | A project can save up to 50 cards without contacting Crossmint. To save more, <a href="https://www.crossmint.com/contact/sales" target="_blank">contact our sales team</a>. The first 1,000 saved cards are free, and after that each saved card costs 0.05 USD. |

## Test Without a Purchase

### Test the Card Flow in Staging (Optional)

This step is optional. Agent Cards works in staging. Save a card, register it, approve an order intent, and get a credential with the staging test cards. See [Test Agent Cards](/agents/payment-methods/cards/test-agent-cards). Then do the same steps with production keys, for Agent Checkouts.

### Change a Cart Only

A checkout that only adds an item to the cart tests the merchant, your questions UI, and your result handling. Nothing is bought. See [Manage a Store Cart](/agents/checkouts/use-cases/manage-a-cart).

### Stop at the Payment Step

Let the checkout go to the payment step, read the total from the payment request, and cancel the checkout. Do not answer the payment request.

```bash cURL theme={null}
curl --fail-with-body --request POST "https://www.crossmint.com/api/unstable/agent-checkouts/YOUR_RUN_ID/cancel" \
    --header "X-API-KEY: YOUR_SERVER_API_KEY" \
    --header "x-crossmint-user-id: YOUR_USER_ID"
```

See [Check a Price Without Buying](/agents/checkouts/use-cases/check-a-price) for the full steps.

### Set a Low Spending Cap

Set `constraints.maxCost` below the price of the product. The checkout stops before it pays, with the status `blocked` and `result.code: "policy.max_cost_exceeded"`. This tries your handling of a blocked checkout.

## Make Your First Purchase

<Steps>
  <Step title="Choose a low-cost product">
    Choose a product that costs less than 10 USD, from a merchant that sells to your country. Use your own card.
  </Step>

  <Step title="Set the spending cap">
    Set `maxCost` a little above the product's price, so that the checkout stops if the total is unexpected.
  </Step>

  <Step title="Run the checkout">
    Answer the questions, approve an order intent, and read the receipt. See [Pay for a Checkout](/agents/checkouts/payments).
  </Step>

  <Step title="Return or cancel the order">
    Cancel or return the order with the merchant, under the merchant's policy. Use `result.purchase.receipt.merchantOrderId` to find the order.
  </Step>
</Steps>

## Clean Up

* **Delete test cards.** Saved cards count toward the project's limit of 50 saved cards. See [Cancel Card Access](/agents/payment-methods/cards/remove-cards).
* **Cancel unused order intents.** An order intent stays usable until it expires or you cancel it.

## Common Gotchas

<AccordionGroup>
  <Accordion title="A request gets 403 &#x22;Agent Checkouts is only available in production&#x22;">
    The request uses a staging API key. Create a production server key with the Agent Checkouts scopes.
  </Accordion>

  <Accordion title="A server key cannot create an order intent">
    Order intents accept only a client key with the user's JWT. A server key gets "Provided API key must be client specific". Create the order intent in your app, where the user is signed in.
  </Accordion>

  <Accordion title="The checkout cannot use the order intent">
    The checkout and the order intent belong to different users. Send `x-crossmint-user-id` with the user ID claim of the JWT that created the order intent (`sub` by default).
  </Accordion>

  <Accordion title="Saving a card returns payments:payment-method.card-limit-reached">
    The project reached its saved-card limit. Delete test cards, or contact our sales team to raise the limit.
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={3}>
  <Card title="Quickstart" icon="bolt" href="/agents/agent-checkouts-quickstart">
    Test a merchant with OCA, call the API, or add it to your app with one prompt
  </Card>

  <Card title="Statuses, Results, and Errors" icon="list-check" href="/agents/checkouts/statuses">
    Handle every result of a checkout
  </Card>

  <Card title="Create a Checkout" icon="brackets-curly" href="/api-reference/agent-checkouts/create-agent-checkout">
    Review the complete create request schema
  </Card>
</CardGroup>
