clientOrderId is an optional tag you attach to an order on
POST /orders-v3. It is your own value, echoed back to you on the
create response, the order row, the orders channel, and in the fills grain.
clientOrderId has no effect on funds, fees, or matching.
Why it is useful
You do not know an order’s id untilPOST /orders-v3 responds. That makes correlation awkward when
the pieces of one order’s story arrive on different paths: the HTTP response, and then separate
publications on account:orders_v3_#{address}. A clientOrderId
is a value you choose before you submit, so you can stitch those messages together against your own
records the moment each one lands, rather than waiting on the id.
This is the standard pattern on async trading platforms: attach your own reference at submit time,
then match it back as updates flow in.
Format
Uniqueness
AclientOrderId must be unique per address — not just within one request, but across every order
you currently have in the system.
The safe rule is to treat each clientOrderId as single-use. Generate a fresh value per order — for
example strategy-<nonce> — and never reuse one, exactly as you would mint a fresh salt per order.
Where it shows up
clientOrderId is echoed on the order grain:
POST /orders-v3— the201body’sordersarray echoes yourclientOrderIdon each result when you set one, alongsideorderId,status, andcommandId.GET /orders-v3— each order row carriesclientOrderIdwhen set.account:orders_v3_#{address}— each publication carries it too when set.
GET /fills-v3andaccount:fills_v3_#{address}— each fill carries theclientOrderIdof the order on that side (the maker’s tag on maker rows, the taker’s on taker rows) when that order carried a tag; otherwise the field is omitted.
Recommended pattern
JavaScript
timeInForce is write-only, recording it against your
clientOrderId at submit time is the reliable way to know later which type an order used.
Related
Posting orders
The submit flow this field rides on.
Time in force
The other write-only field worth recording against your tag.
Tracking your orders
Keep a local store keyed by an id you control.
EIP-712 order signing
Why the order id is a digest, not a server-assigned value.
External user id
A per-person tag when one SX account places orders for many people.