Example error
code to handle errors in your integration. message is a description for people and can change, so don’t match on it. When an error relates to a specific field, param names that field. When an order, an application or an allocation is rejected, reject_reason gives the reason. When an error is about one of your orders, applications or allocations, order, application or allocation gives its ID, so you can retrieve it. The message shown for each code below is its short form. A response can carry a longer message that names the object and what to do.
invalid_request
400 invalid_request_error
The request could not be read.
What to do. Fix what the message describes, or the field param names, and send the request again.
Your Idempotency-Key. Stored: No. Fix the request. You can reuse the key.
missing_required_field
400 invalid_request_error
A required field is missing.
What to do. Add the field param names, and send the request again.
Your Idempotency-Key. Stored: No. Fix the request. You can reuse the key.
unknown_account
400 invalid_request_error
The account is not registered to you.
What to do. Answered for an account in a request body, and for the account in the path of its balance, positions, trades and contract notes. Use one of your account codes: GET /v1/accounts lists them.
Your Idempotency-Key. Stored: No. Fix the request. You can reuse the key.
unauthorized
401 authentication_error
Invalid credentials.
What to do. Check the key: it must be for this environment’s host, unexpired and not revoked, and a live key must come from an address you registered. Closing a partner revokes every key it holds, so each answers unauthorized. See Keys and security.
Your Idempotency-Key. Stored: No. Nothing was done. Fix the API key or its scope, then send it again with the same Idempotency-Key.
account_blocked
403 permission_error
This account is blocked: no new order or allocation is taken for it. Nothing was written and nothing was sent. Cancels, estimates and reads still work.
What to do. We’ve blocked this one account: no new order or allocation is taken for it. The message says why. Your other accounts are not affected. Contact us. Cancels, estimates and reads still work.
Your Idempotency-Key. Stored: No. You can reuse the key once we lift the account’s block. Contact us.
account_money_blocked
403 permission_error
New allocations to this account are blocked. Nothing was written and nothing was sent.
What to do. We’ve blocked new allocations to this one account. The message says why. Your other accounts are not affected. Contact us.
Your Idempotency-Key. Stored: No. You can reuse the key once we lift the account’s block. Contact us.
account_trading_blocked
403 permission_error
New orders on this account are blocked. Nothing was written and nothing was sent. Cancels, estimates and reads still work.
What to do. We’ve blocked new orders on this one account. The message says why. Your other accounts are not affected. Contact us. Cancels, estimates and reads still work.
Your Idempotency-Key. Stored: No. You can reuse the key once we lift the account’s block. Contact us.
feature_not_enabled
403 permission_error
This feature is not enabled on this gateway. Sending the request again will not change the result. Contact us.
What to do. Contact us. Account opening and deposits are enabled for every partner on a gateway, or for none. Once we enable deposits, send a refused allocation again with a new key: its own key keeps returning 403.
Your Idempotency-Key. Stored: An application: no. An allocation: yes, as refused. Contact us. Sending it again does not change the result.
insufficient_scope
403 permission_error
This API key does not have the scope this request requires. Nothing was done.
What to do. Use a key that has the scope the message names, or create one in your partner portal. See Keys and security.
Your Idempotency-Key. Stored: No. Nothing was done. Fix the API key or its scope, then send it again with the same Idempotency-Key.
partner_closed
403 permission_error
This partner is closed. This request was refused before it was read.
What to do. Your partner account is closed. Contact us.
Your Idempotency-Key. Stored: No. None. The partner is closed, and its keys are revoked.
partner_money_paused
403 permission_error
New allocations are paused for this partner. Nothing was written and nothing was sent.
What to do. We’ve paused new allocations for your partner account. The message says why. Contact us.
Your Idempotency-Key. Stored: No. You can reuse the key once we lift the pause or the suspension. Contact us.
partner_suspended
403 permission_error
This partner is suspended. This request was refused before it was read.
What to do. We’ve suspended your partner account. Every request with your keys is refused, and your webhooks are held, not lost: they are sent once the suspension is lifted. Contact us.
Your Idempotency-Key. Stored: No. You can reuse the key once we lift the pause or the suspension. Contact us.
partner_trading_paused
403 permission_error
New orders, applications and documents are paused for this partner. Nothing was written and nothing was sent. Cancels, estimates and reads still work.
What to do. We’ve paused new trading for your partner account. The message says why. Contact us. Cancels, estimates and reads still work.
Your Idempotency-Key. Stored: No. You can reuse the key once we lift the pause or the suspension. Contact us.
security_blocked
403 permission_error
New orders in this symbol are blocked. Nothing was written and nothing was sent. Cancels and reads still work.
What to do. We’ve blocked new orders and estimates in this symbol for every partner. Your open orders in it are not cancelled; cancel any you no longer want. See Security restrictions.
Your Idempotency-Key. Stored: No. You can reuse the key once we lift the symbol’s restriction. A security.restriction_changed event tells you.
security_close_only
403 permission_error
This symbol is close-only: we take sells and refuse buys. Nothing was written and nothing was sent. Cancels and reads still work.
What to do. We’ve made this symbol close-only for every partner: buys and buy estimates are refused, sells are taken. Your open orders in it are not cancelled; cancel any you no longer want. See Security restrictions.
Your Idempotency-Key. Stored: No. You can reuse the key once we lift the symbol’s restriction. A security.restriction_changed event tells you.
account_not_found
404 invalid_request_error
No such account.
What to do. Answered only by GET /v1/accounts/{account}. Check the code: GET /v1/accounts lists yours.
allocation_not_found
404 invalid_request_error
No such allocation.
What to do. Check the allocation ID.
application_not_found
404 invalid_request_error
No such application.
What to do. Check the application ID.
not_found
404 invalid_request_error
No such path. Check the path against the API reference.
What to do. Check the path against the API reference.
order_not_found
404 invalid_request_error
No such order.
What to do. Check the order ID. An order another partner placed is not found either.
method_not_allowed
405 invalid_request_error
This method is not allowed on this path.
What to do. Use a method the Allow header lists.
account_not_at_broker
409 invalid_request_error
The broker does not recognise this account. No change is needed on your side. Contact us to resolve it.
What to do. Contact us with the x-request-id.
A code, or a reject reason. We answer 409 account_not_at_broker to a read of an account the broker doesn’t recognise: its balance, positions, trades or contract notes. An order or an allocation for such an account is rejected with reject_reason account_not_at_broker instead, and its key is spent.
application_not_accepting_documents
409 invalid_request_error
This application does not take documents in its state. Nothing was sent.
What to do. Read the application’s state. If it’s sending or uncertain, wait for it to be settled. If it ends unplaced, send the application again under a new key, then its documents. Otherwise it takes no more documents.
document_already_delivered
409 invalid_request_error
A different file of this type is already delivered for this application. Nothing was sent.
What to do. Contact us to replace a delivered document.
document_in_flight
409 invalid_request_error
An earlier request with this document is still in progress. Send it again shortly.
Sent with Retry-After: 1.
What to do. Wait the Retry-After interval, then send the same file again.
duplicate_allocation
409 idempotency_error
This Idempotency-Key already belongs to a different allocation.
What to do. Read the allocation allocation names before you send anything with a new key.
Your Idempotency-Key. Stored: Yes, under another request. Read the resource the error’s order, application or allocation names before you send anything with a new key. It may be the one you intended.
duplicate_application
409 idempotency_error
This Idempotency-Key already belongs to a different application.
What to do. Read the application application names before you send anything with a new key.
Your Idempotency-Key. Stored: Yes, under another request. Read the resource the error’s order, application or allocation names before you send anything with a new key. It may be the one you intended.
duplicate_order
409 idempotency_error
This Idempotency-Key already belongs to a different order.
What to do. Read the order order names. If it is the order you intended, it is already placed. Otherwise, send the new order with a new key.
Your Idempotency-Key. Stored: Yes, under another request. Read the resource the error’s order, application or allocation names before you send anything with a new key. It may be the one you intended.
earlier_document_unconfirmed
409 invalid_request_error
Receipt of an earlier file of this type was not confirmed. Nothing was sent. Send that earlier file again.
What to do. Send the earlier file again, the same bytes: its answer settles the type. To send a different file instead, contact us.
order_not_cancelable
409 order_error
This order cannot be cancelled.
What to do. Read the order to see why: a market order, an order already final, one not yet confirmed at the exchange, or a cancel the broker refused. See Cancel an order.
similar_allocation_unresolved
409 wallet_error
An allocation to this account for this amount is not yet resolved.
What to do. Retrieve the allocation allocation names until it resolves. If it becomes booked, the account is funded: send yours again with the same key only if it is a separate allocation, not a repeat of that one. Its id and client_reference identify it in your records. If it becomes rejected, send yours again with the same key. See Identical allocations.
Your Idempotency-Key. Stored: No. You can reuse the key once the earlier allocation resolves. See Identical allocations.
similar_order_unresolved
409 order_error
An identical order on this account is not yet resolved.
What to do. Retrieve the order order names until it resolves. If it becomes pending, partially_filled or filled, the exchange has it: send yours again with the same key only if it is a separate order, not a repeat of that one. If it becomes rejected, refused or cancelled, check its filled_quantity, then send yours again with the same key if you still want it. See Identical orders.
Your Idempotency-Key. Stored: No. You can reuse the key once the earlier order resolves. See Identical orders.
document_too_large
413 invalid_request_error
The document is 1,000,000 bytes or more. Nothing was sent.
What to do. Send the document smaller than 1,000,000 bytes. See Send the documents.
request_too_large
413 invalid_request_error
The request body exceeds the size limit.
What to do. Send a smaller body. See Limits.
Your Idempotency-Key. Stored: No. Fix the request. You can reuse the key.
unsupported_media_type
415 invalid_request_error
Content-Type must be application/json.
What to do. Send the body as JSON, with Content-Type: application/json; a document as the file itself, with Content-Type: image/jpeg or image/png.
Your Idempotency-Key. Stored: No. Fix the request. You can reuse the key.
allocation_rejected
422 wallet_error
The broker rejected this allocation. Its amount has been returned to the wallet.
What to do. Act on reject_reason: see Allocation reject reasons.
Your Idempotency-Key. Stored: Yes, as rejected. To try again, send a corrected request with a new key.
application_rejected
422 application_error
This application was rejected.
What to do. Act on reject_reason and param: see Application reject reasons.
Your Idempotency-Key. Stored: Yes, as rejected. To try again, send a corrected request with a new key.
document_rejected
422 application_error
The broker refused this document. Nothing was delivered. Contact us.
What to do. Answered only for an application sent before account opening changed: correct the file and send it again, and if it’s refused again, contact us with the application’s id and the document’s type. For an application sent since, a document the broker refuses makes the application uncertain instead.
invalid_document
422 invalid_request_error
The file is not the image its Content-Type says, or is too large to show. Nothing was sent.
What to do. Send a JPEG or PNG, with the Content-Type of what it is, at most 8,000 pixels wide and high. param is body.
limit_exceeded
422 limit_error
This request would exceed your daily limit. Nothing was written and nothing was sent.
What to do. Wait until the limit resets at midnight, West Africa Time (WAT). A single order or allocation larger than the whole daily limit never fits: split it, or ask us to change the limit. See Limits.
Your Idempotency-Key. Stored: No. You can reuse the key once your limit or your wallet allows the request.
order_rejected
422 order_error
The broker or the exchange rejected this order.
What to do. Act on reject_reason: see Order reject reasons.
Your Idempotency-Key. Stored: Yes, as rejected. To try again, send a corrected request with a new key.
too_many_applications_in_progress
422 limit_error
Your company has 100 applications in progress, the most it may have at once. Nothing was written and nothing was sent.
What to do. Wait for one of your applications that is sending, documents_required or submitted to move to another state, then send the same request again, with the same Idempotency-Key. Sending documents doesn’t free a place: a submitted application is still in progress. One whose documents you never send becomes uncertain 7 days after you sent it. See Limits.
Your Idempotency-Key. Stored: No. You can reuse the key once your limit or your wallet allows the request.
too_many_keys
422 limit_error
This would leave your company more than 10 working API keys. Nothing was changed.
What to do. Answered only in your partner portal, when you create a key or rotate one with an overlap. Revoke a key you no longer use, then try again. A rotation with no overlap ends the old key as it issues the new one, so it adds no key and is never refused for this.
unknown_symbol
422 order_error
The broker does not list this symbol. Nothing was written and nothing was sent.
What to do. Check the symbol. Nothing was stored, so you can send a corrected order with the same key.
A code, or a reject reason. We answer 422 unknown_symbol before we store anything, for a market order or a sell whose symbol the broker’s price list doesn’t have, so you can send a corrected order with the same key. A limit buy isn’t checked before we store it: if the broker refuses its symbol, the order is rejected with reject_reason unknown_symbol instead, and its key is spent.
Your Idempotency-Key. Stored: No. Fix the request. You can reuse the key.
wallet_too_low
422 wallet_error
The wallet’s available balance is less than this amount. Nothing was written and nothing was sent.
What to do. Allocate less, or wait for a credit to your wallet. See Wallet.
Your Idempotency-Key. Stored: No. You can reuse the key once your limit or your wallet allows the request.
rate_limited
429 rate_limit_error
Too many requests. Nothing was done. Send the same request again after the Retry-After interval.
Sent with Retry-After: 1.
What to do. Wait the Retry-After interval, then send the same request again. See Limits.
Your Idempotency-Key. Stored: No. Wait the Retry-After interval, then send it again with the same key.
internal_error
500 api_error
The gateway encountered an internal error. Send the same request again, exactly as you sent it.
What to do. Send the same request again, exactly as you sent it. If it keeps failing, contact us with the x-request-id.
Your Idempotency-Key. Stored: Maybe. Send the same request with the same key. Never a new key.
exchange_error
502 api_error
The exchange returned a response the gateway cannot process. Nothing was changed. Sending the request again will not change the result. Contact us.
What to do. Contact us with the x-request-id. Sending it again does not change the result.
Your Idempotency-Key. Stored: No. Contact us. Sending it again does not change the result.
allocation_not_sent
503 api_error
The allocation was recorded but could not be sent. It never reached the broker.
What to do. The allocation is recorded as never sent, its amount has been returned to your wallet, and its key is spent. Send it again with a new key.
Your Idempotency-Key. Stored: Yes, as never sent. Send it again with a new key.
application_not_sent
503 api_error
We could not take this application, and sent nothing.
What to do. The application is recorded as never sent, and its key is spent. Send it again with a new key.
Your Idempotency-Key. Stored: Yes, as never sent. Send it again with a new key.
cancel_unconfirmed
503 api_error
Cancel unconfirmed: the broker did not confirm receipt of the cancel request. Send it again. Repeating a cancel request is safe.
What to do. Send the cancel again, or read the order: it becomes cancelled once the exchange confirms.
document_unconfirmed
503 api_error
Document unconfirmed: we could not confirm receipt of the document. Send the same file again. Sending the same file again is safe.
What to do. Send the same file again. Its answer settles the document.
exchange_unavailable
503 api_error
The broker cannot be reached. Nothing was written and nothing was sent. Send the request again, with the same Idempotency-Key if it has one.
What to do. Send the same request again, with the same Idempotency-Key if it has one, backing off as Handle errors says. Nothing was sent.
Your Idempotency-Key. Stored: No. Send it again with the same key.
order_not_sent
503 api_error
The order was recorded but could not be sent. It never reached the exchange.
What to do. The order is recorded as never sent, and its key is spent. Send the order again with a new key.
Your Idempotency-Key. Stored: Yes, as never sent. Send it again with a new key.
outcome_not_recorded
503 api_error
Your request reached us, and its outcome was not recorded.
What to do. Retrieve the order, application or allocation the error names, or wait for its event, until it resolves. It reads sending until then and may already be at the broker, so don’t send it again under a new key. See Handle an uncertain result.
Your Idempotency-Key. Stored: Yes, as sending. Retrieve the resource the error’s order, application or allocation names until it resolves. Don’t send it again under a new key.
service_unavailable
503 api_error
The gateway is temporarily unable to process this request. Send the same request again, with the same Idempotency-Key if it has one.
What to do. Send the same request again, with the same Idempotency-Key if it has one.
Your Idempotency-Key. Stored: Maybe. Send the same request with the same key. Never a new key.
settlement_lockout
503 api_error
Temporarily unavailable: the broker is settling the day’s trades. Send the request again after the Retry-After interval.
Sent with Retry-After: 60.
What to do. Send the request again after the Retry-After interval.
A code, or a reject reason. We answer 503 settlement_lockout to a read while the broker settles the day’s trades. The broker applies the lockout to the cash balance, the estimate and placing an order, and to withdrawals, which are not in the API yet; we pass it through on any broker read if the broker sends one. An estimate or an order meets it as 422 order_rejected with reject_reason settlement_lockout, and an allocation as allocation_rejected with the same reason.
trading_paused
503 api_error
New orders, applications, documents and allocations are paused. Nothing was written and nothing was sent. Cancels, estimates and reads still work. Send it again after the Retry-After interval.
Sent with Retry-After: 60.
What to do. Wait the Retry-After interval, then send it again, with the same key where it has one. Cancels, estimates and reads still work.
Your Idempotency-Key. Stored: No. Wait the Retry-After interval, then send it again with the same key.
Order reject reasons
When you receiveorder_rejected, or an order is in the rejected state, reject_reason has one of these values.
Application reject reasons
When you receiveapplication_rejected, or an application is in the rejected state, reject_reason has one of these values.
Allocation reject reasons
When you receiveallocation_rejected, or an allocation is in the rejected state, reject_reason has one of these values.