Place Bulk Order
When you want to place buy or sell order of multiple stocks or F&O contracts. This API will allow you to place up to 20 orders
per request, and response will contain you original request with response received after request sent for execution. This API supports Equity/Derivative orders using intraday ("I"), margin ("M"), MTF ("F"), Cash and Carry ("C") orders.
Note
If your app type is partner you will not be able to call this API. Please go to the EaseAPI For Business section to see how partners can use EaseAPI.
Sample code¶
curl --location 'https://easeapi.venturasecurities.com/trade/v1/bulk_order' \
--header 'x-client-id: AA0605' \
--header 'x-app-key: 8ab5rt7yp2lm9qw4s1ex' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...' \
--data '{
"orders": [
{
"instrument_id": 2885, // Reliance Industries Ltd. (NSE)
"exchange": "NSE",
"segment": "E",
"transaction_type": "B",
"order_type": "MKT",
"quantity": 1,
"price": 0.0,
"trigger_price": 0,
"product": "C",
"validity": "DAY",
"disclosed_quantity": 0,
"off_market_flag": 0
},
{
"instrument_id": 500325, // Reliance Industries Ltd. (BSE)
"exchange": "BSE",
"segment": "E",
"transaction_type": "B",
"order_type": "MKT",
"quantity": 1,
"price": 0.0,
"trigger_price": 0,
"product": "C",
"validity": "DAY",
"disclosed_quantity": 0,
"off_market_flag": 0
}
]
}'
import requests
import json
url = "https://easeapi.venturasecurities.com/trade/v1/bulk_order"
payload = json.dumps({
"orders": [
{
"instrument_id": 2885, // Reliance Industries Ltd. (NSE)
"exchange": "NSE",
"segment": "E",
"transaction_type": "B",
"order_type": "MKT",
"quantity": 1,
"price": 0,
"trigger_price": 0,
"product": "C",
"validity": "DAY",
"disclosed_quantity": 0,
"off_market_flag": 0
},
{
"instrument_id": 500325, // Reliance Industries Ltd. (BSE)
"exchange": "BSE",
"segment": "E",
"transaction_type": "B",
"order_type": "MKT",
"quantity": 1,
"price": 0,
"trigger_price": 0,
"product": "C",
"validity": "DAY",
"disclosed_quantity": 0,
"off_market_flag": 0
}
]
})
headers = {
'x-client-id': 'AA0605',
'x-app-key': '8ab5rt7yp2lm9qw4s1ex',
'Content-Type': 'application/json',
'Authorization': 'Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let data = JSON.stringify({
"orders": [
{
"instrument_id": 2885, // Reliance Industries Ltd. (NSE)
"exchange": "NSE",
"segment": "E",
"transaction_type": "B",
"order_type": "MKT",
"quantity": 1,
"price": 0,
"trigger_price": 0,
"product": "C",
"validity": "DAY",
"disclosed_quantity": 0,
"off_market_flag": 0
},
{
"instrument_id": 500325, // Reliance Industries Ltd. (BSE)
"exchange": "BSE",
"segment": "E",
"transaction_type": "B",
"order_type": "MKT",
"quantity": 1,
"price": 0,
"trigger_price": 0,
"product": "C",
"validity": "DAY",
"disclosed_quantity": 0,
"off_market_flag": 0
}
]
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://easeapi.venturasecurities.com/trade/v1/bulk_order',
headers: {
'x-client-id': 'AA0605',
'x-app-key': '8ab5rt7yp2lm9qw4s1ex',
'Content-Type': 'application/json',
'Authorization': 'Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Response¶
{
"success": true,
"message": "Bulk order processing is done.",
"data": [
{
"instrument_id": 2885,
"exchange": "NSE",
"segment": "E",
"transaction_type": "B",
"order_type": "MKT",
"quantity": 1,
"price": 0.0,
"trigger_price": 0,
"product": "C",
"validity": "DAY",
"disclosed_quantity": 0,
"off_market_flag": 0,
"response": {
"client_id": "AA0605",
"security_id": 2885,
"order_no": "1131250606100",
"status": "success", // "error" if order is rejected.
"message": "Order submitted successfully. Your Order Ref No. 1131250606100"
}
},
{
"instrument_id": 500325,
"exchange": "BSE",
"segment": "E",
"transaction_type": "B",
"order_type": "MKT",
"quantity": 1,
"price": 0.0,
"trigger_price": 0,
"product": "C",
"validity": "DAY",
"disclosed_quantity": 0,
"off_market_flag": 0,
"response": {
"client_id": "AA0605",
"security_id": 500325,
"order_no": "1127250606101",
"status": "success", // "error" if order is rejected.
"message": "Order submitted successfully. Your Order Ref No. 1127250606101"
}
}
]
}
Request parameters¶
Parameter |
Description |
---|---|
instrument_id |
Unique identifier for each tradable item (whether its a stock or derivative contract) |
transaction_type |
Whether you're buying (B ) or selling (S ) the instrument |
exchange |
The stock exchange where the trade will occur, like the National Stock Exchange (NSE ) or the Bombay Stock Exchange (BSE ) |
segment |
Indicates whether the trade is in equity (E ) or derivatives (D ) |
product |
Type of trading product being used, like intraday (I ), margin (M ), CNC (C ), MTF (F ) |
quantity |
Number of shares for equity or lots (F&O contracts) you want to buy/sell |
price |
Price per share or contract. Not needed for certain order types (like market orders), but required for others (like limit orders) |
validity |
Specifies how long the order remains valid - either for the day (DAY ) or instant or cancel (IOC ) |
order_type |
Type of order being placed, such as market (MKT ), limit (LMT ), stop-loss (SL ) and stop-loss market (SLM ) |
disclosed_quantity |
Optional. If specified, it's the minimum amount of quantity to reveal at the time of order placement |
trigger_price |
Relevant only for stop-loss orders. The order gets placed in the market when it gets achieved or attained |
off_market_flag |
Indicates if the order is placed outside of regular trading hours (after market order - AMO ) |
Response parameters¶
Response will contain the original request and its response inside response
json field. Response structure is same as Place Order API.
Parameter |
Description |
---|---|
client_id |
The client id of the user who placed the order |
security_id |
Refers to the instrument token that was set for this order. This uniquely identifies the instrument |
order_no |
Order id generated by the exchange |
status |
Indicates the status of the order based on its execution. It can be either "success" or "error" |
message |
A message providing a reason if the order was not executed for some reason |