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 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

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 orders404 — "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

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.
statusOrder status (e.g. CREATED, FILLED, CANCELLED, SYSTEM_CANCELLED).
trade_currencyUSDT or INR.
quantity / filled_quantityOrdered and filled quantity (base asset).
price / filled_priceOrder price and average fill price (USDT).
actual_amountOrder value (quantity × price) in trade_currency. On partially filled orders with the remainder cancelled, see the known issue below.
leverageLeverage.
hedge_rateINR/USDT rate for the order (1 for USDT).
reasonPlacement result, e.g. {"message": "OK"}, or null.
created_at / updated_atISO-8601 timestamps (UTC).
🚧

Known issue: actual_amount on partially filled orders

When an order is partially filled and the remainder is cancelled, actual_amount returns price × ordered quantity instead of the filled value, and status can remain PARTIAL_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_price is 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:

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

ScenarioHTTPMessage
Invalid format (disallowed characters or longer than 64)400invalid order identifier
No identifier on get detail400order id or client order id is required
Unknown order_id or client_order_id404order not found
Both identifiers provided and they identify different orders404order not found
Previously accepted client_order_id reused on a create path409client 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_id first. If found, that is the original. If not found, POST. If POST returns 409, GET again.

Did this page help you?