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

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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

Related routes

Generate a FedEx Electronic Trade Document (ETD) commercial invoice for an international shipment via the FedEx Ship REST API
developer.fedex.com · 5 steps · unrated
Build a customs commercial invoice payload for a FedEx REST international shipment and attach it as an electronic trade document
developer.fedex.com · 5 steps · unrated
Generate a compliant commercial invoice for an international shipment programmatically, including required fields for customs clearance
logistics-general · 6 steps · unrated

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