Skip to main content
Order cancellation is performed over WebSocket.
  • Endpoint: wss://trade.qfex.com?api_key=YOUR_API_KEY
  • Authenticate within 1 minute of connecting.

1) Authenticate

Send this immediately after you connect:

2) Cancel Order

You can cancel by order_id, client_order_id, twap_id, or client_twap_id by setting the order_id field and using cancel_order_id_type to specify how the value should be interpreted.
  • order_id — always a UUID v4 and unique. Cancels exactly one order.
  • client_order_idnot guaranteed unique. Cancels all orders for that symbol that share this client order id.
  • twap_id — server-generated TWAP id. Cancels the matching TWAP.
  • client_twap_id — client-supplied TWAP id. Cancels the matching TWAP for that symbol.

Cancel by order id (single order)

Cancel by client order id (may cancel multiple)

Cancel by TWAP id

Cancel by client TWAP id

Parameters

⚠️ Notes:
  • Put the identifier value in the order_id field for all four modes. The engine uses cancel_order_id_type to decide whether that value is an order id, client order id, TWAP id, or client TWAP id.
  • order_id is always unique (UUID v4).
  • client_order_id is not guaranteed unique and may cancel multiple orders for the same symbol.
  • twap_id and client_twap_id are used to cancel TWAPs.
  • Responses will include OrderStatus codes, e.g. CANCELLED, NO_SUCH_ORDER, or REJECTED.

Sample Code

Example Response

Placing an order returns ACK. Cancelling it returns the same structure but with status CANCELLED.