Skip to content

Place Order

Delivery Order

When you place an order through an API, the request to buy or sell stocks or F&O contracts is sent to the exchange. The execution of the order may be delayed due to factors such as the availability of funds in your account, the type of order (Market or Limit), and the current market hours.

After placing the order, the exchange will process it and provide you with an order_id. You can receive status updates by calling the Order Book and Trade Book API. These updates will inform you about the progress of your open or pending orders as they are executed.

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/delivery' \
--header 'x-client-id: AA0605' \
--header 'x-app-key: 8ab5rt7yp2lm9qw4s1ex' \
--header 'authorization: Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...' \
--header 'Content-Type: application/json' \
--data '{
    "instrument_id": 2885, // Reliance Industries Ltd.
    "exchange": "NSE",
    "segment": "E",
    "transaction_type": "B",
    "order_type": "LMT",
    "quantity": 1,
    "price": 1224.0,
    "trigger_price": 0.0,
    "product": "C",
    "validity": "DAY",
    "disclosed_quantity": 0,
    "off_market_flag": 0
}'
import requests
import json

url = "https://easeapi.venturasecurities.com/trade/v1/delivery"
payload = json.dumps({
    "instrument_id": 2885, // Reliance Industries Ltd.
    "exchange": "NSE",
    "segment": "E",
    "transaction_type": "B",
    "order_type": "LMT",
    "quantity": 1,
    "price": 1224.0,
    "trigger_price": 0,
    "product": "C",
    "validity": "DAY",
    "disclosed_quantity": 0,
    "off_market_flag": 0
})
headers = {
    'x-client-id': 'AA0605',
    'x-app-key': '8ab5rt7yp2lm9qw4s1ex',
    'authorization': 'Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...',
    'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let data = JSON.stringify({
    "instrument_id": 2885, // Reliance Industries Ltd.
    "exchange": "NSE",
    "segment": "E",
    "transaction_type": "B",
    "order_type": "LMT",
    "quantity": 1,
    "price": 1224.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/delivery',
    headers: { 
        'x-client-id': 'AA0605', 
        'x-app-key': '8ab5rt7yp2lm9qw4s1ex', 
        'authorization': 'Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...', 
        'Content-Type': 'application/json'
    },
    data : data
};

axios.request(config)
    .then((response) => {
        console.log(JSON.stringify(response.data));
    })
    .catch((error) => {
        console.log(error);
    });

Response

{   
    "client_id": "AA0605",
    "security_id": 2885, 
    "order_no": "1191250120123",
    "status": "success", // "error" if order is rejected.
    "message": "Order submitted successfully. Your Order Ref No. 1191250120123"
}

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

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

Intraday Order

Placing an intraday order through an API means requesting to buy or sell stocks or F&O (futures and options) contracts within the same trading day. The order's execution depends on available funds, the type of order (Market or Limit), and market hours. Once placed, the exchange assigns an order ID.

Unlike delivery orders, intraday orders must be squared off (closed) before the market closes. Status updates are sent via Order Book and Trade Book API, indicating whether the order is executed, partially executed, or pending. Monitoring these updates is crucial for effective intraday position management.

Sample code

curl --location 'https://easeapi.venturasecurities.com/trade/v1/intraday/regular' \
--header 'x-client-id: AA0605' \
--header 'x-app-key: 8ab5rt7yp2lm9qw4s1ex' \
--header 'authorization: Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...' \
--header 'Content-Type: application/json' \
--data '{
    "instrument_id": 2885, // Reliance Industries Ltd.
    "exchange": "NSE",
    "segment": "E",
    "transaction_type": "B",
    "order_type": "LMT",
    "quantity": 1,
    "price": 1224.0,
    "trigger_price": 0.0,
    "product": "I",
    "validity": "DAY",
    "disclosed_quantity": 0,
    "off_market_flag": 0
}'
import requests
import json

url = "https://easeapi.venturasecurities.com/trade/v1/intraday/regular"
payload = json.dumps({
    "instrument_id": 2885, // Reliance Industries Ltd.
    "exchange": "NSE",
    "segment": "E",
    "transaction_type": "B",
    "order_type": "LMT",
    "quantity": 1,
    "price": 1224.0,
    "trigger_price": 0,
    "product": "I",
    "validity": "DAY",
    "disclosed_quantity": 0,
    "off_market_flag": 0
})
headers = {
    'x-client-id': 'AA0605',
    'x-app-key': '8ab5rt7yp2lm9qw4s1ex',
    'authorization': 'Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...',
    'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let data = JSON.stringify({
    "instrument_id": 2885, // Reliance Industries Ltd.
    "exchange": "NSE",
    "segment": "E",
    "transaction_type": "B",
    "order_type": "LMT",
    "quantity": 1,
    "price": 1224.0,
    "trigger_price": 0,
    "product": "I",
    "validity": "DAY",
    "disclosed_quantity": 0,
    "off_market_flag": 0
});

let config = {
    method: 'post',
    maxBodyLength: Infinity,
    url: 'https://easeapi.venturasecurities.com/trade/v1/intraday/regular',
    headers: { 
        'x-client-id': 'AA0605', 
        'x-app-key': '8ab5rt7yp2lm9qw4s1ex', 
        'authorization': 'Bearer eyJraWQiOiJRMUd0YmNyZVwvZWo5U0JZUHBiVGxOc1U1...', 
        'Content-Type': 'application/json'
    },
    data : data
};

axios.request(config)
    .then((response) => {
        console.log(JSON.stringify(response.data));
    })
    .catch((error) => {
        console.log(error);
    });

Response

{
    "client_id": "AA0605",
    "security_id": 2885, 
    "order_no": "1111250120121",
    "status": "success",  // "error" if order is rejected.
    "message": "Order submitted successfully. Your Order Ref No. 1111250120121"
}

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

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