Developers
Test mode
A test key lets you build your whole integration without spending anything. Its orders are checked and priced the same way as live ones, but they are never charged, printed or shipped. They move through every status on their own and send the same events.
What a test-key order is
- An order placed with a key that starts with
sn_test_sk_is a test order. It is checked against the same rules as a live order: the designs, the address, the lines and the rights confirmation. It is priced with the same price list and the same postage, and its price is locked the same way. - It is never charged. No card is needed, and nothing is sent to the payment service. It is never printed and never shipped.
- A test key sees only test orders, test events and test webhook endpoints. A live key sees only live ones. The account’s designs are the same for both.
- The portal’s Orders page lists test orders too, marked Test. A test order started in the portal with New test order is the same kind of order. A test key can see it through the API, and everything on this page applies to it. See Test orders.
The walk through the statuses
A test order moves forward by itself, one step at a time. Each step is due 60 seconds after the one before, and the steps are taken once a minute. So each step happens one to two minutes after the last, and a test order reaches delivered a few minutes after it is placed.
| Status | When | Event |
|---|---|---|
| Received | When it is placed | order.accepted |
| In production | 60 seconds or more later | order.in_production |
| Packed | 60 seconds or more after that | None, as for a live order |
| Shipped | 60 seconds or more after that, with a tracking number that starts with TEST- | order.shipped |
| Delivered | 60 seconds or more after that | order.delivered |
To move a test order on without waiting, call Advance a test order. Each call takes it one step and sends the same events as the timed steps. A live key gets test_mode_only, and an order that cannot move any further gets order_not_advanceable.
You can cancel a test order while it is Received. It sends order.refunded and then order.cancelled, and no money moves. Once it is in production it cannot be cancelled, the same as a live order.
Events in test mode
A test order sends the same events as a live order, at the same points, each with mode: "test". They go only to your test webhook endpoints. GET /api/v1/events with a test key lists them. Because a test order is never charged, it never sends order.payment_failed and never refunds real money.
Going live
- An owner saves a card on the Billing page.
- Make a live secret key on the Developers page, and a live webhook endpoint on the Webhooks page if you use webhooks. A live endpoint has its own signing secret.
- Switch your server to the live key. From then on, its orders are charged and printed.
Read Orders through the API for the whole flow, and Webhooks for checking what you receive.