# CFDI 4.0

Source: https://xmlvalid.com/schemas/cfdi-4.0

> The Mexican electronic invoice, with the Timbre Fiscal Digital stamp and the Pagos 2.0 payment complement.

Every invoice in Mexico is a CFDI: an XML file signed by the issuer and stamped (timbrado) by an authorised certification provider (PAC) before it is valid. Version 4.0 has been the only accepted version since 2023.
The Complemento element only accepts elements whose schema is known, so a stamped CFDI fails against cfdv40.xsd alone. This entry loads cfdv40.xsd together with the SAT schemas of the Timbre Fiscal Digital 1.1 and the Complemento para recepción de Pagos 2.0 through a small wrapper schema by xmlvalid.com.

- Type: XSD
- Version: 4.0
- Namespace: `http://www.sat.gob.mx/cfd/4`
- Root element: `Comprobante`
- Publisher: SAT (Servicio de Administración Tributaria) (Published by SAT for implementers), source: http://www.sat.gob.mx/sitio_internet/cfd/4/cfdv40.xsd
- Validate against it: https://xmlvalid.com/validate?schema=cfdi-4.0

## Notes

- The schema checks structure, data types and the SAT catalogues it includes (catCFDI is 6 MB of code lists). The signature, the certificate, the RFC registry and arithmetic between amounts are checked by the PAC and SAT, not by the schema.
- Other complements (Carta Porte, Nómina, Comercio Exterior and so on) are not included; a document that carries one is reported invalid here.
- The example is by xmlvalid.com and uses the SAT test RFC EKU9003173C9; its seal, certificate and stamp are placeholders.
