Skip to main content

Get Trades Charges

Request

curl --location 'https://api.upstox.com/v2/trade/profit-loss/charges?from_date=05-11-2023&to_date=19-12-2023&segment=EQ&financial_year=2324' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'

Additional samples in various languages are available in the Sample Code section on this page.

Query Parameters

NameRequiredTypeDescription
from_datefalsestringDate 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_datefalsestringDate 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
segmenttruestringSegment for which data is requested can be from the following options EQ - Equity, FO - Futures and Options, COM - Commodity, CD - Currency Derivatives
financial_yeartruestringFinancial 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.
Responses

Response Body

{
"status": "success",
"data": {
"charges_breakdown": {
"total": 154.23,
"brokerage": 97.23,
"taxes": {
"gst": 20.93,
"stt": 15,
"stamp_duty": 2
},
"charges": {
"transaction": 0.56,
"clearing": 0,
"ipft": null,
"others": 0,
"sebi_turnover": 0.01,
"demat_transaction": 18.5
}
}
}
}
NameTypeDescription
statusstringA string indicating the outcome of the request. Typically success for successful operations.
dataobjectResponse data for brokerage
data.charges_breakdownobjectResponse data for charges details
data.charges_breakdown.totalfloatTotal charges for the user
data.charges_breakdown.brokeragefloatBrokerage charges for the order
data.charges_breakdown.taxesobjectTaxes levied on order
data.charges_breakdown.taxes.gstfloatGST charges
data.charges_breakdown.taxes.sttfloatSTT charges
data.charges_breakdown.taxes.stamp_dutyfloatStamp duty charges
data.charges_breakdown.chargesobjectOther charges levied
data.charges_breakdown.charges.transactionfloattransaction charges
data.charges_breakdown.charges.clearingfloatclearing charges
data.charges_breakdown.charges.ipftfloatIPF charges
data.charges_breakdown.charges.othersfloatothers charges
data.charges_breakdown.charges.sebi_turnoverfloatSEBI turnover
data.charges_breakdown.charges.demat_transactionfloatdemat transaction charges

Sample Code

import requests

url = 'https://api.upstox.com/v2/trade/profit-loss/charges'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}

params = {
'from_date': '05-11-2023',
'to_date': '19-12-2023',
'segment': 'EQ',
'financial_year': '2324'
}

response = requests.get(url, headers=headers, params=params)

print(response.status_code)
print(response.json())
Loading...