Generate a Mexico CFDI 4.0 electronic invoice and submit it to a PAC (Proveedor Autorizado de Certificación) for SAT stamp
domain: government-general · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Prepare the CFDI 4.0 XML document conforming to the SAT (Servicio de Administración Tributaria) Anexo 20 technical specification; the document must include the Version attribute set to 4.0, the Emisor RFC and regime, the Receptor RFC and DomicilioFiscalReceptor, and the correct UsoCFDI code for the recipient
Obtain a valid CSD (Certificado de Sello Digital) from the SAT for the issuing company's RFC; the CSD is used to generate the cadena original and the digital sello on the CFDI XML before submission to the PAC
Compute the cadena original by applying the XSLT stylesheet published by the SAT to the CFDI XML, then sign the resulting string using the private key associated with the CSD to produce the Sello value embedded in the XML
Submit the pre-signed CFDI XML to a SAT-authorized PAC via the PAC's API (format varies by PAC but typically REST or SOAP); the PAC validates the document, adds the SAT's TimbreFiscalDigital (TFD) complement with the UUID and SAT-issued seal, and returns the stamped CFDI
Extract the UUID from the TimbreFiscalDigital complement of the stamped CFDI; this UUID is the legal invoice identifier and must be included on printed representations (PDF) and retained with the XML for the legally required period
For cancellation, submit a cancellation request to the SAT via the PAC or directly via SAT web services using the UUID; CFDI 4.0 cancellation rules require specifying a cancellation motive code and, in some cases, require recipient acceptance before the SAT processes the cancellation
Known gotchas
The SAT releases updated XSLT stylesheets for cadena original generation; using an outdated stylesheet produces an incorrect Sello that the PAC will reject, so always fetch the current stylesheet from the SAT portal before computing the cadena
The DomicilioFiscalReceptor (recipient's fiscal address ZIP code) is mandatory in CFDI 4.0 and must match the recipient's SAT-registered tax address; a mismatch causes PAC rejection even if all other fields are correct
CSD certificates have an expiration date and must be renewed before expiry; an expired CSD causes all new CFDI submissions to fail, and renewing requires a trámite at SAT that may take time — plan renewal well in advance
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp