Cancel Order
DELETE/api/v1.0/accounts/{acc_id}/orders/{order_id}Cancel an existing order.
When canceling
- Pass
exchangeas a query parameter. Use the value returned by Open Orders or Order Details (e.g.SEHKfor many HK orders). Do not infer it from the symbol (e.g.HK.00700). - Fully filled or already canceled orders usually cannot be canceled again; the API returns an error (see the failure example below). After a partial fill you can usually cancel the remaining quantity; the API response is authoritative.
- After canceling, reconcile with Open Orders or Trade Push.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
acc_id | string | Yes | Business account ID. |
order_id | string | Yes | Order ID. |
Request Parameters
| Parameter | Type | Position | Required | Description |
|---|---|---|---|---|
exchange | exchange | query | Yes | Exchange. See Naming Dictionary - exchange. |
Request Example
bash
curl -X DELETE 'https://webapi.moomoo.com/api/v1.0/accounts/{acc_id}/orders/{order_id}?exchange=US' \
-H 'Authorization: Bearer <AccessToken>' | jqResponse Parameters
| Field | Type | Description |
|---|---|---|
s | string | Request result. ok on success; error on failure. |
errcode | integer | Error code, returned on failure only. |
errmsg | string | Error message, returned on failure only. |
Response Example
json
{
"s": "ok"
}Failure:
json
{
"s": "error",
"errcode": 100003,
"errmsg": "No further amendment/cancellation is allowed because your order has been filled or amended."
}