Skip to content

撤單 ​

POST /api/v1.0/sim-trade/{acc_id}/orders/{order_id}/cancel

撤銷未成交的訂單。僅 status=2(已提交)的訂單可撤。

請求參數 ​

參數類型位置必填說明
acc_idstringpath是業務賬戶 ID
order_idstringpath是要撤銷的訂單 ID
marketintbody是賬戶市場ID(賬戶列表中該賬戶的 market_id,如 1=港股 100=美股融資融券),必須與 acc_id 對應賬戶一致

請求示例 ​

bash
curl -s -X POST "https://webapi.futunn.com/api/v1.0/sim-trade/80306537/orders/1294505/cancel" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"market":100}' | jq

響應欄位 ​

欄位類型說明
order_idstring被撤銷的訂單ID(回顯路徑參數)

響應示例 ​

json
{
  "ret_code": 0,
  "ret_msg": "success",
  "data": {
    "order_id": "1294505"
  }
}

錯誤響應 ​

HTTP 狀態仍為 200。請求失敗時返回非 0 的 ret_code 和 error 物件。

json
{
  "ret_code": -3,
  "ret_msg": "invalid request",
  "error": {"code": "invalid_parameter", "message": "invalid request"}
}