Cancel Order
- Provide either
OrderID (37)orClOrdID (11)to identify the order. If both are provided and they conflict,OrderIDtakes precedence. - Only unfilled or partially filled orders can be cancelled.
- For Spot, use
OrderFilter (30024)to distinguish between normal orders, TP/SL orders, and conditional orders. - The final
OrdStatusreflects the fill state at the time of cancellation:4(Canceled) if the order had no fills;F(PartiallyFilledCanceled) if it had partial fills.
Message Type
OrderCancelRequest — MsgType F
Request Fields
| Tag | Field | Required | Type | Description |
|---|---|---|---|---|
| 30010 | Category | Y | String | Product type. Currently spot only |
| 55 | Symbol | Y | String | Symbol name, e.g. BTCUSDT (uppercase) |
| 37 | OrderID | N | String | Server-assigned order ID. At least one of OrderID or ClOrdID required |
| 11 | ClOrdID | N | String | Client order ID. At least one of OrderID or ClOrdID required |
| 30024 | OrderFilter | N | String | Spot only. Order (default); tpslOrder; StopOrder |
Response
The server responds with an OrderCancelAck (XCA):
| Tag | Field | Required | Description |
|---|---|---|---|
| 37 | OrderID | N | Server-assigned order ID. Absent when the cancel is rejected |
| 11 | ClOrdID | N | Echoes the request's ClOrdID if provided; otherwise echoes the original order's orderLinkId. Absent when the cancel is rejected — correlate rejects to requests by send order |
| 150 | ExecType | N | On acceptance: 6 (PendingCancel). Absent on rejection — an XCA lacking 150/39 but carrying 103/58 indicates a reject |
| 39 | OrdStatus | N | On acceptance: 6 (PendingCancel). Absent on rejection |
| 103 | OrdRejReason | N | Bybit internal error code (e.g. 170213). Present only when the cancel is rejected |
| 58 | Text | N | Human-readable reject reason. Present only when the cancel is rejected |
OrderCancelAck is an acceptance confirmation (ExecType=6 PendingCancel) carrying only minimal state fields. The terminal cancel state (ExecType=4 Canceled or F PartiallyFilledCanceled) is delivered via a subsequent ExecutionReport (35=8) push with full order fields and 30040 CancelType. That push is only emitted in ResponseMode=1 (Everything).
Request Example
8=FIX.4.4|9=105|35=F|49=FIX_CLIENT|56=BYBIT_FIX_SERVER|34=4|52=20240101-08:02:00.000|
30002=1704096120000|30001=5000|
30010=spot|55=BTCUSDT|37=1234567890123456|10=xxx|
Note: | represents SOH (0x01) in actual wire format.
PendingCancel Ack (ExecType=6)
- In
OnlyAcksmode this is the only response. - In
Everythingmode this arrives first, followed by anExecutionReport(ExecType=4Canceled orFPartiallyFilledCanceled) confirming the final state. - Rate-limit headers (
30005TraceId,30007BapiLimit,30008BapiLimitStatus,30009BapiLimitResetTimestamp) appear on this ack only — subsequent state pushes omit them. - If the request carried
30006 ReqId, this ack echoes it back; the subsequent state push does not carry30006.
8=FIX.4.4|9=265|35=XCA|34=2|49=BYBIT_FIX_SERVER|52=20260824-10:13:20.321|56=FIX_CLIENT|
30005=56fc3d7313c3739e7ca1f36ddda54c65|30006=f15d0d96-a643-4b13-9186-1a9f3138752a|30007=20|30008=19|30009=1787566400320|
11=b52e9783-1a34-4264-aae3-bd5e6ca3f522|37=2288666911934089984|150=6|39=6|10=108|
Failed Response Example ACK (Rejected)
On rejection the XCA omits 150/39/37/11 — correlate rejects to requests by send order, and read 103 (internal error code) plus 58 (message) for the reason.
8=FIX.4.4|9=184|35=XCA|34=2|49=BYBIT_FIX_SERVER|52=20260820-06:28:36.328|56=FIX_CLIENT|
30005=2119c192fd5916fa6d5f065567a73293|30007=20|30008=19|30009=1787207316327|
58=Order does not exist.|103=170213|10=121|
Canceled Terminal Push Example (ExecType=4)
In Everything mode, after the PendingCancel Ack the server pushes the terminal state via an ExecutionReport (35=8) carrying full order fields, 30040 CancelType (e.g. CancelByUser), and an internal reason code in OrdRejReason (103) (e.g. EC_PerCancelRequest).
8=FIX.4.4|9=402|35=8|34=3|49=BYBIT_FIX_SERVER|52=20260824-10:13:20.325|56=FIX_CLIENT|
11=b52e9783-1a34-4264-aae3-bd5e6ca3f522|37=2288666911934089984|150=4|39=4|
30010=spot|55=BTCUSDT|54=1|40=2|38=0.001000|44=50000.0|59=1|30013=UNKNOWN|30014=N|
151=0.001|30041=50.0000000|14=0|30038=0.0000000|
60=20260824-10:13:20.320|30039=20260824-10:12:36.590|
103=EC_PerCancelRequest|30040=CancelByUser|
30018=None|30019=N|30046=77297.5|10=146|