Trade Profit And Loss

Get Trade-wise Profit and Loss Report Data

This API gives the data of the realised Profit and Loss report requested by a user

get/v2/trade/profit-loss/data

Request

  • Base URL: https://api-v2.upstox.com
  • URL: https://api-v2.upstox.com/v2/trade/profit-loss/data
  • Auth: OAuth 2 (authorization code, authorization URL https://api-v2.upstox.com/v2/login/authorization/dialog, token URL https://api-v2.upstox.com/v2/login/authorization/token)

Query parameters

from_datestring

Date from which data needs to be fetched. from_date and to_date should fall under the same financial year as mentioned in financial_year attribute. Date in dd-mm-yyyy format

to_datestring

Date till which data needs to be fetched. from_date and to_date should fall under the same financial year as mentioned in financial_year attribute. Date in dd-mm-yyyy format

segmentstring required

Segment for which data is requested can be from the following options EQ - Equity, FO - Futures and Options, COM - Commodity, CD - Currency Derivatives

financial_yearstring required

Financial year for which data has been requested. Concatenation of last 2 digits of from year and to year Sample:for 2021-2022, financial_year will be 2122

page_numberinteger required

Page Number, the pages are starting from 1

page_sizeinteger required

Page size for pagination. The maximum page size value is obtained from P and L report metadata API.

Response

Successful

status'success' | 'error' | 'partial_success'

Example response

{
  "data": [
    {
      "quantity": 100,
      "isin": "INE256A01028",
      "scrip_name": "ZEE ENTER",
      "trade_type": "EQ",
      "buy_date": "14-09-2021",
      "buy_average": 12345.67,
      "sell_date": "14-09-2021",
      "sell_average": 12345.67,
      "buy_amount": 12345.67,
      "sell_amount": 12345.67
    }
  ],
  "metadata": {
    "page": {
      "page_number": 1,
      "page_size": 2
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.