Skip to main content

Authentication

CodeHTTPMeaning
auth_required401X-Api-Key header missing on an authenticated endpoint
api_key_bad_format401X-Api-Key header didn’t match ps_<env>_<keyId>_<secret> shape
api_key_unknown_key401keyId not found in the registry (typo, wrong environment, or revoked long ago and garbage-collected)
api_key_bad_secret401Stored hash didn’t match — wrong secret
api_key_revoked401Key was explicitly revoked via admin
api_key_expired401Key’s expiresAt has passed
api_key_suspended401Partner was suspended — all their keys stop working until reactivation
api_key_ip_denied401Caller IP not in the key’s ipAllowlist
api_key_no_associated_wallet401single_wallet partner has no associatedWallet attached — admin must attach one before authenticated endpoints work
api_key_user_wallet_required401multi_wallet partner: X-User-Wallet header missing on an authenticated request
api_key_user_wallet_invalid401multi_wallet partner: X-User-Wallet header value isn’t a 0x + 40-hex address
api_key_scope_missing403Key lacks the scope required by this endpoint; response body includes requiredScope + have[]
wallet_banned403The request’s effective wallet (associated or X-User-Wallet) is on the banned list

Trading

CodeHTTPMeaning
invalid_amounts400price or quantity ≤ 0 or bad format
invalid_tif400MARKET+GTC rejected
bad_signature400EIP-712 recover failed
fee_too_high400feeRateBps > MAX_FEE_RATE_BIPS (1000)
expired400Order expiration in the past
invalid_outcome400Outcome index out of range
insufficient_funds200 (envelope)Balance overdraft
market_not_open409Market status ≠ OPEN
idempotency_race500Internal race on (wallet, clientOrderId)
matcher_error200 (envelope)Matcher returned a business error
exchange_unavailable503Exchange-service / matcher unreachable

Orders

CodeHTTPMeaning
order_not_found404Order ID doesn’t exist for this wallet
not_cancellable409Order already terminal
forbidden403Order belongs to a different wallet

Withdrawals

CodeHTTPMeaning
invalid_amount400Amount ≤ 0
bad_signature400User EIP-712 signature invalid
destination_not_cleared200 (envelope)New destination below EDD threshold
new_destination_edd200 (envelope)New destination above EDD → MLRO review
wallet_banned200 (envelope)Destination on banned-wallets list
aml_blocked200 (envelope)Destination failed AML screen
invalid_state409Tried to cancel after SUBMITTED
not_found404Withdrawal ID doesn’t exist

Faucet (testnet)

CodeHTTPMeaning
faucet_disabled403Faucet not enabled
faucet_daily_cap429Daily cap exceeded
invalid_amount400Amount out of range

Rate limits

CodeHTTPMeaning
rate_limited429Bucket exhausted; retry after retryAfterSec

Service-level

CodeHTTPMeaning
exchange_unavailable503Upstream service temporarily unavailable — retry with backoff
exchange_transport_error503Connection failed
exchange_malformed_response503Non-JSON response
not_implemented501Feature disabled in this env

Handling strategy

  • 4xx codes — fix the client.
  • 200 with code — business logic reject; surface to user.
  • 429 — wait retryAfterSec then retry.
  • 5xx — exponential backoff with jitter; 3 attempts max for idempotent calls. Non-idempotent writes use clientOrderId / nonce
    • deadline for safe retries.