Skip to main content

Amend Order

important
  • Bybit uses AtomicReplaceRequest (XAR) for order amendment. The standard FIX OrderCancelReplaceRequest (G) is not supported.
  • Provide either OrderID (37) or ClOrdID (11) to identify the order. If both are provided and they conflict, OrderID takes 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 OrderQty causes the order to lose its current queue position. Decreasing OrderQty does not affect queue position.

Message Type

AtomicReplaceRequest — MsgType XAR

Request Fields

TagFieldRequiredTypeDescription
30010CategoryYStringProduct type. Currently spot only
55SymbolYStringSymbol name, e.g. BTCUSDT (uppercase)
37OrderIDNStringServer-assigned order ID. At least one of OrderID or ClOrdID required
11ClOrdIDNStringClient order ID. At least one of OrderID or ClOrdID required
38OrderQtyNQtyNew order quantity
44PriceNPriceNew order price
99StopPxNPriceNew trigger price for conditional orders
30026TakeProfitPriceNPriceNew take profit trigger price. Pass 0 to clear an existing take profit.
30027StopLossPriceNPriceNew stop loss trigger price. Pass 0 to clear an existing stop loss.
30030TpLimitPriceNPriceNew TP limit price
30031SlLimitPriceNPriceNew SL limit price

Response

The server responds with an OrderAmendAck (XAA):

TagFieldRequiredDescription
37OrderIDNServer-assigned order ID. Absent when the amend is rejected
11ClOrdIDNOriginal order's ClOrdID (orderLinkId). Absent when the amend is rejected — correlate rejects to requests by send order
150ExecTypeNOn acceptance: E (PendingReplace). Absent on rejection — an XAA lacking 150/39 but carrying 103/58 indicates a reject
39OrdStatusNOn acceptance: E (PendingReplace). Absent on rejection
103OrdRejReasonNBybit internal error code (e.g. 10001). Present only when the amend is rejected
58TextNHuman-readable reject reason. Present only when the amend is rejected
info

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 OnlyAcks mode this is the only response.
  • In Everything mode this arrives first, followed by an ExecutionReport (35=8) carrying the amended order state.
  • Rate-limit headers (30005 TraceId, 30007 BapiLimit, 30008 BapiLimitStatus, 30009 BapiLimitResetTimestamp) 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 carry 30006.
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|