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: isolatedCross: 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-20 |
| 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: buySell: sell |
| posSide | false | string | Position side Required when product type is SWAPLong: longShort: short |
| mrgPosition | false | string | Position mode Required when product type is SWAP Merged: mergeSplit: split |
| closePosId | false | string | Position ID to close, required in split mode |
| ordType | true | string | Order type Market order: marketLimit order: limitPost only: post_onlyImmediate 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 falseDefault: 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_ccyQuote 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": ""
}
}
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
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 Name | Required | Type | Description |
|---|---|---|---|
| instId | true | string | Product ID, e.g. BTC-USDT-SWAP |
| ordId | false | string | Order ID. Either ordId or clOrdId is required. If both are provided, ordId takes priority |
| clOrdId | false | string | Custom 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 Name | Type | Description |
|---|---|---|
| instType | string | Product type |
| instId | string | Product ID |
| tgtCcy | string | Market order quantity type Base currency: base_ccyQuote currency: quote_ccy, only applicable to spot orders |
| ccy | string | Margin currency, only applicable to cross margin orders in single-currency margin mode |
| ordId | string | Order ID |
| clOrdId | string | Custom order ID |
| tag | string | Order tag |
| px | string | Order price |
| sz | string | Order size |
| pnl | string | Profit and loss |
| ordType | string | Order type Market order: marketLimit order: limitPost only: post_only |
| side | string | Order side Buy: buySell: sell |
| posSide | string | Position side |
| tdMode | string | Trading mode |
| accFillSz | string | Accumulated fill size |
| fillPx | string | Latest fill price |
| tradeId | string | Latest trade ID |
| fillSz | string | Latest fill size |
| fillTime | string | Latest fill time |
| avgPx | string | Average fill price |
| state | string | Order state Pending: livePartially filled: partially_filledCanceled: canceledFilled: filled |
| lever | string | Leverage between 0.01 and 125, only applicable to margin/futures/perpetual trading |
| tpTriggerPx | string | Take profit trigger price |
| tpTriggerPxType | string | Take profit trigger price type Last price: lastIndex price: indexMark price: mark |
| tpOrdPx | string | Take profit order price |
| slTriggerPx | string | Stop loss trigger price |
| slTriggerPxType | string | Stop loss trigger price type Last price: lastIndex price: indexMark price: mark |
| slOrdPx | string | Stop loss order price |
| feeCcy | string | Fee currency |
| fee | string | Trading fee |
| rebateCcy | string | Rebate currency |
| source | string | Order source |
| reduceOnly | string | Reduce only |
| rebate | string | Rebate 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 |
| category | string | Order category |
| uTime | string | Order update time, Unix timestamp in milliseconds |
| cTime | string | Order 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"
}
]
}