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 witham_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
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_changedby updating the cart betweencreate_checkoutandcomplete_checkout. Testreview_mismatchby 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_cartstarts a browser session on Browserbase. - Test and live data don’t mix. Test orders are only visible when querying with a test key.