GuidesSandbox testing
Sandbox testing
Every company has a sandbox copy alongside its live data. A key created with the sandbox environment under Settings › API Keys starts with nvl_test_ and acts on that copy: routes are created, matched, held and canceled exactly as they would be live, but nothing is ever sent to a driver.
What is different with a sandbox key
Section titled “What is different with a sandbox key”- Same base URL, same endpoints, same request and response shapes. Only the key changes.
GET /v1/mereports"environment": "sandbox", and every route the key creates carries"environment": "sandbox".- Nothing reaches a driver. A sandbox route never messages anyone, whatever its status.
- Sandbox routes live in the sandbox copy, apart from the routes a live key sees.
A suggested workflow
Section titled “A suggested workflow”- Create a sandbox key with the same scopes you plan to give the live key. Confirm it with
GET /v1/meand check thatenvironmentissandbox. - Reconcile vehicles and drivers.
GET /v1/vehiclesandGET /v1/driversshow what the sandbox copy knows. Compare against the unit numbers and names your TMS will send. - Push a real load’s data with
POST /v1/routes. Check you get201and adraftroute, and thatscheduledStartround-trips into UTC the way you expect. - Push it again unchanged and changed. Both should return
200and the second should reflect the change. - Push a load with an unknown unit number and confirm you handle the
202/pending_mappingresponse, including surfacingpending.detail. - Send an invalid body (one stop, a missing latitude) and check that your integration logs the
errorsarray from the400. - Cancel a route with
DELETE /v1/routes/{id}and confirm a re-push creates a fresh route. - Swap the key for the
nvl_live_one. No other change is needed.
What the sandbox cannot show you
Section titled “What the sandbox cannot show you”Fuel plans are built when the truck arrives at the route’s first stop. No truck arrives anywhere in the sandbox, so do not expect a sandbox route to progress past draft on its own, or its fuelPlan to be anything but null. Test the plan-reading side of your integration against the response shapes in the API reference and the Quickstart, then confirm it on the first live route.
Keeping the two apart
Section titled “Keeping the two apart”- Never put a live key in a test configuration. The prefix (
nvl_live_vsnvl_test_) is visible in logs and inGET /v1/meprecisely so that this is easy to check. - If your integration stores route ids, store the environment alongside them; an id from the sandbox means nothing to a live key.