Skip to main content
Test and live keys run the same flow with different outcomes Test keys let your agent run the full checkout flow without placing a real order or paying a fee.

Test keys vs live keys

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 page in the console. Test keys start with am_test_.

Example

The flow is the same as Agent searches and buys. The only difference is the key and the response.

Complete checkout with a test key

Response:

Read the test order

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.