Cancel Order
Send on an established WebSocket connection to cancel a previously placed order.
Submits a cancel request for the given orderId. A successful response confirms the
cancel request was accepted, not that the order is already canceled — confirm final
status on the orders subscription channel or via Get Order.
See the REST Cancel Order endpoint for validation error codes.
Requires access token scope: trade_trade on the token used to open the connection.
Idempotency: canceling an order already in pending_cancel is accepted again.
Header Params
-
Authorizationstring requiredBearer token for authorization
Body Params
object
-
typestring enum requiredMust becancel_order.cancel_order -
reqIdstringOptional client correlation ID, echoed in the response when valid. Omitted from the response when not supplied or whenreqIditself fails validation. Use a freshreqIdon each send (including retries). Do not usereqIdfor idempotency — useorderIdonly to identify the order being canceled. -
accountIdstring requiredThe ID of the account -
orderIdstring uuid requiredThe order ID to cancel (UUID). Validation errors use fieldidin the error payload (notorderId), even though the request field isorderId.
Responses
101
Switching Protocols. The server responds with WsCancelOrderResponse for each cancel_order message.
WsCancelOrderResponse for each cancel_order message.Response Body
cancel_order message. Accepted responses confirm the cancel
request was accepted; rejected responses contain a structured error.
Confirm final cancellation on the orders channel or via Get Order.ONE OF
-
typestring enum requiredcancel_order_response -
reqIdstringEchoed when the client supplied a validreqId. -
statusstring enum requiredaccepted -
orderIdstring uuid requiredEchoes theorderIdfrom thecancel_orderrequest.
-
typestring enum requiredcancel_order_response -
reqIdstringEchoed when the client supplied a validreqId. -
statusstring enum requiredrejected -
errorobject requiredStructured error whenstatusisrejected. Error codes mirror REST domain codes (e.g.trade:invalidQuantity) without the RESTbackend:prefix.error object
-
codestring requiredError code. Common values:
common:invalidArgument— validation failure (seefield)common:permissionDenied— missingtrade_tradescopetrade:orderNotCancelable— cancel on completed/canceled orderinternal:internalError— internal failure (generic message)internal:timeout— request timed out or connection canceled
-
fieldstring nullableRequest field associated with the error when applicable. Cancel validation usesidfororderIdwire field errors. -
messagestring requiredHuman-readable error detail.
-
403
Forbidden - Insufficient permissions
Response Body
object
-
errorstring required -
errorNamestring required -
reqIdstring required