Generate CFDI de Retenciones e Información de Pagos XML
Skill: Convert withholdings into the CFDI de Retenciones e información de pagos XML, stamped by a PAC
Region: Mexico (México)
Category: E-Invoicing — Comprobante de Retenciones e información de pagos
Does: Takes withholding (retención) data and produces the CFDI de Retenciones e Información de Pagos XML (retenciones:Retenciones) — the separate retenciones schema (not cfdi:Comprobante) used for payments such as foreign-resident payments, dividends, interest and similar — then sends it to a PAC for timbrado, which returns the TimbreFiscalDigital complemento with the UUID.
Standard: SAT CFDI Retenciones e información de pagos 2.0 + TimbreFiscalDigital 1.1
The retenciones CFDI uses its own root element (
retenciones:Retenciones, namespacehttp://www.sat.gob.mx/esquemas/retencionpago/2), distinct from the ordinarycfdi:Comprobante. It documents tax withheld and amounts paid in cases the SAT lists in the catálogo CveRetenc (e.g. dividendos, intereses, pagos a residentes en el extranjero, enajenación de acciones). It still requires the issuer's CSDSello, is stamped (timbrado) by a PAC, and receives the sametfd:TimbreFiscalDigitalwith a UUID. Specific cases carry their own complemento (Dividendos, Intereses, Pagos a extranjeros, etc.). Validate against the retenciones 2.0 XSD before stamping.
When this applies
- When you withhold tax and must issue a retención comprobante under one of the SAT-listed
CveRetenccases — e.g. payments to residentes en el extranjero, dividendos, intereses, arrendamiento en fideicomiso, enajenación de acciones, premios. - Use this schema (not a normal invoice) — the operation reports the period total, the amounts paid and the tax retained (ISR and/or IVA), plus a case-specific complemento when required.
- For a foreign resident the
Receptoris identified asNacionalidad="Extranjero"with aNumRegIdTrib(foreign tax ID) and country, rather than an RFC.
Input data required
| Input | Node / attribute |
|---|---|
| Issuer | retenciones:Emisor@RfcE, @NomDenRazSocE, @RegimenFiscalE |
| Receiver (national) | retenciones:Receptor@NacionalidadR="Nacional", Nacional@RfcR, @NomDenRazSocR, @DomicilioFiscalR |
| Receiver (foreign) | Receptor@NacionalidadR="Extranjero", Extranjero@NumRegIdTribR, @NomDenRazSocR, @PaisResidR |
| Document | Retenciones@Version="2.0", @FechaExp, @CveRetenc (catálogo), @LugarExpRetenc |
| Period | Periodo@MesIni, @MesFin, @Ejerc (ejercicio fiscal) |
| Totals | Totales@MontoTotOperacion, @MontoTotGrav, @MontoTotExent, @MontoTotRet |
| Tax detail | Totales/ImpRetenidos@BaseRet, @ImpuestoRet (01 ISR, 02 IVA), @MontoRet, @TipoPagoRet |
| CSD | @SelloDigital, @NoCertificado, @Certificado |
Mexican specifics: CveRetenc selects the withholding case and may require a matching complemento (e.g. dividendos:Dividendos, intereses:Intereses, pagosaextranjeros:Pagos). TipoPagoRet states whether the retention is provisional/definitivo.
Document structure (retenciones:Retenciones)
retenciones:Retenciones (Version=2.0, FechaExp, CveRetenc, LugarExpRetenc, Sello, NoCertificado, Certificado)
├── retenciones:Emisor (RfcE, NomDenRazSocE, RegimenFiscalE)
├── retenciones:Receptor (NacionalidadR)
│ └── retenciones:Nacional (RfcR, NomDenRazSocR, DomicilioFiscalR) -- or retenciones:Extranjero (NumRegIdTribR, PaisResidR)
├── retenciones:Periodo (MesIni, MesFin, Ejerc)
├── retenciones:Totales (MontoTotOperacion, MontoTotGrav, MontoTotExent, MontoTotRet)
│ └── retenciones:ImpRetenidos (BaseRet, ImpuestoRet, MontoRet, TipoPagoRet)
├── retenciones:Complemento (caso específico: Dividendos / Intereses / Pagos a extranjeros, ...)
└── retenciones:Complemento → tfd:TimbreFiscalDigital (UUID) ← added by PAC
ImpuestoRet: 01 = ISR, 02 = IVA, 03 = IEPS. The root namespace is retenciones (.../esquemas/retencionpago/2), not cfdi.
Calculation rules
Totales/@MontoTotOperacion= total amount of the operation in the period;@MontoTotGrav+@MontoTotExentreconcile to it.@MontoTotRet= Σ of eachImpRetenidos/@MontoRet.- Each
ImpRetenidos/@MontoRet=@BaseRet× the applicable withholding rate for thatCveRetenc/ImpuestoRet. - The
Sellois computed over the cadena original derived via the retenciones XSLT with a valid CSD; amounts in 2 decimals (MXN) unless a foreign-currency complemento applies.
Worked example (CveRetenc 14 — pagos a residentes en el extranjero, abridged)
<?xml version="1.0" encoding="UTF-8"?>
<retenciones:Retenciones
xmlns:retenciones="http://www.sat.gob.mx/esquemas/retencionpago/2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sat.gob.mx/esquemas/retencionpago/2 http://www.sat.gob.mx/esquemas/retencionpago/2/retencionpagov2.xsd"
Version="2.0" FechaExp="2026-06-04T10:00:00" CveRetenc="14"
LugarExpRetenc="64000" Sello="(sello CSD)"
NoCertificado="30001000000400002463" Certificado="(base64)">
<retenciones:Emisor RfcE="AAA010101AAA" NomDenRazSocE="ACME SA DE CV" RegimenFiscalE="601"/>
<retenciones:Receptor NacionalidadR="Extranjero">
<retenciones:Extranjero NumRegIdTribR="TAXID-998877" NomDenRazSocR="FOREIGN VENDOR LLC" PaisResidR="USA"/>
</retenciones:Receptor>
<retenciones:Periodo MesIni="06" MesFin="06" Ejerc="2026"/>
<retenciones:Totales MontoTotOperacion="100000.00" MontoTotGrav="100000.00"
MontoTotExent="0.00" MontoTotRet="25000.00">
<retenciones:ImpRetenidos BaseRet="100000.00" ImpuestoRet="01"
MontoRet="25000.00" TipoPagoRet="Pago definitivo"/>
</retenciones:Totales>
<retenciones:Complemento>
<tfd:TimbreFiscalDigital
xmlns:tfd="http://www.sat.gob.mx/TimbreFiscalDigital"
Version="1.1" UUID="B2C3D4E5-F6A7-4890-BCDE-2345678901BC"
FechaTimbrado="2026-06-04T10:00:30" RfcProvCertif="PAC010101AAA"
SelloCFD="(sello del CFD)" NoCertificadoSAT="00001000000500000123"
SelloSAT="(sello del SAT)"/>
</retenciones:Complemento>
</retenciones:Retenciones>
When the CveRetenc requires it, add the case complemento (e.g. dividendos:Dividendos, intereses:Intereses) inside retenciones:Complemento alongside (before) the tfd:TimbreFiscalDigital, which the PAC appends on timbrado.
Validation checklist
- Uses the
retenciones:Retencionesroot (namespace.../retencionpago/2), notcfdi:Comprobante;Version="2.0" - Valid
CveRetencfrom the current catalog; matching case complemento included when required - Issuer
RfcE/RegimenFiscalEvalid; receiver asNacional(RfcR) orExtranjero(NumRegIdTribR+PaisResidR) -
Periodo(MesIni/MesFin/Ejerc) correct;MontoTotGrav+MontoTotExent=MontoTotOperacion -
@MontoTotRet= ΣImpRetenidos/@MontoRet; eachMontoRet=BaseRet× rate;ImpuestoRet(01ISR /02IVA) andTipoPagoRetcorrect -
Sellofrom the cadena original (retenciones XSLT) with a valid CSD; passes retenciones 2.0 XSD validation - PAC timbrado succeeds and
tfd:TimbreFiscalDigitalwithUUIDis present
Last updated: 2026-06-04 — confirm the active CFDI/SAT schema version, catálogos, and PAC/portal requirements against the current SAT specifications before use.