Sandbox
Sandbox (Test Mode)
Sandbox lets you integrate the Courier API risk-free: use your Test Key, and the endpoints & base URL are exactly the same as live, but every courier call runs against a mock and the balance uses a fake wallet. No real shipments, no real charges.
How to Use
- Get your Test Key from the dashboard (the "Sandbox (Test) Key" card).
- Send that key in the
x-api-co-idheader — exactly like live. - Run the normal flow: create address → check shipping cost → order. Everything is isolated from live data.
What's Different in Sandbox
- Free shipping rate checks — no Rp 5 fee.
- Seeded wallet — the sandbox balance starts at around Rp 1.000.000 and decreases with each order; endpoints return
402when the balance runs out. - Auto-advance — sandbox orders automatically move
waiting → shipping → deliveredwithin a few seconds, so you see the full webhook sequence without doing anything. - Manual trigger — force any event (problem/returned/failed/cancelled) via the trigger endpoint.
- Flagged webhooks — every sandbox webhook payload carries
"sandbox": true(similar to Stripe'slivemode:false) so your handler can tell them apart. - Same reference data — the courier & location lists are shared (not sandbox-specific data).
info
Test Keys and Live Keys are fully separate: it's impossible to create a real order with a Test Key, and sandbox data never appears in your live order list.
Sandbox: Trigger Event
Sandbox mode only. Force a single lifecycle event on a sandbox order so the matching webhook is sent — to test your handler without waiting.
POST /courier/v1/sandbox/orders/{id}/trigger
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
event | string | yes | One of: shipping, delivered, problem, returned, cancelled, failed. |
Example Request
- cURL
- JavaScript
- Python
curl -X POST 'https://use.api.co.id/courier/v1/sandbox/orders/{id}/trigger' \
-H 'x-api-co-id: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"event": "delivered"
}'
const res = await fetch('https://use.api.co.id/courier/v1/sandbox/orders/{id}/trigger', {
method: 'POST',
headers: {
'x-api-co-id': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"event": "delivered"
}),
});
const data = await res.json();
import requests
res = requests.post(
"https://use.api.co.id/courier/v1/sandbox/orders/{id}/trigger",
json={"event":"delivered"},
headers={"x-api-co-id": "YOUR_API_KEY"},
)
data = res.json()
Example Response
{
"is_success": true,
"message": "OK",
"data": { "id": "ord_3a9f", "status": "completed", "event": "delivered" }
}
- Only applies to
is_sandboxorders; live orders →404. - Orders already in a final status (delivered/cancelled/returned) can no longer be changed.
Try it out
tip
Use your sandbox Test Key to try these endpoints without creating real shipments or charges. See Sandbox.
- POST/courier/v1/sandbox/orders/{id}/triggerSandbox: Trigger Event
Was this page helpful?