Skip to main content

Query Orders History(v2)

Interface description

  • Function Description: Historical orders, query the records of the past 7 days. If they are group orders, will be returned together, and the number of orders returned on one page may exceed the page_size.

  • Applicable objects: Customers who integrate into Webull through Webull OpenAPI

  • Request URL: /openapi/account/orders/history?account_id={account_id}

  • Request method: GET

  • Frequency limit: The calling frequency of each AppId is limited to 2 time per second.

Parameters

ParameterTypeRequiredDescriptionValues/Example
account_idStringRequiredAccount IDCASH_10004248
start_dateStringOptionalStart date (if empty, the default is the last 7 days), in the format of yyyy-MM-dd.2024-09-25
page_sizeStringOptionalLimit the number of records per query to 10 by default.10
last_client_order_idStringOptionalThe last order ID from the previous response. For the first page query, this parameter is not required.THI82O5JB7MQ2K76LL5FSDS2CB

Response

ParameterTypeRequiredDescriptionValues/Example
client_order_idStringRequiredClient Order IDTHI82O5JB7MQ2K76LL5FSDS2CB
order_idStringRequiredWebull System Order ID0352U72LQI6DT0KF41GK000000
sideStringRequiredSideBUY
order_typeStringRequiredOrder TypesMARKET
time_in_forceStringRequiredTime In ForceDAY
stop_priceStringOptionalStop Price11.00
limit_priceStringOptionalLimit Price11.00
quantityStringRequiredQuantity1
filled_quantityStringOptionalFilled Quantity1
statusStringRequiredOrder StatusSUBMITTED
items[]order_itemRequiredOrder Details

order_item:

ParameterTypeRequiredDescriptionValues/Example
order_idStringRequiredWebull System Order ID0352U72LQI6DT0KF41GK000000
symbolStringRequiredSymbolAAPL
sideStringRequiredSideBUY
order_typeStringRequiredOrder TypesMARKET
time_in_forceStringRequiredTime In ForceDAY
stop_priceStringOptionalStop Price11.00
limit_priceStringOptionalLimit Price11.00
total_quantityStringRequiredQuantity1
filled_quantityStringOptionalFilled Quantity1
filled_priceStringOptionalAverage transaction price11.00
statusStringRequiredOrder StatusSUBMITTED
account_tax_typeStringRequiredAccount Tax TypeGENERAL

Code Example

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.get_order_history_request(account_id=account_id)
if res.status_code == 200:
print("order_history_res=" + json.dumps(res.json(), indent=4))

Response

Exception example