Guides
Guides

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

ParameterTypeRequiredDescription
idstringConditionalQuery parameter. Asset UUID. Required unless symbol is given.
symbolstringConditionalQuery parameter. Trading symbol (e.g. BTCUSDT). Required unless id is given.
trigger_typestringYesMARKET or LIMIT.
order_typestringYesLONG or SHORT. If reduce_only is true, must be opposite the existing position.
quantitystringYesOrder 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_pricestringConditionalRequired and > 0 for LIMIT, sent as a string. A JSON number is also accepted. Ignored for MARKET, which uses the live price. USDT.
is_stoplossbooleanNoWhether to set a stop loss order (default: false). Ignored when reduce_only is true, and when close_on_trigger is true.
stoploss_pricestringConditionalRequired if is_stoploss is true, sent as a string. USDT price. LONG: below the order price. SHORT: above it.
is_takeprofitbooleanNoWhether to set a take profit order (default: false). Ignored when reduce_only is true, and when close_on_trigger is true.
takeprofit_pricestringConditionalRequired if is_takeprofit is true, sent as a string. USDT price. LONG: above the order price. SHORT: below it.
reduce_onlybooleanNoIf true, order can only decrease or close an existing position (default: false). No new margin is blocked.
trade_currencystringNoUSDT or INR (body field). Defaults to USDT. Selects the wallet the margin is debited from.
client_order_idstringNoOptional client-supplied order id (letters, digits, -, _; max 64). See Client order ID.
tpsl_modestringNoFULL 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_typestringNoMARKET (default) or LIMIT. LIMIT requires tpsl_mode: PARTIAL.
stoploss_limit_pricestringConditionalRequired for a LIMIT SL. The limit price the SL order rests at once stoploss_price is reached. Ignored for a MARKET SL.
takeprofit_order_typestringNoMARKET (default) or LIMIT. LIMIT requires tpsl_mode: PARTIAL.
takeprofit_limit_pricestringConditionalRequired for a LIMIT TP. Ignored for a MARKET TP.
trigger_pricestringNoMakes 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_directionstringConditionalRequired with trigger_price. RISE: triggers when the price rises to trigger_price. FALL: triggers when it falls to it.
close_on_triggerbooleanNoConditional 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

FieldDescription
order_idUUID of the created order. Used for CRUD operations on the order/position (SL/TP, square off, cancel).
client_order_idYour client-supplied id when set; otherwise null / omitted.
position_idUUID of the position the order belongs to. Returned before the order fills. See Order and position IDs.
priceOrder price (USDT). Live price for MARKET; the order_price sent for LIMIT; trigger_price for a conditional MARKET.
quantityOrder quantity (base asset).
leverageLeverage used for the order, resolved from the leverage saved for this asset.
statusUNTRIGGERED for a conditional order, CREATED otherwise.
messageStatus message.

Errors

❕Common errors
HTTPError textMeaning / how to fix
400invalid trade_currencytrade_currency is not USDT or INR.
400trigger_type must be MARKET or LIMITtrigger_type is not MARKET or LIMIT.
400order_type must be LONG or SHORTorder_type is not LONG or SHORT.
400order_price must be > 0 for LIMIT ordersLIMIT order sent with a zero or missing price.
400quantity not a multiple of the quantity stepquantity is not a multiple of the asset's quantity_step.
400order quantity out of permissible rangeQuantity below the asset's min or above its max contract size.
400price not a multiple of the price steporder_price is not a multiple of the asset's price step (LIMIT only).
400order price out of permissible rangeorder_price is outside the asset's min/max price.
400order value less than minimum required valueNotional value (quantity × price) is below the asset's min_notional_value.
400invalid stop loss pricestoploss_price is on the wrong side of the order price.
400invalid takeprofit pricetakeprofit_price is on the wrong side of the order price.
400leverage not foundLeverage has not been set for this asset. Set it via POST /futures/{asset_id}/leverage first.
400insufficient balanceAvailable balance is less than the required margin.
400reduce only order in new positionreduce_only is true but no open position exists.
400reduce only order on same side of the positionreduce_only order placed on the same side as the existing position.
400TPSLMode Unknown errortpsl_mode is not FULL or PARTIAL.
400stoploss_order_type must be MARKET or LIMITInvalid stoploss_order_type (takeprofit_order_type likewise).
400a LIMIT stop loss or take profit requires tpsl_mode PARTIALLIMIT SL/TP sent without tpsl_mode: PARTIAL.
400stoploss_limit_price must be greater than 0 for a LIMIT stop lossLIMIT SL sent without a limit price (TP likewise).
400stoploss_limit_price not a multiple of the price stepLimit price off the asset's price step (TP likewise).
400stoploss_limit_price out of permissible rangeLimit price outside the asset's min/max price (TP likewise).
400trigger direction must be RISE or FALLtrigger_price sent without a valid trigger_direction.
400trigger price must be greater than 0trigger_price is zero or negative.
400trigger price for <SYMBOL> must be a multiple of <step> USDTtrigger_price off the asset's price step.
400trigger price must be between the asset's min and max pricetrigger_price outside the asset's price range.
400trigger price is already below or equal to the current price ($<p>), set a trigger above itRISE trigger at or below the current price. A FALL trigger at or above it returns the above / below twin.
400use close_on_trigger instead of reduce_only for conditional ordersreduce_only sent on a conditional order.
400you have reached the maximum order limit, please remove existing orders to place new ones10 conditional orders are already waiting on this symbol.
400maximum number of partial stop loss or take profit orders reached20 partial SL/TP legs already exist on this symbol.
400Params errorThe exchange rejected the order parameters. An order record can still be left behind with status SYSTEM_CANCELLED. Check it by client_order_id.
400This trading pair is being delistedThe asset is being delisted; no new positions are allowed.
404future asset not foundThe asset UUID or symbol does not exist.
423action not allowed: another user action in progressAnother order or a liquidation is in progress for the same asset. Retry shortly.
500something went wrongInternal 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 the position_id without waiting for a fill. The position_id does not change. The position is listed in Open Positions once it is OPEN.
  • 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 (include trade_currency for INR) before placing an order, or the call returns 400 leverage not found.
  • Order amount: Always computed as quantity × price. actual_amount and desired_amount are not accepted.
  • Order Price: Must be between the asset's min & max price for LONG/SHORT orders (USDT).
  • LIMIT orders / minimum notional: A LIMIT order must meet the asset's min_notional_value (USDT) evaluated at the limit price. Orders below the minimum notional are rejected.
  • Reduce-Only Orders: If reduce_only is true and 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 return 400 reduce only order on same side of the position. With no position and no active orders, a reduce-only order returns 400 reduce only order in new position.
  • Stop Loss/Take Profit: If is_takeprofit or is_stoploss is true, 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 with 400 Params error.
  • SL/TP mode: Without SL/TP, the order's tpsl_mode is null. With SL/TP and no tpsl_mode, the mode is FULL. The mode is fixed once placed. You cannot change the trigger type (MARKET or LIMIT) of a stop loss or take profit once it is placed. A limit price sent for a MARKET SL/TP is ignored.
  • Partial SL/TP: A PARTIAL SL/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_price waits with status UNTRIGGERED and 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 as CANCELLED.
  • Close on trigger: close_on_trigger: true makes a conditional order close-only. SL/TP fields (is_stoploss, is_takeprofit and the related prices) sent with it are accepted and ignored, the same as when reduce_only is 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 as CANCELLED with 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: 423 means 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_id returns 404. A 400 from the exchange, such as Params error from SL/TP validation, can still leave an order record. That order ends in status SYSTEM_CANCELLED and carries the rejection reason in reason. After a 400, check Order detail by client_order_id, or Execution report, rather than assuming nothing was created.
  • Settlement: 202 Accepted means 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}/order still works for existing integrations. Use POST /fapi/v2/futures/order for 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"
    }
}

Did this page help you?