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 Name | Required | Type | Description |
---|---|---|---|
instId | true | string | Product ID |
tdMode | true | string | Trading mode Isolated: isolated Cross: cross |
ccy | false | string | Margin currency, only applicable to cross margin orders in single-currency margin mode |
clOrdId | false | string | Custom order ID, combination of letters (case-sensitive) and numbers, length between 1-32 . Parameter not supported currently |
tag | false | string | Order tag, combination of letters (case-sensitive) and numbers, length between 1-16 . Parameter not supported currently |
side | true | string | Order side Buy: buy Sell: sell |
posSide | false | string | Position side Required when product type is SWAP Long: long Short: short |
mrgPosition | false | string | Position mode Required when product type is SWAP Merged: merge Split: split |
closePosId | false | string | Position ID to close, required in split mode |
ordType | true | string | Order type Market order: market Limit order: limit Post only: post_only Immediate or cancel: ioc |
sz | true | string | Order size, get minimum order size (minSz) through Get Product Info API |
px | false | string | Order price, get price precision (tickSz) through Get Product Info APIOnly applicable to limit and post_only orders |
reduceOnly | false | boolean | Reduce only,true or false Default: false Only applicable to margin trading and futures/perpetual in long/short mode |
tgtCcy | false | string | Market order quantity type, only applicable to spot orders Base currency: base_ccy Quote currency: quote_ccy |
tpTriggerPx | false | string | Take profit trigger price, only applicable to take profit and stop loss orders |
slTriggerPx | false | string | Stop 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 Name | Type | Description |
---|---|---|
ordId | string | Order ID |
clOrdId | string | Custom order ID |
tag | string | Order tag |
sCode | string | Status code of execution result, 0: Success |
sMsg | string | Error message if execution fails |
Response Example
{
"code": "0",
"msg": "",
"data": {
"ordId": "1000587866646229",
"clOrdId": "",
"tag": "",
"sCode": "0",
"sMsg": ""
}
}