Create new order
Place a new market or limit order via POST /fapi/v2/futures/order (?symbol= or ?id=).
Place a new market or limit order, optionally with a stop loss (SL) and take profit (TP), or as a conditional order that waits for a trigger price. Pass the asset as a query parameter (?id= or ?symbol=). Leverage comes from the leverage already set for that asset (not sent in the body).
order_price, stoploss_price, and takeprofit_price are USDT price levels; quantity is in the base asset. Add "trade_currency": "INR" to draw margin from the INR futures wallet; omit it (or use "USDT") for USDT.
Request
# USDT: MARKET with stop loss
curl -X POST "https://trade.mudrex.com/fapi/v2/futures/order?symbol=BTCUSDT" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"trigger_type": "MARKET",
"order_type": "LONG",
"quantity": "0.001",
"trade_currency": "USDT",
"is_stoploss": true,
"stoploss_price": "62000",
"client_order_id": "my-order-123"
}'# INR: LIMIT
curl -X POST "https://trade.mudrex.com/fapi/v2/futures/order?symbol=BTCUSDT" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"trigger_type": "LIMIT",
"order_type": "SHORT",
"quantity": "0.01",
"order_price": "65000",
"trade_currency": "INR"
}'# By asset UUID instead of symbol
curl -X POST "https://trade.mudrex.com/fapi/v2/futures/order?id={asset_id}" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"trigger_type": "MARKET",
"order_type": "LONG",
"quantity": "0.001"
}'# INR: conditional LIMIT LONG with a partial LIMIT stop loss and a MARKET take profit
curl -X POST "https://trade.mudrex.com/fapi/v2/futures/order?symbol=DOGEUSDT" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"trade_currency": "INR",
"trigger_type": "LIMIT",
"order_type": "LONG",
"quantity": "100",
"order_price": "0.05671",
"trigger_price": "0.05683",
"trigger_direction": "FALL",
"tpsl_mode": "PARTIAL",
"is_stoploss": true,
"stoploss_price": "0.05506",
"stoploss_order_type": "LIMIT",
"stoploss_limit_price": "0.05500",
"is_takeprofit": true,
"takeprofit_price": "0.06216",
"client_order_id": "my-conditional-1"
}'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Conditional | Query parameter. Asset UUID. Required unless symbol is given. |
symbol | string | Conditional | Query parameter. Trading symbol (e.g. BTCUSDT). Required unless id is given. |
trigger_type | string | Yes | MARKET or LIMIT. |
order_type | string | Yes | LONG or SHORT. If reduce_only is true, must be opposite the existing position. |
quantity | string | Yes | Order quantity in the base asset, sent as a string (e.g. "100"). A JSON number is also accepted. Must be > 0 and a multiple of the asset's quantity step. |
order_price | string | Conditional | Required and > 0 for LIMIT, sent as a string. A JSON number is also accepted. Ignored for MARKET, which uses the live price. USDT. |
is_stoploss | boolean | No | Whether to set a stop loss order (default: false). Ignored when reduce_only is true, and when close_on_trigger is true. |
stoploss_price | string | Conditional | Required if is_stoploss is true, sent as a string. USDT price. LONG: below the order price. SHORT: above it. |
is_takeprofit | boolean | No | Whether to set a take profit order (default: false). Ignored when reduce_only is true, and when close_on_trigger is true. |
takeprofit_price | string | Conditional | Required if is_takeprofit is true, sent as a string. USDT price. LONG: above the order price. SHORT: below it. |
reduce_only | boolean | No | If true, order can only decrease or close an existing position (default: false). No new margin is blocked. |
trade_currency | string | No | USDT or INR (body field). Defaults to USDT. Selects the wallet the margin is debited from. |
client_order_id | string | No | Optional client-supplied order id (letters, digits, -, _; max 64). See Client order ID. |
tpsl_mode | string | No | FULL or PARTIAL, in upper case. Applies to both the SL and the TP. Omitted with an SL/TP, the mode is FULL. Omitted with no SL/TP, the mode is null. PARTIAL: the SL/TP is sized to this order. Required as PARTIAL for a LIMIT SL/TP. |
stoploss_order_type | string | No | MARKET (default) or LIMIT. LIMIT requires tpsl_mode: PARTIAL. |
stoploss_limit_price | string | Conditional | Required for a LIMIT SL. The limit price the SL order rests at once stoploss_price is reached. Ignored for a MARKET SL. |
takeprofit_order_type | string | No | MARKET (default) or LIMIT. LIMIT requires tpsl_mode: PARTIAL. |
takeprofit_limit_price | string | Conditional | Required for a LIMIT TP. Ignored for a MARKET TP. |
trigger_price | string | No | Makes the order conditional: it waits with status UNTRIGGERED until the last price reaches trigger_price, then is placed as a MARKET or LIMIT order. |
trigger_direction | string | Conditional | Required with trigger_price. RISE: triggers when the price rises to trigger_price. FALL: triggers when it falls to it. |
close_on_trigger | boolean | No | Conditional orders only. When true, the triggered order can only close the position and never opens or adds to one. Use it instead of reduce_only on conditional orders. SL/TP fields sent with it are accepted and ignored, the same as with reduce_only. |
Response
Status: 202 Accepted
{
"success": true,
"data": {
"leverage": "5",
"quantity": "30",
"price": "0.19887",
"order_id": "01a0c317-61e9-7388-a2f9-474780998ebb",
"status": "CREATED",
"message": "OK",
"client_order_id": "my-order-123",
"position_id": "01a0c317-61e7-73ec-93c5-a98a7b82bbb7"
}
}Conditional order (?symbol=DOGEUSDT, INR):
{
"success": true,
"data": {
"leverage": "75",
"quantity": "100",
"price": "0.05671",
"order_id": "01a1e244-d626-7e11-accb-64d03197410d",
"status": "UNTRIGGERED",
"message": "OK",
"client_order_id": "my-conditional-1",
"position_id": "01a1e244-d624-7d67-a232-93d31dc88540"
}
}Response fields
| Field | Description |
|---|---|
order_id | UUID of the created order. Used for CRUD operations on the order/position (SL/TP, square off, cancel). |
client_order_id | Your client-supplied id when set; otherwise null / omitted. |
position_id | UUID of the position the order belongs to. Returned before the order fills. See Order and position IDs. |
price | Order price (USDT). Live price for MARKET; the order_price sent for LIMIT; trigger_price for a conditional MARKET. |
quantity | Order quantity (base asset). |
leverage | Leverage used for the order, resolved from the leverage saved for this asset. |
status | UNTRIGGERED for a conditional order, CREATED otherwise. |
message | Status message. |
Errors
Common errors
| HTTP | Error text | Meaning / how to fix |
|---|---|---|
| 400 | invalid trade_currency | trade_currency is not USDT or INR. |
| 400 | trigger_type must be MARKET or LIMIT | trigger_type is not MARKET or LIMIT. |
| 400 | order_type must be LONG or SHORT | order_type is not LONG or SHORT. |
| 400 | order_price must be > 0 for LIMIT orders | LIMIT order sent with a zero or missing price. |
| 400 | quantity not a multiple of the quantity step | quantity is not a multiple of the asset's quantity_step. |
| 400 | order quantity out of permissible range | Quantity below the asset's min or above its max contract size. |
| 400 | price not a multiple of the price step | order_price is not a multiple of the asset's price step (LIMIT only). |
| 400 | order price out of permissible range | order_price is outside the asset's min/max price. |
| 400 | order value less than minimum required value | Notional value (quantity × price) is below the asset's min_notional_value. |
| 400 | invalid stop loss price | stoploss_price is on the wrong side of the order price. |
| 400 | invalid takeprofit price | takeprofit_price is on the wrong side of the order price. |
| 400 | leverage not found | Leverage has not been set for this asset. Set it via POST /futures/{asset_id}/leverage first. |
| 400 | insufficient balance | Available balance is less than the required margin. |
| 400 | reduce only order in new position | reduce_only is true but no open position exists. |
| 400 | reduce only order on same side of the position | reduce_only order placed on the same side as the existing position. |
| 400 | TPSLMode Unknown error | tpsl_mode is not FULL or PARTIAL. |
| 400 | stoploss_order_type must be MARKET or LIMIT | Invalid stoploss_order_type (takeprofit_order_type likewise). |
| 400 | a LIMIT stop loss or take profit requires tpsl_mode PARTIAL | LIMIT SL/TP sent without tpsl_mode: PARTIAL. |
| 400 | stoploss_limit_price must be greater than 0 for a LIMIT stop loss | LIMIT SL sent without a limit price (TP likewise). |
| 400 | stoploss_limit_price not a multiple of the price step | Limit price off the asset's price step (TP likewise). |
| 400 | stoploss_limit_price out of permissible range | Limit price outside the asset's min/max price (TP likewise). |
| 400 | trigger direction must be RISE or FALL | trigger_price sent without a valid trigger_direction. |
| 400 | trigger price must be greater than 0 | trigger_price is zero or negative. |
| 400 | trigger price for <SYMBOL> must be a multiple of <step> USDT | trigger_price off the asset's price step. |
| 400 | trigger price must be between the asset's min and max price | trigger_price outside the asset's price range. |
| 400 | trigger price is already below or equal to the current price ($<p>), set a trigger above it | RISE trigger at or below the current price. A FALL trigger at or above it returns the above / below twin. |
| 400 | use close_on_trigger instead of reduce_only for conditional orders | reduce_only sent on a conditional order. |
| 400 | you have reached the maximum order limit, please remove existing orders to place new ones | 10 conditional orders are already waiting on this symbol. |
| 400 | maximum number of partial stop loss or take profit orders reached | 20 partial SL/TP legs already exist on this symbol. |
| 400 | Params error | The exchange rejected the order parameters. An order record can still be left behind with status SYSTEM_CANCELLED. Check it by client_order_id. |
| 400 | This trading pair is being delisted | The asset is being delisted; no new positions are allowed. |
| 404 | future asset not found | The asset UUID or symbol does not exist. |
| 423 | action not allowed: another user action in progress | Another order or a liquidation is in progress for the same asset. Retry shortly. |
| 500 | something went wrong | Internal error; retry with backoff. |
Leverage not set
{
"success": false,
"errors": [
{ "code": 400, "text": "leverage not found" }
]
}Status: 400 Bad Request
Notes
- Position id: Placing an order creates its position immediately, with status
INITIATED, and returns theposition_idwithout waiting for a fill. Theposition_iddoes not change. The position is listed in Open Positions once it isOPEN. - Client order id: Optional body field
client_order_id. See Client order ID for lookup and cancel by client id. - Leverage: Not accepted in the request body. Set it once per asset with
POST /futures/{asset_id}/leverage(includetrade_currencyfor INR) before placing an order, or the call returns400 leverage not found. - Order amount: Always computed as
quantity × price.actual_amountanddesired_amountare not accepted. - Order Price: Must be between the asset's min & max price for
LONG/SHORTorders (USDT). - LIMIT orders / minimum notional: A
LIMITorder must meet the asset'smin_notional_value(USDT) evaluated at the limit price. Orders below the minimum notional are rejected. - Reduce-Only Orders: If
reduce_onlyistrueand a position is open, the order type must be opposite the existing position. All stop loss and take profit fields are ignored, and an SL/TP can't be added to the order later. If a closed position still has active orders, such as a waiting conditional order, a reduce-only order is checked against that position. It can return400 reduce only order on same side of the position. With no position and no active orders, a reduce-only order returns400 reduce only order in new position. - Stop Loss/Take Profit: If
is_takeprofitoris_stoplossistrue, you must define the corresponding price. The stop loss price is not validated against the liquidation price, so check it yourself. A stop loss far from the order price can still be rejected by the exchange with400 Params error. - SL/TP mode: Without SL/TP, the order's
tpsl_modeisnull. With SL/TP and notpsl_mode, the mode isFULL. The mode is fixed once placed. You cannot change the trigger type (MARKETorLIMIT) of a stop loss or take profit once it is placed. A limit price sent for aMARKETSL/TP is ignored. - Partial SL/TP: A
PARTIALSL/TP is sized to the order's quantity and coexists with the position's Full SL/TP and other partial SL/TPs. Up to 20 partial SL/TP legs per symbol. Each partial SL and each partial TP counts as one leg, including those of unfilled orders. - Conditional orders: An order with
trigger_pricewaits with statusUNTRIGGEREDand triggers on the last price (trigger_by: LAST_PRICE). Up to 10 waiting conditional orders per symbol. Change the trigger or its SL/TP with Amend order, and cancel it with Cancel order. A conditional order rejected by the exchange after triggering ends asCANCELLED. - Close on trigger:
close_on_trigger: truemakes a conditional order close-only. SL/TP fields (is_stoploss,is_takeprofitand the related prices) sent with it are accepted and ignored, the same as whenreduce_onlyis true, and no SL/TP is attached. A waiting (UNTRIGGERED) close-on-trigger order is not cancelled when the position closes; it stays waiting. If it later triggers with nothing to close, it ends asCANCELLEDwith nothing filled. Cancel such orders yourself after you close the position. - Available balance: Unsettled PnL is not counted towards available balance, so a margin check can fail here where it would have passed on
POST /fapi/v1/futures/{asset_id}/order. - Concurrent actions:
423means another order or liquidation holds the lock for the same user and asset. Retry after a short delay rather than resubmitting immediately. - Rejected requests: a request rejected by validation (for example a bad field value or a price on the wrong side) creates no order, and a lookup by its
client_order_idreturns404. A400from the exchange, such asParams errorfrom SL/TP validation, can still leave an order record. That order ends in statusSYSTEM_CANCELLEDand carries the rejection reason inreason. After a400, check Order detail byclient_order_id, or Execution report, rather than assuming nothing was created. - Settlement:
202 Acceptedmeans the order was created and handed to the exchange. Fills and settlement are applied asynchronously: poll the order to follow its progress.
Place order (v1)
Deprecated.
POST /fapi/v1/futures/{asset_id}/orderstill works for existing integrations. UsePOST /fapi/v2/futures/orderfor all new integrations and move existing ones to it.
POST /fapi/v1/futures/{asset_id}/order is supported for existing integrations. Limit SL/TP, partial SL/TP and conditional orders are available only on v2: v1 ignores tpsl_mode, stoploss_order_type, takeprofit_order_type, stoploss_limit_price, takeprofit_limit_price, trigger_price, trigger_direction and close_on_trigger. The v1 response has the same fields as v2, plus amount (order value, USDT). Unlike v2, v1 rejects a stop loss beyond the estimated liquidation price with 400 invalid stop loss price.
Status: 202 Accepted
{
"success": true,
"data": {
"leverage": "5",
"amount": "6.038",
"quantity": "4",
"price": "1.5095",
"order_id": "01a0f1ca-8e86-7b1d-8616-ce6f8a10eb8e",
"status": "CREATED",
"message": "OK",
"client_order_id": null,
"position_id": "01a0f1ca-8e83-7c9f-b3e6-d51b34cba2e3"
}
}Updated 9 days ago
