Skip to main content

Order & Report

Holdings

Portfolio holdings may encompass a wide range of investment products, including stocks, bonds, mutual funds, options, futures, and exchange traded funds (ETFs).

The holdings encompass a combination of both long and short-term equity delivery stocks. You will have visibility into three types of holdings, including Demat Holdings, Collateral Holdings, and Unsettled Holdings, which are expected to be delivered from the stock exchange.

Method: POST

https://connect.thefirstock.com/api/V4/holdings

Request details

API Parameters
Parameter Description Example
userId
string
Identifier for the user upon login, unique
to each user in the system.
AA0013
jKey
string
A unique key obtained upon successful login,
used for session identification and security.
d9b4e1b1c790424

Libraries and SDKs

Tabbed Interface
from thefirstock import thefirstock

holdings = thefirstock.firstock_Holding(userId="{{userId}}")
curl --location --request POST 'https://connect.thefirstock.com/api/V4/holdings' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jKey": "{{jKey}}",
    "userId": "{{userID}}"
}'
const Firstock = require("thefirstock");

const firstock = new Firstock();

firstock.holdings(userId: {{userId}},{ product: "I" }, (err, result) => {
  console.log("Error, ", err);
  console.log("Result: ", result);
});
using thefirstock;

class Program
{
    public static void Main()
    {
        Firstock firstock = new Firstock(userId: {{userId}});
        var result = firstock.holdings(product: "I");
    }
}

Success response details

API Parameters
Parameter Description Example
status
String
Indicates the outcome of the
API call, confirming whether the
operation was successful or not.
success
data.holdQuantity
String
The total number of shares
or units currently held by the user,
not yet sold or traded.
0
data.BTSTQuantity
String
Represents the quantity for
the 'Buy Today Sell Tomorrow' strategy,
where assets are bought for
selling the next trading day.
0
data.usedQuantity
String
The portion of holdings that
has been utilized or allocated
for trading on the current day.
0
data.sellAmount
String
The total monetary value received
from selling orders. It reflects
the sum of all sales made.
0.000000
data.uploadPrice
String
The price at which the
user's holdings were initially recorded
or uploaded into the trading system.
1027.55
data.tradeQuantity
String
The total number of units
of the security that were involved
in trades during the specified period.
0

Response Details: Json Fields of object in values Array

API Parameters
Parameter Description Example
exchange
String
Stock exchange where the scrip is traded,
such as NSE or BSE.
BSE
tradingSymbol
String
Trading symbol or identifier of the scrip
(contract).
DEEPAKFERT
token
String
Unique token or identifier for the scrip
(contract).
500645
pricePrecision
String
Number of decimal places to which
the price of the scrip can be specified.
2
tickSize
String
Minimum price movement of the scrip. 0.05
lotSize
String
Quantity of the underlying asset
in one contract of the scrip.
1
{
  "status": "success",
  "data": [
      {
          "exchangeTradingSymbol": [
              {
                  "exchange": "NSE",
                  "token": "11184",
                  "tradingSymbol": "IDFCFIRSTB-EQ",
                  "pricePrecision": "2",
                  "tickSize": "0.05",
                  "lotSize": "1"
              },
              {
                  "exchange": "BSE",
                  "token": "539437",
                  "tradingSymbol": "IDFCFIRSTB",
                  "pricePrecision": "2",
                  "tickSize": "0.05",
                  "lotSize": "1"
              }
          ],
          "sellAmount": "0.000000",
          "holdQuantity": "0",
          "uploadPrice": "58.50",
          "BTSTQuantity": "0",
          "usedQuantity": "0",
          "tradeQuantity": "0"
      },
      {
          "exchangeTradingSymbol": [
              {
                  "exchange": "NSE",
                  "token": "1660",
                  "tradingSymbol": "ITC-EQ",
                  "pricePrecision": "2",
                  "tickSize": "0.05",
                  "lotSize": "1"
              },
              {
                  "exchange": "BSE",
                  "token": "500875",
                  "tradingSymbol": "ITC",
                  "pricePrecision": "2",
                  "tickSize": "0.05",
                  "lotSize": "1"
              }
          ],
          "sellAmount": "0.000000",
          "holdQuantity": "0",
          "uploadPrice": "349.25",
          "BTSTQuantity": "0",
          "usedQuantity": "0",
          "tradeQuantity": "0"
      },
      {
          "exchangeTradingSymbol": [
              {
                  "exchange": "NSE",
                  "token": "827",
                  "tradingSymbol": "DEEPAKFERT-EQ",
                  "pricePrecision": "2",
                  "tickSize": "0.05",
                  "lotSize": "1"
              },
              {
                  "exchange": "BSE",
                  "token": "500645",
                  "tradingSymbol": "DEEPAKFERT",
                  "pricePrecision": "2",
                  "tickSize": "0.05",
                  "lotSize": "1"
              }
          ],
          "sellAmount": "0.000000",
          "holdQuantity": "0",
          "uploadPrice": "1027.55",
          "BTSTQuantity": "0",
          "usedQuantity": "0",
          "tradeQuantity": "0"
      }
  ]
}

Failure response details

API Error Parameters
Parameter Description Example
status
String
Indicates the result status of the
API operation
failed
code
String
HTTP status code associated with the error 401
name
String
Specifies the type or category of
the error encountered
INVALID_JKEY
error.field
String
Field in the request that triggered the error jKey
error.message
String
Detailed message describing the error jKey parameter is invalid
{
  "status": "failed",
  "code": "401",
  "name": "INVALID_JKEY",
  "error": {
      "field": "jKey",
      "message": "jKey parameter is invalid"
  }
}