Yonne External API — Test Mode vs Live Mode
This guide explains the practical difference between test mode and live mode when using the Yonne External API.How the environment is selected
The environment is determined by the merchant API key prefix.yonne_live_...-> liveyonne_test_...-> test
Why this matters
The environment affects:- wallet behavior
- order creation side effects
- tracking identifiers
- webhook behavior
- operational expectations
Live mode
Live mode is the production behavior used for real deliveries.In live mode
- merchant wallet balance is checked before order creation
- live wallet balance is debited
- real dispatch logic runs
- capacity-aware rider selection runs
ERR_NO_CAPACITY_AVAILABLEcan block order creation- notifications and downstream side effects run
- order webhooks are dispatched
Live create-order example
Test mode
Test mode is for integration validation and QA.In test mode
- environment is returned as
test - test tracking IDs are generated
- real live merchant billing should not be assumed
- the flow is safer for sandbox experimentation
- webhook simulation tools are available
Important note
Even though the endpoint behavior resembles production, your integration should treat test mode as non-production and avoid assuming real financial or operational fulfillment.Side-by-side comparison
| Area | Live | Test |
|---|---|---|
| Key prefix | yonne_live_... | yonne_test_... |
| Environment field | live | test |
| Wallet validation | Yes | sandbox/test context |
| Real dispatch expectation | Yes | no production assumption |
| Production merchant operations | Yes | No |
| Webhook simulation endpoint | Available | especially useful here |
Recommended test workflow
1. Validate the test key
2. Create a test quote
3. Create a test order
4. Simulate status changes
Recommended live workflow
Before going live
- confirm merchant pickup location is configured
- confirm wallet has sufficient balance
- confirm quote and create-order payloads use canonical snake_case fields
- confirm your webhook receiver is ready
- confirm heavy-package handling is tested
- confirm idempotency keys are implemented
During production operation
- always send
Idempotency-Keyon create-order - log
order_id,tracking_id,merchant_reference_id - handle
402and422separately from transport errors
Common mistakes
Using the wrong key in the wrong environment
Symptom:- order not found
- unexpected wallet values
- confusion about missing orders
- make sure your integration keeps live and test keys separate
Treating test mode like production dispatch
Symptom:- assuming every test order maps to a real rider workflow
- use test mode to validate integration logic, not real courier operations
Not using idempotency in either mode
Symptom:- duplicate orders after retry
- always send
Idempotency-Keyin both live and test mode
Best practice summary
- use test mode for integration QA, webhook receiver development, and payload validation
- use live mode only after merchant setup is complete
- keep keys, logging, and dashboards clearly separated by environment
