Skip to main content

Place Order

Place Order

Place an order when your account has sufficient funds

Request frequency limit: 1/1s

Request URL

POST /deepcoin/trade/order

Request Parameters

Field NameRequiredTypeDescription
instIdtruestringProduct ID
tdModetruestringTrading mode
Isolated: isolated
Cross: cross
ccyfalsestringMargin currency, only applicable to cross margin orders in single-currency margin mode
clOrdIdfalsestringCustom order ID, combination of letters (case-sensitive) and numbers, length between 1-20
tagfalsestringOrder tag, combination of letters (case-sensitive) and numbers, length between 1-16. Parameter not supported currently
sidetruestringOrder side
Buy: buy
Sell: sell
posSidefalsestringPosition side
Required when product type is SWAP
Long: long
Short: short
mrgPositionfalsestringPosition mode
Required when product type is SWAP
Merged: merge
Split: split
closePosIdfalsestringPosition ID to close, required in split mode
ordTypetruestringOrder type
Market order: market
Limit order: limit
Post only: post_only
Immediate or cancel: ioc
sztruestringOrder size, get minimum order size (minSz) through Get Product Info API
pxfalsestringOrder price, get price precision (tickSz) through Get Product Info API
Only applicable to limit and post_only orders
reduceOnlyfalsebooleanReduce only,true or false
Default: false
Only applicable to margin trading and futures/perpetual in long/short mode
tgtCcyfalsestringMarket order quantity type, only applicable to spot orders
Base currency: base_ccy
Quote currency: quote_ccy
tpTriggerPxfalsestringTake profit trigger price, only applicable to take profit and stop loss orders
slTriggerPxfalsestringStop loss trigger price, only applicable to take profit and stop loss orders

Request Example

{
"instId": "BTC-USDT",
"tdMode": "cash",
"ccy": "USDT",
"clOrdId": "string",
"tag": "string",
"side": "buy",
"posSide": "long",
"mrgPosition": "merge",
"closePosId": "1001063717138767",
"ordType": "limit",
"sz": "0.0004",
"px": "0.01",
"reduceOnly": "boolean",
"tgtCcy": "string",
"tpTriggerPx": "10000.1",
"slTriggerPx": "9000.1"
}



// Market Buy, Open Long
{
"instId": "BTC-USDT-SWAP",
"tdMode": "cross",
"side": "buy",
"ordType": "market",
"sz": "5",
"posSide": "long",
"mrgPosition": "merge",
}

// Market Sell, Close Long
{
"instId": "BTC-USDT-SWAP",
"tdMode": "cross",
"side": "sell",
"ordType": "market",
"sz": "5",
"posSide": "long",
"mrgPosition": "merge",
}

// Market Sell, Open Short
{
"instId": "BTC-USDT-SWAP",
"tdMode": "cross",
"side": "sell",
"ordType": "market",
"sz": "1",
"posSide": "short",
"mrgPosition": "merge",
}

// Market Buy, Close Short
{
"instId": "BTC-USDT-SWAP",
"tdMode": "cross",
"side": "buy",
"ordType": "market",
"sz": "1",
"posSide": "short",
"mrgPosition": "merge",
}

// Limit Buy, Open Long
{
"instId": "BTC-USDT-SWAP",
"tdMode": "cross",
"side": "buy",
"ordType": "limit",
"sz": "1",
"px": "23000",
"posSide": "long",
"mrgPosition": "merge",
}

// Limit Sell, Open Short
{
"instId": "BTC-USDT-SWAP",
"tdMode": "cross",
"side": "sell",
"ordType": "limit",
"sz": "1",
"px": "35000",
"posSide": "short",
"mrgPosition": "merge",
}

Response Parameters

Field NameTypeDescription
ordIdstringOrder ID
clOrdIdstringCustom order ID
tagstringOrder tag
sCodestringStatus code of execution result, 0: Success
sMsgstringError message if execution fails

Response Example

{
"code": "0",
"msg": "",
"data": {
"ordId": "1000587866646229",
"clOrdId": "",
"tag": "",
"sCode": "0",
"sMsg": ""
}
}

Get Order Info

Get the information of a single order by order ID. This endpoint searches historical orders first, then searches pending orders if no historical order is matched.

Request frequency limit: 15/1s

note

The response data is an array for compatibility. At most one matched order is expected.

ordId and clOrdId can both be used to query an order. If both are provided, ordId takes priority.

If the same clOrdId is associated with multiple orders, only the most recent matched order is returned.

Because historical orders and pending orders are stored in different data sources, REST queries may have a short visibility delay immediately after an order is filled. Use the private WebSocket order or trade channel for faster order status changes.

Request URL

GET /deepcoin/trade/order

Request Parameters

Field NameRequiredTypeDescription
instIdtruestringProduct ID, e.g. BTC-USDT-SWAP
ordIdfalsestringOrder ID. Either ordId or clOrdId is required. If both are provided, ordId takes priority
clOrdIdfalsestringCustom order ID, length between 1-20. Either ordId or clOrdId is required. If it is associated with multiple orders, only the most recent matched order is returned

Request Example

GET /deepcoin/trade/order?instId=BTC-USDT-SWAP&ordId=1000598077772927

GET /deepcoin/trade/order?instId=BTC-USDT-SWAP&clOrdId=myOrder001

Response Parameters

Field NameTypeDescription
instTypestringProduct type
instIdstringProduct ID
tgtCcystringMarket order quantity type
Base currency: base_ccy
Quote currency: quote_ccy, only applicable to spot orders
ccystringMargin currency, only applicable to cross margin orders in single-currency margin mode
ordIdstringOrder ID
clOrdIdstringCustom order ID
tagstringOrder tag
pxstringOrder price
szstringOrder size
pnlstringProfit and loss
ordTypestringOrder type
Market order: market
Limit order: limit
Post only: post_only
sidestringOrder side
Buy: buy
Sell: sell
posSidestringPosition side
tdModestringTrading mode
accFillSzstringAccumulated fill size
fillPxstringLatest fill price
tradeIdstringLatest trade ID
fillSzstringLatest fill size
fillTimestringLatest fill time
avgPxstringAverage fill price
statestringOrder state
Pending: live
Partially filled: partially_filled
Canceled: canceled
Filled: filled
leverstringLeverage between 0.01 and 125, only applicable to margin/futures/perpetual trading
tpTriggerPxstringTake profit trigger price
tpTriggerPxTypestringTake profit trigger price type
Last price: last
Index price: index
Mark price: mark
tpOrdPxstringTake profit order price
slTriggerPxstringStop loss trigger price
slTriggerPxTypestringStop loss trigger price type
Last price: last
Index price: index
Mark price: mark
slOrdPxstringStop loss order price
feeCcystringFee currency
feestringTrading fee
rebateCcystringRebate currency
sourcestringOrder source
reduceOnlystringReduce only
rebatestringRebate amount. Platform pays maker rebates to users who reach specified trading levels. Empty string if no rebate. Positive number for fee rebate, e.g., 0.01
categorystringOrder category
uTimestringOrder update time, Unix timestamp in milliseconds
cTimestringOrder creation time, Unix timestamp in milliseconds

Response Example

{
"code": "0",
"msg": "",
"data": [
{
"instType": "SWAP",
"instId": "BTC-USDT-SWAP",
"tgtCcy": "",
"ccy": "",
"ordId": "1000598077772927",
"clOrdId": "",
"tag": "",
"px": "62000",
"sz": "1",
"pnl": "0",
"ordType": "limit",
"side": "buy",
"posSide": "long",
"tdMode": "cross",
"accFillSz": "0",
"fillPx": "",
"tradeId": "",
"fillSz": "0",
"fillTime": "1780040369000",
"avgPx": "",
"state": "live",
"lever": "17",
"tpTriggerPx": "",
"tpTriggerPxType": "",
"tpOrdPx": "",
"slTriggerPx": "",
"slTriggerPxType": "",
"slOrdPx": "",
"feeCcy": "USDT",
"fee": "0",
"rebateCcy": "",
"source": "",
"reduceOnly": "",
"rebate": "",
"category": "normal",
"uTime": "1780040369000",
"cTime": "1780040369000"
}
]
}