API Reference

Create Multiple orders

Create orders in batches up to 20 orders at a time. Currently only support for same symbol

📘

Batch order Frequency Limit Type: Weight: 1

Weight: 1

Sample body string

curl  -H "Content-Type:application/json" -H "X-HK-APIKEY: SRQGN9M8Sr87nbfKsaSxm33Y6CmGVtUu9Erz73g9vHFNn36VROOKSaWBQ8OSOtSq" -X POST -d '[   
{     "newClientOrderId": "pl12241234567898",         
      "symbol": "BTCUSDT",     
      "side": "SELL",     
      "type": "LIMIT",     
      "price": 17001,     
      "quantity": 1   
},   
{     "newClientOrderId": "pl12241234567899",          
      "symbol": "BTCUSDT",     
      "side": "SELL",     
      "type": "LIMIT",     
      "price": 17002,     
      "quantity": 1  
 } ]' 'https://${host}/api/v1/spot/batchOrders?timestamp=1671880913657&signature=7548b6834613afed3b7d3b0b9bfb0e0b3e3799c46db3ea6b952439fde35cb88f'

Request Parameters


📘

api/v1/spot/order request parameters


PARAMETERTYPEReq'dDESCRIPTION
symbolSTRINGYName of instrument
e.g. "BTCUSDT", "ETHUSDT"
sideENUMYBUY or SELL
typeENUMYCurrently offer 3 order types:

- LIMIT - Limit order
- MARKET - Market order
- LIMIT_MAKER - Maker Limit order
quantityDECIMALYOrder amount in units of the instrument. Commonly known as "orderQty"
priceDECIMALCRequired for LIMIT and LIMIT_MAKER order
newClientOrderIdSTRINGAn ID defined by the client for the order, it will be automatically generated if it is not sent in the request.
timeInForceENUMGTC for Limit order, Limit maker order and IOC for Market order
recvWindowLONGRecv Window. Default 5000
timestampLONGYTimestamp

📘

api/v1.1/spot/order request parameters

PARAMETERTYPEReq'dDESCRIPTION
symbolSTRINGYName of instrument
e.g. "BTCUSDT", "ETHUSDT"
sideENUMYBUY or SELL
typeENUMYCurrently offer 3 order types:

- LIMIT - Limit order
- MARKET - Market order
- LIMIT_MAKER - Maker Limit order
quantityDECIMALC"Order amount in units of the instrument. Commonly known as "orderQty"

*Required if the order type is "MARKET"
amountDECIMALC"Cash amount in the units of quote currency. Market order only

*Required if the order type is "MARKET"
priceDECIMALCRequired for LIMIT and LIMIT_MAKER order
newClientOrderIdSTRINGAn ID defined by the client for the order, it will be automatically generated if it is not sent in the request
timeInForceENUMGTC for Limit order, Limit maker order and IOC for Market order
recvWindowLONGRecv Window. Default 5000
timestampLONGYTimestamp

Response Content


PARAMETERTYPEExample valuesDESCRIPTION
codeINTEGER0Error code
resultObject ArrayBatch order result
- codeINTEGER0Error code of an order
- msgSTRING"Create order failed"Error code
- orderObject ArrayOrder response data
order.accountIdLONG1467298646903017216Account Number
order.symbolSTRINGBTCUSDTrading pair
order.symbolNameSTRINGBTCUSDTrading pair name
order.clientOrderIdSTRING123433An ID defined by the client for the order, it will be automatically generated if it is not sent in the request
order.orderIdLONG1470929631548869632System generated order ID. A maximum of 20 characters.
order.transactTimeLONG1690084476357Millisecond timestamp
order.priceDECIMAL28000Price
order.origQtyDECIMAL0.01Quantity
order.executedQtyDECIMAL0Traded Volume
order.statusENUMFILLEDOrder status. See Enumeration definition for more details
order.timeInForceENUMGTCDuration of the order before expiring
order.typeENUMLIMITOrder type. See Enumeration definition for more details
order.sideENUMSELLBUY or SELL
order.reqAmountSTRING0Requested Cash amount
concentrationSTRINGConcentration reminder message
Language
Credentials
Header
Click Try It! to start a request and see the response here!