Errors

Binance error codes, mapped by CCXT to typed exceptions.

Every error is a JSON body of exactly two fields with the HTTP status Binance would use:

{ "code": -2010, "msg": "Account has insufficient balance for requested action." }

CCXT's binance class maps code to its typed exceptions (AuthenticationError, InsufficientFunds, InvalidOrder, OrderNotFound, RateLimitExceeded, BadSymbol, ...), so try / catch written for Binance works unchanged.

Codes

HTTPcodemsgWhat to do
401-2015Invalid API-key, IP, or permissions for action.Missing X-MBX-APIKEY, revoked key, or signature mismatch. Check the secret and the signed bytes.
400-1021Timestamp for this request is outside of the recvWindow.Sync your clock or raise recvWindow (max 30000).
400-1102Mandatory parameter 'timestamp' was not sent...Add timestamp.
400-1131recvWindow must be less than 30000Lower recvWindow.
400-2010This key is bound to a SPOT strategy; use /api/v3Wrong family for this key.
400-2010Strategy not liveNo strategy bound, or a write against a strategy that is not LIVE.
400-2010Account has insufficient balance for requested action.Reduce size; check free in the account response.
400-1121Invalid symbol.Not in Wellat's exchangeInfo.
400-4161Leverage reduction is not supported in Isolated Margin Mode with open positionsClose or reduce the position first.
400-1116Invalid orderType.Use a type the symbol advertises.
400-1102Bad or missing parameterIncludes sizing and precision failures: round to stepSize / tickSize and meet minNotional from exchangeInfo.
400-2013Order does not exist.Wrong orderId or origClientOrderId.
400-2011Unknown order sent.Cancel of an order that is already filled or cancelled.
400-4120Conditional order type not allowed on /fapi/v1/orderUse /fapi/v1/algoOrder for STOP / TAKE_PROFIT.
429-1003Too many requests...Back off per Retry-After. See Rate limits.
429-1015Too many new orders...Slow down order placement.
418-1003Way too much request weight used; banned until ...Stop for two minutes.
404-1000Unknown routeThe path is not part of the Bot API.
413-1000Request body exceeds the 10240 byte limitBodies are small form strings; something is wrong with the client.
503-1001Internal error; unable to process your request. Please try again.Wellat could not reach its trading engine in time. Retry with the same newClientOrderId.

Retrying safely

Wellat never retries a request on your behalf. On a timeout or a 503 you do not know whether an order was placed. Always send newClientOrderId (or clientAlgoId for futures legs) and retry with the same value: a duplicate returns the existing order rather than placing another. Reads are always safe to retry.

What never comes back

No error body is wrapped in { status, message, data } or any other envelope. If you see one, you are not talking to the Bot API.


Did this page help you?