Get Profit Loss Report
Header Parameters
Name | Required | Type | Description |
---|---|---|---|
Authorization | true | string | Requires the format Bearer access_token where access_token is obtained from the Token API. |
Accept | true | string | Defines the content format the client expects, which should be set to application/json . |
Query Parameters
Name | Required | Type | Description |
---|---|---|---|
from_date | false | string | 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_date | false | string | 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 |
segment | true | string | Segment for which data is requested can be from the following options EQ - Equity, FO - Futures and Options, COM - Commodity, CD - Currency Derivatives |
financial_year | true | string | 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. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
page_number | true | integer (int32) | Page Number, the pages are starting from 1 |
page_size | true | integer (int32) | Page size for pagination. The maximum page size value is obtained from P and L report metadata API. |
Responses
- 200
- 4XX
Response Body
{
"status": "success",
"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
}
}
}
Name | Type | Description |
---|---|---|
status | string | A string indicating the outcome of the request. Typically success for successful operations. |
data | object[] | Response data for trade wise data details |
data[].quantity | float | The quantity of stock traded |
data[].isin | string | ISIN of the stock |
data[].scrip_name | string | Name of the scrip traded |
data[].trade_type | string | FUT - Futures OPT - Options EQ - Equity |
data[].buy_date | string | The date on which the stock was bought |
data[].buy_average | float | The average rate at which each quantity of the stock was bought |
data[].sell_date | string | The date on which the stock was sold |
data[].sell_average | float | The average rate at which each quantity of the stock was sold |
data[].buy_amount | float | Total buy amount |
data[].sell_amount | float | Total sell amount |
metadata | object | Meta data for trade wise data details |
metadata.page | object | Meta data for page. |
metadata.page.page_number | int32 | pageNumber for pagination |
metadata.page.page_size | int32 | Page size |
Error codes
Error code | Description |
---|---|
UDAPI1067 | The 'segment' is required - You must provide the 'segment' for this operation. |
UDAPI1066 | The 'segment' is invalid - The provided 'segment' value isn't recognized or accepted. |
UDAPI1070 | The financial_year is required - Please specify the 'financial_year' in your request. |
UDAPI1074 | The financial_year is invalid - The 'financial_year' you've provided isn't recognized or valid. |
UDAPI1071 | The page_number is required - You need to specify the page number for the data you're trying to retrieve. |
UDAPI1072 | The page_size is required - The page size, indicating the number of results per page, must be provided. |
UDAPI100051 | Invalid financial year - The financial year you've entered doesn't match any recognized formats or values. |
UDAPI1075 | to_date must be greater than or equal to from_date and Date should be in valid format: dd-mm-yyyy - Ensure your date ranges and formats are correct. |
UDAPI1105 | The provided dates do not fall within the specified financial year - The given dates are outside the specified financial year. |
UDAPI1106 | The page_size should be greater than or equal to 1 - The page_size must be greater than 0. |
UDAPI1107 | The page_size should be less than or equal to 5000 - The page_size must be no more than 5000. |
Examples
A comprehensive set of examples is provided to illustrate various use cases and implementation scenarios for this API. To view detailed examples and access sample code, please refer to: API Examples.
Loading...