Skip to content

Cancel Order ​

DELETE /api/v1.0/accounts/{acc_id}/orders/{order_id}

Cancel an existing order.

When canceling

  • Pass exchange as a query parameter. Use the value returned by Open Orders or Order Details (e.g. SEHK for 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 ​

ParameterTypeRequiredDescription
acc_idstringYesBusiness account ID.
order_idstringYesOrder ID.

Request Parameters ​

ParameterTypePositionRequiredDescription
exchangeexchangequeryYesExchange. 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>' | jq

Response Parameters ​

FieldTypeDescription
sstringRequest result. ok on success; error on failure.
errcodeintegerError code, returned on failure only.
errmsgstringError 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."
}