Skip to content

Batch Order

Rate Limit: 5 req/sec/uid

Description

Place order

HTTP Request

  • POST /api/v1/futures/trade/batch_order

Request Parameters

ParameterTypeRequiredDescription
symbolstringtrueTrading pair
orderListlisttrueOrder list, maximum length: 20
>qtystringtrueAmount (base coin)
>pricestringfalsePrice of the order.
Required if the order type is LIMIT
>sidestringtrueOrder direction
buy: BUY
sell: SELL
>tradeSidestringtrueDirection
Only required in hedge-mode
Open and Close Notes:
For open long, side fill in"BUY"; tradeSide should be "OPEN"
For open short, side fill in "SELL"; tradeSide should be "OPEN"
For close long, side fill in "BUY"; tradeSide should be "CLOSE"
For close short, side fill in "SELL";tradeSide should be "CLOSE"
>positionIdstringfalsePosition ID
Only required when "tradeSide" is "CLOSE"
>orderTypestringtrueOrder type
LIMIT: limit orders
MARKET: market orders
>effectstringfalseOrder expiration date.
Required if the orderType is limit
IOC: Immediate or cancel
FOK: Fill or kill
GTC: Good till canceled(default value)
POST_ONLY: POST only
>clientIdstringfalseCustomize order ID
>reduceOnlybooleanfalseWhether or not to just reduce the position
>tpPricestringfalsetake profit trigger price
>tpStopTypestringfalsetake profit trigger type
MARK_PRICE
LAST_PRICE
>tpOrderTypestringfalsetake profit trigger place order type
LIMIT
MARKET
>tpOrderPricestringfalsetake profit trigger place order price
LIMIT
MARKET
required if tpOrderType is LIMIT
>slPricestringfalsestop loss trigger price
>slStopTypestringfalsestop loss trigger type
MARK_PRICE
LAST_PRICE
>slOrderTypestringfalsestop loss trigger place order type
LIMIT
MARKET
>slOrderPricestringfalsestop loss trigger place order price
LIMIT
MARKET
required if slOrderType is LIMIT

Request Example

bash
curl -X 'POST'  --location 'https://fapi.bitunix.com/api/v1/futures/trade/batch_order' \
   -H "api-key:*******" \
   -H "sign:*" \
   -H "time:1659076670000" \
   -H "language:en-US" \
   -H "Content-Type: application/json" \
 --data '{"symbol":"BTCUSDT","orderList":[{"side":"BUY","price":"60000","qty":"0.5","orderType":"LIMIT","reduceOnly":false,"effect":"GTC","clientId":"c12345","tpPrice":"61000","tpStopType":"MARK","tpOrderType":"LIMIT","tpOrderPrice":"61000.1","slPrice":"59000","slStopType":"LAST","slOrderType":"MARKET"},{"side":"SELL","price":"61000","qty":"0.5","orderType":"LIMIT","reduceOnly":false,"effect":"IOC","clientId":"c12346"}]}'

Response Parameters

ParameterTypeDescription
successListlistSuccessful order list
>idstringorder id
>clientIdstringclient id
failureListlistFailed order list
>clientIdstringclient id
>errorMsgstringerror msg
>errorCodestringerror code

Response Example

json
{"code":0,"data":{"successList":[{"id":"11111","clientId":"22222"}],"failureList":[{"clientId":"22222","errorMsg":"Insufficient balance","errorCode":10012}]},"msg":"Success"}