Skip to main content
To send orders, first subscribe to the Execution Report stream. All order responses and updates are sent as ExecutionReport messages. Send requests with the NewOrderSingle, OrderCancelRequest, OrderCancelReplaceRequest and OrderControlRequest commands.

Typical workflow

  1. Subscribe to MarketDataSnapshot for the relevant securities.
  2. Subscribe to ExecutionReport with StartDate set to the Timestamp of the last ExecutionReport you processed, to recover order state.
  3. Subscribe to Trade with StartDate set to the Timestamp of the last Trade you processed, to recover any missed trades.
  4. Keep a map of OrderID to the last ExecutionReport received for each open order.
  5. Keep a set of the ClOrdID of each pending request.
  6. To submit an order, generate a new ClOrdID and send a NewOrderSingle with the ClOrdID, Side, Price, OrderQty, Strategy and other fields for the request.
  7. The response arrives on the ExecutionReport stream with the ClOrdID from the NewOrderSingle. If the order is accepted (ExecType PendingNew), add it to your open orders.
  8. To cancel or modify an open order, generate a new ClOrdID and send an OrderCancelRequest or OrderCancelReplaceRequest with that ClOrdID, the OrderID or the OrigClOrdID from the previous successful request, and the remaining fields.
  9. Fills arrive as ExecutionReport messages with ExecType Trade.

Order state change matrices

Order states and transitions on the WebSocket API follow FIX 4.4 closely. The main difference is how a rejected cancel or replace is reported. In FIX 4.4, and on the Prime FIX API, it arrives as a separate OrderCancelReject message. The WebSocket API has no OrderCancelReject message: it sends an ExecutionReport with ExecType CancelRejected or ReplaceRejected instead. In the tables below, A and B are ClOrdID values. A response shown as (B,A) has ClOrdID B and OrigClOrdID A. Rows with the same time are alternatives.

Filled order

An order with CumQty > 0 receives ExecutionReports with CumQty set to the filled size. An order that is partially filled and then canceled receives an ExecutionReport with the terminal status Canceled and CumQty > 0.

Canceled order

Replace to increase quantity

Replace during fill