Skip to main content
v2 returns errors with HTTP status codes in the 4xx–5xx range and a JSON body that describes what went wrong. This page is the single source of truth for every error shape v2 emits, the conditions that produce it, and how to recover. Use this page to:
  • Look up the exact message string for a given HTTP status
  • Wire up retry logic for idempotency-aware POST endpoints
  • See which endpoints carry extra 400 cases beyond the common set
  • Plan ahead for the v3 status code changes

Response shape

Most v2 errors use a bare two-field envelope:
Idempotency errors extend that envelope with a nested error object carrying a machine-readable code and a details string:
v2 has a hybrid error shape. Most errors use the bare { status, message } form, while idempotency errors add the error.code nested object. Branch on response.status first, then check data.error?.code when you need to disambiguate idempotency cases. v3 normalises this so every error carries a stable code — see Notable v2 → v3 changes below.
message is human-readable and is not guaranteed stable across releases — a copy edit can change it. For idempotency errors, switch on error.code. For everything else in v2, switch on HTTP status code.

Common errors (every endpoint)

These five status codes can fire on any v2 endpoint. The message strings below are the exact strings the OpenAPI spec documents.
The 409/422 rows above only apply to endpoints that participate in idempotency. In v2 that includes both POST endpoints (where Idempotency-Key is required) and GETs (where the header is honoured if you send it). All v2 endpoints can return the 409 or 422 idempotency conflict — the OpenAPI spec documents both responses on every operation.

Idempotency errors

These codes come back inside the nested error.code field. They are the only v2 errors with a stable machine-readable code today. See Migration v1 → v2 — Step 5: Handle new error codes for a worked client-side handler that branches on these codes.
Same-key-on-retry is the rule. When you retry a write after a transient failure (network drop, 409, 503), keep the original Idempotency-Key. A new key on the same logical operation defeats the protection and can land the same trade or withdrawal twice. The keys are valid for 24h (/trade) to 7 days (/withdrawal, /fiat_withdrawal) — plenty of headroom for retry loops.

Endpoint-specific errors

Most endpoints emit only the common five. The list below covers the endpoints whose OpenAPI catalog adds messages beyond that set.

POST /v2/brokerage//withdrawal (stablecoin)

Three additional 400 cases on top of the common set. All three are state- or input-driven and should be surfaced to the user rather than retried. See Initiate stablecoin withdrawal.

POST /v2/brokerage//fiat_withdrawal

Three additional 400 cases — analogous to the stablecoin case but applied to bank accounts. See Initiate fiat withdrawal.

POST /v2/brokerage//generate_quote

The 500 case carries a quote-specific message instead of the generic one. See Generate quote.

POST /v2/brokerage//trade/reverse

Adds a 404 and a business-logic 409 on top of the common five. See Reverse a trade.

POST /v2/brokerage//trade/reverse-quote

Adds a 404 and a quote-specific 500 on top of the common five. See Generate a reverse quote.

POST /v2/brokerage//trade/settle

Adds a 404 and a business-logic 409 on top of the common five. See Settle a trade.

v3 status code changes

v3 reshapes errors into a single uniform envelope with a stable error.code on every response, and lines several status codes up with the bucket they semantically belong to. Highlights: See Migration from v2 → HTTP status changes for the full delta and a worked migration plan.

What’s next

  • Building retry logic? Read Migration v1 → v2 — Step 3: Handle retry logic.
  • Want stable error codes today? v3’s error catalog ships a uniform { code, type, message, details } envelope on every response.
  • Hit an error not listed here? It’s almost certainly a transient 500 An internal error has occurred. Capture the response body and timestamp, then contact support.