Skip to main content

Errors

A failed request answers with a flat object carrying a numeric code and a message:

{
"code": 2002,
"message": "Failed to create order. \nError: Not enough money"
}

Branch on code. Messages are written for humans, and several of them are filled in at runtime — Failed to create order. Error: <reason> puts the underlying reason into the text, and a few codes carry a message composed entirely at runtime. Matching on message text will break.

Shared errors

Every authenticated endpoint can answer with these three, so handle them once rather than per call:

CodeHTTPMeaning
401The Api-Token header is missing or empty. No code is returned.
2008401The token does not match any account
2029400Internal error. The message asks you to contact support

Note that an internal error arrives as 400, not 500.

Validation and lookups

1001 is the general "this value is not acceptable" code, and the message names the field: member_id does not have a valid value, dchain_id does not have a valid value, and so on. It covers both a malformed value and an object that does not exist for your account — the two are not distinguished.

CodeHTTPMeaning
1001400A field or path id is invalid, or the object it points at was not found for your account
1002400Not enough money
1003400A withdrawal failed validation on amount, balance or address. The message carries the detail
2058400A validation rule specific to your configuration. The message is composed at runtime

1001 also covers two uniqueness rules: client_order_id is not unique for owner and client_withdrawal_id is not unique for owner.

Refused operations

CodeHTTPMeaningWhere
2002400The trading core refused the operation. The reason is in the messageorders, withdrawals
2005400The order could not be cancelled — it is a market order, is not in a cancellable state, or the core refusedcancel order
2020400Deposit-address limit reached for this membercreate deposit address
2024400Market not found, or inactiveorders, auto-conversions
2066400This network needs a destination tag as well as an addresscreate withdrawal

Temporarily unavailable

These say "try later" and are not caused by your request:

CodeHTTPMeaning
2070400Withdrawals are switched off for the moment
3009400The trading core is in maintenance
3036400Address creation is switched off for one network. The message names it
Retry only these

2070, 3009 and 3036 are the codes worth retrying, with a backoff. Everything else is either a bad request or an internal error, and repeating it produces the same answer — or, on a create call, a duplicate operation.

The health endpoint is different

Health Check does not use this format and does not use HTTP status to report trouble — it answers 200 either way, with the outcome in the body. See that page.