Skip to main content

Place Order

Interface Description

  • Function description: This interface is used by customers in Hong Kong to place orders, and supports placing orders in three markets: U.S Stocks, Hong Kong stocks, and A shares (China Connect).

  • Applicable objects: Customers who connect to webull through the OpenApi development platform.

  • Request URL: /trade/order/place

  • Request method: POST

  • Frequency limit: The calling frequency of each AppId is limited to 1 time per second.

Request Parameters

ParameterTypeRequired fieldsDescriptionExample value
account_idStringYesAccount ID20150320010101001
stock_order{}stock_orderYesStock Order ParametersSee example codes

stock_order:

ParameterTypeRequired fieldsDescriptionExample value
client_order_idStringYesThird-party order ID, and the maximum length of this field is 40.2022021819071234
sideStringYesBuy and sell direction support BUY, SELL, referring to the dictionary value OrderSide.BUY
tifStringYesOrder validity period supports DAY, referring to the dictionary value OrderTIF.DAY
extended_hours_tradingBooleanYesWhether to allow pre-market and post-market trading. Market orders can only be false, and limit orders can be true or false.false
instrument_idStringYesThe caller obtains the symbol ID by calling Get Instruments.12064446
order_typeStringYesOrder type refers to the dictionary value OrderTypeMARKET
limit_priceStringNoOrder_type is LIMIT, STOP_LOSS_LIMIT, ENHANCED_LIMIT, AT_AUCTION_LIMIT (at-auction limit order) and needs to be passed.100.49
qtyStringYesThe amount of the equities to place an order, integer, the maximum value supported is 1000000 shares100
stop_priceStringNoWhen order_type is STOP_LOSS (stop-loss order), STOP_LOSS_LIMIT (stop-loss limit price), it needs to pass100.49
trailing_typeStringNoSpread type of trailing stop order, trailing stop order to be transmitted, refer to TrailingTypeAMOUNT
trailing_stop_stepStringNoSpread value of trailing stop order, trailing stop order to be transmitted100.49

Response Parameter

ParameterTypeDescriptionExample value
client_order_idStringThe 3rd party order ID2022021819071234

Request Example

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

Response Example

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

Exception Example

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