Skip to main content

Modify Order via WebSocket

To modify orders on Rails platform, use the WebSocket v2 API and subscribe to the Order Creation Stream. This new WebSocket API supports every request and notification from the legacy Order Creation WebSocket. The specifications and behavior remain the same.

Order Modification Workflow

Order modification is done by submitting a Modify Order request. You will receive four responses in sequence:
  • Acknowledgment: Confirms the request was received and validates basic parameters
  • Original Order Modified Notice: Confirms the original order has been successfully cancelled and is no longer present in the system
  • New Order Pending Notice: Confirms a new order was created with the updated parameters, pending acceptance
  • Creation Confirmation: Confirms the new order was accepted and created in the order book
Key differences:
AcknowledgmentOriginal Order Modified NoticeNew Order Pending NoticeCreation Confirmation
Result TypemodifyOrdermodifyOrdermodifyOrdercreateOrder
Bodymodifying orderoriginal order modifiednew order created, pending acceptanceorder accepted
Order Statusmodifyingmodifiedpendingactive
Status Code202200200200
API Quota UsedIncludedNot IncludedNot IncludedNot included
Note that a unique clientRequestId can be used to correlate acknowledgment, confirmation, and any error responses for a single request.

Comparison with Cancel and Create Workflow

The order modification workflow provides a more streamlined process with fewer steps and lower overall latency compared to cancelling an order and creating a new one separately. Despite modifying an existing order, the modified order is treated as a new order in the order book with a new order ID, and the original order is cancelled. Since it’s essentially a cancellation followed by a new order creation, it’s subject to the same Order Limits and Restrictions as a regular order creation.