NF-e 4.00
Brazilian electronic invoice (Nota Fiscal Eletrônica)
The Brazilian electronic invoice for goods (model 55), in the layout of schema package PL_010f
About
An NF-e is an XML document signed by the issuer and authorised by the state tax authority (SEFAZ) before the goods move. The SEFAZ web services reject a document that does not match the schema.
The schemas come from the package Pacote de Liberação nº 010f, which includes the tax reform fields of NT 2025.002 and NT 2026.007.
E-invoicing in Brazil: the rules in short and how to check an invoice →
Good to know
- After the schema, the SEFAZ authorisation rules that need only the file run as our br-nfe rules: 353 rejection codes of the MOC 7.0 Anexo I and its Notas Técnicas (the tax reform rules of NT 2025.002, the DANFE Simplificado Tipo 2 of NT 2026.002), with the Portuguese descriptions and the values found. Access key and check digits, CNPJ (also alphanumeric) and CPF, GTIN, CFOP against the operation, item and IBS/CBS amounts, totals and vNF.
- Not checked: registry lookups (issuer and receiver registration, authorised documents, duplicates), the support tables (CFOP, NCM, cClassTrib, municipalities), state registration (IE) check digits and the signature. Rules the MOC leaves to each state are warnings. The date of issue stands in for the day the SEFAZ receives the document.
- The example is by xmlvalid.com: a homologação (test environment) document with dummy CNPJs, the 2026 test rates of IBS (0.1%) and CBS (0.9%) and a placeholder signature.
- An authorised NF-e as issuers store and send it, with the SEFAZ protocol around it (nfeProc), is checked with NF-e 4.00 with authorisation protocol.
Files
5 files · 441.5 KB · Download all (.zip)-
nfe_v4.00.xsd main
-
leiauteNFe_v4.00.xsd
-
xmldsig-core-schema_v1.01.xsd
-
tiposBasico_v4.00.xsd
-
DFeTiposBasicos_v1.00.xsd
The validator loads all of these with their folder structure, so includes and imports resolve as published
Business rules
Schematron · run in this order-
SEFAZ authorisation rules of NF-e 4.00 MOC 7.0 Anexo I, NTs up to 2026.010
xmlvalid, after the validation rules of the Manual de Orientação do Contribuinte and its Notas Técnicas · MIT
The rules run after the schema check, only when the document matches the schema, and in your browser like the schema check (with SaxonJS by Saxonica). Each finding names its rule, such as BR-CO-15, and the line it points at; each rule has a page with what it checks.
Example document
nfe.xml · 5.7 KB · passes the schema and the rules
In CI and from code
The same schema by its name, nfe-4.00, through the API.
npx @xmlvalid/cli validate "**/*.xml" --schema nfe-4.00
- uses: xmlvalid/validate-action@v1
with:
files: "**/*.xml"
schema: nfe-4.00
api-key: ${{ secrets.XMLVALID_API_KEY }}
curl https://xmlvalid.com/api/v1/validations \
-H "Authorization: Bearer $XMLVALID_API_KEY" \
-F document=@nfe.xml \
-F schema=nfe-4.00
Free accounts get 100 API validations a month. On Pro, a URL monitor can check a published document against this schema every hour and email you when it breaks. More CI setups