Category: User Permissions: Operator, Trading Call Type: Synchronous

CancelReplaceOrder is a single API call that both cancels an existing order and replaces it with a new order. Canceling one order and replacing it with another also cancels the order’s priority in the order book. You can use ModifyOrder to preserve priority in the book; but ModifyOrder only allows a reduction in order quantity.

Warning: CancelReplaceOrder sacrifices the order's priority in the order book.




integer. The ID of the Order Management System on which the order is being canceled and replaced by another order.


long integer. The ID of the order to replace with this order.


long integer. A user-assigned ID for the new, replacement order (like a purchase-order number assigned by a company). This ID is useful for recognizing future states related to this order. If unspecified, ClientOrderId defaults to 0.


integer. An integer representing the type of the replacement order: 0 Unknown 1 Market 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade


integer. An integer representing the side of the replacement order: 0 Buy 1 Sell 2 Short 3 Unknown (error condition)


integer. The ID of the account under which the original order was placed and the new order will be placed.


integer. The ID of the instrument being traded.


Boolean. The display quantity is the quantity of a product shown to the market to buy or sell. A larger quantity may be wanted or available, but it may disadvantageous to display it when buying or selling. The display quantity is set when placing an order (using SendOrder or CancelReplaceOrder for instance). If you enter a Limit order with reserve, you must set useDisplayQuantity to true.


real. The quantity of a product that is available to buy or sell that is publicly displayed to the market.


real. The price at which to execute the new order, if the new order is a limit order.


real. The price at which to execute the new order, if the order is a stop order.


real. The reference price of the instrument in the order.


integer. An integer that represents the type of price you set in a stop/trailing order to "peg the stop." 0 Unknown (error condition) 1 Last 2 Bid 3 Ask 4 Midpoint


integer. An integer that represents the period during which the new order is executable. One of: 0 Unknown (error condition) 1 GTC (good 'til canceled, the default) 2 OPG (execute as close to opening price as possible) 3 IOC (immediate or canceled) 4 FOK (fill or kill — fill the order immediately, or cancel it immediately) 5 GTX (good 'til executed) 6 GTD (good 'til date)


integer. One Cancels the Other — If the order being canceled in this call is order A, and the order replacing order A in this call is order B, then OrderIdOCO refers to an order C that is currently open. If order C executes, then order B is canceled. You can also set up order C to watch order B in this way, but that will require an update to order C.


real. The amount of the order (either buy or sell).


  "replacementOrderId": 1234,
  "replacementClOrdId": 1561,
  "origOrderId": 5678,
  "origClOrdId": 91011,

The response returns the new replacement order ID and echoes back any replacement client ID you have supplied, along with the original order ID and the original client order ID.



integer. The order ID assigned to the replacement order by the server.


long integer. Echoes the contents of the clientOrderId value from the request.


integer. Echoes orderIdToReplace, which is the original order you are replacing.


long integer. Provides the client order ID of the original order (not specified in the requesting call).

Last updated