General guidance
- Use webhooks over polling. Don’t repeatedly call
/track/:idto check order status — let Yonne push status updates to you instead. See Real-time Tracking. - Cache stable data. The response from
GET /api/v1/external/validaterarely changes. CachepickupLatitude,pickupLongitude, andpickupAddressinstead of fetching them on every order. - Use exponential backoff on transient failures (
5xx, network errors). Don’t retry at a fixed 100ms interval. - Never use tight retry loops on business errors like
402or422. These require human or system-level resolution, not hammering the API.
Handling a 429 Too Many Requests response
If you exceed the rate limit, the API returns 429. Honor it — back off and retry after the delay indicated in the response headers.
Order creation is the most sensitive endpoint
POST /api/v1/external/create-order is the only mutating endpoint that should ever be retried, and only with the same Idempotency-Key. Retrying with a new key creates a new order.
See Idempotency & Retries for the full retry decision tree.
