Sandbox & simulator
Build and test your integration without drivers, recipients or money.
Sandbox shipments
- A test token (
atk_test_…) only sees sandbox shipments and only creates sandbox shipments, even in a company that is already live. The database enforces it, not just the API. - A company still under review creates sandbox shipments with any token.
- Sandbox shipments are free, are not offered to drivers and send nothing to recipients. Everything else is real: validation, prices, tracking numbers, labels, events and webhooks.
- Webhook messages about sandbox shipments carry
"livemode": falseand go to test endpoints only. - A test token reads the shared address book but only changes or archives the locations it created, and never sees live labels or live webhook endpoints.
Simulator
A sandbox shipment moves one step at a time through the same state machine real deliveries use:
POST /v1/sandbox/shipments/{id}/advance
Authorization: Bearer atk_test_…
Idempotency-Key: 3f1c…
Content-Type: application/json
{ "to": "picked_up" }
The answer is the shipment. The step sends the same events and webhooks a real one would.
| From | to |
|---|---|
ready | pickup_assigned, at_hub (customer drop-off, hub service levels) |
pickup_assigned | picked_up |
picked_up | out_for_delivery (direct service levels), at_hub (hub service levels) |
at_hub | out_for_delivery, return_in_transit (attempts used up) |
out_for_delivery | delivered, attempt_failed |
attempt_failed | out_for_delivery (attempts left), at_hub, return_in_transit (attempts used up) |
return_in_transit | returned |
| any open status | exception |
exception | closed_exception |
- Confirm first (
POST /v1/shipments/{id}/confirm): drafts are not simulated, confirming prices the shipment and gives it its tracking number. - A step the rules do not allow answers
409with the state machine's code (for exampleshipment.hub_requiredorshipment.attempts_remaining). - Live tokens get
403 sandbox.live_token; live shipments409 sandbox.live_shipment. - Only the shipment moves (its status, attempts and history); driver tasks stay as they were.