WebSocket›Trade WebSocket

WSS

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.

Connection

WSS wss://app.bitgo-test.com/api/prime/trading/v1/ws

Channel cancel_order

Authorization The access token used to open the connection must have the trade_trade scope to send cancel_order messages. If the token is missing or invalid the upgrade is refused with HTTP 403 and no socket is opened; a token without trade_trade gets a WebSocket cancel_order_response with status: rejected and error code common:permissionDenied.

Messages sent

Cancel order

Cancel order request.

object

  • type string enum required
    Must be cancel_order.
    cancel_order
  • reqId string
    Optional client correlation ID, echoed in the response when valid. Omitted from the response when not supplied or when reqId itself fails validation. Use a fresh reqId on each send (including retries). Do not use reqId for idempotency — use orderId only to identify the order being canceled.

    up to 36 characters

  • accountId string required
    The ID of the account
  • orderId string uuid required
    The order ID to cancel (UUID). Validation errors use field id in the error payload (not orderId), even though the request field is orderId.

Messages received

Cancel order response

The server responds with a cancel_order_response for each cancel_order message.

ONE OF

  • type string enum required
    cancel_order_response
  • reqId string
    Echoed when the client supplied a valid reqId.
  • status string enum required
    accepted
  • orderId string uuid required
    Echoes the orderId from the cancel_order request.