Skip to main content

Place Order

Interface Description

  • Function description: This interface is used by eligible customers to place orders (of U.S. customers and crypto currency only)

  • URL: /trade/order/place

  • Method: POST

  • Rate limit: The calling frequency of each App ID is limited to 2 times per second.

Request Parameters

ParameterTypeRequired fieldsDescriptionExample value
account_idStringYesAccount IDa015d0c1001
crypto_ordercrypto_orderYescrypto Order ParametersSee example codes

crypto_order:

ParameterTypeRequired fieldsDescriptionExample value
request_idStringYesCustom request ID, Each request must be unique.27290e2404e84572b2ffa0f89906525d
instrument_idStringYesInstrument ID, which can be obtained by querying tradable instrument information(/trade/Query Trade Instrument)9056135
entrust_typeStringYesOrderEntrustTypeCASH
qtyStringNoOrder quantity. When entrustType is set to QTY, this field is required1
amtStringNoOrder amount.When entrustType is set to AMT, this field is required.26.5
sideStringYesOrderSideBUY
tifStringYesTime-in-force: the validity period of the orderIOC
order_typeStringYesOrderTypeMKT
limit_priceStringNoThe limit price must be greater than 0. Required for Limit and Stop Loss Limit Order order types. Limit price: Must be null for Market order types100.49
stop_priceStringNoThe stop-loss price must be greater than 0. Required for Stop Loss Limit order types. Stop price: Must be null for Limit and Market order types100.49

Response Parameter

ParameterTypeDescriptionExample value
client_order_idStringWebull Pay Order ID20e220a218ss1907d123dsd4

Request Example

from webullpaysdktrade.api import API
from webullpaysdkcore.client import ApiClient
from webullpaysdkcore.common.region import Region

your_app_key = "<your_app_key>"
your_app_secret = "<your_app_secret>"

crypto_order = {
"account_id": "abc123",
"crypto_order": {
"request_id": request_id,
"instrument_id": "913256409",
"order_type": "MKT",
"tif": "IOC",
"side": "BUY",
"entrust_type": "QTY",
"qty": "1"
}
}

api_client = ApiClient(your_app_key, your_app_secret, Region.US.value)
api = API(api_client)
response = api.order.place_order(crypto_order['account_id'], **crypto_order['crypto_order'])

if response.status_code == 200:
order_res = response.json()
print(order_res)

Response Example

{
"client_order_id": "01916462123512190"
}

Exception Example

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