Guides
Guides

Create new order

Place a new market or limit order on a chosen trading pair.

Request

curl -X POST "https://trade.mudrex.com/fapi/v1/futures/{asset_id}/order" \
  -H "Content-Type: application/json" \
  -H "X-Authentication: your-secret-key" \
  -d '{
    "leverage": 50,
    "quantity": 0.01,
    "order_price": 12445627,
    "order_type": "LONG",
    "trigger_type": "MARKET",
    "is_takeprofit": true,
    "is_stoploss": true,
    "stoploss_price": 3800,
    "takeprofit_price": 5000,
    "reduce_only": false
  }'

Parameters

ParameterTypeRequiredDescription
asset_idstringYesThe unique identifier of the asset (path parameter) or trading symbol (e.g., "BTCUSDT") if is_symbol query parameter is present
is_symbolstringNoQuery parameter. If present (even with value false/0), the asset_id path parameter is treated as a trading symbol instead of asset ID. If not passed, backward compatibility is maintained and asset ID is used
leveragenumberYesLeverage value (must be within permissible range for the asset)
quantitynumberYesOrder quantity (must be a multiple of the quantity step for the asset)
order_pricenumberYesOrder price (must be between min & max price for the asset based on LONG/SHORT orders)
order_typestringYesOrder type: LONG or SHORT. If reduce_only is true, must be opposite of existing position
trigger_typestringYesTrigger type: MARKET or LIMIT
is_takeprofitbooleanNoWhether to set a take profit order (default: false)
is_stoplossbooleanNoWhether to set a stop loss order (default: false)
stoploss_pricenumberConditionalRequired if is_stoploss is true. Stop loss price
takeprofit_pricenumberConditionalRequired if is_takeprofit is true. Take profit price
reduce_onlybooleanNoIf true, order can only decrease or close an existing position (default: false)

Response

Status: 202 Accepted

{
    "success": true,
    "data": {
        "leverage": "80.9",
        "amount": "222.8",
        "quantity": "0.05",
        "price": "4456",
        "order_id": "0199c39f-e866-7d6b-947e-ed2f09c90b8e",
        "status": "CREATED",
        "message": "OK"
    }
}

Parameters

ParameterDescription
order_idUUID of the created order. This ID is used for CRUD operations on the order/position (setting SL/TP, square off, cancel, delete)
leverageLeverage used for the order
amountAmount used for the order
quantityOrder quantity
priceOrder price
statusOrder status (e.g., CREATED)
messageStatus message

Common errors

Params error

{
    "success": false,
    "errors": [
        {
            "code": 400,
            "text": "Params error"
        }
    ]
}

Status: 400 Bad Request

Invalid trigger type

{
    "success": false,
    "errors": [
        {
            "code": 400,
            "text": "invalid trigger type"
        }
    ]
}

Status: 400 Bad Request

Invalid order type

{
    "success": false,
    "errors": [
        {
            "code": 400,
            "text": "invalid order type"
        }
    ]
}

Status: 400 Bad Request

Order price out of permissible range

{
    "success": false,
    "errors": [
        {
            "code": 400,
            "text": "order price out of permissible range"
        }
    ]
}

Status: 400 Bad Request

Quantity not a multiple of the quantity step

{
    "success": false,
    "errors": [
        {
            "code": 400,
            "text": "quantity not a multiple of the quantity step"
        }
    ]
}

Status: 400 Bad Request

Leverage out of permissible range

{
    "success": false,
    "errors": [
        {
            "code": 400,
            "text": "leverage out of permissible range"
        }
    ]
}

Status: 400 Bad Request


Symbol-First Trading

You can use trading symbols (e.g., "BTCUSDT", "ETHUSDT") instead of asset IDs by including the is_symbol query parameter:

curl -X POST "https://trade.mudrex.com/fapi/v1/futures/BTCUSDT/order?is_symbol" \
  -H "Content-Type: application/json" \
  -H "X-Authentication: your-secret-key" \
  -d '{
    "leverage": 50,
    "quantity": 0.01,
    "order_price": 12445627,
    "order_type": "LONG",
    "trigger_type": "MARKET",
    "is_takeprofit": true,
    "is_stoploss": true,
    "stoploss_price": 3800,
    "takeprofit_price": 5000,
    "reduce_only": false
  }'

Note: The is_symbol query parameter need not have a value—its mere presence is enough. If the query parameter is passed (even with values like false, f, False, 0), the system will treat the path parameter as a symbol. For backward compatibility, if the query parameter is not passed, the existing Asset ID support is used.


Notes

  • Order Price: Must be between min & max price for the asset based on LONG/SHORT orders
  • Order Type: Can be LONG or SHORT. If there is no existing position in an asset, you can open a new position or average/reduce position sizing
  • Reduce-Only Orders: If reduce_only is true and there is an existing open position in a particular asset, the order type must be opposite to the existing position (e.g., if open position is LONG, request body must have order type SHORT and vice versa). A reduce-only order ensures it can only decrease or close an existing position
  • Trigger Type: Can be MARKET or LIMIT
  • Stop Loss/Take Profit: If is_takeprofit is true or is_stoploss is true, you must define the corresponding price. If both are false, stop loss and take profit prices are not required