Skip to content

Error catalogue

Errors share one shape: { "error": { "code", "message", "requestId", "details"? } }. Switch on code; quote requestId to support. How to handle each class: Errors.

Code Status Meaning details
invalid_id 400 An id is malformed or of the wrong kind (an ord_ id where an acc_ id belongs)
invalid_idempotency_key 400 Idempotency-Key is not 16–128 letters, digits, - or _
unauthenticated 401 No key, or the key is not valid here (revoked, expired, other environment)
forbidden 403 Not allowed: wrong kind of key, a missing scope, another firm, a mandate that does not allow it, or never possible with a key audience, scope, reason
not_found 404 No such thing, or not one the key may see
conflict 409 Not possible in the current state: not enough cash or units, no price or rate, a check blocks a proposal, already done checks for proposals
invalid_transition 409 The thing cannot move to that state from where it is (cancelling a filled order) from, to
validation_failed 422 A field is missing or wrong issues: [{ "path", "message" }], or field
invalid_amount 422 An amount is not valid for its currency (too many decimals, not positive)
currency_mismatch 422 Amounts in different currencies where one currency is needed
rate_limited 429 Past 120 requests a minute for the key (or a per-endpoint limit) retryAfterSeconds, plus the Retry-After header
http_error 4xx The request could not be read at the HTTP level (for example a body that is not JSON)
internal_error 500 Something went wrong on IDEALX’s side. Retry with backoff and the same Idempotency-Key
{
"error": {
"code": "validation_failed",
"message": "The request is not valid",
"requestId": "req_01937e2b4c5d6e7f8091a2b3c4d5e6f7",
"details": { "issues": [{ "path": "quantity", "message": "Invalid input: expected string, received number" }] }
}
}
{ "error": { "code": "forbidden", "message": "This key does not have the trade scope", "requestId": "req_…", "details": { "scope": "trade" } } }
{ "error": { "code": "forbidden", "message": "Use a firm key for firm endpoints", "requestId": "req_…", "details": { "audience": "firm" } } }
{ "error": { "code": "forbidden", "message": "This is not possible with an API key; do it in the IDEALX app", "requestId": "req_…", "details": { "audience": "app" } } }
{ "error": { "code": "forbidden", "message": "This key works for its own firm only", "requestId": "req_…" } }
{ "error": { "code": "conflict", "message": "Not enough cash in this portfolio", "requestId": "req_…" } }
{
"error": {
"code": "conflict",
"message": "A check blocks this proposal",
"requestId": "req_…",
"details": { "checks": [{ "key": "mandate", "outcome": "block", "label": "Inside the mandate", "detail": "Proposals need an advisory or discretionary mandate" }] }
}
}
{ "error": { "code": "invalid_transition", "message": "An order cannot go from filled to cancelled", "requestId": "req_…", "details": { "from": "filled", "to": "cancelled" } } }
{ "error": { "code": "rate_limited", "message": "At most 120 requests a minute per key", "requestId": "req_…", "details": { "retryAfterSeconds": 18 } } }

message texts are examples: they are written for people and can change.