跳到主要内容

提交批量订单

类型 POST

接口描述: /v4/batch-order


请求参数

参数名类型是否必填默认值描述取值范围
clientBatchIdstringN/A客户端批次号。正则规则:^[a-zA-Z0-9_]{4,32}$
itemsarrayN/A订单数组
item.symbolstringN/A交易对
item.clientOrderIdstringN/A客户端订单号。正则规则:^[a-zA-Z0-9_]{4,32}$
item.sidestringN/A买卖方向BUY, SELL
item.typestringN/A订单类型LIMIT, MARKET
item.timeInForcestringN/A有效方式GTC, FOK, IOC, GTX
item.bizTypestringN/A业务类型SPOT, LEVER
item.pricenumberN/A价格。LIMIT 必填,MARKET 可为空
item.quantitynumberN/A数量。LIMIT 必填,或按数量下 MARKET 订单时必填
item.quoteQtynumberN/A金额。LIMIT 必填,或按金额下 MARKET 订单时必填

限流规则

  • 30次/秒/apikey

请求示例

curl --location --request POST 'https://sapi.xt.com/v4/batch-order' \
--header 'accept: */*' \
--header 'Content-Type: application/json' \
--header 'validate-algorithms: HmacSHA256' \
--header 'validate-recvwindow: 60000' \
--header 'validate-appkey: xxxxxxxxxx' \
--header 'validate-timestamp: xxxxxxxxxx' \
--header 'validate-signature: xxxxxxxxxx' \
--data '{
"clientBatchId": "xxxxxxxxxx",
"items": [
{
"symbol": "XT_USDT",
"clientOrderId": "xxxxxxxxxx",
"side": "BUY",
"type": "LIMIT",
"timeInForce": "GTC",
"bizType": "SPOT",
"price": 10,
"quantity": 1
}
]
}'

请求示例

Request
{
"clientBatchId": "51232",
"items": [
{
"symbol": "BTC_USDT",
"clientOrderId": "16559590087220001",
"side": "BUY",
"type": "LIMIT",
"timeInForce": "GTC",
"bizType": "SPOT",
"price": 40000,
"quantity": 2,
"quoteQty": 80000
}
]
}

响应示例

Response
{
"rc": 0,
"mc": "string",
"ma": [{}],
"result": {
"batchId": "123",
"items": [
{
"index": "0", // 从 0 开始
"clientOrderId": "123",
"orderId": "123",
"reject": "false",
"reason": "invalid price precision"
}
]
}
}