Cancel Options
Interface description
Function Description: Cancel options orders according to the incoming client_order_id. It is recommended to use the v2 order query interface for option order inquiries: Order Detail V2
Request URL: /openapi/account/orders/option/cancel?account_id={account_id}
Request method: POST
Frequency limit: The calling frequency of each AppId is limited to 1 time per second.
Parameters
Parameter | Type | Required | Description | Example value |
---|---|---|---|---|
account_id | String | Required | Account ID | 2847483 |
client_order_id | String | Required | Cancel options orders according to the incoming client_order_id. | 0KGOHL4PR2SLC0DKIND4TI0002 |
Response
Parameter | Type | Required | Description | Example value |
---|---|---|---|---|
client_order_id | String | Required | client_order_id to cancel | 0KGOHL4PR2SLC0DKIND4TI0002 |
order_id | String | Required | order_id to cancel | CDI8BOMDU5KO70LEFNLBVV9RA8 |
Request Example
- 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);