The cancel replace feature in the REST API allows a user to cancel an existing active order and place a new order in a single call. The new order will use fields from the existing order (symbol, side, and accountType) and replace the values for the rest of the fields if specified. The replacement order can amend price, quantity, amount, type, timeInForce, and allowBorrow fields. Partially filled orders are also eligible for cancellation and replacement. Similar functionality is provided for existing active smart orders where price, stopPrice, quantity, amount, type, and timeInForce can be amended for untriggered smart orders.
An optional parameter called proceedOnFailure is available for both normal and smart orders, which when set will continue to place the new order even if the cancelation of the existing order fails.
Rest API Endpoints
Endpoint: PUT /orders/{id} or PUT /orders/{cid:}
Body params: clientOrderId, price, quantity, amount, type, timeInForce, allowBorrow, proceedOnFailure
Response params: id, clientOrderId
Endpoint: PUT /smartorders/{id} or PUT /smartorders/{cid:}
Body params: clientOrderId, price, stopPrice, quantity, amount, type, timeInForce, proceedOnFailure
Response params: id, clientOrderId