Create Order
Single Order¶
When you place a single buy or sell order using this API, the request is sent directly to the exchange when your trigger price is reached.
This API supports Equity and Derivative orders using margin ("M"), 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/for365/v1/place' \
--header 'x-client-id: AA0605' \
--header 'x-app-key: 8ab5rt7yp2lm9qw4s1ex' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...' \
--data '{
"instrument_id": 2885,
"exchange": "NSE",
"segment": "E",
"transaction_type": "B",
"order_type": "LMT",
"product": "C",
"validity": "DAY",
"quantity": 1,
"type": "G",
"price": 1000.0,
"trigger_price": 1000
}'
import requests
import json
url = "https://easeapi.venturasecurities.com/for365/v1/place"
payload = json.dumps({
"instrument_id": 2885,
"exchange": "NSE",
"segment": "E",
"transaction_type": "B",
"order_type": "LMT",
"product": "C",
"validity": "DAY",
"quantity": 1,
"type": "G",
"price": 1000,
"trigger_price": 1000
})
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({
"instrument_id": 2885,
"exchange": "NSE",
"segment": "E",
"transaction_type": "B",
"order_type": "LMT",
"product": "C",
"validity": "DAY",
"quantity": 1,
"type": "G",
"price": 1000,
"trigger_price": 1000
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://easeapi.venturasecurities.uat/for365/v1/place',
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": "Order submitted successfully. Your Order Ref No. 1132506091189",
"order_ref_no": "1132506091189"
}
Request parameters¶
Parameter |
Description |
---|---|
instrument_id |
Unique identifier for each tradable item (whether its a stock or derivative contract) |
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 ) |
transaction_type |
Whether you're buying (B ) or selling (S ) the instrument |
order_type |
Type of order being placed, we are supporting market (MKT ), limit (LMT ) order types in For365. |
product |
Type of trading product being used, we are supporting margin (M ), CNC (C ) product types in For365. |
validity |
Specifies how long the order remains valid - either for the day (DAY ) or instant or cancel (IOC ) |
quantity |
Number of shares for equity or lots (F&O contracts) you want to buy/sell. |
type |
This indicates, types of For265 order that you want to place, we are supporting Single Order (G ) and OCO Order (O ) |
price |
This is a limit price for instrument, Order will sent to exchange with this limit price. |
trigger_price |
This is trigger price for order, when price gets to trigger price then this For365 order will trigger. |
Response parameters¶
Parameter |
Description |
---|---|
success |
Indicates the status of the order based on its execution. It can be either "true" or "false" |
message |
A message providing a reason when order gets processed. |
order_ref_no |
Order id generated for this order. |
OCO Order¶
When placing an OCO (One Cancels the Other) order, you need to specify both a target price and a stop-loss.
This API supports Equity and Derivative orders using margin ("M"), Cash and Carry ("C") orders.
Sample code¶
curl --location 'https://easeapi.venturasecurities.com/for365/v1/place' \
--header 'x-client-id: AA0605' \
--header 'x-app-key: 8ab5rt7yp2lm9qw4s1ex' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...' \
--data '{
"instrument_id": 57250,
"exchange": "NSE",
"segment": "D",
"transaction_type": "B",
"order_type": "LMT",
"product": "M",
"validity": "DAY",
"quantity": 175,
"type": "O",
"target_price": 1500,
"target_trigger_price": 1500,
"sl_price": 1400,
"sl_trigger_price": 1400
}'
import requests
import json
url = "https://easeapi.venturasecurities.com/for365/v1/place"
payload = json.dumps({
"instrument_id": 57250,
"exchange": "NSE",
"segment": "D",
"transaction_type": "B",
"order_type": "LMT",
"product": "M",
"validity": "DAY",
"quantity": 175,
"type": "O",
"target_price": 1500,
"target_trigger_price": 1500,
"sl_price": 1400,
"sl_trigger_price": 1400
})
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({
"instrument_id": 57250,
"exchange": "NSE",
"segment": "D",
"transaction_type": "B",
"order_type": "LMT",
"product": "M",
"validity": "DAY",
"quantity": 175,
"type": "O",
"target_price": 1500,
"target_trigger_price": 1500,
"sl_price": 1400,
"sl_trigger_price": 1400
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://easeapi.venturasecurities.uat/for365/v1/place',
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": "Order submitted successfully. Your Order Ref No. 1132506091189",
"order_ref_no": "1132506091189"
}
Request parameters¶
Parameter |
Description |
---|---|
instrument_id |
Unique identifier for each tradable item (whether its a stock or derivative contract) |
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 ) |
transaction_type |
Whether you're buying (B ) or selling (S ) the instrument |
order_type |
Type of order being placed, we are supporting market (MKT ), limit (LMT ) order types in For365. |
product |
Type of trading product being used, we are supporting margin (M ), CNC (C ) product types in For365. |
validity |
Specifies how long the order remains valid - either for the day (DAY ) or instant or cancel (IOC ) |
quantity |
Number of shares for equity or lots (F&O contracts) you want to buy/sell. |
type |
This indicates, types of For265 order that you want to place, we are supporting Single Order (G ) and OCO Order (O ) |
target_price |
This is a limit price for instrument when this For365 target order triggers. Order will be with this limit price. |
target_trigger_price |
This is target trigger price for order, when price gets to trigger price then this For365 order will trigger. |
sl_price |
This is a limit price for instrument when this For365 stoploss order triggers. Order will be with this limit price. |
sl_trigger_price |
This is stoploss trigger price for order, when price gets to trigger price then this For365 order will trigger. |
Response parameters¶
Parameter |
Description |
---|---|
success |
Indicates the status of the order based on its execution. It can be either "true" or "false" |
message |
A message providing a reason when order gets processed. |
order_ref_no |
Order id generated for this order. |