跳到主要内容

提交批量订单

类型 POST

接口描述: /v4/batch-order


请求参数​

参数名类型是否必填默认值描述取值范围
clientBatchIdstring否N/A客户端批次号。正则规则:^[a-zA-Z0-9_]{4,32}$—
itemsarray是N/A订单数组—
item.symbolstring是N/A交易对—
item.clientOrderIdstring否N/A客户端订单号。正则规则:^[a-zA-Z0-9_]{4,32}$—
item.sidestring是N/A买卖方向BUY, SELL
item.typestring是N/A订单类型LIMIT, MARKET
item.timeInForcestring是N/A有效方式GTC, FOK, IOC, GTX
item.bizTypestring是N/A业务类型SPOT, LEVER
item.pricenumber否N/A价格。LIMIT 必填,MARKET 可为空—
item.quantitynumber否N/A数量。LIMIT 必填,或按数量下 MARKET 订单时必填—
item.quoteQtynumber否N/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"
}
]
}
}