Cancel Order
Requests cancellation of one order. Cancellation is asynchronous: the call forwards the request and answers immediately with the order still in its previous state.
/api/orders/{id}Auth: RequiredDELETE answers with state: "wait" — the order as it was. Do not treat that as
a cancelled order.
Confirmation arrives as an order webhook carrying the terminal state
cancel. Only a limit order that is still open can be cancelled; a market order
is refused at once with 2005.
If you are not consuming webhooks, poll Get Order until the state changes.
Path Parameters
idnumberRequiredThe order to cancel.
Response
200, carrying the order — but still in its previous state, normally wait.
The response is an acknowledgement that the cancellation was sent, not that it
happened.
Errors
Beyond the shared errors:
| Code | Meaning |
|---|---|
1001 | No order with this id belongs to your account |
2005 | The order cannot be cancelled — it is a market order, it is no longer open, or the core refused. In the first two cases the message is just Failed to cancel order.; when the core refuses, its reason is appended |
A market order is not cancellable, so 2005 is the expected answer for one.