Errors
Every non-2xx body has {code,message} plus the fields below. code is stable; message may change. Route pages list which status carries each code.
Codes
| HTTP | code | Extra fields |
|---|---|---|
| 400 | validation | field |
| 400 | invalid_pair, invalid_amount, tx_not_found, wrong_reservation | — |
| 401 | unauthorized | — |
| 401 | invalid_widget_key | — |
| 402 | insufficient_balance | balance, cost, depositAddress |
| 403 | geo_blocked, sanctioned, captcha_failed | — |
| 404 | not_found | — |
| 409 | seat_taken | retryAfter |
| 409 | rate_below_floor | toAmount, floor |
| 409 | price_changed | fromAmount, toAmount |
| 409 | not_awaiting_deposit | — |
| 422 | amount_too_low, amount_too_high, no_liquidity | minFromAmount, maxFromAmount |
| 422 | reserve_rejected | reason |
| 429 | rate_limited | retryAfter; Retry-After header |
| 500 | internal_error | — |
| 503 | widget_unavailable | — |
| 503 | checkout_unavailable | — |
| 503 | network_paused | — |
invalid_widget_key and captcha_failed also protect checkout. widget_unavailable comes only from the exchange widget; checkout uses checkout_unavailable.
500 internal_error: retry after 30 seconds. If it persists for 10 minutes the service is down; stop and report it.
Example
409 seat_taken
{
"code": "seat_taken",
"message": "every rate inside your slippage band is taken — retry in 14 s",
"retryAfter": 14
}