TF Fiscal

Core APIs

NF-e Tax Codes

5 endpoints

POST/api/category/create

Create tax category

Creates a new tax category (tax template) bound to the authenticated company. Each category aggregates scenarios of ICMS, IPI, PIS, COFINS, and optionally IBS/CBS and IS. To edit an existing one, use /api/category/edit.

Required headers

HeaderTypeDescription
tokenstringCompany token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body — top-level

FieldTypeDescription
descricao *stringCategory description
category_idstringCustom ID. When omitted, auto-generated as "TF" + incremental number
disable_difalbooleanDisables DIFAL calculation for this category. Default: false
desconta_icms_pis_cofinsbooleanDeduct ICMS before computing PIS/COFINS — tax on (amount − ICMS), the current Brazilian standard; default false (no deduction, higher tax)
icms[] *arrayICMS scenarios (structure below)
ipi[] *arrayIPI scenarios (structure below)
pis[] *arrayPIS scenarios (structure below)
cofins[] *arrayCOFINS scenarios (structure below)
ibs_cbs[]arrayIBS/CBS scenarios — tax reform (structure below)
is[]arrayIS scenarios — Selective Tax (structure below)

Body — icms[]

FieldTypeDescription
tipo_tributacao *stringICMS tax type
cenario *stringScenario (e.g., "saida_dentro_estado", "saida_fora_estado", "padrao")
tipo_pessoa *string"fisica" or "juridica"
codigo_cfop *stringCFOP
situacao_tributaria *stringICMS CST/CSOSN
nao_contribuintebooleanNon-contributor customer
aliquota_importacaostringImport rate
aliquota_creditodecimalCredit rate (% for Simples Nacional)
aliquota_diferimentodecimalDeferral percentage (not returned by get_detail)
aliquota_diferimentoFcpstringFCP deferral (note: field uses camelCase diferimentoFcp; not returned by get_detail)
aliquota_reducaodecimalICMS base reduction percentage
aliquota_reducaoStdecimalICMS-ST base reduction percentage (note: reducaoSt camelCase)
motivo_desoneracaostringICMS exemption reason code
motivo_desoneracaoStstringICMS-ST exemption reason code (note: camelCase)
ad_rem_icmsdecimalSingle-phase ICMS — ad rem rate in BRL/unit (CST 02, 15, 53)
ad_rem_icms_retdecimalSingle-phase ICMS — withheld ad rem in BRL/unit (CST 15, 61)
p_dif_monodecimalSingle-phase ICMS — deferral percentage (CST 53)
q_bc_monodecimalSingle-phase ICMS — taxed quantity (liters/kg); 0 uses the item quantity (CST 02, 15, 53)
valor_desoneracaodecimalExempted ICMS amount in BRL — emits vICMSDeson (CST 40, 41, 50, 90)
v_bc_st_retdecimalCalculation base of the ICMS-ST withheld in the previous operation (provided, not calculated — CST 60, CSOSN 500)
p_stdecimalRate borne by the final consumer, in % (provided, not calculated — CST 60, CSOSN 500)
v_icms_st_retdecimalICMS-ST amount withheld in the previous operation (provided, not calculated — CST 60, CSOSN 500)
v_icms_substitutodecimalSubstitute's own ICMS amount (provided, not calculated — CST 60, CSOSN 500)
v_bc_fcp_st_retdecimalCalculation base of the FCP withheld by ST (provided, not calculated — CST 60, CSOSN 500)
p_fcp_st_retdecimalFCP rate withheld by ST, in % (provided, not calculated — CST 60, CSOSN 500)
v_fcp_st_retdecimalFCP amount withheld by ST (provided, not calculated — CST 60, CSOSN 500)
Per-state rates — optional
aliquota_mva[]arrayMVA per UF — items: { estado, aliquota }
aliquota_icms[]arrayICMS rate per UF — items: { estado, aliquota }
aliquota_icms_st[]arrayICMS-ST rate per UF — items: { estado, aliquota }
aliquota_fcp[]arrayFCP rate per UF — items: { estado, aliquota }
aliquota_fcp_st[]arrayFCP-ST rate per UF — items: { estado, aliquota }
beneficio_fiscal[]arrayTax benefit code per UF — items: { estado, codigo }

Body — ipi[]

FieldTypeDescription
cenario *stringScenario
tipo_pessoa *string"fisica" or "juridica"
situacao_tributaria *stringIPI CST
codigo_enquadramento *stringLegal framework code
aliquota *stringIPI rate
valor_unidadestringIPI by quantity — value in BRL/unit; only used when there is no percentage rate (CST 00, 50, 49, 99)

Body — pis[] and cofins[] (same structure)

FieldTypeDescription
cenario *stringScenario
tipo_pessoa *string"fisica" or "juridica"
situacao_tributaria *stringPIS/COFINS CST
aliquota *stringRate
valor_unidadestringPIS/COFINS by quantity — value in BRL/unit; v = quantity × value (CST 03 and other per-quantity forms)

Body — ibs_cbs[] (Tax Reform)

FieldTypeDescription
cenario *stringScenario
tipo_pessoa *string"fisica" or "juridica"
situacao_tributaria *stringIBS/CBS CST
classificacao_tributaria *stringTax classification
p_ibs_ufstringIBS state rate in % (optional; empty uses the transition default, 0.10 in 2026). Accepts dot or comma
p_ibs_munstringIBS municipal rate in % (optional; default 0 in 2026)
p_cbsstringCBS rate in % (optional; default 0.90 in 2026)
p_red_aliqstringRate reduction percentage (CST 011, 200, 515)
p_difstringDeferral percentage (CST 510, 515)
p_red_bcstringTax base reduction percentage (CST 222)
proporcaostringOperation proportion in % (CST 221)
aliquota_cbs_monostringSingle-phase CBS — rate in % over the base; takes precedence over valor_unidade_cbs (CST 620)
aliquota_ibs_monostringSingle-phase IBS — rate in % over the base; takes precedence over valor_unidade_ibs (CST 620)
valor_unidade_cbsstringSingle-phase CBS — ad rem in BRL/unit; only used when there is no percentage rate (CST 620)
valor_unidade_ibsstringSingle-phase IBS — ad rem in BRL/unit; only used when there is no percentage rate (CST 620)
valor_deducao_legalstringLegal base deduction value in BRL (CST 830)

Body — is[] (Selective Tax)

FieldTypeDescription
cenario *stringScenario
tipo_pessoa *string"fisica" or "juridica"
situacao_tributaria *stringIS CST
aliquota *stringIS rate

* Required field.

GET/api/category/get_detail

Tax category details

Returns the complete configuration of a tax category: all ICMS, IPI, PIS, COFINS, IBS/CBS scenarios, including per-UF arrays (MVA, rates, tax benefits).

Required headers

HeaderTypeDescription
tokenstringCompany token
signstringMD5 signature (path includes the query string)
timestampstringUnix timestamp in seconds

Query string

ParameterTypeDescription
category_id *stringTax category ID

* Required field.

GET/api/category/get_list

List tax categories

Lists the tax categories of the authenticated company with pagination. Returns category_id, descricao and the ibs_cbs block (Tax Reform) of each category — for the remaining taxes use /api/category/get_detail.

Required headers

HeaderTypeDescription
tokenstringCompany token
signstringMD5 signature (path includes the query string)
timestampstringUnix timestamp in seconds

Query string

ParameterTypeDescription
page *intPage number (≥ 1)
page_size *intPage size (1–50)

* Required field.

POST/api/category/edit

Edit tax category

Edits an existing tax category. The body is identical to /api/category/create, the only difference being that category_id is required and must match an existing category. The upsert fully replaces the icms, ipi, pis, cofins, ibs_cbs, is arrays — send all updated scenarios (there is no per-scenario merge).

Required headers

HeaderTypeDescription
tokenstringCompany token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

The full body structure is documented in /api/category/create. Only category_id is handled differently here:

FieldTypeDescription
category_id *stringID of the category to edit (must exist; otherwise returns an error)
descricao *stringDescription
icms[] *arrayICMS scenarios (fully replaces)
ipi[] *arrayIPI scenarios
pis[] *arrayPIS scenarios
cofins[] *arrayCOFINS scenarios
ibs_cbs[]arrayIBS/CBS scenarios (optional)
is[]arrayIS scenarios (optional)
disable_difalbooleanDefault: false
desconta_icms_pis_cofinsbooleanDeduct ICMS before computing PIS/COFINS — tax on (amount − ICMS), the current Brazilian standard; default false (no deduction, higher tax)

* Required field. For the inner fields of each array (icms[].codigo_cfop etc.), see /api/category/create.

POST/api/category/delete

Delete tax category

Removes a tax category from the company. Irreversible operation. Products bound to this category will continue referencing the removed category_id, so NFe issuance will fail — update the products before deleting.

Required headers

HeaderTypeDescription
tokenstringCompany token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
category_id *stringID of the category to delete

* Required field.