Skip to navigation

Place order

You can place an order only if you have sufficient funds.

Authentication

OK-ACCESS-KEYstring
Your API key.
OK-ACCESS-SIGNstring

Base64-encoded HMAC-SHA256 signature of the prehash string.

OK-ACCESS-TIMESTAMPstring

ISO 8601 UTC timestamp, e.g. 2020-12-08T09:08:57.715Z.

OK-ACCESS-PASSPHRASEstring
The passphrase you set when creating the API key.

Request

This endpoint expects an object.
instIdstringRequired

Instrument ID, e.g. BTC-USDT

tdModeenumRequired

Trade mode Margin mode cross isolated (isolated is only applicable to spot margin isolated) Non-Margin mode cash spot_isolated (only applicable to SPOT lead trading, tdMode should be spot_isolated for SPOT lead trading.) Note: isolated (spot margin isolated) is not available in multi-currency margin mode and portfolio margin mode. Event contracts symbols only support isolated

Allowed values:
sideenumRequired

Order side, buy sell

Allowed values:
ordTypeenumRequired

Order type market: Market order, only applicable to SPOT/MARGIN/FUTURES/SWAP limit: Limit order post_only: Post-only order fok: Fill-or-kill order ioc: Immediate-or-cancel order optimal_limit_ioc: Places a limit order at the maximum buy price (upper price limit) for buy orders, or the minimum sell price (lower price limit) for sell orders, as defined by the exchange's price limit bands. Any unfilled portion is immediately cancelled (IOC). Applicable only to Expiry Futures and Perpetual Futures. mmp: Market Maker Protection (only applicable to Option in Portfolio Margin mode) mmp_and_post_only: Market Maker Protection and Post-only order(only applicable to Option in Portfolio Margin mode) rpi: Retail Price Improvement order elp: Enhanced Liquidity Program order (Deprecated; use rpi. Accepted until October 31, 2026.)

szstringRequired
Quantity to buy or sell
ccystringOptional

Margin currency Applicable to all isolated MARGIN orders and cross MARGIN orders in Futures mode.

clOrdIdstringOptional

Client Order ID as assigned by the client A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 32 characters. Only applicable to general order. It will not be posted to algoId when placing TP/SL order after the general order is filled completely.

tagstringOptional

Order tag A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 16 characters.

posSideenumOptional

Position side The default is net in the net mode It is required in the long/short mode, and can only be long or short. Only applicable to FUTURES/SWAP. Do not send this field for SPOT or MARGIN orders. Omitting it for FUTURES/SWAP in long/short mode returns error 51000.

Allowed values:
pxstringOptional

Order price. Only applicable to limit,post_only,fok,ioc,mmp,mmp_and_post_only order. When placing an option order, one of px/pxUsd/pxVol must be filled in, and only one can be filled in

pxUsdstringOptional

Place options orders in USD Only applicable to options When placing an option order, one of px/pxUsd/pxVol must be filled in, and only one can be filled in

pxVolstringOptional

Place options orders based on implied volatility, where 1 represents 100% Only applicable to options When placing an option order, one of px/pxUsd/pxVol must be filled in, and only one can be filled in

reduceOnlybooleanOptional

Whether orders can only reduce in position size. Valid options: true or false. The default value is false. Only applicable to MARGIN orders, and FUTURES/SWAP orders in net mode Only applicable to Futures mode and Multi-currency margin

tgtCcyenumOptional

Whether the target currency uses the quote or base currency. base_ccy: Base currency ,quote_ccy: Quote currency Only applicable to SPOT Market Orders Default is quote_ccy for buy, base_ccy for sell

Allowed values:
slippagePctstringOptional

Maximum acceptable slippage for spot and spot margin market-side orders, where tgtCcy is the received currency (base_ccy for buy, quote_ccy for sell). Range: 0 to 0.05 (0% to 5%, inclusive). Up to 2 decimal places of the percentage, e.g., 0.01 (1%) and 0.0123 (1.23%) are accepted; 0.01234 (1.234%) is rejected. If not specified or empty, defaults to 0.00%. Slippage cannot be modified on an existing order. Cancel and resubmit to change the slippage setting. Only applicable to SPOT and SPOT margin market orders.

banAmendbooleanOptional

Whether to disallow the system from automatically reducing the order size when account balance is insufficient for the full SPOT Market Order. Valid options: true or false. The default value is false. If true: the entire order is rejected when balance is insufficient. If false (default): the system reduces sz to fit the available balance and executes the smaller order. Only applicable to SPOT Market Orders

pxAmendTypeenumOptional

The price amendment type for orders 0: Do not allow the system to amend to order price if px exceeds the price limit 1: Allow the system to amend the price to the best available value within the price limit if px exceeds the price limit The default value is 0

Allowed values:
tradeQuoteCcystringOptional

The quote currency used for trading. Only applicable to SPOT. The default value is the quote currency of the instId, for example: for BTC-USD, the default is USD.

stpModeenumOptional

Self trade prevention mode. cancel_maker,cancel_taker, cancel_both Cancel both does not support FOK The account-level acctStpMode will be used to place orders by default. The default value of this field is cancel_maker. Users can log in to the webpage through the master account to modify this configuration. Users can also utilize the stpMode request parameter of the placing order endpoint to determine the stpMode of a certain order.

Allowed values:
attachAlgoOrdslist of objectsOptional

Attached TP/SL or trailing stop order information

Response

Successful response
codestringOptional

Result code. 0 means success; any other value is an error code.

msgstringOptional
Error message. Empty on success.
datalist of objectsOptional