ediverse Explore the platform

Spotlight PEPPOL BIS Billing 3.0 The EU e-invoicing mandate is here — France Sept 2026, Belgium Jan 2026, Germany 2025.

Brazil — NF-e, NFS-e and the fiscal mosaic

Brazil has run the world's most mature and most fragmented e-invoicing system since 2008: each document type (goods, services, transport, consumer) has its own schema, its own authorisation server and its own regulator, federal or municipal.

Regulatory timeline

  • 30 September 2005 — Ajuste SINIEF 7/2005. National adoption of NF-e model 55 by CONFAZ (Conselho Nacional de Política Fazendária).
  • 1 April 2008 — First mandatory NF-e roll-out. Sectoral mandate (cigarettes, fuel) then progressive widening by CNAE wave until 2010.
  • 15 December 2010 — Ajuste SINIEF 9/2007 and CT-e. Mandatory launch of the Conhecimento de Transporte eletrônico for the main transport modes.
  • 2014 — NFC-e national rollout. Several states (RS, AC, MT) activate the Nota Fiscal de Consumidor eletrônica to progressively replace the ECF (fiscal coupon issuer).
  • 2 October 2017 — NF-e 4.00 mandatory. Migration to schema 4.0 (Note Técnica 2016.002), with mandatory QR code for NFC-e and restructuring of IPI and ICMS-ST.
  • 4 December 2020 — Convênio ICMS 134/2020. NFCom model 62 for communication services (telecoms, internet) — rollout from November 2025.
  • 20 December 2023 — Emenda Constitucional 132/2023. Enactment of the tax reform: creation of the IBS (Imposto sobre Bens e Serviços) and CBS (Contribuição sobre Bens e Serviços), progressive fusion of ICMS, ISS, PIS and COFINS between 2026 and 2033.
  • 16 January 2025 — Lei Complementar 214/2025. Regulation law for the tax reform: creation of the Comitê Gestor do IBS, mandatory national NFS-e from 2026 per the migration schedule.

Technical schema

Each document type has its own XSD, published on portalfiscal.inf.br:

  • NF-e v4.00: nfe_v4.00.xsd, NFe + infNFe envelope + procNFe protocol.
  • CT-e v4.00: cte_v4.00.xsd, structured by modal (rodoviário, aéreo, aquaviário, ferroviário, dutoviário).
  • MDF-e v3.00: mdfe_v3.00.xsd, links to transported NF-e/CT-e.
  • NFC-e v4.00: same XSD as NF-e but mod=65 and local signing (without SEFAZ transit for contingencies).
  • NFS-e ABRASF v2.04: national reference schema, not systematically adopted; each municipality may publish its own WSDL.

Minimal NF-e example:

xmlnfe-v400.xml
<?xml version="1.0" encoding="UTF-8"?>
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
  <infNFe Id="NFe35260512345678000199550010000000421000000042" versao="4.00">
    <ide>
      <cUF>35</cUF><cNF>00000042</cNF>
      <natOp>Venda de mercadoria</natOp>
      <mod>55</mod><serie>1</serie><nNF>42</nNF>
      <dhEmi>2026-05-16T10:23:00-03:00</dhEmi>
      <tpNF>1</tpNF><idDest>1</idDest>
      <cMunFG>3550308</cMunFG>
      <tpImp>1</tpImp><tpEmis>1</tpEmis>
      <cDV>2</cDV><tpAmb>1</tpAmb><finNFe>1</finNFe>
    </ide>
    <emit>
      <CNPJ>12345678000199</CNPJ>
      <xNome>EDIVERSE DEMO LTDA</xNome>
      <enderEmit>
        <xLgr>AV PAULISTA</xLgr><nro>1000</nro>
        <xBairro>BELA VISTA</xBairro>
        <cMun>3550308</cMun><xMun>SAO PAULO</xMun>
        <UF>SP</UF><CEP>01310100</CEP><cPais>1058</cPais>
        <xPais>BRASIL</xPais>
      </enderEmit>
      <IE>123456789012</IE>
      <CRT>3</CRT>
    </emit>
    <dest>
      <CNPJ>98765432000188</CNPJ>
      <xNome>CLIENTE DEMO LTDA</xNome>
      <indIEDest>1</indIEDest>
      <IE>987654321098</IE>
    </dest>
    <det nItem="1">
      <prod>
        <cProd>SKU001</cProd>
        <cEAN>SEM GTIN</cEAN>
        <xProd>Produto demo</xProd>
        <NCM>84713019</NCM>
        <CFOP>5102</CFOP>
        <uCom>UN</uCom><qCom>1.0000</qCom>
        <vUnCom>1000.0000</vUnCom><vProd>1000.00</vProd>
        <cEANTrib>SEM GTIN</cEANTrib>
        <uTrib>UN</uTrib><qTrib>1.0000</qTrib>
        <vUnTrib>1000.0000</vUnTrib>
        <indTot>1</indTot>
      </prod>
      <imposto>
        <ICMS><ICMS00><orig>0</orig><CST>00</CST><modBC>3</modBC>
          <vBC>1000.00</vBC><pICMS>18.00</pICMS><vICMS>180.00</vICMS>
        </ICMS00></ICMS>
      </imposto>
    </det>
    <total><ICMSTot>
      <vBC>1000.00</vBC><vICMS>180.00</vICMS>
      <vProd>1000.00</vProd><vNF>1000.00</vNF>
    </ICMSTot></total>
  </infNFe>
</NFe>

Submission flow

The issuer signs the NF-e with an ICP-Brasil certificate (e-CNPJ or e-CPF) in A1 (software) or A3 (token/card) format, then submits via SOAP webservice to the SEFAZ autorizadora of the issuing state. If the SEFAZ returns cStat=100 (autorizado o uso da NF-e), the invoice is legal; otherwise rejected (cStat documented in the Manual de Orientação do Contribuinte).

textnfe-sefaz-flow.txt
┌──────────────┐    ┌──────────────────┐    ┌──────────────┐
│ BR issuer    │───>│ SEFAZ autorizador│───>│ Recipient    │
│ (ERP)        │XML │ (per state)      │XML │ (download)   │
│              │A1  │                  │aut │              │
└──────────────┘    └─────────┬────────┘    └──────────────┘


                ┌──────────────────────────┐
                │ Protocolo de autorização │  ← synchronous
                │ with cStat=100 (ok)      │     XML return
                └──────────────────────────┘


                ┌──────────────────────────┐
                │ DANFE (PDF) printed to   │
                │ accompany the goods      │
                └──────────────────────────┘

On SEFAZ unavailability, the issuer can switch to contingência mode (EPEC, FS-DA, SVRS, SVAN). The printed DANFE physically accompanies the goods and carries a QR code enabling public lookup at consultadanfe.nfe.fazenda.gov.br.

Validation

Common pitfalls

  1. 27 SEFAZ × 5,570 municipalities. NF-e and CT-e schemas are national, but the webservice endpoint and root certificate differ by state. Municipal NFS-e are each a bespoke integration. No library covers the 5,570 municipalities: trade off prioritising by city or relying on an aggregator (Sieg, Migrate, Arquivei).
  2. Tax reform 2026-2033. The fusion of ICMS/ISS/PIS/COFINS into IBS+CBS will progressively change the NF-e XML structure from 2026. ERPs must anticipate a 7-year coexistence with dual tax totals.
  3. CFOP and NCM mis-calibrated. CFOP (Código Fiscal de Operações e Prestações, 4 digits) and NCM (Nomenclatura Comum do Mercosul, 8 digits) must be consistent with the operation: an intra-state sale between ICMS taxpayers requires a CFOP starting with 5, inter-state with 6, export with 7. An error distorts the ICMS-ST (substituição tributária) and triggers an automatic fine.
  4. Expired ICP-Brasil certificate. The e-CNPJ A1 expires after 1 year, A3 after 3 years. An expired certificate blocks any NF-e issuance; ERPs must monitor the expiry date and provision the renewal (in-person procedure for A3).
  5. Parallel EFD-Reinf and eSocial. NF-e is not enough for payroll: social filing (eSocial) and withholding return (EFD-Reinf) are parallel obligations with their own XML formats and cycles. Payroll-NF-e integration must cover the three flows.