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:
| Rule | Value |
|---|---|
| Allowed characters | Letters (A–Z, a–z), digits (0–9), hyphen (-), underscore (_) |
| Length | 1–64 characters when set |
| Case | Case-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
| Parameter | Type | Required | Description |
|---|---|---|---|
order_id | string | Conditional | Mudrex order UUID. Provide this or client_order_id. |
client_order_id | string | Conditional | Your 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.
| Query | Behaviour |
|---|---|
| Neither | 400: "order id or client order id is required" |
| One | Resolve that order |
| Both, same order | 200: return the order |
| Both, different orders | 400: "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
| Field | Description |
|---|---|
id | Order UUID. |
client_order_id | Client order id, or null if not set. See Client order ID. |
position_id | UUID of the position the order belongs to. Same value as future_position_uuid. See Order and position IDs. |
future_position_uuid | Position UUID. Same value as position_id. |
asset_uuid | Asset UUID. |
symbol | Trading pair (e.g. XRPUSDT). |
order_type | LONG, SHORT, STOPLOSS, or TAKEPROFIT. |
trigger_type | MARKET or LIMIT. |
status | UNTRIGGERED (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_currency | USDT or INR. |
quantity / filled_quantity | Ordered and filled quantity (base asset). |
price / filled_price | Order 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_amount | Order value (quantity × price) in trade_currency. |
leverage | Leverage. |
hedge_rate | INR/USDT rate for the order (1 for USDT). |
reason | Placement result, e.g. {"message": "OK"}, or null. |
tpsl_mode | On 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_price | SL trigger and limit price set on a normal or conditional order (USDT). null on SL/TP orders and when unset. |
takeprofit_price / takeprofit_limit_price | TP trigger and limit price set on a normal or conditional order (USDT). null on SL/TP orders and when unset. |
trigger_price | Trigger price of an SL/TP order or a conditional order (USDT), otherwise null. |
stop_order_type | STOP on a conditional order, otherwise null. |
trigger_direction | RISE or FALL on a conditional order, otherwise null. |
trigger_by | LAST_PRICE on a conditional order, otherwise null. |
close_on_trigger | true or false on a conditional order, otherwise null. |
created_at / updated_at | ISO-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:
| Field | Type | Required | Description |
|---|---|---|---|
stoploss_client_order_id | string | No | Client id for the stop-loss order created by this call. |
takeprofit_client_order_id | string | No | Client 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:
| Field | Type | Required | Description |
|---|---|---|---|
client_order_id | string | No | Becomes 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
client_order_id appears on readsAny 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
| HTTP | Error text | Meaning / how to fix |
|---|---|---|
| 400 | invalid order identifier | Invalid format (disallowed characters or longer than 64) on a create path. On reads, an invalid id returns 404 order not found. |
| 400 | order id or client order id is required | No identifier on get detail. |
| 404 | order not found | Unknown order_id or client_order_id. |
| 400 | order id and client order id do not refer to the same order | Both identifiers provided and they identify different orders. |
| 409 | client order id already exists | Previously 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_idfirst. If found, that is the original. If not found, POST. If POST returns409, GET again. - After a
400on Place order v2, such asParams error, GET the order byclient_order_id. The request can still leave an order with statusSYSTEM_CANCELLED, andreasoncarries the rejection reason.
Updated 9 days ago
