Sandbox test orders
Use the Sandbox section in the API explorer to create scripted test orders on UAT without Lynq courier intake or live operations.
What you get
- Orders stored only in order-worker (
is_test: true). - Lifecycle webhooks with
livemode: false(safe for integration handlers). - Optional synthetic courier, placeholder proof URLs, and one tracking push (when your webhook subscribes to
tracking.courier_locations).
Quick flow
- Create sandbox test order —
POST /orders/test-simulationwith the same pickup/dropoff body as production create, plus:scenario:delivered|cancelled_before_pickup|failed_at_pickup|returnedstep_interval_sec: delay between auto steps (whensandbox_simulatorruns on the server)advance_first_step:trueto fire the first webhook immediately
- Advance sandbox step —
POST /orders/{order_id}/simulation/advanceuntil the scenario completes (409simulation_complete).
Register webhooks on UAT and point them at your endpoint (or a request bin) before advancing so you can inspect payloads.
Scenarios
| Scenario | Terminal status | Typical use |
|---|---|---|
delivered | delivered | Full happy-path webhooks |
cancelled_before_pickup | cancelled | Cancel before pickup |
failed_at_pickup | failed | Failure at pickup |
returned | returned | Pickup then return |
Not the same as production orders
Sandbox orders do not mirror into Lynq public.orders and do not assign real couriers. For end-to-end UAT with Lynq + proof links, use normal Create order on UAT with Calo (or your partner) credentials.
OpenAPI
Sandbox operations are defined in order-worker and merged into partner-api.json under the sandbox tag. After order-worker API changes, update order-worker/docs/openapi/sandbox.openapi.json and run npm run merge-sandbox-spec in this repo (or npm run sync-spec after UAT deploy).