跳到主要内容

撤销订单

接口说明

  • 功能说明:撤销订单。

  • 注意事项:调用此接口前,必须已经成功调用对应的下单接口。

  • 适用对象:通过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"
}