E-invoicing in Mexico in short
Every invoice in Mexico is electronic. Since 1 January 2014 the CFDI (Comprobante Fiscal Digital por Internet) has been the only invoice that counts for tax purposes, for sales, services, payroll and payments alike (Código Fiscal de la Federación, articles 29 and 29-A). The issuer seals the XML with its digital seal certificate (CSD) from SAT and sends it to an authorised certification provider, a PAC, which validates it, adds the Timbre Fiscal Digital with the folio fiscal (a UUID) and passes a copy to SAT. Without that stamp the document is not a CFDI.
Version 4.0 of Anexo 20 took effect on 1 January 2022 and has been the only one accepted since 1 April 2023, when version 3.3 ended. It added the receiver's name, postal code and tax regime, which must match SAT's records, whether each line is subject to tax (ObjetoImp), the export key and the global invoice for sales to the general public. An invoice not paid when it is issued (payment method PPD) is followed by a payment receipt, a CFDI of type P with the Pagos 2.0 complement, for each payment. A CFDI is cancelled with one of four reasons, and many cancellations need the receiver's acceptance.
How to check a CFDI
- Open the validator with the CFDI 4.0 profile. A CFDI opened or pasted picks the profile on its own, by its Comprobante element and namespace.
- Paste the XML or drop the file, an invoice or a payment receipt, stamped or not, then press Validate.
- Each finding names SAT's error code; click it for the rule, its Spanish wording from the matrix and what usually causes it.
What is checked
First the SAT schemas: cfdv40.xsd with its catalogues, the Timbre Fiscal Digital 1.1 and the Complemento para recepción de Pagos 2.0. Then our rules, written from SAT's error matrices for CFDI 4.0 (of 25 March 2026) and Pagos 2.0 (revision B) and the validations of Anexo 20. Each rule carries SAT's error code and the Spanish description of the matrix: SubTotal is the sum of the lines (CFDI40108), a line's Importe is quantity times price within the limits Anexo 20 computes from the decimals written (CFDI40167), each tax is base times rate within the same limits (CFDI40180), the tax summary adds up from the lines (CFDI40221), and an invoice to the general public is a global invoice with its period (CFDI40130). Decimals follow the currency, and the payment form and method, exchange rate, the receiver's regime and the use of the CFDI follow the catalogues.
For a payment receipt the Pagos 2.0 rules run too: the fixed fields of type P, each related document's balance after the payment (CRP20244), the taxes paid converted by EquivalenciaDR (CRP20268), the totals in pesos and the account patterns of each payment form.
What needs more than the file is not checked: the seal and certificate, SAT's RFC registry (the receiver's name, postal code and regime), limits that need the day's exchange rate, and what the product catalogue requires of each line. Other complements (Carta Porte, Nómina, Comercio Exterior) are not in the schema, so a document that carries one is reported invalid.
Profiles to check with
- CFDI 4.0: The Mexican electronic invoice, with the Timbre Fiscal Digital stamp and the Pagos 2.0 payment complement. Validate
Rules invoices break most
Each one has a page with what it checks, its test and, for many, how to fix it
CFDI40108: In an income (I), expense (E) or payroll (N) CFDI, SubTotal must be the sum of the lines' Importe rounded to the currency's decimals.CFDI40167: A line's Importe must be Cantidad times ValorUnitario, within the limits Anexo 20 computes from the decimals written: (Cantidad - half a unit) × (ValorUnitario...CFDI40180: The Importe of a line's transferred tax must be Base times TasaOCuota, between (Base - half a unit) × rate truncated and (Base + half a unit) × rate rounded up,...CFDI40221: The Importe of a transferred tax in the summary must be the sum of the lines' amounts with the same tax, factor and rate, rounded to the currency's decimals.CFDI40130: An income CFDI to the general public (receiver RFC XAXX010101000, name PUBLICO EN GENERAL) is a global invoice and must have InformacionGlobal (periodicity, mon...CRP20244: The balance left (ImpSaldoInsoluto) must be ImpSaldoAnt minus ImpPagado, and not negative.CRP20268: A payment's BaseP must be the sum of its related documents' BaseDR with the same tax, factor and rate, each divided by its EquivalenciaDR; every tax, factor and...
Questions
Is the invoice uploaded?
No. The schema check and the rules both run in your browser. Only the API and URL monitors validate on our servers.
Does a valid result mean the PAC will stamp it?
It means the CFDI passes the schema and the validations of SAT's matrices that need only the file. The PAC also checks the seal and the certificate, SAT's RFC registry (name, postal code and regime of the receiver) and limits that need the day's exchange rate, so it can still refuse the document for something a file alone doesn't show.
Can I check a stamped CFDI or a payment receipt?
Yes. The Timbre Fiscal Digital is part of the schema, though its seal is not verified, and a payment receipt (type P) gets the Pagos 2.0 rules, from the balances of each related document to the totals in pesos.
Are these SAT's own rules?
They are our implementation of the validations SAT publishes in its error matrices, with SAT's codes and wording; PACs run their own. The examples use SAT's test RFCs.
Can I check invoices from code?
Yes: the API and the command-line client with --schema cfdi-4.0, or --schema auto for a folder of mixed files.
Official sources
- SAT: Anexo 20, CFDI 4.0 standard and error matrices (in Spanish)
- SAT: CFDI 4.0 schema (cfdv40.xsd)
- SAT: how a CFDI is cancelled (in Spanish)
- Código Fiscal de la Federación (in Spanish)
Other countries
- French e-invoice validator
- German e-invoice validator: XRechnung and ZUGFeRD
- Belgian e-invoice validator: Peppol BIS
- Dutch e-invoice validator: SI-UBL 2.0 and NLCIUS
- KSeF invoice validator: FA(3)
- Danish e-invoice validator: OIOUBL 2.1
- Norwegian e-invoice validator: EHF
- Swedish e-invoice validator: Peppol BIS
- Finnish e-invoice validator: Finvoice
- Austrian e-invoice validator for e-Rechnung.gv.at
- Czech e-invoice validator: ISDOC
- Croatian eRačun validator
- RO e-Factura validator
- FatturaPA validator
- Spanish e-invoice validator
- Portuguese e-invoice validator: CIUS-PT
- ZATCA e-invoice validator (FATOORA)
- UAE e-invoice validator (PINT AE)
- InvoiceNow validator (PINT SG)
- JP PINT validator
- Australian e-invoice validator (PINT A-NZ)
- Malaysian e-invoice validator (MyInvois)
- Brazilian NF-e validator (SEFAZ rules)