跳到主要内容

下单

接口说明

  • 功能说明:该接口供香港地区的客户调用下单,支持下美股、港股、A股(中华通)三个市场的订单。

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

  • 请求URL:/trade/order/place

  • 请求方式:POST

  • 频次限制:每个AppId调用频次限制为1秒1次。

请求参数

参数类型是否必填描述示例值
account_idString账户id20150320010101001
stock_order{}stock_order股票下单参数见示例代码

stock_order:

参数类型是否必填描述示例值
client_order_idString第三方订单ID,此字段入参长度最长为402022021819071234
sideString买卖方向,参考字典值 OrderSide,支持BUY、SELLBUY
tifString订单有效期,参考字典值OrderTIF,支持 DAYDAY
extended_hours_tradingBoolean是否允许盘前盘后交易。 市价单只能是false; 限价单可以是true或者falsefalse
instrument_idString资产标的id,调用者通过调用Get Instruments获取12064446
order_typeString订单类型,参考字典值OrderTypeMARKET
limit_priceStringorder_type为 LIMIT、STOP_LOSS_LIMIT、ENHANCED_LIMIT、AT_AUCTION_LIMIT(竞价限价盘)需要传100.49
qtyString下单的标的数量,整数,支持的最大值为1000000股100
stop_priceStringorder_type为 STOP_LOSS(止损单)、STOP_LOSS_LIMIT(止损限价)时,需要传100.49
trailing_typeString跟踪止损单的价差类型,跟踪止损单要传,参考 TrailingTypeAMOUNT
trailing_stop_stepString跟踪止损单的价差数值,跟踪止损单要传100.49

响应参数

参数类型描述示例值
client_order_idString第三方订单ID2022021819071234

请求示例

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.HK.value)
api = API(api_client)
response = api.order.place_order(account_id, qty, instrument_id, side, client_order_id, order_type,
extended_hours_trading, tif, limit_price, stop_price,
trailing_type, trailing_stop_step)
if response.status_code == 200:
order_res = response.json()

响应示例

{
"code": 200,
"msg": "ok",
"data": {
"client_order_id": "01916462123512190"
}
}

异常示例

{
"error_code": "TRADE_PLACE_ORDER_REPEAT",
"message": "The order existed"
}