批量下单
描述
批量下单
HTTP 请求
- POST /open/api/batchOrders
请求参数
| 参数名 | 参数类型 | 是否必须 | 描述 |
|---|---|---|---|
| api_key | String | Yes | api管理的key |
| time | Long | Yes | 当下时间戳 |
| sign | String | Yes | 经过签名规则产生的字串 |
| symbol | String | Yes | 币对,例如: btcusdt |
| orderList | List<Object> | No | 下单订单集合, 最大长度: 100 |
| >orderList.volume | String | Yes | 订单数量 |
| >orderList.price | String | No | 订单价格(市价单不需要填) |
| >orderList.side | String | Yes | 买卖方向: BUY, SELL |
| >orderList.type | Integer | Yes | 订单类型: 1限价委托, 2市价委托 |
| >orderList.volumeType | Integer | Yes | 订单数量类型 1 总价值数量, e.g. 以 1000 USDT 总价值买或卖单. 2 基准货币数量, e.g. 买或卖 1 BTC. 如为限价单(type = 1), volumeType 则为 2. 如为市价单(type = 2), 无论是买或卖单可选择 1 或 2. |
| >orderList.clientOrderId | String | No | 自定义订单ID |
请求示例
http
curl -X POST 'https://openapi.100ex.com/open/api/batchOrders' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'api_key=*********&time=1743921229830&sign=*********&symbol=BTCUSDT&symbol=BTCUSDT&orderList=[{"price":"70000","side":"BUY","type":1,"volume":0.00001,"volumeType":1,"clientOrderId":"client00004"},{"price":"70200","side":"BUY","type":1,"volume":0.00001,"volumeType":1,"clientOrderId":"client00005"}],
{"price":"70300","side":"BUY","type":1,"volume":0.00001,"volumeType":1,"clientOrderId":"client000001"}'返回参数
| 返回字段 | 字段类型 | 字段说明 |
|---|---|---|
| successList | List | 成功订单数组 |
| >orderId | Long | 订单ID |
| >clientOrderId | String | 自定义订单ID |
| >side | String | 订单方向 |
| >price | String | 订单价格 |
| failureList | List | 失败订单数组 |
| >orderId | Long | 订单ID |
| >clientOrderId | String | 自定义订单ID |
| >errorMsg | String | 错误信息 |
返回示例
json
{
"code": "0",
"msg": "suc",
"data": {
"failureList": [
{
"orderId": 443037583316877312,
"clientOrderId": "client000001",
"errMsg": "duplicate clientOrderId"
}
],
"successList": [
{
"side": "BUY",
"orderId": 443057883307835392,
"price": "70000",
"clientOrderId": "client00004"
},
{
"side": "BUY",
"orderId": 443057883307835393,
"price": "70200",
"clientOrderId": "client00005"
}
]
},
"message": null,
"traceId": null
}Status Code
| Code | Description |
|---|---|
| 0 | success |
| 1 | system error |
| 2 | parameters error |
| 3 | user's trading has been frozen |
| 5 | fail to place order |
| 9 | the trading was froze |
| 31 | the price or amount is less than the minimum value |
| 35 | placing orders is not allowed |
| 100004 | illegal parameter |
| 100005 | illegal sign |
| 100007 | illegal ip address |
| 100008 | the request time is expired |
| 10062 | price or volume precision exceeds the maximum limit. |
| 10063 | the volume is less than the minimum value |
| 101151 | there are open liquidation orders for the coin pair |
| 210006 | this user isn't in the whitelist of open-api |
| 210014 | Spot bulk order exceeds the maximum limit |
| 210015 | Spot bulk cancellation exceeds the maximum limit |
