Query Opened Orders
Interface Description
Function description: Paging query pending orders.
Applicable objects: Customers who integrate into Webull through Webull OpenAPI.
Request URL: /trade/orders/list-open
Request method:: GET
Frequency limit: The calling frequency of each App ID is limited to 10 times in 30 seconds.
Request Parameters
Parameter | Type | Required fields | Description | Example value |
---|---|---|---|---|
account_id | String | Yes | Account ID | 20150320010101001 |
page_size | int | Yes | Number of entries per page: default value is 10, and maximum value is 100. Integers can be filled. | 10 |
last_client_order_id | String | No | User-defined order ID is not passed, and the default check is conducted on the first page. | 2022021819071234 |
Response Parameter
Parameter | Type | Required fields | Description | Example value |
---|---|---|---|---|
has_next | Boolean | Yes | Is there a next page | true |
orders | [ ]Order | No | Order List | Reference sample code |
Order:
Field | Type | Description |
---|---|---|
account_id | String | Account ID |
combo_type | String | Group Order Types |
combo_ticker_type | String | Categories of Group Orders |
client_order_id | String | The ID passed in when the customer places an order |
extended_hours_trading | Boolean | Whether to support pre-market and post-market |
order_id | String | Order ID |
tif | String | For order validity period, please refer to OrderTIF in the data dictionary |
items | Item[] | Order item list |
Item:
Field | Type | Description |
---|---|---|
category | String | For Category,please refer to Category in the data dictionary |
currency | String | Currency. Reference: Currency, such as: USD. |
filled_price | String | Average transaction price |
filled_qty | String | The number of transactions |
instrument_id | String | Symbol ID |
last_filled_time | String | Last trade time, UTC time, time format: yyyy-MM-ddTHH:mm:ss.SSSZ. Only traded orders have value |
limit_price | String | Limit price: it only has values if the order type is a limit order or stop limit order. |
order_status | String | For order status, please refer to OrderStatus in the data dictionary |
order_type | String | For order type, please refer to OrderType in the data dictionary |
place_time | String | Order time: UTC time. Time format: yyyy-MM-ddTHH:mm:ss.SSSZ |
qty | String | Quantity |
side | String | For buy and sell directions, please refer to OrderSide in the data dictionary. |
stop_price | String | Stop loss price: it only has values when order type is stop loss order or stop loss limit. |
symbol | String | Stock code, eg: AAPL |
trailing_stop_step | String | Trailing spread: it has values when the order type is trailing stop order. |
trailing_type | String | Trailing type, only has value when the order type is trailing stop order. |
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.US.value)
api = API(api_client)
response = api.order.list_open_orders(account_id, page_size, last_client_order_id)
if response.status_code == 200:
open_orders = response.json()
HttpApiConfig apiConfig = HttpApiConfig.builder()
.appKey(Env.APP_KEY)
.appSecret(Env.APP_SECRET)
.regionId(Region.us.name())
.build();
TradeApiService apiService = new TradeHttpApiService(apiConfig);
Orders<ComboOrder> openedOrders = apiService.getOpenedOrders(accountId, pageSize, lastClientOrderId);
Response Example
{
"hasNext": false,
"pageSize": 0,
"orders": [
{
"items": [
{
"symbol": "AAPL",
"category": "US_STOCK",
"filled_qty": "0",
"order_status": "SUBMITTED",
"order_type": "LIMIT",
"place_time": "2022-12-16 03:20:14.307+0000",
"qty": "1",
"side": "BUY",
"limit_price": "385.10",
"instrument_id": "913256135",
"currency": "USD"
}
],
"combo_ticker_type": "STOCK",
"client_order_id": "2365e15dc8ec44019184b7f750fc19ff",
"order_id": "657309864166948864",
"extended_hours_trading": false,
"tif": "DAY",
"account_id": "6TGIBSMG28Q35OVA465T99VHPB"
},
{
"items": [
{
"symbol": "AAPL",
"category": "US_STOCK",
"filled_qty": "0",
"order_status": "SUBMITTED",
"order_type": "LIMIT",
"place_time": "2022-02-24 07:12:58.000+0000",
"qty": "1",
"side": "BUY",
"limit_price": "159.22",
"instrument_id": "913256135",
"currency": "USD"
}
],
"combo_ticker_type": "STOCK",
"client_order_id": "62172ff9cac63a0000c085f2",
"order_id": "550464014661455872",
"extended_hours_trading": true,
"tif": "DAY",
"account_id": "6TGIBSMG28Q35OVA465T99VHPB"
}
]
}
Exception Example
{
"error_code": "INVALID_PARAMETER",
"message": "page_size range must be [10,100]"
}