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 |
Examples
Section titled “Examples”A field is wrong (422)
Section titled “A field is wrong (422)”{ "error": { "code": "validation_failed", "message": "The request is not valid", "requestId": "req_01937e2b4c5d6e7f8091a2b3c4d5e6f7", "details": { "issues": [{ "path": "quantity", "message": "Invalid input: expected string, received number" }] } }}The key lacks a scope (403)
Section titled “The key lacks a scope (403)”{ "error": { "code": "forbidden", "message": "This key does not have the trade scope", "requestId": "req_…", "details": { "scope": "trade" } } }The wrong kind of key (403)
Section titled “The wrong kind of key (403)”{ "error": { "code": "forbidden", "message": "Use a firm key for firm endpoints", "requestId": "req_…", "details": { "audience": "firm" } } }Never possible with a key (403)
Section titled “Never possible with a key (403)”{ "error": { "code": "forbidden", "message": "This is not possible with an API key; do it in the IDEALX app", "requestId": "req_…", "details": { "audience": "app" } } }Another firm (403)
Section titled “Another firm (403)”{ "error": { "code": "forbidden", "message": "This key works for its own firm only", "requestId": "req_…" } }Not enough cash (409)
Section titled “Not enough cash (409)”{ "error": { "code": "conflict", "message": "Not enough cash in this portfolio", "requestId": "req_…" } }A check blocks a proposal (409)
Section titled “A check blocks a proposal (409)”{ "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" }] } }}A state change that is not allowed (409)
Section titled “A state change that is not allowed (409)”{ "error": { "code": "invalid_transition", "message": "An order cannot go from filled to cancelled", "requestId": "req_…", "details": { "from": "filled", "to": "cancelled" } } }Too many requests (429)
Section titled “Too many requests (429)”{ "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.