Amend Order
- Bybit uses
AtomicReplaceRequest (XAR)for order amendment. The standard FIXOrderCancelReplaceRequest (G)is not supported. - Provide either
OrderID (37)orClOrdID (11)to identify the order. If both are provided and they conflict,OrderIDtakes precedence. - Only include fields that need to change. Omitted fields retain their current values.
- Only unfilled or partially filled orders can be amended.
- Queue priority: Amending the price to one closer to the best bid/offer improves queue position. Increasing
OrderQtycauses the order to lose its current queue position. DecreasingOrderQtydoes not affect queue position.
Message Type
AtomicReplaceRequest — MsgType XAR
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 |
| 38 | OrderQty | N | Qty | New order quantity |
| 44 | Price | N | Price | New order price |
| 99 | StopPx | N | Price | New trigger price for conditional orders |
| 30026 | TakeProfitPrice | N | Price | New take profit trigger price. Pass 0 to clear an existing take profit. |
| 30027 | StopLossPrice | N | Price | New stop loss trigger price. Pass 0 to clear an existing stop loss. |
| 30030 | TpLimitPrice | N | Price | New TP limit price |
| 30031 | SlLimitPrice | N | Price | New SL limit price |
Response
The server responds with an OrderAmendAck (XAA):
| Tag | Field | Required | Description |
|---|---|---|---|
| 37 | OrderID | N | Server-assigned order ID. Absent when the amend is rejected |
| 11 | ClOrdID | N | Original order's ClOrdID (orderLinkId). Absent when the amend is rejected — correlate rejects to requests by send order |
| 150 | ExecType | N | On acceptance: E (PendingReplace). Absent on rejection — an XAA lacking 150/39 but carrying 103/58 indicates a reject |
| 39 | OrdStatus | N | On acceptance: E (PendingReplace). Absent on rejection |
| 103 | OrdRejReason | N | Bybit internal error code (e.g. 10001). Present only when the amend is rejected |
| 58 | Text | N | Human-readable reject reason. Present only when the amend is rejected |
OrderAmendAck is an acceptance confirmation (ExecType=E PendingReplace) carrying only minimal state fields — the server does not return full order details (qty, price, etc.) in this ack. The terminal amended state is delivered via a subsequent ExecutionReport (35=8) push (in ResponseMode=1), or can be queried via REST.
Request Example
8=FIX.4.4|9=239|35=XAR|34=3|49=FIX_CLIENT|52=20260824-10:37:21.002|56=BYBIT_FIX_SERVER|
30002=1787567841002|30001=5000|
30010=spot|55=BTCUSDT|30006=50fe3e28-f97c-487d-8f5d-8651acde7bc1|
37=2288679064669883136|11=e05649fe-e1a5-482a-821e-68cc25ed8254|38=0.002|10=140|
Note: | represents SOH (0x01) in actual wire format.
PendingReplace Ack (ExecType=E)
Immediate acceptance ack for the amend request. ExecType=E (PendingReplace) and OrdStatus=E (PendingReplace) mean the server has accepted and queued the amend — the terminal state is not yet delivered.
- In
OnlyAcksmode this is the only response. - In
Everythingmode this arrives first, followed by anExecutionReport (35=8)carrying the amended order 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=264|35=XAA|34=2|49=BYBIT_FIX_SERVER|52=20260824-10:37:21.258|56=FIX_CLIENT|
30005=6bf19e217c37870d49032dbf7cda90dc|30006=50fe3e28-f97c-487d-8f5d-8651acde7bc1|30007=10|30008=9|30009=1787567841257|
11=e05649fe-e1a5-482a-821e-68cc25ed8254|37=2288679064669883136|150=E|39=E|10=140|
Amended Order State Push (ExecType=5)
In Everything mode, after the PendingReplace Ack the server pushes the amended order state via ExecutionReport (35=8). 150=5 (Replaced) indicates the report carries a Replace event; 39=0 (New) means the order's continuing status is still New after the amend (UTA's OrdStatus does not include a Replaced value). OrderID is unchanged (amend is an atomic replace); 38 OrderQty / 44 Price reflect the amended values; 30039 CreateTime remains the original submission time while 60 TransactTime marks the amend event. Neither rate-limit headers nor 30006 ReqId are attached to this push.
8=FIX.4.4|9=360|35=8|34=3|49=BYBIT_FIX_SERVER|52=20260824-10:37:21.263|56=FIX_CLIENT|
11=e05649fe-e1a5-482a-821e-68cc25ed8254|37=2288679064669883136|150=5|39=0|
30010=spot|55=BTCUSDT|54=1|40=2|38=0.002000|44=50000.0|59=1|30013=UNKNOWN|30014=N|
151=0.002|30041=100.0000000|14=0|30038=0.0000000|
60=20260824-10:37:21.258|30039=20260824-10:36:45.309|
30018=None|30019=N|30046=77307.8|10=213|
Response Example (Rejected)
On rejection the XAA 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=239|35=XAA|34=2|49=BYBIT_FIX_SERVER|52=20260820-03:47:07.284|56=FIX_CLIENT|
30005=43a6c52966d9c0f137d9fedf7e8c12a0|30007=10|30008=9|30009=1787197627283|
58=The order remains unchanged as the parameters entered match the existing ones.|103=10001|10=085|