Skip to main content

Portfolio

Portfolio APIs

A user's portfolio consists of two sections majorly, Holdings and Positions. Holdings consist of long term equity holdings and positions contains Future and options positions and equities taken today. The portfolio APIs return instruments in a portfolio with up-to-date profit and loss computations.

Portfolio API

TypeEndpointDescription
GET/report/holdings/Get user profile
GET/report/positions/Get user profile

Holdings

Get user Holdings

Holdings contain the user's portfolio of long term equity delivery stocks. An instrument in a holdings portfolio remains there indefinitely until its sold or is delisted or changed by the exchanges. Underneath it all, instruments in the holdings reside in the user's DEMAT account, as settled by exchanges and clearing institutions.

Request

curl --location --request GET 'https://{{base_url}}/report/holdings/'
--header 'access-token: access-token' \
--header 'Content-Type: application/json' \
--data-raw ''

Response In Success response, we get a list of equity instruments. If HTTP status code is received in response like 4xx or 5xx, this means failure or exceptions.

[
{
"instrument": [
{
"exchange_name": 1,
"token": "5054",
"trading_symbol": "GRINFRA-EQ",
"lot_size": 1,
"tick_size": "0.05"
},
{
"exchange_name": 3,
"token": "543317",
"trading_symbol": "GRINFRA",
"lot_size": 1,
"tick_size": "0.05"
}
],
"used_quantity": "0",
"avg_price": "1220.00",
"holding_quantity": "1300",
"dp_quantity": "0",
"non_poa_dispaly_qty": "",
"collateral_quantity": "1155",
"beneficiary_quantity": "0",
"unpledged_quantity": "0",
"broker_quantity": "0",
"btst_quantity": "0",
"btst_collateral_quantity": ""
},
{
"instrument": [
{
"exchange_name": 1,
"token": "7936",
"trading_symbol": "AVANTIFEED-EQ",
"lot_size": 1,
"tick_size": "0.05"
},
{
"exchange_name": 3,
"token": "512573",
"trading_symbol": "AVANTI",
"lot_size": 1,
"tick_size": "0.05"
}
],
"used_quantity": "0",
"avg_price": "460.00",
"holding_quantity": "1500",
"dp_quantity": "0",
"non_poa_dispaly_qty": "",
"collateral_quantity": "1225",
"beneficiary_quantity": "0",
"unpledged_quantity": "0",
"broker_quantity": "0",
"btst_quantity": "0",
"btst_collateral_quantity": ""
}
]
Holding details attributes
FieldField typeDescription
instrument[]obectlist of details of instrument for NSE and BSE
exchange_nameintExchange name. See Details
tokenstringtoken for the instrument
trading_symbolstringTrading symbol for the instrument
lot_sizeintlot size for the instrument
tick_sizestringTick size for the instrument
used_quantitystringused Quantity
avg_pricestringaverage buy price of the holding
holding_quantitystringholding quantity
dp_quantitystringDP qunatity
non_poa_dispaly_qtystringNon POA display Quantity
collateral_quantitystringcollateral quantity
beneficiary_quantitystringBeneficiary quantity
unpledged_quantitystringunpledged quantity
broker_quantitystringbroker quantity
btst_quantitystringT1 qty
btst_collateral_quantitystringT1 collateral Qty

Positions

Get user Positions

Positions contain the user's portfolio for futures and options contracts and intraday equity stocks. Equity positions carried overnight move to the holdings portfolio the next day.

The positions API returns current net position portfolio.

Request

curl --location --request GET 'https://{{base_url}}/report/positions/'
--header 'access-token: access-token' \
--header 'Content-Type: application/json' \
--data-raw ''

Response The success response give a list of instruments present in Net wise positions. If HTTP status code is received in response like 4xx or 5xx, this means failure or exceptions.

[
{
"order_type": 4,
"price_factor": "1.000000",
"day_buy_quantity": "1",
"day_sell_quantity": "0",
"day_buy_amount": "8.06",
"day_buy_avg_price": "8.06",
"day_sell_amount": "0.00",
"day_sell_avg_amount": "0.00",
"cf_buy_quantity": "0",
"cf_sell_quantity": "",
"cf_buy_amount": "",
"cf_avg_price": "",
"cf_sell_amount": "",
"cf_sell_avg_price": "",
"cf_org_avg_price": "",
"open_buy_quantity": "0",
"open_sell_quantity": "1",
"open_buy_amount": "0.00",
"open_buy_avg_price": "0.00",
"open_sell_amount": "6.95",
"open_sell_avg_price": "6.95",
"net_quantity": "1",
"net_avg_price": "8.06",
"last_trade_price": "9.65",
"unrealized_mtom": "1.59",
"realized_pnl": "-0.00",
"frozen_quantity": "12040313",
"upload_price": "0.00",
"bep": "8.06",
"exchange_name": 1,
"trading_symbol": "SUZLON-EQ",
"token": "12018",
"price_precision": "2",
"tick_size": "0.05",
"lot_size": 1,
"multiply_factor": "1"
},
{
"order_type": 2,
"price_factor": "1.000000",
"day_buy_quantity": "0",
"day_sell_quantity": "1",
"day_buy_amount": "0.00",
"day_buy_avg_price": "0.00",
"day_sell_amount": "8.06",
"day_sell_avg_amount": "8.06",
"cf_buy_quantity": "0",
"cf_sell_quantity": "",
"cf_buy_amount": "",
"cf_avg_price": "",
"cf_sell_amount": "",
"cf_sell_avg_price": "",
"cf_org_avg_price": "",
"open_buy_quantity": "0",
"open_sell_quantity": "0",
"open_buy_amount": "0.00",
"open_buy_avg_price": "0.00",
"open_sell_amount": "0.00",
"open_sell_avg_price": "0.00",
"net_quantity": "-1",
"net_avg_price": "8.06",
"last_trade_price": "9.65",
"unrealized_mtom": "-1.59",
"realized_pnl": "0.00",
"frozen_quantity": "12040313",
"upload_price": "0.00",
"bep": "8.06",
"exchange_name": 1,
"trading_symbol": "SUZLON-EQ",
"token": "12018",
"price_precision": "2",
"tick_size": "0.05",
"lot_size": 1,
"multiply_factor": "1"
}
]
positions details attributes
response is list of instruments present in positions
FieldField typeDescription
exchange_nameintExchange name. See Details
tokenstringtoken for the instrument
trading_symbolstringTrading symbol for the instrument
lot_sizeintlot size for the instrument
tick_sizestringTick size for the instrument
price_precisionstringno of decimal places in price
multiply_factorstringmultiplication factor
order_typeenumOrder Type. See details
price_factorstringprice factor
day_buy_quantitystringtoday's buy quantity
day_sell_quantitystringtoday's sell quantity
day_buy_amountstringtoday's buy amount
day_sell_amountstringtoday's sell amount
day_buy_avg_pricestringtoday's buy average price
day_sell_avg_pricestringtoday's sell average price
cf_buy_quantitystringcarry forward buy quantity
cf_sell_quantitystringcarry forward sell quantity
cf_buy_amountstringcarry forward buy amount
cf_avg_pricestringcarry forward average price
cf_sell_amountstringcarry forward sell amount
cf_sell_avg_pricestringcarry forward sell average price
cf_org_avg_pricestringcarry forward origional average price
open_buy_quantitystringopen buy quantity
open_sell_quantitystringopen sell quantity
open_buy_amountstringopen buy amount
open_buy_avg_pricestringopen buy average price
open_sell_amountstringopen sell amount
open_sell_avg_pricestringopen sell average price
net_quantitystringnet quantity
net_avg_pricestringnet average price
last_trade_pricestringLast trade price
unrealized_mtomstringunrealized MTOM
realized_pnlstringrealized PnL
frozen_quantitystringfrozen quantity
upload_pricestringupload price
bepstringbest execution price