error field, and on most routes that field is a sentence. This page explains the shapes an error takes, the codes
a refused request carries, and what each HTTP status means. Use it when you write the error
handling for your integration.
error text is written for a person reading a log. Show it, log it, and decide what to do from
the status and the code. Some routes add fields you should keep, such as code, params,
commandId, referenceId or the details of a conflict, because they tell you whether a retry is
safe.
Error shapes
Trading refusals
When trdrs refuses a trading request before anything reaches the market, the answer carries the refusal’scode and params. For example, a futures account at Binance held in Hedge Mode is
refused like this:
code is one of the codes in the Refusal model of the API reference. They fall into these
groups:
Every account a venue issues is an issued account here. Any other rejection, including the
provider’s own, is
order_rejected, and its error is the sentence to show.
params carries only what your client needs to say the same thing in its own words: a provider’s
name, an instrument, a mode or a limit. It never carries a secret, an account number or text a
provider sent.
Translate a refusal from its code and params, keep error as the English fallback, and show a
general message for a code your client doesn’t know, because the list grows.
Account and balance errors
The account-issuing and balance routes refuse these before anything is created or recorded. They aren’t trading refusals and aren’t in theRefusal model.
The venue routes answer
currency_not_issuable and amount_precision_exceeded in their own shape,
with the code as error beside the same params.
While an account is held for reconciliation, no money moves on it, not even a credit. A balance
operation is refused with 423 and reconciliation_hold, and records nothing, until a trdrs
operator releases the hold.
Venue configuration errors
The venue routes refuse a configuration they won’t store, with the code aserror. Nothing is
recorded.
The fields a venue route refuses are named in
field:
404 not_found, for a read and for a publication alike.
Status codes
Handle the statuses that need care
409means read the response. A duplicate order means your intent already landed; a conflict means your change was refused. Sending the sameclientOrderIdagain keeps answering409, and sending a new one would place a second order. Read the account stream to see what actually rests.503doesn’t prove nothing happened. A trading503withRetry-Afterwas refused before it was sent: wait that many seconds and retry with the sameclientOrderId.outcome_unknownmeans the effect may have happened, whatever the headers say: read the account stream, or the balance operation’s receipt by its original reference. Never mint a new id to get past it.423means the account is held, not that the request was wrong. Show it to the trader as a risk hold. Retrying in a loop earns the same refusal.429tells you how long to wait. Wait forRetry-Afterrather than retrying at once.
Origin header must come from a registered origin, even with a valid key
attached. Keys and authentication has the rule.