Guides
Guides

Client order ID

Set your own client_order_id (letters, digits, hyphen, underscore; max 64), then get or cancel by that id.

Assign your own client_order_id when creating a Futures order. You can then retrieve or cancel that order using your identifier instead of storing the Mudrex order_id.

When unset, responses return "client_order_id": null.

This page covers format, uniqueness, retries, setting the id, lookup and cancel, risk orders, and partial close. Prefer Get order detail below over the path-only Order by id (Deprecated).

Format

client_order_id is an optional string with these rules:

RuleValue
Allowed charactersLetters (A–Z, a–z), digits (0–9), hyphen (-), underscore (_)
Length1–64 characters when set
CaseCase-sensitive (order_1 and ORDER_1 are different)

Anything else is rejected with 400 and "invalid order identifier". No order is created.

An empty string ("") is treated as unset: the order is created and client_order_id is null.

Uniqueness

Once Mudrex accepts a client_order_id on your Futures account, that id is unique for that account for all time: across symbols and trade_currency values, and after the order reaches a terminal status (FILLED, CANCELLED, and so on).

Send a fresh id for each new order. Reuse is rejected (see Retries below).

Retries

client_order_id prevents duplicate order creation, but Place Order does not use idempotent replay semantics. If an already-accepted client_order_id is submitted again, Mudrex returns 409 "client order id already exists" rather than returning the original Place Order response. No second order is created, whether the new request matches the original details or not.

If the Place Order response is lost, first GET the order using client_order_id. Do not blindly retry the POST.

If place is rejected by validation before any order is created (for example a bad field value, or a price on the wrong side), the id is not consumed and you may send it again. A 400 from the exchange, such as Params error from SL/TP validation, can still leave an order with status SYSTEM_CANCELLED. That order consumes the client_order_id and carries the rejection reason in reason. After a 400, GET the order by client_order_id (see Get order detail below, or Execution report) before assuming nothing was created or reusing the id.

Set on place order

Pass client_order_id in the body of POST /fapi/v2/futures/order. It is optional.

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": "LONG",
    "quantity": "0.002",
    "order_price": "10000",
    "trade_currency": "USDT",
    "client_order_id": "my-order-123"
  }'

Status: 202 Accepted

{
    "success": true,
    "data": {
        "leverage": "150",
        "quantity": "0.002",
        "price": "10000",
        "order_id": "01a0ce36-e743-7634-b063-8e698df2b695",
        "status": "CREATED",
        "message": "OK",
        "client_order_id": "my-order-123",
        "position_id": "01a0ce36-e741-76ce-bb59-c59dff4e0b78"
    }
}

See Create new order for the full parameter list.

Get order detail (by order id or client order id)

Preferred way to fetch a single order when you may have either id.

Request

# By Mudrex order UUID
curl -X GET "https://trade.mudrex.com/fapi/v1/futures/orders/detail?order_id={order_id}" \
  -H "X-Authentication: your-secret-key"
# By your client_order_id
curl -X GET "https://trade.mudrex.com/fapi/v1/futures/orders/detail?client_order_id=my-order-123" \
  -H "X-Authentication: your-secret-key"

Parameters

ParameterTypeRequiredDescription
order_idstringConditionalMudrex order UUID. Provide this or client_order_id.
client_order_idstringConditionalYour client-supplied order id. Provide this or order_id.

Provide at least one identifier (order_id or client_order_id). When both are provided, they must identify the same order.

QueryBehaviour
Neither400: "order id or client order id is required"
OneResolve that order
Both, same order200: return the order
Both, different orders400: "order id and client order id do not refer to the same order"

Response

Status: 200 OK

{
    "success": true,
    "data": {
        "created_at": "2026-09-23T12:21:40Z",
        "updated_at": "2026-09-23T12:21:47Z",
        "reason": {
            "message": "OK"
        },
        "actual_amount": 20,
        "quantity": 0.002,
        "filled_quantity": 0,
        "price": 10000,
        "filled_price": 0,
        "leverage": 150,
        "hedge_rate": 1,
        "order_type": "LONG",
        "trigger_type": "LIMIT",
        "trade_currency": "USDT",
        "status": "CANCELLED",
        "id": "01a0ce36-e743-7634-b063-8e698df2b695",
        "client_order_id": "my-order-123",
        "stoploss_price": null,
        "stoploss_limit_price": null,
        "takeprofit_price": null,
        "takeprofit_limit_price": null,
        "stop_order_type": null,
        "trigger_price": null,
        "trigger_direction": null,
        "trigger_by": null,
        "close_on_trigger": null,
        "tpsl_mode": null,
        "asset_uuid": "01903a7b-bf65-707d-a7dc-d7b84c3c756c",
        "symbol": "BTCUSDT",
        "future_position_uuid": "01a0ce36-e741-76ce-bb59-c59dff4e0b78",
        "position_id": "01a0ce36-e741-76ce-bb59-c59dff4e0b78"
    }
}

Response fields

FieldDescription
idOrder UUID.
client_order_idClient order id, or null if not set. See Client order ID.
position_idUUID of the position the order belongs to. Same value as future_position_uuid. See Order and position IDs.
future_position_uuidPosition UUID. Same value as position_id.
asset_uuidAsset UUID.
symbolTrading pair (e.g. XRPUSDT).
order_typeLONG, SHORT, STOPLOSS, or TAKEPROFIT.
trigger_typeMARKET or LIMIT.
statusUNTRIGGERED (waiting conditional order), CREATED (on the book; also a waiting SL/TP), PARTIAL_FILLED, FILLED, CANCELLED (cancelled by the user, or rejected by the exchange after triggering) or SYSTEM_CANCELLED (cancelled by the system).
trade_currencyUSDT or INR.
quantity / filled_quantityOrdered and filled quantity (base asset).
price / filled_priceOrder price and average fill price (USDT). On an SL/TP order, price is the limit price for LIMIT and the trigger price for MARKET.
actual_amountOrder value (quantity × price) in trade_currency.
leverageLeverage.
hedge_rateINR/USDT rate for the order (1 for USDT).
reasonPlacement result, e.g. {"message": "OK"}, or null.
tpsl_modeOn an SL/TP order: its mode, FULL or PARTIAL. On a normal or conditional order: the mode of its SL/TP, or null when it has none.
stoploss_price / stoploss_limit_priceSL trigger and limit price set on a normal or conditional order (USDT). null on SL/TP orders and when unset.
takeprofit_price / takeprofit_limit_priceTP trigger and limit price set on a normal or conditional order (USDT). null on SL/TP orders and when unset.
trigger_priceTrigger price of an SL/TP order or a conditional order (USDT), otherwise null.
stop_order_typeSTOP on a conditional order, otherwise null.
trigger_directionRISE or FALL on a conditional order, otherwise null.
trigger_byLAST_PRICE on a conditional order, otherwise null.
close_on_triggertrue or false on a conditional order, otherwise null.
created_at / updated_atISO-8601 timestamps (UTC).

Response shape matches Order by id.

Execution report by order id or client order id

GET /fapi/v1/futures/orders/execution-report takes the same order_id / client_order_id query parameters, rules and errors as Get order detail, and returns the order with its fills. See Execution report.

curl -X GET "https://trade.mudrex.com/fapi/v1/futures/orders/execution-report?client_order_id=my-order-123" \
  -H "X-Authentication: your-secret-key"

Cancel by client order id

You can cancel with the existing path cancel (DELETE /fapi/v1/futures/orders/{order_id}), or by query using your client id:

curl -X DELETE "https://trade.mudrex.com/fapi/v1/futures/orders?client_order_id=my-order-123" \
  -H "X-Authentication: your-secret-key"

Response schema matches path cancel. See Cancel order by id for fields and the note on empty data strings on some successful cancels.

Cancel by Mudrex UUID uses the path parameter. Cancel by client_order_id uses the query form above. Query order_id is not supported on this endpoint and returns 400 order id or client order id is required.

Risk orders (SL / TP)

On Set SL/TP, optional fields set the client id on the new stop-loss / take-profit order:

FieldTypeRequiredDescription
stoploss_client_order_idstringNoClient id for the stop-loss order created by this call.
takeprofit_client_order_idstringNoClient id for the take-profit order created by this call.

Same format and uniqueness rules as client_order_id. Once accepted, the id is immutable. Reusing an already-accepted id on a later create is rejected with 409 "client order id already exists".

On Edit SL/TP, stoploss_client_order_id / takeprofit_client_order_id (when used) locate an existing risk order. Edit does not attach or change a client id on an existing leg.

Partial close

On Partial Close, optional body field:

FieldTypeRequiredDescription
client_order_idstringNoBecomes the client_order_id of the generated close order (not the original entry order or the position). Same uniqueness / 409 rules as place.

Where client_order_id appears on reads

Any response that returns an order object can include client_order_id (null when unset), including open orders, order history, get-by-id, get detail, and place-order success data.

Errors

❕Common errors
HTTPError textMeaning / how to fix
400invalid order identifierInvalid format (disallowed characters or longer than 64) on a create path. On reads, an invalid id returns 404 order not found.
400order id or client order id is requiredNo identifier on get detail.
404order not foundUnknown order_id or client_order_id.
400order id and client order id do not refer to the same orderBoth identifiers provided and they identify different orders.
409client order id already existsPreviously accepted client_order_id reused on a create path.

Omit client_order_id when you do not want to set one. An empty string ("") is currently treated as unset (order is created with client_order_id: null).

Notes

  • Prefer Get order detail when you need to resolve either a Mudrex UUID or your own client id.
  • Path cancel by UUID remains available; use query cancel when you only have client_order_id.
  • After a lost Place Order response: GET by client_order_id first. If found, that is the original. If not found, POST. If POST returns 409, GET again.
  • After a 400 on Place order v2, such as Params error, GET the order by client_order_id. The request can still leave an order with status SYSTEM_CANCELLED, and reason carries the rejection reason.

Did this page help you?