Skip to main content

Batch Order Placement

Method: POST

Endpoint: /future/trade/v2/order/atomic-create-batch

Content-Type = application/x-www-form-urlencoded && application/json


Rate Limit

200 requests/second per apikey


Parameters

Request Body (JSON)

The request body is a JSON array, where each element represents an individual order.


Request Example

Request
curl -X POST "https://fapi.xt.com/future/trade/v2/order/atomic-create-batch" \
-H "validate-appkey: $APPKEY" \ # Required
-H "validate-timestamp: $TIMESTAMP" \ # Required
-H "validate-signature: $SIGNATURE" \ # Required
-H "Content-Type: application/json" \ # Required
-d '[
{
"symbol": "btc_usdt",
"origQty": 10,
"orderType": "MARKET",
"orderSide": "BUY",
"positionSide": "LONG"
},
{
"symbol": "eth_usdt",
"origQty": 5,
"orderType": "MARKET",
"orderSide": "BUY",
"positionSide": "LONG"
}
]' \ # Required

Response Example

Response
{
"error": {
"code": "",
"msg": ""
},
"msgInfo": "",
"result": "",
"returnCode": 0
}

Error Codes

Error CodeDescription
gateway_decommission_ip_countryUnfortunately, our services are not available to users from restricted countries/regions. Please contact customer support if you have any questions.
gateway_decommission_kyc_countryUnfortunately, our services are not available to users from restricted countries/regions. Please contact customer support if you have any questions.
GATEWAY_0003The user has triggered risk control; your operation is temporarily blocked.
GATEWAY_0006Your account has been locked due to risk control for {hour}hours {minutes}minutes. Please contact customer support or your account manager.
GATEWAY_0007Your account has been locked due to risk control for {minutes} minutes. Please contact customer support or your account manager.
invalid_symbolThe trading pair does not exist.
symbol_is_not_tradingThe trading pair is not currently available for trading.
openapi_not_supportedThe trading pair does not support OpenAPI operations.
symbol_is_not_open_positionThe trading pair cannot open positions.
invalid_paramsInvalid parameters.
invalid_quantityorigQty must be an integer.
quantity_can_not_less_than *origQty must be greater than *.
user_can_not_tradeThe account is currently prohibited from trading.
sub_account_not_tradeThe sub-account is not allowed to trade.
user_can_not_open_positionThe account cannot open new positions.
invalid_time_in_forceInvalid timeInForce parameter.
invalid_priceInvalid price setting.
invalid_trigger_profit_priceInvalid take-profit trigger price.
invalid_trigger_stop_priceInvalid stop-loss trigger price.
trigger_profit_price_more_than_sell_one_priceTake-profit trigger price must be higher than the best ask (long position).
trigger_profit_price_less_than_buy_one_priceTake-profit trigger price must be lower than the best bid (short position).
trigger_stop_price_more_than_sell_one_priceStop-loss trigger price must be lower than the best ask (long position).
trigger_stop_price_less_than_buy_one_priceStop-loss trigger price must be higher than the best bid (short position).
trigger_profit_price_less_than_order_delegate_priceTake-profit trigger price cannot be lower than the order price (long).
trigger_profit_price_more_than_order_delegate_priceTake-profit trigger price cannot be higher than the order price (short).
trigger_stop_price_more_than_order_delegate_priceStop-loss trigger price cannot be higher than the order price (long).
trigger_stop_price_less_than_order_delegate_priceStop-loss trigger price cannot be lower than the order price (short).
on_board_30_minutes_limit_order_price_limitLimit order price restrictions apply within 30 minutes of listing.
order_create_size_exceedThe number of orders in a single batch exceeds the maximum limit (20 orders).