Errors
Errors arrive in the standard envelope
with a machine-readable error.code. Switch on the code, not the
message.
Standard codes
| Code | HTTP | When |
|---|---|---|
invalid_request | 400 | Validation failure — missing field, wrong type, out-of-range |
invalid_json | 400 | Body wasn't parseable JSON |
unauthorized | 401 | Missing or invalid Authorization header |
forbidden | 403 | Authenticated, but this credential can't perform the action |
account_not_active | 403 | The account's state forbids it |
account_trade_frozen | 403 | Account is trade_frozen |
not_found | 404 | Resource doesn't exist (or belongs to another account) |
instrument_halted | 409 | Instrument is not in trading state |
stp_aborted | 409 | Self-trade prevention blocked the order |
payload_too_large | 413 | Body exceeded the 64 KiB cap |
insufficient_funds | 422 | Available collateral can't cover the order's hold |
fok_would_not_fully_fill | 422 | FOK order can't fill in full against the current book |
max_cost_blocks_any_fill | 422 | Market BUY whose max_cost blocks all offered liquidity |
market_no_liquidity | 422 | Market order has no counterparty |
internal_error | 500 | Unexpected server-side failure — report the correlation_id |
service_unavailable | 503 | A required downstream is unreachable — retry with backoff |
engine_timeout | 504 | Engine didn't ack within the deadline — treat outcome as unknown |
Parameter-parse failures use specific codes of the form
invalid_order_id, invalid_instrument_id, invalid_credential_id,
invalid_resolution.
Retry semantics
- 400/401/403/404/409/413/422 — deterministic; retrying the same request will fail the same way. Fix the request.
- 503 — retry with exponential backoff and jitter.
- 504 (
engine_timeout) — the outcome is unknown: the order may or may not have been accepted. Reconcile viaGET /v1/ordersbefore re-placing; blind retries can double-place.
Operation-specific reject reasons (order rejects, cancel rejects) are documented on each endpoint's reference page.