Errors
Time Seventeen HTTP error codes, frame refusals and order reject reasons, with what causes each one and how to recover.
There are three layers of failure. Handle each separately.
1. HTTP errors
JSON body {"error": "<CODE>"}.
| Status | Code | Meaning |
|---|---|---|
| 400 | EMPTY_BATCH, INVALID_ACCOUNT, INVALID_MARKET, INVALID_PUBLIC_KEY, INVALID_ENROLL, BODY_READ_FAILED | Malformed request |
| 401 | SIGNATURE_REQUIRED, SIGNATURE_INVALID | Missing or bad signed read (check the 30 s clock window) |
| 401 | INVALID_INVITE, WRONG_PASSWORD | Enrollment or session password |
| 403 | NOT_PERMITTED | This entry or account may not send the command |
| 404 | UNKNOWN_MARKET, UNKNOWN_ACCOUNT, NOT_FOUND | Unknown id or path |
| 409 | ENROLL_ON_CORE | Enrollment sent to an edge gateway; use the site proxy |
| 413 | BODY_TOO_LARGE | Body above 64 KiB |
| 429 | RATE_LIMITED, TOO_MANY_FAILED_SIGN_INS | Slow down; back off and retry |
| 503 | BUSY, SERVICE_CLOSED, CORE_* | Temporarily unavailable; retry with backoff |
| 504 | REQUEST_TIMEOUT | No result in time; re-read state before retrying |
2. Refusals
{"Refused": "<reason>"} in results. The command was not sequenced; nothing changed.
| Reason | Fix |
|---|---|
UnknownKey | Register a key (or the key was replaced) |
BadSignature | Check the signed bytes against the test vectors |
Replay | Use a fresh nonce; one lane per process |
WrongAccount | Command account must equal frame account |
IdNamespace | Order id must be account × 2^32 + local |
Malformed | Wrong length or field |
KeyChanged | Key rotated during the request; retry with the new key |
RateLimited, Overloaded, Closed | Back off; retry later |
NotPermitted | This entry may not send this command |
3. Rejects
The command was sequenced and refused by the engine: a Rejected event with a reason. State is unchanged; a rejected cancel or amend leaves the order as it was.
| Reason | Meaning |
|---|---|
InsufficientCash | Not enough available cash for price × quantity |
InsufficientPosition | Selling more contracts than you hold |
ReduceOnlyExceedsPosition | Reduce-only order larger than the position |
MarketNotOpen | Market halted, closed or settled |
UnknownMarket, UnknownOrder | Unknown id, or the order already left the book |
PriceOutOfBounds, QtyOutOfBounds, QtyStep, BelowMinNotional | Outside the market terms |
WouldCrossPostOnly | Post-only order would trade |
FokUnfillable | Not enough liquidity for fill-or-kill |
NoLiquidity | Market-to-limit with an empty opposite side |
SelfTrade | Would trade against your own order |
DuplicateOrderId | Order id already used |
OpenOrderLimit, PositionLimit | Account risk limits |
NoPermission | Account may not trade |
InvalidOrder | Inconsistent fields (e.g. post-only with a non-limit kind) |