Why You Need a Dedicated Tax Calculation API
Brazil's tax system is rated by international financial institutions (IMF / OECD) as one of the most complex in the world. Goods circulation alone involves:
- ICMS · state goods-circulation tax, legislated independently by 27 states, with standard rates of 7–25%
- ICMS-ST · tax substitution, where the manufacturer or distributor withholds the downstream tax due in advance
- DIFAL · the state-tax differential on interstate transactions, requiring additional payment or refund
- IPI · federal industrial products tax, with rates set per NCM product code (10,000+ codes)
- PIS / COFINS · federal social contributions (being gradually replaced by CBS from 2026)
- ISS · service tax (municipal, being gradually replaced by IBS from 2026)
- 2026 CBS / IBS · new taxes after the reform, coexisting with the old ones during the transition
It's nearly impossible for an ERP to implement these calculations on its own: ICMS alone requires maintaining a multi-dimensional rate database of 27 states × product categories × customer types, and rates may change every month. The error rate of doing it yourself exceeds 30%, and miscalculations lead to rejected invoices, complex refunds and high compliance risk.
Core Capabilities of the TF Fiscal Tax Calculation API
1. Support for All Taxes
One call returns the breakdown of every tax due. No need for multiple queries.
2. NCM Product Code Linkage
Provide the product's NCM code (Brazil's product classification code, compatible with the customs HS code), and the corresponding IPI and PIS / COFINS rates are applied automatically. Not familiar with NCM codes? TF Fiscal's fuzzy matching of NCM by product name can help.
3. Automatic Interstate DIFAL Determination
When the origin state ≠ the destination state, the platform automatically determines whether DIFAL applies and computes the amount to be paid / refunded based on the destination state's rate differential.
4. Nationwide ICMS-ST Rules Database
Which products require ICMS-ST? What's the withholding ratio? What is the base price (MVA)? — all built into the rules database and applied automatically.
5. Customer Type Recognition
The rate algorithm differs for selling the same product to a "distributor" vs an "end consumer" vs a "small business under the Simples Nacional regime." The API accepts a customer type and adjusts automatically.
6. CBS / IBS Dual-Track Calculation
During the reform transition, old and new taxes coexist. The API returns both the "old tax amount" and the "new tax amount," so you can choose how to file or reconcile.
API Example
POST /v1/tax/calculate
{
"ncm": "8517.12.31",
"valor": 1000.00,
"uf_origem": "SP",
"uf_destino": "RJ",
"tipo_cliente": "PJ_consumidor_final",
"regime_emit": "Lucro_Real"
}
Response:
{
"icms": { "aliquota": 0.18, "valor": 180.00 },
"icms_st": null,
"difal": { "aliquota": 0.02, "valor": 20.00 },
"ipi": { "aliquota": 0.15, "valor": 150.00 },
"pis": { "aliquota": 0.0165, "valor": 16.50 },
"cofins": { "aliquota": 0.076, "valor": 76.00 },
"cbs_simulacao_2026": { "valor": 87.00 },
"valor_total_com_impostos": 1442.50
}
Typical Use Cases
- ERP quotations: real-time tax-inclusive calculation when pricing products, so the invoiced amount later matches up
- E-commerce product pricing: display different tax-inclusive prices depending on the destination state
- Financial reconciliation: compare against the actual tax on issued NF-e to spot anomalies
- Cross-border reconciliation: accounting for tax differences when settling between the Chinese entity and the Brazilian entity
Pricing
- Pay per call: R$ 0.10 / call
- Customized enterprise solution: for customers with high call volumes, cross-region batch calculation or dedicated SLA requirements, we offer one-on-one customization: annual / per-business-line package pricing, a dedicated account manager, a dedicated resource pool and priority technical support. Contact sales for a quote →
FAQ
Q: What if I don't know the NCM code?
Provide the product name, and the system fuzzy-matches the most likely NCM candidates. The final choice should be confirmed by you or your finance team.
Q: How often is the rate database updated?
We scan and update rate notices across all 27 states monthly; for urgent tax changes, we sync within 48 hours.
Q: Can it be used for tax planning?
It can do basic comparative estimates, but for specific planning we recommend consulting a professional tax advisor. This API only performs compliance calculations and does not offer avoidance advice.
Related Solutions