Skip to main content

Cancel Order

Interface Description

  • Function description: Cancel the order.

  • Note: Before calling this interface, you must have successfully called the corresponding order interface.

  • URL: /trade/order/cancel

  • Method: POST

  • Rate limit: The calling frequency of each App ID is limited to 2 times per second.

Request Parameters

ParameterTypeRequired fieldsDescriptionExample value
account_idStringYesAccount IDac231e01
client_order_idStringYesWebull Pay Order IDCO0358O5QRRC83E0KHK8G8000000

Response Parameter

ParameterTypeRequired fieldsDescriptionExample value
client_order_idStringYesWebull Pay Order IDCO0358O5QRRC83E0KHK8G8000000

Request Example

from webullpaysdktrade.api import API
from webullpaysdkcore.client import ApiClient
from webullpaysdkcore.common.region import Region

your_app_key = "<your_app_key>"
your_app_secret = "<your_app_secret>"
account_id = "account_id"
client_order_id = "client_order_id"


api_client = ApiClient(your_app_key, your_app_secret, Region.US.value)
api = API(api_client)
response = api.order.cancel_order(account_id, client_order_id)
if response.status_code == 200:
order_res = response.json()
print(order_res)

Response Example

{
"client_order_id": "01916462123512190"
}

Exception Example

{
"error_code": "TRADE_WEBULL_REQUEST_PROCESSING",
"message": "The order is processing, please try later"
}