跳至主要内容

撤銷訂單

接口说明

  • 功能說明:撤銷訂單。

  • 注意事項:調用此接口前,必須已經成功調用對應的下單接口。

  • 適用對象:通過OpenApi開發平台對接webull的客戶。

  • 請求URL:/trade/order/cancel

  • 請求方式:POST

  • 頻次限制:每個AppId調用頻次限制為1秒1次

請求參數

參數類型是否必填描述示例值
account_idString賬戶id20150320010101001
client_order_idString第三方訂單ID2022021819071234

響應參數

參數類型是否必填描述示例值
client_order_idString第三方訂單ID2022021819071234

請求示例

from webullsdktrade.api import API
from webullsdkcore.client import ApiClient
from webullsdkcore.common.region import Region

api_client = ApiClient(your_app_key, your_app_secret, Region.HK.value)
api = API(api_client)
response = api.order.cancel_order(account_id, client_order_id)
if response.status_code == 200:
order_res = response.json()

響應示例

{
"code": 200,
"msg": "ok",
"data": {
"client_order_id": "01916462123512190"
}
}

異常示例

{
"error_code": "TRADE_WEBULL_REQUEST_PROCESSING",
"message": "The order is processing, please try later"
}