Query Orders History
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
| Parameter | Type | Required | Description | Values/Example |
|---|---|---|---|---|
| account_id | String | Required | Account ID | CASH_10004248 |
| start_date | String | Optional | Start date (if empty, the default is the last 7 days), in the format of yyyy-MM-dd. | 2024-09-25 |
| page_size | String | Optional | Limit the number of records per query to 10 by default. | 10 |
| last_client_order_id | String | Optional | The last order ID from the previous response. For the first page query, this parameter is not required. | THI82O5JB7MQ2K76LL5FSDS2CB |
Response
| Parameter | Type | Required | Description | Values/Example |
|---|---|---|---|---|
| client_order_id | String | Required | Client Order ID | THI82O5JB7MQ2K76LL5FSDS2CB |
| order_id | String | Required | Webull System Order ID | 0352U72LQI6DT0KF41GK000000 |
| side | String | Required | Side | BUY |
| order_type | String | Required | Order Types | MARKET |
| time_in_force | String | Required | Time In Force | DAY |
| stop_price | String | Optional | Stop Price | 11.00 |
| limit_price | String | Optional | Limit Price | 11.00 |
| quantity | String | Required | Quantity | 1 |
| filled_quantity | String | Optional | Filled Quantity | 1 |
| status | String | Required | Order Status | SUBMITTED |
| items | []order_item | Required | Order Details |
order_item:
| Parameter | Type | Required | Description | Values/Example |
|---|---|---|---|---|
| order_id | String | Required | Webull System Order ID | 0352U72LQI6DT0KF41GK000000 |
| symbol | String | Required | Symbol | AAPL |
| side | String | Required | Side | BUY |
| order_type | String | Required | Order Types | MARKET |
| time_in_force | String | Required | Time In Force | DAY |
| stop_price | String | Optional | Stop Price | 11.00 |
| limit_price | String | Optional | Limit Price | 11.00 |
| total_quantity | String | Required | Quantity | 1 |
| filled_quantity | String | Optional | Filled Quantity | 1 |
| filled_price | String | Optional | Average transaction price | 11.00 |
| status | String | Required | Order Status | SUBMITTED |
| account_tax_type | String | Required | Account Tax Type | GENERAL |
Code 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.get_order_history_request(account_id=account_id)
if res.status_code == 200:
print("order_history_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);
List<OrderHistory> tradeOrderItems = apiService.listOrders(accountId, 10, "2024-09-25", "034Q784G9K6DT0KHKA8S000000");