查询当前委托
描述
此接口用于查询合约当前未成交的委托单,若全部为否,则全量查询用户所有挂单,并且根据创建时间由早到晚进行排序。
HTTP请求
GET /v3/trade/order/opens
请求参数
参数 | 是否必填 | 类型 | 描述 |
---|---|---|---|
side | 否 | String | 交易方向,枚举:BUY 和 SELL |
symbol | 否 | String | 交易对。常用形式为“基础货币”+“报价货币” |
ordId | 否 | String | 要查询的订单的订单 ID |
clOrdId | 否 | String | 用户自定义订单ID |
from | 否 | Long | ordId ,查询的起始id,默认从0开始 |
limit | 否 | Integer | 分页页面大小,默认为10 ,最大为100。 |
direct | 否 | String | 枚举:PREV , NEXT ;默认是 NEXT |
响应参数
参数 | 类型 | 描述 |
---|---|---|
symbol | String | 交易对。常用形式为“基础货币”+“报价货币” |
side | String | 枚举:BUY 和 SELL |
type | String | 订单类型;枚举:MARKET , LIMIT , LIMIT_MAKER |
ordId | String | 订单编号 |
clOrdId | String | 用户自定义订单ID |
mgnMode | String | 保证金模式;枚举:ISOLATED 逐仓,CROSS 全仓 |
posSide | String | 持仓方向 LONG -多 或 SHORT -空, 单向持仓为BOTH 。 |
px | String | 委托价格 |
sz | String | 委托张数 |
state | String | 订单状态;枚举:NEW ,PARTIALLY_FILLED |
source | String | 订单来源;枚举:WEB , APP , API , SMART , WEB_MARGIN , APP_IOS , APP_ANDROID , APP_IOS_MARGIN , APP_ANDROID_MARGIN , API_MARGIN , SMART_MARGIN , WS , WS_MARGIN , GRID , GRID_MARGIN , SYSTEM , COPY_TRADING , TRIGGER , LIQUIDATION , ADL , TRIAL , MARGIN_FL , MARGIN_FL_OFFLINE |
reduceOnly | Boolean | 只减仓 |
timeInForce | String | 枚举:FOK ,IOC ,GTC ;可选,默认为 GTC |
avgPx | String | 平均成交价格 |
execQty | String | 累计成交数量 |
execAmt | String | 累计成交金额 |
feeCcy | String | 手续费币种名称 |
feeAmt | String | 累计手续费数量 |
deductCcy | String | 手续费抵扣币种名称 |
deductAmt | String | 累计手续费抵扣数量 |
stpMode | String | Enumerate - EXPIRE_TAKER - EXPIRE_MAKER - EXPIRE_BOTH 默认为NONE |
cTime | String | 订单创建时间, UTC时间戳(MS) |
uTime | String | 订单更新时间, UTC时间戳(MS) |
请求示例
{
"symbol": "BTC_USDT_PERP",
"limit": "100"
}
响应示例
{
"code": 200,
"data": [
{
"avgPx": "0",
"cTime": "1719974138337",
"clOrdId": "11c033ce-8d86-49e2-9503-f21c61de51ee",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"posSide": "BOTH",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331382472938094592",
"px": "60000",
"reduceOnly": false,
"side": "SELL",
"slPx": "0",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "NEW",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719974161941"
},
{
"avgPx": "0",
"cTime": "1719974138335",
"clOrdId": "99048dd0-ba62-48a1-88e3-e567640b0414",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"posSide": "BOTH",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331382472929705985",
"px": "60000",
"reduceOnly": false,
"side": "SELL",
"slPx": "0",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "NEW",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719974161941"
},
{
"avgPx": "0",
"cTime": "1719974138333",
"clOrdId": "d1dac66e-6728-4f45-b0e7-c24da8456e1e",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"posSide": "BOTH",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331382472921317376",
"px": "60000",
"reduceOnly": false,
"side": "BUY",
"slPx": "0",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "NEW",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719974161941"
},
{
"avgPx": "0",
"cTime": "1719974138330",
"clOrdId": "55d7b1e0-fbce-4f86-abfa-d1b0e6d5b053",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"posSide": "BOTH",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331382472908734464",
"px": "60000",
"reduceOnly": false,
"side": "BUY",
"slPx": "0",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "NEW",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719974161941"
}
],
"msg": ""
}