You can cancel all active orders for your account over WebSocket using the cancel_all_orders message.

Example Request

{
  "type": "cancel_all_orders",
  "params": {}
}

Sample Code

# Python (websocket-client)
import json, websocket

API_KEY = "YOUR_API_KEY"

def send(ws, obj): ws.send(json.dumps(obj))

def on_open(ws):
    # Authenticate
    send(ws, {"type": "auth", "params": {"api_key": API_KEY}})
    # Cancel all orders
    send(ws, {"type": "cancel_all_orders", "params": {}})

ws = websocket.WebSocketApp(
    "wss://trade.qfex.com?api_key=YOUR_API_KEY",
    on_open=on_open,
    on_message=lambda _, m: print("Message:", m)
)
ws.run_forever()

Example Response

Every cancelled order will generate an order_response with status CANCELLED.
{
  "order_response": {
    "order_id": "5b309929-206f-40ec-804d-cbe46e81afc1",
    "symbol": "AAPL-USD",
    "status": "CANCELLED",
    "quantity": 1.0,
    "price": 200.0,
    "side": "BUY",
    "type": "LIMIT",
    "time_in_force": "GFD",
    "user_id": "0020ce8e-eaee-480e-8d7f-b9241d756ee5",
    "client_order_id": "my-client-oid",
    "quantity_remaining": 1.0
  }
}
This cancels all open orders across all symbols for the authenticated account. If you only want to cancel specific orders, use the Cancel Order endpoint instead.