
How to Comply with SEFAZ in Brazil: Issue Your First NF-e and NFS-e End to End (2026)
Global E-Invoicing Platform Series
This guide is part of a comprehensive series. Explore all 36 topics:
To comply with SEFAZ in Brazil, a CNPJ-registered business must hold an active state inscription (Inscrição Estadual) for goods and a municipal inscription (Inscrição Municipal) for services, install an ICP-Brasil A1 digital certificate bound to that CNPJ, build the NF-e XML to the SEFAZ v4.00 schema (now extended by NT 2025/002 for IBS/CBS reform fields), sign with XML-DSig, transmit to the state SEFAZ webservice for the emitter UF, receive the authorisation protocol with the 44-digit chave de acesso, generate the DANFE for transport, and route service invoices (NFS-e) to the appropriate municipal endpoint.
At a glance
- Authority: SEFAZ (state) for NF-e and CT-e; the municipality for NFS-e; Receita Federal and Comitê Gestor do IBS for CBS/IBS oversight from 2026.
- Artefact: Signed XML cleared by SEFAZ; printable DANFE (NF-e) or DANFSe (NFS-e) with QR for verification.
- Schema: NF-e v4.00 with NT 2025/002 v1.33 extensions for IBS/CBS reform; NFS-e municipal schemas (ABRASF, Ginfes, Betha, or proprietary São Paulo/Rio).
- Certificate: ICP-Brasil A1 (software, 1-year expiry) bound to CNPJ.
- Cancellation window: 24 hours after authorisation (extended to 168 hours in some UFs).
- New from 1 Jan 2026: IBS and CBS must be itemised on every fiscal document — penalties activate 1 August 2026 per Decree 12.955/2026.
- Last reviewed: 20 November 2026 against the Receita Federal Orientações 2026 and NT 2025/002 v1.33.
Where SEFAZ sits in the global e-invoicing landscape
Brazil runs the oldest production clearance regime in the world — NF-e has been mandatory since 2006.
Brazil runs the oldest production clearance regime in the world — NF-e has been mandatory since 2006. Every sale of goods is pre-cleared by the state SEFAZ before the buyer is allowed to receive the merchandise or take an input credit. That puts SEFAZ in the same architectural family as ZATCA Phase 2 in Saudi Arabia, MyInvois in Malaysia, and FIRS MBS in Nigeria — and at the opposite end of the spectrum from periodic reporting regimes like HMRC MTD. For the broader split, see clearance vs reporting models in e-invoicing.
What is new in 2026 is the parallel run of ICMS/PIS/COFINS with the reform-era IBS (Imposto sobre Bens e Serviços) and CBS (Contribuição sobre Bens e Serviços). NT 2025/002 v1.33 added the validation rules, the new event types, and the rejection codes (1115 onwards) that any compliant emitter must handle.
What you need before you start
An active CNPJ (legal entity tax ID) issued by Receita Federal. State inscription (Inscrição Estadual) in every UF where you ship goods.
- An active CNPJ (legal entity tax ID) issued by Receita Federal.
- State inscription (Inscrição Estadual) in every UF where you ship goods.
- Municipal inscription (Inscrição Municipal) in every municipality where you provide services.
- An ICP-Brasil A1 certificate bound to your CNPJ — see ICP-Brasil A1 certificates explained.
- An invoicing platform integrated with the SEFAZ webservices of the UFs where you operate and the municipal NFS-e endpoints of the municipalities where you provide services.
- A code base updated to NT 2025/002 v1.33 — IBS/CBS fields are no longer optional from 1 January 2026.
Step 1 — Decide NF-e or NFS-e per transaction
How do I classify the transaction?
Sale of goods → NF-e, cleared by the state SEFAZ of the emitter UF. Provision of services → NFS-e, cleared by the municipality where the service is rendered (ISS jurisdiction rule).
Sale of goods → NF-e, cleared by the state SEFAZ of the emitter UF. Provision of services → NFS-e, cleared by the municipality where the service is rendered (ISS jurisdiction rule). Freight movement → CT-e, cleared by the originating UF. Mixed invoices are split into one NF-e plus one NFS-e — never combined.
What if my customer is in another UF?
The clearance is always done by the emitter's UF, but the inter-state ICMS calculation (DIFAL) applies and must be embedded in the payload. SEFAZ will reject the document if the ICMS split between origin and destination UF does not match the current rate matrix.
The clearance is always done by the emitter's UF, but the inter-state ICMS calculation (DIFAL) applies and must be embedded in the payload. SEFAZ will reject the document if the ICMS split between origin and destination UF does not match the current rate matrix.
Step 2 — Load the ICP-Brasil A1 certificate
Load the . pfx file with its password into the invoicing platform's key store.
Load the .pfx file with its password into the invoicing platform's key store. Invoicemonk binds the certificate to the corresponding CNPJ and uses it to sign every payload programmatically. The A1 certificate expires after one calendar year — set a renewal reminder for day 320 of the cycle to avoid clearance outages.
What about A3 certificates?
A3 lives on a smart card or HSM, requires hardware, and is impractical for high-volume API issuance. Production NF-e systems almost universally run on A1.
A3 lives on a smart card or HSM, requires hardware, and is impractical for high-volume API issuance. Production NF-e systems almost universally run on A1. See ICP-Brasil A1 certificates explained for the trade-offs.
Step 3 — Build the NF-e XML (with IBS/CBS fields)
The NF-e XML follows the SEFAZ schema v4. 00 with NT 2025/002 v1.
The NF-e XML follows the SEFAZ schema v4.00 with NT 2025/002 v1.33 extensions. Required blocks:
- Emitter (emit): CNPJ, Inscrição Estadual, address, regime tributário (1 = Simples Nacional, 3 = Regime Normal).
- Recipient (dest): CNPJ or CPF, address, IE indicator.
- Items (det): CFOP (operation code), NCM (HS code), unit, quantity, unit price, total.
- Taxes (imposto): ICMS group (CST or CSOSN for Simples), IPI, PIS, COFINS — plus new IBS and CBS groups from NT 2025/002.
- Identification (ide): UF code, year-month, document model (55 = NF-e), series, document number, emission timestamp, contingency type.
- Chave de acesso: composed automatically from the ide fields plus a check digit (44 digits total).
Step 4 — Sign and transmit to SEFAZ
Step 4 — Sign and transmit to SEFAZ includes: The platform canonicalises the XML (C14N) and computes the SHA-256 digest of the InfNFe block. The A1 private key signs the digest using XML-DSig in the Brazilian XAdES-BES profile.
- The platform canonicalises the XML (C14N) and computes the SHA-256 digest of the InfNFe block.
- The A1 private key signs the digest using XML-DSig in the Brazilian XAdES-BES profile.
- The signed XML is sent to the SEFAZ webservice of the emitter's UF (or to SVAN / SVRS contingency endpoints if the primary is down).
- SEFAZ returns an authorisation protocol containing the protocol number and the cStat = 100 (Autorizado o uso da NF-e).
- The platform generates the DANFE (PDF, A4 or thermal) carrying the chave de acesso, QR for SEFAZ verification, and the protocol number.
What if SEFAZ is down?
Three contingency paths: EPEC (Evento Prévio de Emissão em Contingência) for immediate emission with later transmission; SVAN/SVRS — the national contingency SEFAZ; FS-DA — paper contingency form, last resort. Invoicemonk falls back automatically when the primary UF SEFAZ returns repeated timeouts.
Three contingency paths: EPEC (Evento Prévio de Emissão em Contingência) for immediate emission with later transmission; SVAN/SVRS — the national contingency SEFAZ; FS-DA — paper contingency form, last resort. Invoicemonk falls back automatically when the primary UF SEFAZ returns repeated timeouts.
Step 5 — Handle NFS-e per municipality
NFS-e is municipal, so the webservice and schema vary.
NFS-e is municipal, so the webservice and schema vary. The largest municipalities (São Paulo, Rio de Janeiro, Belo Horizonte, Curitiba) run their own proprietary systems; many smaller municipalities standardise on ABRASF, Ginfes, or Betha shared platforms. The unified national NFS-e (DPS — Declaração de Prestação de Serviços) is rolling out gradually and is mandatory for some service categories from 2026.
Invoicemonk routes each NFS-e to the correct municipal endpoint based on the service-location postcode and the ISS jurisdiction rule, then stores the municipal receipt alongside the chave de acesso.
Step 6 — Cancellations and corrections
NF-e cancellation is allowed within 24 hours of authorisation (some UFs extend to 168 hours).
NF-e cancellation is allowed within 24 hours of authorisation (some UFs extend to 168 hours). After the window, the only paths are:
- Carta de Correção Eletrônica (CC-e): corrects minor errors that do not change ICMS calculation, total value, parties, or product.
- Return NF-e: a separate document reversing the original — used for material changes.
- Inutilização: only for unused numbers in a series, not for cancelled documents.
NFS-e cancellation rules vary by municipality — São Paulo allows cancellation any time in the same month; many others enforce shorter windows.
IBS/CBS reform — what changes from 2026
Per the Receita Federal Orientações 2026 publication and Decree 12.
Per the Receita Federal Orientações 2026 publication and Decree 12.955/2026 (in force from 30 April 2026, penalties from 1 August 2026), every fiscal document issued from 1 January 2026 must:
- Itemise CBS (federal) and IBS (state+municipal) per line, in addition to the legacy ICMS/PIS/COFINS during the transition.
- Carry the new CGIBS-prescribed identifiers (Comitê Gestor do IBS).
- Validate against NT 2025/002 v1.33 — rejection codes 1115 onwards cover the new fields.
The transition runs through 2033, when ICMS and ISS are fully replaced by IBS, and PIS/COFINS by CBS. Your platform must support both stacks in parallel until then.
Pre-go-live compliance checklist
Pre-go-live compliance checklist includes: ☐ CNPJ active and IE registered in every emitter UF. ☐ Municipal inscription active in every service-location municipality.
- ☐ CNPJ active and IE registered in every emitter UF.
- ☐ Municipal inscription active in every service-location municipality.
- ☐ ICP-Brasil A1 certificate loaded; renewal reminder set for day 320.
- ☐ Invoicing platform updated to NT 2025/002 v1.33 (IBS/CBS validations).
- ☐ SEFAZ contingency endpoints (SVAN/SVRS) tested with a smoke load.
- ☐ NFS-e routing map covers every service-location municipality.
- ☐ CC-e and return-NF-e workflows trained with the AR team.
- ☐ Five-year XML retention bucket configured (chave de acesso indexed).
Authority sources
- Portal Nacional da Nota Fiscal Eletrônica — SEFAZ
- Receita Federal — Orientações da Reforma Tributária para 2026
- SEFAZ — Notas Técnicas (NT 2025/002 v1.33)
- ITI — Instituto Nacional de Tecnologia da Informação (ICP-Brasil)
- Receita Federal — Portal Oficial
- Receita Federal — Sistema Nacional NFS-e
TL;DR
Register the CNPJ, IE, and IM, install the A1 certificate, build the NF-e XML to v4. 00 + NT 2025/002 v1.
Register the CNPJ, IE, and IM, install the A1 certificate, build the NF-e XML to v4.00 + NT 2025/002 v1.33, sign and clear with the emitter UF's SEFAZ, route NFS-e to the right municipality, respect the 24/168-hour cancellation window, and run ICMS/PIS/COFINS in parallel with the new IBS/CBS until the reform completes in 2033.
Related reading
Related reading includes: SEFAZ Brazil — how Invoicemonk implements NF-e and NFS-e SEFAZ Brazil explained: NF-e, NFS-e, CT-e, and the chave de acesso
- SEFAZ Brazil — how Invoicemonk implements NF-e and NFS-e
- SEFAZ Brazil explained: NF-e, NFS-e, CT-e, and the chave de acesso
- ICP-Brasil A1 certificates explained
- Clearance vs reporting models in e-invoicing
- QR codes on tax invoices explained
Ready to issue your first NF-e today? See how Invoicemonk handles SEFAZ NF-e and NFS-e end to end.
More in this series (36 articles)
From this series
Mandate-compliant e-invoicing in 17 jurisdictions, with the local artefact (CSID, IRN, UUID, QR, digital signature) issued automatically.
Digital Marketing, SEO Specialist, Content Creator & Product Professional
Olayinka is a digital marketer, content creator, growth and SEO specialist with 10+ years helping businesses in Nigeria, the UK, the US, Australia, and Dubai achieve their goals online.




