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:
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.
One call returns the breakdown of every tax due. No need for multiple queries.
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.
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.
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.
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.
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.
POST https://api.tffiscal.com/api/tax/calculate
Headers: token · timestamp · sign = md5(token + path + body + timestamp)
{
"data_operacao": "2026-11-27",
"natureza": "venda",
"destinatario": { "cpf": "52998224725", "uf": "RJ" },
"itens": [
{
"codigo": "MESA-01",
"descricao": "Mesa de madeira",
"ncm": "94036000",
"origem": 0,
"quantidade": 2,
"valor_unitario": 500.00,
"frete": 20.00,
"producao_propria": false
}
]
}
Response (abridged; groups use the NF-e tag names):
{
"success": true,
"data": {
"status": "determinado",
"itens": [
{
"nItem": 1,
"status": "determinado",
"CFOP": "6108",
"NCM": "94036000",
"ICMS": { "orig": 0, "CST": "00", "vBC": 1020.00, "pICMS": 12.00, "vICMS": 122.40 },
"ICMSUFDest": { "vBCUFDest": 1020.00, "pICMSUFDest": 20.00, "pICMSInter": 12.00,
"vICMSUFDest": 81.60, "pFCPUFDest": 2.00, "vFCPUFDest": 20.40 },
"IPI": { "CST": "53" },
"PIS": { "CST": "01", "vBC": 1020.00, "pPIS": 0.65, "vPIS": 6.63 },
"COFINS": { "CST": "01", "vBC": 1020.00, "pCOFINS": 3.00, "vCOFINS": 30.60 },
"IBSCBS": {
"CST": "000",
"cClassTrib": "000001",
"gIBSCBS": {
"vBC": 1020.00,
"gIBSUF": { "pIBSUF": 0.10, "vIBSUF": 1.02 },
"gIBSMun": { "pIBSMun": 0.00, "vIBSMun": 0.00 },
"vIBS": 1.02,
"gCBS": { "pCBS": 0.90, "vCBS": 9.18 }
}
},
"pendencias": []
}
],
"total": {
"ICMSTot": { "vBC": 1020.00, "vICMS": 122.40, "vICMSUFDest": 81.60,
"vFCPUFDest": 20.40, "vPIS": 6.63, "vCOFINS": 30.60 },
"IBSCBSTot": { "vBCIBSCBS": 1020.00, "vIBS": 1.02, "vCBS": 9.18 }
}
}
}
The origin state and the tax regime come from the registration of the token's company. In this example, a São Paulo issuer under lucro presumido sells to a final consumer in Rio de Janeiro: 12% interstate ICMS plus DIFAL with a 2% FCP. Full contract, fields and statuses in the API documentation →