跳到主要内容

查询待成交订单

接口说明

  • 功能说明:分页查询待成交订单。

  • 适用对象:通过OpenAPI开发平台对接webull的客户。

  • 请求URL:/trade/orders/list-open

  • 请求方式:GET

  • 频次限制:每个App ID调用频次限制为30秒10次。

请求参数

参数类型是否必填描述示例值
account_idString账户id20150320010101001
page_sizeint每页条数。 默认值:10;最大值:100, 可填整数。10
last_client_order_idString第三方订单ID, 不传默认查第一页2022021819071234

响应参数

参数类型是否必填描述示例值
has_nextBooleantrue是否还有下一页true
orders[ ]Order订单列表参考示例代码

Order:

字段类型说明
account_idString账户ID
combo_typeString组合订单类型
combo_ticker_typeString组合订单标的类型
client_order_idString客户下单传入的ID
extended_hours_tradingBoolean是否支持盘前盘后
order_idString订单ID
tifString订单有效期, OrderTIF数据字典
itemsItem[]订单项

Item:

字段类型说明
categoryString品类, Category数据字典
currencyString币种, 取值参考字典值:Currency,如:USD
filled_priceString平均成交价格
filled_qtyString成交数量
instrument_idString标的ID
last_filled_timeString最后一次成交时间, UTC时间,时间格式:yyyy-MM-ddTHH:mm:ss.SSSZ只有成交的订单才有值
limit_priceString限价, 订单类型如果是限价单、止损限价时,才有值
order_statusString订单状态, OrderStatus数据字典
order_typeString订单类型, OrderType数据字典
place_timeString下单时间, UTC时间,时间格式:yyyy-MM-ddTHH:mm:ss.SSSZ
qtyString数量
sideString买卖方向, OrderSide数据字典
stop_priceString止损价, 订单类型为止损单、止损限价的时候,才有值
symbolString股票代码, 如:AAPL
trailing_stop_stepString跟踪差价, 订单类型为跟踪止损单时,才有值
trailing_typeString跟踪类型,  订单类型为跟踪止损单时,才有值

请求示例

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()

响应示例

{
"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"
}
]
}

异常示例

{
"error_code": "INVALID_PARAMETER",
"message": "page_size range must be [10,100]"
}