Skip to content

Place batch orders

POST
/v1/batch/orders

Create a batch of multiple create, cancel or modify orders in a single request. The data parameter supports the same fields as in the non batch order for the relevant request.

When the response is 200 OK, this means that the Batch Order has been submitted. However, this does not mean that all the orders in the Batch have been executed.

In the response body will be the outcomes of each of the orders in the batch. Values are true with an orderId for accepted orders, or false with a failure message for failed orders.

Parameter Description
type (required) For each order in the batch, order type being placed. Can be PLACE_MARKET, PLACE_LIMIT, PLACE_STOP_LIMIT, CANCEL_ORDER or MODIFY_ORDER
data (required) Contains the order parameters matching the individual order endpoint (see data fields per type below)
customerBatchId (optional) Alphanumeric value for tracking the batch. Supports alphanumeric characters and dashes, 50-character limit.

A maximum of 20 orders may be submitted in a single Batch Orders request. Responses for the orders will be returned in the same sequence that they are submitted in the request.

Supported Request Types

Type Description
PLACE_LIMIT Place a new limit order
PLACE_MARKET Place a new market order
PLACE_STOP_LIMIT Place a new stop limit order
CANCEL_ORDER Cancel an existing order
MODIFY_ORDER Modify an existing order

Data Fields Per Type

PLACE_LIMIT: pair, side, quantity, price, timeInForce (optional, default GTC), postOnly (optional, default false), customerOrderId (optional).

PLACE_MARKET: pair, side, baseAmount or quoteAmount (provide one, not both), customerOrderId (optional).

PLACE_STOP_LIMIT: pair, side, quantity, price, stopPrice, type (TAKE_PROFIT_LIMIT or STOP_LOSS_LIMIT), timeInForce (optional, default GTC), customerOrderId (optional).

CANCEL_ORDER: orderId or customerOrderId (provide one, not both), pair.

MODIFY_ORDER: orderId, pair, modifyMatchStrategy (RETAIN_ORIGINAL, CANCEL_ORIGINAL, or REPRICE), newPrice (optional), newRemainingQuantity or newTotalQuantity (optional, provide one, not both), customerOrderId (optional).

Each request in the batch is processed independently. If one request fails, the others are still processed. The response contains the result for each request in the same order as the input.

Authorizations

apiKey

Your API key

Type
API Key (header: X-VALR-API-KEY)
+
apiSignature

HMAC SHA512 signature of the request (see Authentication section)

Type
API Key (header: X-VALR-SIGNATURE)
+
apiTimestamp

Request timestamp in milliseconds

Type
API Key (header: X-VALR-TIMESTAMP)

Request Body

application/json
JSON
{
"requests": [
{
"type": "PLACE_MARKET",
"data": {
"side": "SELL",
"quoteAmount": "100",
"pair": "BTCUSDT",
"customerOrderId": "1234"
}
},
{
"type": "PLACE_LIMIT",
"data": {
"pair": "BTCUSDT",
"side": "BUY",
"quantity": "0.0002",
"price": "100000",
"timeInForce": "GTC",
"customerOrderId": "5678"
}
}
]
}

Responses

Batch order outcomes

application/json
JSON
{
"outcomes": [
{
"accepted": true,
"orderId": "019817e7-a109-7924-9269-90a1296d0ffd",
"customerOrderId": "1234",
"requestType": "PLACE_MARKET"
},
{
"accepted": true,
"orderId": "019817e7-a10b-70d0-b8c9-4f76be471825",
"requestType": "PLACE_LIMIT"
},
{
"accepted": true,
"orderId": "019817e7-a10b-7a44-aef7-fbb52b6b8f30",
"requestType": "PLACE_LIMIT"
},
{
"accepted": true,
"orderId": "019817e7-a10b-7c90-bf3a-594ba91e9cea",
"requestType": "PLACE_STOP_LIMIT"
},
{
"accepted": true,
"orderId": "019817e7-a113-73df-8bcd-7e29fdcde48d",
"requestType": "PLACE_STOP_LIMIT"
},
{
"accepted": false,
"error": {
"code": -12007,
"message": "Minimum order size not met . Minimum amount: 0.00000786 BTC, minimum total: 0.52 USDT"
}
},
{
"accepted": true,
"orderId": "e5886f2d-191b-4330-a221-c7b41b0bc553",
"requestType": "CANCEL_ORDER"
}
],
"batchId": 1395349783381500000
}

Playground

Authorization
Body

Samples