Cancel Order
POST/api/v1.0/sim-trade/{acc_id}/orders/{order_id}/cancelCancel an unfilled order. Only orders with status=2 (Submitted) can be cancelled.
Parameters
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
acc_id | string | path | Yes | Business account ID |
order_id | string | path | Yes | Order ID to cancel |
market | int | body | Yes | Market (from market_id in the account list) |
Request Example
bash
curl -s -X POST "https://webapi.moomoo.com/api/v1.0/sim-trade/80303779/orders/1270776/cancel" \
-H "Authorization: Bearer <AccessToken>" \
-H "Content-Type: application/json" \
-d '{"market":1}' | jqResponse Fields
| Field | Type | Description |
|---|---|---|
order_id | int64 | Cancelled order ID |
Response Example
json
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"order_id": 1270776
}
}Error response
HTTP status remains 200. A failed request returns ret_code != 0 and an error object.
json
{
"ret_code": -3,
"ret_msg": "invalid request",
"error": {"code": "invalid_parameter", "message": "invalid request"}
}