Guide: Errors, Retries, and Idempotency
This guide explains how to handle the most important failure modes in the Yonne External API.Always use idempotency on order creation
When calling:- the merchant retries after a timeout
- the network drops after the request is sent
- the client does not know whether the first attempt succeeded
Important error types
401 Unauthorized
Cause:- API key missing
- API key malformed
- API key inactive
- confirm the
X-API-Keyheader is present - validate the key with
GET /api/v1/external/validate
400 Missing coordinates / invalid coordinates
Cause:- destination coordinates missing
- destination or pickup coordinates invalid
- merchant pickup not configured
- ensure
delivery_latanddelivery_lngare sent - validate coordinate formats before sending
- confirm the merchant pickup location exists
402 Insufficient Funds
Cause:- live wallet balance is lower than the requested delivery fee
- call
GET /api/v1/external/wallet - top up before retrying
422 ERR_NO_CAPACITY_AVAILABLE
Cause:- no online rider can carry the shipment at the required weight
- do not silently downgrade to a smaller vehicle
- surface a meaningful message
- retry later or reduce shipment size
Retry policy
Safe to retry
GETrequestsPOST /create-orderonly with the sameIdempotency-Key
Do not blindly retry
402 Insufficient Funds422 ERR_NO_CAPACITY_AVAILABLE- validation failures such as missing coordinates
Suggested client logic
For temporary uncertainty
If create-order times out on the client side:- retry with the same
Idempotency-Key - if needed, fetch the merchant order list or track by your saved references
For business failures
If you receive:ERR_NO_CAPACITY_AVAILABLEInsufficient Funds
Good operational logging
Log these on your side for support and reconciliation:- merchant reference ID
- idempotency key
- order ID
- tracking ID
- response status code
- response error payload
