Cancel Order(v2)
Interface description
Function Description: Cancel the equity order according to the incoming client_order_id.
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:
/openapi/account/orders/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 | Values/Example |
---|---|---|---|---|
account_id | String | Required | Account ID | CASH_10004248 |
client_order_id | String | Required | User-defined order ID. | 0KGOHL4PR2SLC0DKIND4TI0002 |
Response
Parameter | Type | Required | Description | Values/Example |
---|---|---|---|---|
client_order_id | String | Required | client_order_id to cancel | 0KGOHL4PR2SLC0DKIND4TI0002 |
order_id | String | Required | Order id Simple order return, Webull order ID. | 80HG7CPSFDPCAL3TP66LKBAS69 |
Request example
- python
- Java
from webullsdkcore.client import ApiClient
from webullsdktrade.api import API
api_client = ApiClient(your_app_key, your_app_secret, Region.JP.value)
api = API(api_client)
res = api.order_v2.cancel_order_v2(account_id=account_id, client_order_id=client_order_id)
if res.status_code == 200:
print("cancel_order_res=" + json.dumps(res.json(), indent=4))
HttpApiConfig apiConfig = HttpApiConfig.builder()
.appKey(Env.APP_KEY)
.appSecret(Env.APP_SECRET)
.regionId(Region.jp.name())
.build();
TradeApiService apiService = new TradeHttpApiService(apiConfig);
TradeOrder cancelTradeOrder = new TradeOrder();
cancelTradeOrder.setClientOrderId(tradePlaceOrderResponse.getClientOrderId());
TradeOrderResponse tradeCancelOrderResponse = apiService.cancelOrderV2(accountId, cancelTradeOrder);