Skip to main content

New Order

Type: TRADE

Weight: 1

POST /fapi/v1/order

Send in a new order: LIMIT, MARKET, or a trigger order (STOP / TAKE_PROFIT families).

Request

POST /fapi/v1/order?timestamp=<ms>&signature=<hex>
Content-Type: application/json

Business parameters travel in the JSON body; timestamp and signature in the query string. The signed payload is query_string + raw_body (see Signing).

Body params

NameTypeRequiredNotes
symbolstringyesBTCUSDT (aliases normalized).
sidestringyesBUY / SELL.
typestringyesLIMIT MARKET STOP STOP_MARKET TAKE_PROFIT TAKE_PROFIT_MARKET. Aliases STOP_LIMIT (= STOP) and TAKE_PROFIT_LIMIT (= TAKE_PROFIT) accepted. TRAILING_STOP_MARKET only via algoOrder.
quantitystringone of quantity / quoteOrderQtyBase-asset quantity.
quoteOrderQtystringone of quantity / quoteOrderQtyUSDT notional; converted to quantity = floor(quoteOrderQty / refPrice / lot_size) × lot_size where refPrice is price (LIMIT / STOP / TAKE_PROFIT), stopPrice (STOP_MARKET / TAKE_PROFIT_MARKET) or mark price (MARKET). Supported on every order type (Binance spot supports it only on MARKET). Sending both → -1106.
pricestringLIMIT / STOP / TAKE_PROFITLimit price.
stopPricestringSTOP_* / TAKE_PROFIT_*Trigger price (evaluated against mark price).
timeInForcestringnoGTC (default) IOC FOK GTX (post-only).
reduceOnlybool / stringnoAccepts true/false/"true"/"false"/1/0/"1"/"0"/"".
positionSidestringnoOnly BOTH is meaningful; LONG / SHORT are accepted but behave as BOTH.
workingTypestringnoCONTRACT_PRICE / MARK_PRICE — echoed only; triggers always use mark price.
newClientOrderIdstringno1–36 chars of [A-Za-z0-9_.-]; unique per (user, active orders). Auto-generated when omitted.

Response — 200

{
"orderId": "550e8400-e29b-41d4-a716-446655440000",
"symbol": "BTCUSDT",
"status": "NEW",
"clientOrderId": "my-order-1",
"price": "60000.00",
"avgPrice": "0",
"origQty": "0.010",
"executedQty": "0",
"cumQuote": "0",
"timeInForce": "GTC",
"type": "LIMIT",
"reduceOnly": false,
"side": "BUY",
"positionSide": "BOTH",
"stopPrice": "0",
"workingType": "CONTRACT_PRICE",
"priceProtect": false,
"origType": "LIMIT",
"updateTime": 1714261234567,
"time": 1714261234567
}

statusNEW / PARTIALLY_FILLED / FILLED / CANCELED / REJECTED. orderId and clientOrderId are UUID-style strings, not integers.

Sparky behaviour worth knowing

  1. Trigger orders (STOP_*, TAKE_PROFIT_*) do not enter the book. They are stored as trigger orders and a keeper submits the derived order when mark price crosses stopPrice. A trigger whose condition is already true is rejected with -2021.
  2. GTX (post-only) must be LIMIT with price; if it would cross it is rejected with -2010 post only order would have matched immediately. Accepted GTX orders are persisted as GTC.
  3. reduceOnly is enforced: no opposite-side position → -2022; a quantity larger than the opposite position is capped to it (not rejected), so it can never flip the position.
  4. Lot size: quantity < lot_size-1013; quantities that are not a lot multiple are floored silently.
  5. Notional bounds: notional < min_order_size_usd or > max_order_size_usd-1013, using price for LIMIT and mark price for MARKET.
  6. Margin: notional / leverage × 1.005 is frozen at placement (0.5 % buffer); the unused part is released on fill. Insufficient → -2019.
  7. Leverage is the standing per-symbol value from POST /fapi/v1/leverage, clamped to the market maximum at placement.
  8. Fees use your live VIP tier (same as the web app).
  9. Duplicate newClientOrderId among your active orders → -2014; terminal orders' ids may be reused.
  10. OI cap: if the order would push the market's long or short open interest over its cap it is rejected (-2010).

Errors

HTTPcodemsg
400-1013Quantity below lot size / notional out of bounds.
400-1100Unparseable quantity / price / bad newClientOrderId characters.
400-1102Missing required parameter (e.g. price on LIMIT, stopPrice on STOP).
400-1106quantity and quoteOrderQty both sent.
400-1121Symbol not tradeable on this deployment.
400-1130Unknown side / type.
400-2010GTX would match immediately; OI cap exceeded; reference price ≤ 0.
400-2014Duplicate newClientOrderId.
400-2019Margin insufficient.
400-2021Trigger order would trigger immediately.
400-2022reduceOnly with no opposite position.
500-1001Matching engine / shard forwarding failure.

Authentication failures (INVALID_API_KEY, API_KEY_DISABLED, IP_NOT_ALLOWED, SIGNATURE_INVALID) apply to every signed endpoint and use Sparky's {"success":false,"error":{...}} envelope; see Error Codes.