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

# Testing without orders

> Test keys run the full checkout flow without placing a real order or paying a fee.

![Test and live keys run the same flow with different outcomes](https://mintcdn.com/agentmall/ZuoglRqW4CDsIaRs/images/testing.svg?fit=max\&auto=format\&n=ZuoglRqW4CDsIaRs\&q=85\&s=cda17d3ef431a2bcb15e36a507d665dc)

Test keys let your agent run the full checkout flow without placing a real order or paying a fee.

## Test keys vs live keys

| | Test key (`am_test_`) | Live key (`am_live_`) |
| - | - | - |
| Search | Real merchant results (uses daily cap) | Real merchant results (uses daily cap) |
| Cart | Real browser, real merchant cart | Real browser, real merchant cart |
| Checkout review | Read and validated, `review_hash` checked | Read and validated, `review_hash` checked |
| Order placement | **Skipped** — nothing submitted to merchant | Submitted to the merchant |
| Fee | None | \$0.50 per completed order |
| `test` field | `true` | `false` |
| `permalink_url` | Empty | Merchant order URL |

## How it works

A test key runs the identical flow as a live key up to the moment of placement. `create_checkout` opens the real checkout page. `update_checkout` writes a real address and selects a real shipping method. The `review_hash` is computed from the live review and must match.

The difference is at `complete_checkout`: with a test key, the review is read and checked, but nothing is submitted to the merchant. The order is stored with `test: true` and no fee is charged.

## Getting a test key

Mint one on the [API Keys](https://console.getagentmall.com/keys) page in the console. Test keys start with `am_test_`.

## Example

The flow is the same as [Agent searches and buys](https://agentmall.mintlify.site/examples/agent-buys.md). The only difference is the key and the response.

### Complete checkout with a test key

```json theme={null}
{
  "id": "ses_01JB7PK8M2AN4R8D091CD",
  "review_hash": "c3d4e5f6a1b2...",
  "total_minor": 1837
}
```

Response:

```json theme={null}
{
  "id": "ses_01JB7PK8M2AN4R8D091CD",
  "status": "completed",
  "order": { "id": "ord_01JB7QR9N3BP5T3F193BC" },
  "test": true
}
```

### Read the test order

```json theme={null}
{
  "id": "ord_01JB7QR9N3BP5T3F193BC"
}
```

```json theme={null}
{
  "id": "ord_01JB7QR9N3BP5T3F193BC",
  "checkout_id": "ses_01JB7PK8M2AN4R8D091CD",
  "merchant_id": "mrc_walmart",
  "status": "completed",
  "currency": "USD",
  "totals": { "subtotal": 1697, "tax": 140, "total": 1837 },
  "permalink_url": "",
  "test": true
}
```

`permalink_url` is empty because no merchant order exists. `test: true` confirms this was a test.

## What to test

* **Full flow:** create cart → search → add to cart → checkout → complete. Confirm every step returns the expected shape.
* **Error handling:** test `review_changed` by updating the cart between `create_checkout` and `complete_checkout`. Test `review_mismatch` by sending a stale hash.
* **Edge cases:** empty carts (`cart_empty`), unavailable items (`out_of_stock`), and address validation (`invalid_address`).

## Limitations

* **Search uses your daily cap.** Test and live searches draw from the same allowance.
* **Cart operations use a real browser.** Each `create_cart` starts a browser session on Browserbase.
* **Test and live data don't mix.** Test orders are only visible when querying with a test key.

## CI integration

Use a test key in your CI pipeline. The flow exercises real search results and real checkout validation without placing orders or incurring fees.

```bash theme={null}
export AGENTMALL_KEY="am_test_your_key_here"
# run your integration tests
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.