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-32. Parameter not supported currently
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": ""
}
}