Skip to main content

Place Multi Order Beta

This API extends the functionality of the Place Order API, allowing multiple orders to be placed simultaneously on the exchange. Each order in the request must include a unique correlation_id for individual tracking. Each successful order will return a unique order_id for further management such as modifications or cancellations.

Order Limits and Rate Limits
  • A maximum of 25 orders can be placed in a single request. Any request exceeding this limit will be rejected.
  • The Multi Order API is subject to a different rate limit compared to the standard limits applied across the system. For more information on the rate limits for this API, please check here.

Header Parameters

NameRequiredTypeDescription
AuthorizationtruestringRequires the format Bearer access_token where access_token is obtained from the Token API.
Content-TypetruestringIndicates the media type of the resource, set as application/json.
AccepttruestringDefines the content format the client expects, which should be set to application/json.

Request Body

[
{
"correlation_id": "1",
"quantity": 25,
"product": "D",
"validity": "DAY",
"price": 0,
"tag": "string",
"instrument_token": "NSE_FO|62864",
"order_type": "MARKET",
"transaction_type": "BUY",
"disclosed_quantity": 0,
"trigger_price": 0,
"is_amo": false,
"slice": false
},
{
"correlation_id": "2",
"quantity": 25,
"product": "D",
"validity": "DAY",
"price": 0,
"tag": "string",
"instrument_token": "NSE_FO|62867",
"order_type": "MARKET",
"transaction_type": "BUY",
"disclosed_quantity": 0,
"trigger_price": 0,
"is_amo": false,
"slice": false
}
]
NameRequiredTypeDescription
correlation_idtruestringUniquely identifies each order line within the request. It must be unique per line and is echoed in responses for easy tracking of related errors or feedback. The correlation_id must not exceed 20 characters in length.

Note: The correlation_id is scoped only to this request and cannot be used in another API to refer to this order line.
slicefalsebooleanWhen true, the number of orders is calculated based on the freeze quantity assigned for the instrument by the exchange. This helps automatically split the order into smaller parts in accordance with exchange rules, preventing rejection due to exceeding the allowed quantity. The default value is false. For a detailed explanation, please check the Auto Slicing section.
tagfalsestringThis field functions the same as in the Place Order API, but with a size restriction of 40 characters.

For all other fields, please refer to the Place Order API documentation as all fields are the same as those used when placing an order using the Place Order API.


Order Execution Sequence

In a multi-order request, the system will execute all BUY orders first, followed by the execution of all SELL orders. This ensures a consistent and orderly processing of multiple order types within the same request.


Maximum Order Limit

When slicing is applied, we calculate the total number of resulting orders. The total number of orders in a request, including those generated by the slice, must not exceed the maximum order count specified here.


Responses

Response Body

{
"status": "success",
"data": [
{
"correlation_id": "1",
"order_id": "1644490272000"
},
{
"correlation_id": "2",
"order_id": "2134134141414"
}
],
"summary": {
"total": 2,
"payload_error": 0,
"success": 2,
"error": 0
}
}
NOTE

In the event of payload issues with any order lines, the entire batch of orders will not be placed. Orders will only be executed when the entire array is validated and free of any payload_error. This ensures all transactions are processed without discrepancies.

NameTypeDescription
statusstringA string indicating the outcome of the request.
Possible values: success, partial_success, error.

success - when all order lines were placed
partial_success - when some order lines encountered errors
error - when all order lines encountered errors or there were issues with one or more of the payloads.
dataobjectResponse data for place order request
data.correlation_idstringMirrors the unique identifier provided for each order line in the request, facilitating easy tracking and correlation of responses with their respective orders.
data.order_idstringAn order ID for the order request placed
summaryobjectA summary of the outcomes for the batch of orders processed, detailing total orders, valid submissions, successful completions, and errors.
summary.totalintegerThe total number of order lines present in the payload.
summary.payload_errorintegerThe number of order lines with payload errors, indicating formatting or data validity issues.

Note: Orders are processed only if the entire batch is free of payload_error, ensuring error-free transactions.
summary.successintegerThe number of order lines that were successfully placed without any errors.
summary.errorintegerThe number of order lines that encountered errors during processing, despite their payloads being valid.

NOTE

The Multi order api is down for maintenance from 12:00 AM to 5:30 AM IST daily and is not available for usage during these hours. Users are advised to plan their activities accordingly.


Auto Slicing

Exchanges enforce a limitation on the maximum quantity that can be placed for any scrip, known as the freeze quantity. If an order exceeds this freeze quantity, it will be rejected by the exchange. To simplify the process and prevent such rejections, we automatically slice the order into smaller parts based on the freeze quantity defined by the exchange when necessary.

How to Enable Slicing

To enable this feature, include the slice field in your request payload with the value set to true. Let's walk through a practical example:

Suppose you want to place an order for SCRIP1 with a total quantity of 10,100, and the freeze quantity defined by the exchange is 1,000. If you send the slice field as false, the entire order is submitted to the exchange, which will reject it due to exceeding the allowed quantity. However, if you pass true as the value for the slice field, we automatically split the order into 11 smaller orders: 10 orders of 1,000 units each, and 1 order of 100 units. This ensures that all orders are accepted and processed by the exchange.

Correlation ID for Split Orders

In the case of a sliced order, the correlation_id will be returned with a suffix to uniquely identify each split order. For the use case defined above, if the correlation_id in the request was orderline25, the split orders will be returned with correlation_id values as orderline25_1, orderline25_2, and so on, up to orderline25_11. This allows for easy tracking and management of the split orders in subsequent operations or error handling.

Examples

A comprehensive set of examples is provided to illustrate various use cases and implementation scenarios for this API. To view detailed examples and access sample code, please refer to: API Examples.

Loading...