Skip to main content

Place Order

Interface Description

  • Function description: Ultimately, this is subject to your trading permissions. The A-Share Connect trading function is disabled by default. If you wish to enable it, please contact Customer Service at (852)3852 8500.

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

  • Request URL: /trade/order/place

  • Request method: POST

  • Frequency limit: To ensure stable system operation, the platform enforces the following default rate limits for trading interfaces:
    (US stock order interface: 15 requests/second, HK/A-share order interface: 1 request/second)

caution

📢 If you need to increase the limit, please contact our account manager to submit a request.

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. Allowed characters: letters (A–Z, a–z), digits (0–9), hyphen (-), underscore (_).2022021819071234
sideStringYesBuy and sell direction support BUY, SELL, SHORT, 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

The place_order_v2 method is the preferred way to place orders. It provides a structured request format and improved flexibility.

from webullsdktrade.api import API
from webullsdkcore.client import ApiClient
from webullsdkcore.common.region import Region
from webullsdkmdata.common.category import Category

api_client = ApiClient(your_app_key, your_app_secret, Region.HK.value)
api = API(api_client)

stock_order = {
"account_id": account_id,
"stock_order": {
"client_order_id": client_order_id,
"instrument_id": "913256409",
"side": "BUY",
"tif": "DAY",
"order_type": "ENHANCED_LIMIT",
"limit_price": "1.000",
"qty": "100",
"extended_hours_trading": False
}
}

# This is an optional feature; you can still make a request without setting it.
custom_headers_map = {"category": Category.HK_STOCK.name}
api.order.add_custom_headers(custom_headers_map)
response = api.order.place_order_v2(stock_order['account_id'], stock_order['stock_order'])
api.order.remove_custom_headers()
if response.status_code == 200:
order_res = response.json()

Using place_order (Deprecated)

The place_order method is available but will be removed in future versions. It is recommended to migrate to place_order_v2.

from webullsdktrade.api import API
from webullsdkcore.client import ApiClient
from webullsdkcore.common.region import Region
from webullsdkmdata.common.category import Category

api_client = ApiClient(your_app_key, your_app_secret, Region.HK.value)
api = API(api_client)

# This is an optional feature; you can still make a request without setting it.
custom_headers_map = {"category": category}
api.order.add_custom_headers(custom_headers_map)
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)
api.order.remove_custom_headers()
if response.status_code == 200:
order_res = response.json()

Response Example

Exception Example