API reference / Tax

Capital-gains tax

Equity STCG/LTCG tax with the one-lakh LTCG exemption and cess.

POST/v1/tax/capital-gains
Authentication
Bearer token
Scope
tax:calc

Before you integrate

  • Rates and the exemption are applied exactly as you send them. If you leave them out, the defaults shown above are used, so pass the current figures explicitly.

Request body

FieldTypeRequiredDescription
equity_stcg_minorintegerNoShort-term equity gain in paise; 0 or more. Defaults to 0.
equity_ltcg_minorintegerNoLong-term equity gain in paise; 0 or more. Defaults to 0.
stcg_ratenumberNoShort-term tax rate as a fraction from 0 to 1. Defaults to 0.15; send the rate you want applied.
ltcg_ratenumberNoLong-term tax rate as a fraction from 0 to 1. Defaults to 0.10; send the rate you want applied.
ltcg_exemption_minorintegerNoYearly long-term exemption in paise. Defaults to 10000000 (Rs 1,00,000); send the amount you want applied.

Sample code

Set your key in the GRAPPI_API_KEY environment variable. Sample values are placeholders.

curl -sS -X POST 'https://grappi.ai/v1/tax/capital-gains' \
  -H "Authorization: Bearer $GRAPPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "equity_ltcg_minor": 15000000
}'

Sample response

{
  "request_id": "req_01HZY3K8M2",
  "result": {
    "stcg_tax_minor": 0,
    "ltcg_taxable_minor": 5000000,
    "ltcg_exemption_applied_minor": 10000000,
    "ltcg_tax_minor": 500000,
    "cess_minor": 20000,
    "total_tax_minor": 520000
  }
}

Response fields

FieldTypeDescription
stcg_tax_minorintegerTax on short-term gains in paise.
ltcg_taxable_minorintegerLong-term gain left after the exemption, in paise.
ltcg_exemption_applied_minorintegerExemption actually used, in paise.
ltcg_tax_minorintegerTax on long-term gains in paise.
cess_minorintegerCess on both taxes in paise.
total_tax_minorintegerTotal tax payable in paise.

Errors

Every failure has the same shape. A call that fails on our side or at the data source is refunded to your wallet; a "no record found" answer is charged. See the error reference.