批量下单 (TRADE)
- POST
/api/v3/order/batch
权重(IP): 10, 权重(UID): 50
提示: 当前 V3 暂不支持批量下单,此接口暂不可用。
请求参数
| 参数名 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| symbol | String | 是 | 交易对,例如 BTCUSDT。 |
| orderList | Array<Object> | 是 | 最多 10 笔订单。 |
orderList 中每个元素支持以下字段:
| 字段名 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| side | String | 是 | BUY 或 SELL。 |
| type | String | 是 | LIMIT 或 MARKET。 |
| timeInForce | String | 条件必填 | type = LIMIT 时必填,可选 GTC、IOC、FOK。 |
| quantity | String | 是 | 下单数量。 |
| price | String | 条件必填 | 限价单价格。 |
| newClientOrderId | String | 否 | 客户自定义订单号。 |
请求示例
curl -X POST "https://api-spot.weex.com/api/v3/order/batch" \
-H "ACCESS-KEY:*******" \
-H "ACCESS-SIGN:*******" \
-H "ACCESS-PASSPHRASE:*****" \
-H "ACCESS-TIMESTAMP:1659076670000" \
-H "Content-Type: application/json" \
-d '{
"symbol": "BTCUSDT",
"orderList": [
{
"side": "BUY",
"type": "LIMIT",
"timeInForce": "GTC",
"quantity": "0.01",
"price": "68850",
"newClientOrderId": "batch-1"
},
{
"side": "SELL",
"type": "MARKET",
"quantity": "0.02",
"newClientOrderId": "batch-2"
}
]
}'
返回参数
| 字段名 | 类型 | 说明 |
|---|---|---|
| orderList | Array<Object> | 每笔订单的执行结果。 |
| → symbol | String | 交易对。 |
| → orderId | Long | 成功时返回的订单 ID。 |
| → clientOrderId | String | 客户自定义订单号。 |
| → transactTime | Long | 订单被接受的时间(毫秒)。 |
| → errorCode | String | 失败时的错误码。 |
| → errorMsg | String | 失败时的错误信息。 |
返回示例
{
"orderList": [
{
"symbol": "BTCUSDT",
"orderId": 702345678901234700,
"clientOrderId": "batch-1",
"transactTime": 1764506000456
},
{
"symbol": "BTCUSDT",
"clientOrderId": "batch-2",
"errorCode": "INSUFFICIENT_BALANCE",
"errorMsg": "insufficient balance"
}
]
}