Query Opened Orders
Interface Description
Function description: Paging query pending orders.
Applicable objects: Customers who connect to Webull through the OpenApi development platform.
Request URL: /trade/orders/list-open
Request method:: GET
Frequency limit: The calling frequency of each AppId is limited to 2 times in 2 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 | WEBULL system internal orderId, and the default check is conducted on the first page. | 2022021819071234 |
Response parameter
Parameter | Type | Description | Example value |
---|---|---|---|
has_next | Boolean | Is there a next page | true |
orders | [ ]Order | Order List | Reference sample code |
Order:
Field | Type | Description |
---|---|---|
account_id | String | Account ID |
category | String | Category:referring to the data dictionary |
currency | String | Currency, value reference dictionary value: Currency, such as: USD |
client_order_id | String | WEBULL system internal orderId |
extended_hours_trading | Boolean | Whether to support pre-market and post-market |
filled_price | String | Average trading 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 has values if it is a limit order, or a stop limit order. |
order_status | String | Order status: referring to Order Status in the data dictionary. |
order_type | String | Order type: referring 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 | Buy and sell directions: referring to OrderSide in the data dictionary. |
stop_price | String | Stop loss price: it has values if the order type is stop loss order or stop loss limit order. |
symbol | String | Stock code, eg: 01810 |
tif | String | Order validity period: referring to OrderTIF in the data dictionary. |
trailing_stop_step | String | Trailing spread: it only has value when the order type is trailing stop order. |
trailing_type | String | Trailing type, TrailingType only has value when the order type is trailing stop order |
account_tax_type | String | Account tax type refers to the dictionary value AccountTaxType |
margin_type | String | Margin type refers to the dictionary value MarginType |
close_contracts | []CloseContract | List of contracts, if the position is closed with the field passed in, the position will be closed according to the contract dimension. If contract id is not passed, the position will be closed according to the first-in-first-out rule. |
close_contracts:
Parameter | Type | Description |
---|---|---|
contract_id | String | Contract id |
qty | String | The quantities of orders to be closed under each contract ID. |
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.JP.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.jp.name())
.build();
TradeApiService apiService = new TradeHttpApiService(apiConfig);
Orders openedOrders = apiService.getOpenedOrders(accountId, pageSize, lastClientOrderId);