Skip to main content

Error Codes

Endpoint Error Codes (/fapi)

When a /fapi endpoint rejects a request, the response body has the following structure:

{
"code": -1121,
"msg": "Invalid symbol: XYZUSDT"
}

Most errors are returned with HTTP status 400; -2013 (order not found) may be returned with 404, and -1000/-1001 (internal errors) with 500.

The following codes are in use:

10xx — General Issues

Error CodeError NameDescription / Reason
-1000UNKNOWNAn unknown error occurred while processing the request (e.g. an internal storage error).
-1001DISCONNECTEDInternal error; unable to process the request. Please retry.
-1013FILTER_FAILUREOrder rejected by a symbol filter. The message names the failed filter: Filter failure: LOT_SIZE (quantity below or rounding below the minimum lot size), Filter failure: MIN_NOTIONAL (order notional below the symbol minimum; reduce-only orders are exempt), or Filter failure: MAX_NOTIONAL (order notional above the symbol maximum). Filter values are published per symbol in the filters array of GET /fapi/v1/exchangeInfo.

11xx — Request Parameter Issues

Error CodeError NameDescription / Reason
-1100ILLEGAL_CHARS / BAD_VALUEA parameter value is malformed: invalid quantity, price, stopPrice, orderId, or goodTillDate; non-positive numeric value; newClientOrderId longer than 36 chars or containing illegal characters; query window exceeding 7 days.
-1102MANDATORY_PARAM_EMPTY_OR_MALFORMEDA mandatory parameter was not sent: e.g. quantity, price for LIMIT orders, orderId/origClientOrderId on cancel/query, goodTillDate when timeInForce=GTD. Also returned when timeInForce=GTD is sent on a regular (non-algo) order, which is not supported.
-1106PARAM_NOT_REQUIREDA parameter was sent that is not required or conflicts with another: closePosition together with reduceOnly or quantity, or closePosition on an order type other than STOP_MARKET / TAKE_PROFIT_MARKET.
-1120BAD_INTERVALInvalid kline interval or statistics period.
-1121BAD_SYMBOLInvalid or unknown trading pair.
-1125INVALID_LISTEN_KEYThis listenKey does not exist (expired or never created). Re-issue via POST /fapi/v1/listenKey.
-1128OPTIONAL_PARAMS_BAD_COMBOInvalid combination or value of optional parameters, e.g. a marginType other than CROSSED / ISOLATED.
-1130INVALID_PARAMETERInvalid data sent for a parameter: unknown side, type, algoType, or a positionSide other than BOTH.

20xx — Order Processing Issues

Error CodeError NameDescription / Reason
-2010NEW_ORDER_REJECTEDNew order rejected, e.g. a GTX (post-only) order that would immediately match and take.
-2011CANCEL_REJECTEDCancel rejected: unknown order sent, or the order is already in a terminal state.
-2013NO_SUCH_ORDEROrder does not exist (or cannot be modified).
-2014DUPLICATE_CLIENT_ORDER_IDDuplicate newClientOrderId — another active order already uses this id.
-2019MARGIN_NOT_SUFFICIENTInsufficient available balance for the required margin.
-2021ORDER_WOULD_IMMEDIATELY_TRIGGERConditional order would be triggered immediately at the current mark price.
-2022REDUCE_ONLY_REJECTReduce-only order rejected: no opposite-side position to reduce.

40xx — Account Configuration Issues

Error CodeError NameDescription / Reason
-4028INVALID_LEVERAGELeverage is not valid: below 1 or above the symbol's maximum leverage.
-4046MARGIN_TYPE_NOT_SUPPORTEDIsolated margin is not supported — the exchange runs in cross-margin mode only.
-4059POSITION_MODE_NOT_SUPPORTEDHedge mode (dualSidePosition=true) is not supported — the exchange runs in one-way position mode only.

Authentication Errors

Authentication failures do not use the {code, msg} format above. They are rejected by the authentication middleware before the endpoint runs, with an HTTP 401 (or 403) status and the standard API response envelope:

{
"success": false,
"data": null,
"error": {
"code": "SIGNATURE_INVALID",
"message": "Timestamp outside recv window"
},
"timestamp": 1711000000
}
HTTP StatusError CodeReason
401SIGNATURE_INVALIDHMAC signature verification failed: missing signature or timestamp parameter, invalid signature, or timestamp outside the fixed ±60,000 ms window relative to server time.
401INVALID_API_KEYThe X-MBX-APIKEY header does not match any known API key.
401API_KEY_DISABLEDThe API key exists but is disabled.
403IP_NOT_ALLOWEDThe client IP is not in the API key's IP whitelist.

Note: timestamp and signature problems return 401 SIGNATURE_INVALID as shown above — there are no -1021 / -1022 style codes on this API.