Cancel Order
Interface Description
Function description: Cancel the order.
Note: Before calling this interface, you must have successfully called the corresponding order interface.
Applicable objects: Customers who connect to Webull through the OpenApi development platform.
Request URL: /trade/order/cancel
Request method: POST
Frequency limit: The calling frequency of each AppId is limited to 1 time per second.
Request Parameters
Parameter | Type | Required fields | Description | Example value |
---|---|---|---|---|
account_id | String | Yes | Account ID | 20150320010101001 |
client_order_id | String | Yes | The 3rd party order ID | 2022021819071234 |
Response Parameter
Parameter | Type | Required fields | Description | Example value |
---|---|---|---|---|
client_order_id | String | Yes | The 3rd party order ID | 2022021819071234 |
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_order(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);
OrderResponse orderResponse = apiService.cancelOrder(accountId, clientOrderId);