Cancel Order
writes · destructive · idempotent
Cancel a pending order.
Cancels an order that has not yet been filled. Only works for orders in NEW or PENDING status.
PARAMETERS:
- orderId or clOrdId: Identify the order to cancel (use clOrdId from place_order response)
USAGE:
- Provide either orderId (broker’s ID) or clOrdId (our ID)
- Order must be pending (not filled, not already cancelled)
- Cannot cancel filled or rejected orders
Returns cancellation confirmation on success. Returns ORDER_NOT_FOUND if order doesn’t exist or cannot be cancelled.
The server enforces all checks — a single confirmation is sufficient. Note: cancelling a STOP/LIMIT that is protecting an open position (a stop-loss or take-profit linked via positionId) removes that protection and can INCREASE exposure — surface that to the user before cancelling a protective order.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
orderId | string | No | Broker-assigned order ID (if known) |
clOrdId | string | No | Client order ID (our ID from place_order response) |
