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.
clientOrderId. The 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.
Read an error’s shape
Handle a trading refusal
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:
error is the sentence to show, and params says the same thing as data: the provider, the
setting it reports and the values trdrs trades. code is one of the codes in the Refusal model of
the API reference, and the codes 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.
Find a refused order later
On the paper book, an order refused when it was sent is kept with its code, as FIX keeps a rejected order. List orders withfilter=all or filter=cancelled
lists it beside the account’s other orders for 90 days, with status and ordStatus rejected
and the code in refusal.code. The list can lag the refusal by a moment, because trdrs answers the
refusal first and records it after. The API reference lists each code a refused order carries with
FIX’s OrdRejReason for it.
Each paper book order row also states the order in FIX’s terms: orderId, the order’s id for its
whole life, which a replace keeps, clOrdId, the id it’s known by now, and ordStatus, where it
stands. A provider’s order rows carry these as null.
Handle account and balance errors
The routes that issue accounts and move money on them refuse these before anything is created or recorded. They aren’t trading refusals, so they aren’t in theRefusal model. A venue route answers
with the code as error:
Challenges enrollment answers
currency_not_issuable with a sentence as error, beside code and
the same params.
While an account is held for reconciliation, no money moves on it, not even a credit. A balance
operation on a held account is refused with 423 and reconciliation_hold, and records nothing.
Fix a refused venue configuration
The venue routes refuse a configuration they won’t store, with the code aserror. Nothing is
recorded.
A venue route names the refused value in
field:
400 the same way:
the reason is error and the path of the refused value is field. A futures class that states
its own thresholds, for example, is refused as unknown_field at
policy.classes.futures.thresholds, because a version states one thresholds term for the whole
account.
A risk policy your venue hasn’t stored answers 404 not_found, for a read and for a publication
alike.
Look up a status code
Read a missing-price refusal
On the paper book an order waits, at most 5 seconds, for what it needs that is still on its way: a price of its instrument, that price reaching the account’s risk check on an instrument the account doesn’t hold, and the risk check processing the account’s latest change. A price that is stale, or whose feed is down, isn’t waited for. A quote whose book hasn’t changed for a while is still current while its feed confirms it by reading the book again: an order that fills now waits, at most a second, for the feed to confirm a quote last confirmed more than half the quote’s age ago, and fills at the quote as it stands when the fill is decided. A book that is crossed or locked, or that has left the instrument’s own mark by more than 1% on a venue that states a mark, offers no quote to fill at, and neither does one whose feed has stopped reading it on time.Read a hold
A423 names the hold in its code, and every route refuses the same commands under it. Cancels
and flattens stay available under every hold.
Retry a 503
A503 that was refused before anything was done carries Retry-After: 1, and any route can answer
one while trdrs releases: send the same request again after the wait. The error or code says
which one you have:
Handle the statuses that need care
409means read the response. A duplicate order means your intent already landed, and 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. A write answereddatabase_unavailableis the same: read what stands, then send it again with the same id or reference.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.