Calculate Tax P&L from Tradebook
Tradebook provides you with all the trades that have been executed by an investor or trader. Brokers can use Tradebook to calculate Tax P&L using APIs.
Overview
This API calculates Tax P&L by taking in the tradebook data of Foreign Securities.
Problem
- FDI Platforms/Brokers have to provide accurate Realized & Unrealized P&L.
- FDI Platforms/Brokers must apply tax rules to accurately calculate Pre-Tax & Post-Tax returns on investments.
- The tax landscape is ever-changing with announcements from regulators, tax departments & finance ministry.
- Investors & Traders have to furnish accurate P&L, Holdings, and Turnover in their tax returns as per the tax law.
- Brokers are unable to provide accurate tax computations.
Solution
- API to calculate Tax P&L in real-time.
- API covers tax calculation for corporate actions such as dividends, buybacks, etc.
- Allows Brokers to visualize Tax P&L for their users.
- Tax P&L reports can be generated using tradewise or scripwise methods.
Endpoint
HTTP Method | Endpoint |
---|---|
POST | it-calculator/securities/tax-pnl/tradebook/foreignsecurities |
Request
Follow the below guidelines to calculate Tradebook Tax P&L
Query Parameters
Param | Type | Description | Example |
---|---|---|---|
report | string | Possible values: Tradewise | tradewise |
from | number | From Date in Epoch milliseconds | 1667241000000 |
to | number | To Date, in Epoch milliseconds | 1669746600000 |
Body
Foreign Equity Trade
The headers are explained below:
Param | Type | Required | Description |
---|---|---|---|
trade_id | string | No | Transaction ID of the particular trade |
isin | string | No | ISIN is the international security identification number |
symbol | string | Yes | Symbol or description of equity share |
quantity | number | Yes | Trading quantity |
date | number | Yes | Transaction epoch timestamp |
price | number | Yes | The unit price of the equity share |
transaction_type | string | Yes | Indicates whether the order is :buy Or sell , |
transfer_expenses | number | Yes | Any expense relating to the transfer of shares |
corporate_action | string | No | Refer to Corporate Action for possible values |
ADR Trade
The headers are explained below:
Param | Type | Required | Description |
---|---|---|---|
trade_id | string | No | Transaction ID of the particular trade |
isin | string | No | ISIN is the international security identification number |
symbol | string | Yes | Symbol or description of ADR |
quantity | number | Yes | Trading quantity |
date | number | Yes | Transaction epoch timestamp |
price | number | Yes | The unit price of the ADR |
transaction_type | string | Yes | Indicates whether the order is :buy Or sell , |
transfer_expenses | number | Yes | Any expense relating to the transfer of ADR |
corporate_action | string | No | Refer to Corporate Action for possible values |
Foreign Mutual Fund Trade
The headers are explained below:
Param | Type | Required | Description |
---|---|---|---|
trade_id | string | No | Transaction ID of the particular trade |
isin | string | No | ISIN is the international security identification number |
scheme_name | string | Yes | Scheme name of the mutual fund |
scheme_type | string | Yes | Scheme type, possible valuesequity , debt , other |
quantity | number | Yes | Trading quantity |
date | number | Yes | Transaction epoch timestamp |
price | number | Yes | The unit price of the mutual fund |
transaction_type | string | Yes | Indicates whether the order is :buy Or sell , |
transfer_expenses | number | Yes | Any expense relating to the transfer of Mutual funds |
Other Foreign Income
Param | Type | Required | Description |
---|---|---|---|
dividend | number | No | Dividend amount received for the underlying share |
interest | number | No | Interest amount received against share warrents |
Sample CURL Request
You can refer to the sample payload in workbook format
curl --request POST \
--url 'https: //api.sandbox.co.in/it-calculator/securities/tax-pnl/tradebook?report=Tradewise&from=1667241000000&to=1669746600000' \
--header 'Authorization: xxxxxxxxxxxxxx' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-api-key: xxxxxxxxxxxxxx' \
--header 'x-api-version: 1.0' \
--data '
{
"@entity": "workbook",
"name": "tradebook_workbook",
"sheets": [
{
"name": "foreign_equity_tradebook_sheet",
"@entity": "sheet",
"blocks": [
{
"@entity": "table",
"name": "foreign_equity_tradebook_table",
"header": [
"trade_id",
"isin",
"symbol",
"quantity",
"date",
"price",
"transaction_type",
"transfer_expenses",
"corporate_action"
],
"rows": [
[
"1",
"USA190B01019",
"TSLA",
50,
1617135200000,
80,
"buy",
0,
null
],
[
"2",
"USA190B01019",
"TSLA",
50,
1617195200000,
70,
"buy",
0,
null
],
[
"3",
"USA245A01021",
"AMZN",
49.4698,
1617235200000,
75,
"buy",
0,
null
],
[
"4",
"USA423A01024",
"AAPL",
0.25,
1617321600000,
1000,
"buy",
0,
null
],
[
"5",
"USA245A01021",
"AMZN",
24.7349,
1620604800000,
90,
"sell",
0,
null
],
[
"7",
"USA190B01019",
"TSLA",
40,
1617135209000,
100,
"sell",
0,
null
],
[
"8",
"USA245A01021",
"AMZN",
24.7349,
1623369600000,
80,
"sell",
0,
null
],
[
"17",
"USA423A01024",
"AAPL",
0.2,
1637366400000,
1200,
"sell",
0,
null
],
[
"18",
"USA190B01019",
"TSLA",
15,
1638567500000,
250,
"sell",
0,
null
]
]
}
]
},
{
"name": "adr_tradebook_sheet",
"@entity": "sheet",
"blocks": [
{
"@entity": "table",
"name": "adr_tradebook_table",
"header": [
"trade_id",
"isin",
"symbol",
"quantity",
"date",
"price",
"transaction_type",
"transfer_expenses",
"corporate_action"
],
"rows": [
[
"1",
"USA190B01019",
"INFOSYSADR",
50,
1617135200000,
80,
"buy",
0,
null
],
[
"2",
"USA190B01019",
"INFOSYSADR",
50,
1617195200000,
70,
"buy",
0,
null
],
[
"3",
"USA245A01021",
"WIPROADR",
49.4698,
1617235200000,
75,
"buy",
0,
null
],
[
"4",
"USA423A01024",
"HDFCBANKADR",
0.25,
1617321600000,
1000,
"buy",
0,
null
],
[
"5",
"USA245A01021",
"WIPROADR",
24.7349,
1620604800000,
90,
"sell",
0,
null
],
[
"7",
"USA190B01019",
"INFOSYSADR",
40,
1617135209000,
100,
"sell",
0,
null
],
[
"8",
"USA245A01021",
"WIPROADR",
24.7349,
1623369600000,
80,
"sell",
0,
null
],
[
"17",
"USA423A01024",
"HDFCBANKADR",
0.2,
1637366400000,
1200,
"sell",
0,
null
],
[
"18",
"USA190B01019",
"INFOSYSADR",
15,
1638567500000,
250,
"sell",
0,
null
]
]
}
]
},
{
"name": "foreign_mutual_fund_tradebook_sheet",
"@entity": "sheet",
"blocks": [
{
"@entity": "table",
"name": "foreign_mutual_fund_tradebook_table",
"header": [
"trade_id",
"isin",
"scheme_name",
"scheme_type",
"quantity",
"date",
"price",
"transaction_type",
"transfer_expenses"
],
"rows": [
[
"15648a",
"USE397D01024",
"Sarofim Equity",
"debt",
250,
1622937600,
520,
"buy",
75
],
[
"15648a",
"USE397D01024",
"Sarofim Equity",
"debt",
150,
1628208000,
400,
"sell",
42
],
[
"65412a",
"USF251K01NO3",
"BlackRock Exchange BlackRock",
"equity",
31.536,
1618876800,
99994.6642,
"buy",
100
],
[
"14712a",
"USF277K01YE6",
"Fidelity Mega Cap Stock",
"equity",
30.739,
1618876800,
99996.0019,
"buy",
98
],
[
"89741a",
"USF179KB1HP9",
"State Street US Core Debt Fund",
"debt",
0.247,
1619740800,
1001.7183,
"buy",
88
],
[
"24896a",
"USF179KB1HP9",
"State Street US Core Debt Fund",
"debt",
0.246,
1622505600,
1000.4106,
"sell",
102
],
[
"41564a",
"USF277K01YE6",
"Fidelity Mega Cap Stock",
"equity",
30.603,
1623196800,
99994.1059,
"sell",
114
]
]
}
]
}
]
}
'
Test Environment Not Available
Response
Body
Forigen Equity Tradewise Tax P/L
Param | Type | Description |
---|---|---|
isin | string | ISIN is the international security identification number |
symbol | string | Symbol or description of equity share |
quantity | number | Trading quantity |
buy_trade_id | string | Transaction ID of the buy transaction |
buy_date | number | The date on which the equity share was bought |
buy_price | number | Price at which a unit was bought |
sell_trade_id | string | Transaction ID of the sell transaction |
sell_date | number | The date on which the equity share was sold |
sell_price | number | Price at which a unit was sold |
nature_of_transaction | string | The nature of the transaction of the equity share |
realized_pnl | number | The realized profit or loss on the trade without considering transfer expenses |
transfer_expenses | number | Any expense relating to the transfer of shares. |
net_realized_pnl | number | The realized profit or loss on the trade after considering transfer expenses |
taxable_pnl | number | The taxable amount of the trade |
holding_period | string | The holding period of the equity mutual fund could be either long_term or short_term |
turnover | number | Turnover of the transaction |
income_head | string | The income head of ITR under which the income of a specific trade is to be reported |
income_sub_head | string | The income subhead of ITR under which the income of a specific trade is to be reported |
tax_rate | string | The applicable tax rate for the trade |
Forigen ADR Tradewise Tax P/L
Param | Type | Description |
---|---|---|
isin | string | ISIN is the international security identification number |
symbol | string | Symbol or description of equity share |
quantity | number | Trading quantity |
buy_trade_id | string | Transaction ID of the buy transaction |
buy_date | number | The date on which the equity share was bought |
buy_price | number | Price at which a unit was bought |
sell_trade_id | string | Transaction ID of the sell transaction |
sell_date | number | The date on which the equity share was sold |
sell_price | number | Price at which a unit was sold |
nature_of_transaction | string | The nature of the transaction of the equity share |
realized_pnl | number | The realized profit or loss on the trade without considering transfer expenses |
transfer_expenses | number | Any expense relating to the transfer of shares. |
net_realized_pnl | number | The realized profit or loss on the trade after considering transfer expenses |
taxable_pnl | number | The taxable amount of the trade |
holding_period | string | The holding period of the equity utual fund could be either long_term or short_term |
turnover | number | Turnover of the transaction |
income_head | string | The income head of ITR under which the income of a specific trade is to be reported |
income_sub_head | string | The income subhead of ITR under which the income of a specific trade is to be reported |
tax_rate | string | The applicable tax rate for the trade. |
Foreign Mutual Fund Tradewise Tax P/L
Param | Type | Description |
---|---|---|
isin | string | ISIN is the international security identification number |
scheme_name | string | Symbol or description of equity share |
scheme_type | string | Type of scheme, possible values: debt ,equity ,other |
quantity | number | Trading quantity |
buy_trade_id | string | Transaction ID of the buy transaction |
buy_date | number | The date on which the equity share was bought |
buy_price | number | Price at which a unit was bought |
sell_trade_id | string | Transaction ID of the sell transaction |
sell_date | number | The date on which the equity share was sold |
sell_price | number | Price at which a unit was sold |
nature_of_transaction | string | The nature of the transaction of the equity share |
realized_pnl | number | The realized profit or loss on the trade without considering transfer expenses |
transfer_expenses | number | Any expense relating to the transfer of shares. |
net_realized_pnl | number | The realized profit or loss on the trade after considering transfer expenses |
taxable_pnl | number | The taxable amount of the trade |
holding_period | string | The holding period of the mutual fund could be either long_term or short_term |
turnover | number | Turnover of the transaction |
income_head | string | The income head of ITR under which the income of a specific trade is to be reported |
income_sub_head | string | The income subhead of ITR under which the income of a specific trade is to be reported |
tax_rate | string | The applicable tax rate for the trade. |
Asset Wise Summary
Param | Type | Description |
---|---|---|
asset_class | string | Asset class |
asset_type | string | Asset category |
income_head | string | The income head of ITR under which the income of a specific income is to be reported |
income_sub_head | string | The income subhead of ITR under which the income of a specific income is to be reported |
holding_period | string | The holding period of the asset could be either long_term or short_term |
turnover | number | Turnover of the transactions |
realized_pnl | number | The realized profit or loss on trades without considering transfer expenses |
transfer_expenses | number | Any expense relating to the transfer of assets |
net_realized_pnl | number | The realized profit or loss on trades after considering transfer expenses |
taxable_pnl | number | The taxable amount |
Tax P/L Summary
This table gives a summary of your crypto trades grouped by income_head
, income_sub_head
, and holding_period
.
Param | Type | Description |
---|---|---|
income_head | string | The income head of ITR under which the income is to be reported |
income_sub_head | string | The income subhead of ITR under which the income is to be reported |
holding_period | string | The holding period of the crypto. |
tax_rate | string | The applicable tax rate for all trades. |
realized_pnl | number | Total realized profit or loss on the trades without considering expenses |
transfer_expenses | number | Total expenses that occurred during the transafer of crypto, could be network fees, brokerage, or any other transaction fee. |
net_realized_pnl | number | Total realized profit or loss on the trades after considering expenses |
taxable_pnl | number | The total taxable amount of all trades |
Sample Response
You can refer to the sample response in workbook format
The API responds back in a sheet structure. An example response is shown below.
{
"transaction_id": "b792eb68-1443-4766-b96f-bdee37278d4a",
"timestamp": "1681481686000",
"code": 200,
"data": {
"name": "tradewise_tax_pnl_workbook",
"@entity": "workbook",
"sheets": [
{
"name": "foreign_equity_tradewise_tax_pnl_sheet",
"@entity": "sheet",
"blocks": [
{
"name": "foreign_equity_tradewise_tax_pnl_table",
"@entity": "table",
"header": [
"isin",
"symbol",
"quantity",
"buy_trade_id",
"buy_date",
"buy_price",
"sell_trade_id",
"sell_date",
"sell_price",
"nature_of_transaction",
"realized_pnl",
"transfer_expenses",
"net_realized_pnl",
"taxable_pnl",
"holding_period",
"turnover",
"income_head",
"income_sub_head",
"tax_rate"
],
"rows": [
[
"USA423A01024",
"AAPL",
0.2,
"4",
1617321600000,
1000,
"17",
1637366400000,
1200,
"trading",
40.0,
0,
40.0,
40.0,
"short_term",
240.0,
"capital_gains",
"securities",
"slab_rate"
],
[
"USA190B01019",
"TSLA",
10,
"1",
1617135200000,
80,
"18",
1638567500000,
250,
"trading",
1700,
0,
1700,
1700,
"short_term",
2500,
"capital_gains",
"securities",
"slab_rate"
],
[
"USA190B01019",
"TSLA",
5,
"2",
1617195200000,
70,
"18",
1638567500000,
250,
"trading",
900,
0,
900,
900,
"short_term",
1250,
"capital_gains",
"securities",
"slab_rate"
],
[
"USA245A01021",
"AMZN",
24.7349,
"3",
1617235200000,
75,
"5",
1620604800000,
20,
"trading",
-1360.4195,
0,
-1360.4195,
0,
"short_term",
494.6980,
"capital_gains",
"securities",
"slab_rate"
],
[
"USA245A01021",
"AMZN",
24.7349,
"3",
1617235200000,
75,
"8",
1623369600000,
80,
"trading",
123.6745,
0,
123.6745,
123.6745,
"short_term",
1978.7920,
"capital_gains",
"securities",
"slab_rate"
]
]
}
]
},
{
"name": "adr_tradewise_tax_pnl_sheet",
"@entity": "sheet",
"blocks": [
{
"name": "adr_tradewise_tax_pnl_table",
"@entity": "table",
"header": [
"isin",
"symbol",
"quantity",
"buy_trade_id",
"buy_date",
"buy_price",
"sell_trade_id",
"sell_date",
"sell_price",
"nature_of_transaction",
"realized_pnl",
"transfer_expenses",
"net_realized_pnl",
"taxable_pnl",
"holding_period",
"turnover",
"income_head",
"income_sub_head",
"tax_rate"
],
"rows": [
[
"USA423A01024",
"HDFCBANKADR",
0.2,
"4",
1617321600000,
1000,
"17",
1637366400000,
1200,
"trading",
40.0,
0,
40.0,
40.0,
"short_term",
240.0,
"capital_gains",
"securities",
"slab_rate"
],
[
"USA190B01019",
"INFOSYSADR",
10,
"1",
1617135200000,
80,
"18",
1638567500000,
250,
"trading",
1700,
0,
1700,
1700,
"short_term",
2500,
"capital_gains",
"securities",
"slab_rate"
],
[
"USA190B01019",
"INFOSYSADR",
5,
"2",
1617195200000,
70,
"18",
1638567500000,
250,
"trading",
900,
0,
900,
900,
"short_term",
1250,
"capital_gains",
"securities",
"slab_rate"
],
[
"USA245A01021",
"WIPROADR",
24.7349,
"3",
1617235200000,
75,
"5",
1620604800000,
20,
"trading",
-1360.4195,
0,
-1360.4195,
0,
"short_term",
494.6980,
"capital_gains",
"securities",
"slab_rate"
],
[
"USA245A01021",
"WIPROADR",
24.7349,
"3",
1617235200000,
75,
"8",
1623369600000,
80,
"trading",
123.6745,
0,
123.6745,
123.6745,
"short_term",
1978.7920,
"capital_gains",
"securities",
"slab_rate"
]
]
}
]
},
{
"name": "foreign_mutual_fund_tradewise_tax_pnl_sheet",
"@entity": "sheet",
"blocks": [
{
"name": "foreign_mutual_fund_tradewise_tax_pnl_table",
"@entity": "table",
"header": [
"isin",
"scheme_name",
"asset_class",
"quantity",
"buy_trade_id",
"buy_date",
"buy_price",
"sell_trade_id",
"sell_date",
"sell_price",
"nature_of_transaction",
"realized_pnl",
"transfer_expenses",
"net_realized_pnl",
"taxable_pnl",
"holding_period",
"turnover",
"income_head",
"income_sub_head",
"tax_rate"
],
"rows": [
[
"USF179KB1HP9",
"State Street US Core Debt Fund",
"debt",
0.246,
"89741a",
1619740800,
1001.7183,
"24896a",
1622505600,
1000.4106,
null,
-0.3217,
189.6437,
-189.9654,
0.0000,
"short_term",
246.1010,
"capital_gains",
"other_capital_gains",
"slab_rate"
],
[
"USF277K01YE6",
"Fidelity Mega Cap Stock",
"equity",
30.603,
"14712a",
1618876800,
99996.0019,
"41564a",
1623196800,
99994.1059,
null,
-58.0233,
211.5664,
-269.5897,
0.0000,
"short_term",
3060119.6229,
"capital_gains",
"securities",
"slab_rate"
],
[
"USE397D01024",
"Sarofim Equity",
"debt",
150,
"15648a",
1622937600,
520,
"15648a",
1628208000,
400,
null,
-18000.0000,
87.0000,
-18087.0000,
0.0000,
"short_term",
60000.0000,
"capital_gains",
"other_capital_gains",
"slab_rate"
]
]
}
]
},
{
"name": "tradewise_tax_pnl_summary_sheet",
"@entity": "sheet",
"blocks": [
{
"name": "asset_wise_summary_table",
"@entity": "table",
"header": [
"asset_class",
"asset_type",
"income_head",
"income_sub_head",
"holding_period",
"turnover",
"realized_pnl",
"transfer_expenses",
"net_realized_pnl",
"taxable_pnl"
],
"rows": [
[
"equity",
"share",
"capital_gains",
"Securities",
"short_term",
6463.49,
1403.255,
0,
1403.255,
1403.255
],
[
"equity",
"share",
"capital_gains",
"Securities",
"long_term",
0,
0,
0,
0,
0
],
[
"equity",
"mutual_fund",
"capital_gains",
"Securities",
"short_term",
3060119.623,
-58.0233,
211.5664,
-269.5897,
0
],
[
"equity",
"mutual_fund",
"capital_gains",
"Securities",
"long_term",
0,
0,
0,
0,
0
],
[
"debt",
"mutual_fund",
"capital_gains",
"other_capital_gains",
"short_term",
60246.101,
-18000.3217,
276.6437,
-18276.9654,
0
],
[
"debt",
"mutual_fund",
"capital_gains",
"other_capital_gains",
"long_term",
0,
0,
0,
0,
0
],
[
"other",
"mutual_fund",
"capital_gains",
"other_capital_gains",
"short_term",
0,
0,
0,
0,
0
],
[
"other",
"mutual_fund",
"capital_gains",
"other_capital_gains",
"long_term",
0,
0,
0,
0,
0
],
[
"equity",
"ETF",
"capital_gains",
"Securities",
"short_term",
0,
0,
0,
0,
0
],
[
"equity",
"ETF",
"capital_gains",
"Securities",
"long_term",
0,
0,
0,
0,
0
],
[
"equity",
"ADR",
"capital_gains",
"Securities",
"short_term",
6463.49,
1403.255,
0,
1403.255,
1403.255
],
[
"equity",
"ADR",
"capital_gains",
"Securities",
"long_term",
0,
0,
0,
0,
0
]
]
},
{
"name": "tradewise_tax_pnl_summary_table",
"@entity": "table",
"header": [
"income_head",
"income_sub_head",
"holding_period",
"tax_rate",
"turnover",
"realized_pnl",
"transfer_expenses",
"net_realized_pnl",
"taxable_pnl"
],
"rows": [
[
"capital_gains",
"Securities",
"short_term",
"slab_rate",
3073046.603,
2748.4867,
211.5664,
2536.9203,
2806.51
],
[
"capital_gains",
"Securities",
"long_term",
"20",
0,
0,
0,
0,
0
],
[
"capital_gains",
"other_capital_gains",
"short_term",
"slab_rate",
60246.101,
-18000.3217,
276.6437,
-18276.9654,
0
],
[
"capital_gains",
"other_capital_gains",
"long_term",
"20",
0,
0,
0,
0,
0
]
]
}
]
}
]
}
}
Response Caching
Response caching is not available for this API. Learn more about our response caching mechanism here
Annexure
Annexure-1 Corporate Actions
The enumeration is explained below:
Corporate Action | ENUM |
---|---|
Amalgamation | amalgamation |
Bonus Issue | bonus_issue |
Buy Back of Shares | buy_back |
Consolidation of Shares | consolidation |
Dividend | dividend |
Dividend on Preference Shares | dividend |
Income Distribution (InvIT) | income_distribution_invit |
Income Distribution RITES | income_distribution_rites |
InvIT - Return of Capital | return_of_capital_invit |
Preferential Issue of shares | preferential_issue |
Reduction of Capital | reduction_of_capital |
Right Issue of Equity Shares | right_issue |
Scheme of Arrangement | scheme_of_arrangement |
Spin Off | spin_off |
Stock Split | stock_split |
Voluntary Delisting of Shares | voluntary_delisting_of_share |
Wallet Charge
Since the Tax P&L Calculator from Tradebook API is not a Paid API, no wallet charge will take place.
Versioning
This API is currently in major version 1.0. Refer to our versioning policies here
Updated about 1 month ago