期權撤單
接口说明
功能描述:期權撤單,根據傳入的client_order_id撤單。期權訂單查詢建議使用V2訂單查詢接口:訂單詳情
請求URL: /openapi/account/orders/option/cancel?account_id={account_id}
請求方式: POST
頻次限制:每個AppId調用頻次限制為1秒1次。
請求參數
參數 | 類型 | 是否必須 | 說明 | 示例值 |
---|---|---|---|---|
account_id | String | 是 | 帳戶id | 2847483 |
client_order_id | String | 是 | 需要撤單的客戶端訂單id,值為下單的client_order_id。 | 0KGOHL4PR2SLC0DKIND4TI0002 |
響應參數
參數 | 類型 | 是否必須 | 說明 | 示例值 |
---|---|---|---|---|
client_order_id | String | 是 | 撤單的client_order_id | 0KGOHL4PR2SLC0DKIND4TI0002 |
order_id | String | 是 | 撤單的order_id | CDI8BOMDU5KO70LEFNLBVV9RA8 |
請求示例
- Python
- Java
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_option(account_id, client_order_id)
if response.status_code == 200:
order_res = response.json()
HttpApiConfig apiConfig = HttpApiConfig.builder()
.appKey(Env.APP_KEY)
.appSecret(Env.APP_SECRET)
.regionId(Region.hk.name())
.build();
TradeApiService apiService = new TradeHttpApiService(apiConfig);
OptionOrder optionCancel = new OptionOrder();
optionCancel.setClientOrderId(clientOrderId);
TradeOrderResponse tradeCancelOptionResponse = apiService.cancelOption(accountId, optionCancel);