FinchContext
Run with

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, namespace http://www.sat.gob.mx/esquemas/retencionpago/2), distinct from the ordinary cfdi: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 CSD Sello, is stamped (timbrado) by a PAC, and receives the same tfd:TimbreFiscalDigital with 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


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


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


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.