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 before any order is created (validation, margin, or risk), the id is normally not consumed and you may send it again. A known edge case can still consume the id on some hard rejects; that is being fixed. After any uncertain place attempt, GET by client_order_id before 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.
# 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 | 404 — "order not found" |
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",
"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 | Order status (e.g. CREATED, FILLED, CANCELLED, SYSTEM_CANCELLED). |
trade_currency | USDT or INR. |
quantity / filled_quantity | Ordered and filled quantity (base asset). |
price / filled_price | Order price and average fill price (USDT). |
actual_amount | Order value (quantity × price) in trade_currency. On partially filled orders with the remainder cancelled, see the known issue below. |
leverage | Leverage. |
hedge_rate | INR/USDT rate for the order (1 for USDT). |
reason | Placement result, e.g. {"message": "OK"}, or null. |
created_at / updated_at | ISO-8601 timestamps (UTC). |
Known issue:actual_amounton partially filled ordersWhen an order is partially filled and the remainder is cancelled,
actual_amountreturns price × ordered quantity instead of the filled value, andstatuscan remainPARTIAL_FILLED. Fully filled orders are not affected. Trading fees are charged on the filled quantity only.Workaround: calculate the filled notional from the fill fields.
- USDT orders:
filled_quantity × filled_price- INR orders:
filled_quantity × filled_price × hedge_rate(filled_priceis always in USDT)
Response shape matches Order by id.
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.
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
| Scenario | HTTP | Message |
|---|---|---|
| Invalid format (disallowed characters or longer than 64) | 400 | invalid order identifier |
| No identifier on get detail | 400 | order id or client order id is required |
Unknown order_id or client_order_id | 404 | order not found |
| Both identifiers provided and they identify different orders | 404 | order not found |
Previously accepted client_order_id reused on a create path | 409 | client order id already exists |
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.
Updated 11 days ago
