Use this skill with your AI agent
Paste this skill into your AI agent's context, or save the file to your project. Works with any AI agent that reads markdown.
| 1 | --- |
| 2 | name: mx-cfdi |
| 3 | description: Use this skill whenever asked about Mexican CFDI electronic invoicing. Trigger on phrases like "CFDI", "factura electronica", "PAC", "complemento de pago", "comprobante fiscal", "SAT factura", "CFDI 4.0", "timbrado", "cancelacion CFDI", or any question about issuing, receiving, or managing electronic invoices in Mexico. Covers CFDI 4.0 structure, PAC certification, complemento de pago, uso de CFDI, cancellation rules, and SAT obligations. ALWAYS read this skill before touching any Mexican CFDI work. |
| 4 | --- |
| 5 | |
| 6 | # Mexico CFDI Electronic Invoicing -- Skill |
| 7 | |
| 8 | --- |
| 9 | |
| 10 | ## Skill Metadata |
| 11 | |
| 12 | | Field | Value | |
| 13 | |-------|-------| |
| 14 | | Jurisdiction | Mexico | |
| 15 | | Jurisdiction Code | MX | |
| 16 | | Primary Legislation | Codigo Fiscal de la Federacion (CFF), Art. 29, 29-A | |
| 17 | | Supporting Legislation | Resolucion Miscelanea Fiscal (RMF) 2025; Anexo 20 (CFDI technical standard) | |
| 18 | | Tax Authority | Servicio de Administracion Tributaria (SAT) | |
| 19 | | Portal | Portal SAT (sat.gob.mx) | |
| 20 | | Contributor | Open Accountants Community | |
| 21 | | Validated By | Pending -- requires sign-off by a Mexican contador publico | |
| 22 | | Validation Date | Pending | |
| 23 | | Skill Version | 1.0 | |
| 24 | | Tax Year | 2025 | |
| 25 | | Confidence Coverage | Tier 1: CFDI 4.0 mandatory fields, PAC timbrado, uso de CFDI codes, cancellation rules. Tier 2: complemento de pago timing, foreign currency CFDIs, regime-specific codes. Tier 3: CFDI for payroll (nomina), foreign trade complement, audits. | |
| 26 | |
| 27 | --- |
| 28 | |
| 29 | ## Confidence Tier Definitions |
| 30 | |
| 31 | - **[T1] Tier 1 -- Deterministic.** Apply exactly as written. No reviewer judgement required. |
| 32 | - **[T2] Tier 2 -- Reviewer Judgement Required.** Claude flags and presents options. Qualified professional must confirm. |
| 33 | - **[T3] Tier 3 -- Out of Scope / Escalate.** Do not guess. Escalate and document. |
| 34 | |
| 35 | --- |
| 36 | |
| 37 | ## Step 0: Client Onboarding Questions |
| 38 | |
| 39 | Before advising on any CFDI matter, you MUST know: |
| 40 | |
| 41 | 1. **RFC (Registro Federal de Contribuyentes)** [T1] -- tax ID |
| 42 | 2. **Tax regime (regimen fiscal)** [T1] -- determines regime code on CFDI |
| 43 | 3. **e.firma (FIEL) and CSD (Certificado de Sello Digital)** [T1] -- required for issuing CFDIs |
| 44 | 4. **PAC provider** [T1] -- which authorized certification provider is used |
| 45 | 5. **Type of transaction** [T1] -- sale, service, payment receipt, credit note |
| 46 | 6. **Client's RFC and tax regime** [T1] -- required on CFDI 4.0 for the recipient |
| 47 | 7. **Uso de CFDI** [T1] -- the purpose code the recipient needs |
| 48 | |
| 49 | **If the client does not have a CSD, STOP. They cannot issue CFDIs without it. Must apply at SAT first.** |
| 50 | |
| 51 | --- |
| 52 | |
| 53 | ## Step 1: CFDI 4.0 Overview [T1] |
| 54 | |
| 55 | **Legislation:** CFF Art. 29, 29-A; Anexo 20 v4.0 |
| 56 | |
| 57 | CFDI 4.0 has been mandatory since April 1, 2023. All previous versions are obsolete. |
| 58 | |
| 59 | ### Key Changes from CFDI 3.3 to 4.0 [T1] |
| 60 | |
| 61 | | Change | Detail | |
| 62 | |--------|--------| |
| 63 | | Recipient name validation | Must match exactly with SAT's Constancia de Situacion Fiscal | |
| 64 | | Recipient RFC validation | SAT validates recipient RFC in real time | |
| 65 | | Recipient tax regime | Now mandatory (was optional) | |
| 66 | | Recipient postal code | Now mandatory (fiscal domicile of recipient) | |
| 67 | | Export field | New mandatory field (even if "01" = no export) | |
| 68 | |
| 69 | --- |
| 70 | |
| 71 | ## Step 2: CFDI 4.0 Mandatory Fields [T1] |
| 72 | |
| 73 | **Legislation:** Anexo 20, Seccion II |
| 74 | |
| 75 | | Field | Description | Example | |
| 76 | |-------|-------------|---------| |
| 77 | | Version | Always "4.0" | 4.0 | |
| 78 | | Serie | Invoice series (optional but recommended) | A | |
| 79 | | Folio | Sequential number (optional but recommended) | 1001 | |
| 80 | | Fecha | Date and time of issuance (ISO 8601) | 2025-06-15T10:30:00 | |
| 81 | | FormaPago | Payment method code (catalogo c_FormaPago) | 03 (transfer), 01 (cash), 99 (por definir) | |
| 82 | | SubTotal | Amount before tax | 10000.00 | |
| 83 | | Moneda | Currency code (ISO 4217) | MXN, USD | |
| 84 | | TipoCambio | Exchange rate (required if not MXN) | 17.50 | |
| 85 | | Total | Total including tax | 11600.00 | |
| 86 | | TipoDeComprobante | I (ingreso), E (egreso), T (traslado), P (pago), N (nomina) | I | |
| 87 | | Exportacion | Export code: 01 (no), 02 (definitive), 03 (temporary) | 01 | |
| 88 | | MetodoPago | PUE (una sola exhibicion) or PPD (parcialidades/diferido) | PUE | |
| 89 | | LugarExpedicion | Issuer's postal code | 06600 | |
| 90 | | **Emisor (Issuer)** | | | |
| 91 | | Rfc | Issuer RFC | XAXX010101000 | |
| 92 | | Nombre | Issuer legal name (must match SAT records) | Juan Perez Lopez | |
| 93 | | RegimenFiscal | Issuer regime code (catalogo c_RegimenFiscal) | 612 (personas fisicas) | |
| 94 | | **Receptor (Recipient)** | | | |
| 95 | | Rfc | Recipient RFC | XEXX010101000 | |
| 96 | | Nombre | Recipient legal name (must match SAT records exactly) | Empresa SA de CV | |
| 97 | | DomicilioFiscalReceptor | Recipient postal code | 01000 | |
| 98 | | RegimenFiscalReceptor | Recipient regime code | 601 | |
| 99 | | UsoCFDI | Purpose of CFDI for recipient (catalogo c_UsoCFDI) | G03 (gastos en general) | |
| 100 | |
| 101 | --- |
| 102 | |
| 103 | ## Step 3: Common Uso de CFDI Codes [T1] |
| 104 | |
| 105 | | Code | Description | Typical Use | |
| 106 | |------|-------------|-------------| |
| 107 | | G01 | Adquisicion de mercancias | Purchase of goods | |
| 108 | | G03 | Gastos en general | General expenses (most common for services) | |
| 109 | | I01 | Construcciones | Construction | |
| 110 | | D01 | Honorarios medicos | Medical fees | |
| 111 | | D04 | Donativos | Donations | |
| 112 | | S01 | Sin efectos fiscales | No tax effect (informational) | |
| 113 | | CP01 | Pagos | For complemento de pago | |
| 114 | |
| 115 | --- |
| 116 | |
| 117 | ## Step 4: Common Regimen Fiscal Codes [T1] |
| 118 | |
| 119 | | Code | Regime | |
| 120 | |------|--------| |
| 121 | | 601 | General de Ley Personas Morales | |
| 122 | | 603 | Personas Morales con Fines no Lucrativos | |
| 123 | | 605 | Sueldos y Salarios | |
| 124 | | 606 | Arrendamiento | |
| 125 | | 607 | Regimen de Enajenacion o Adquisicion de Bienes | |
| 126 | | 608 | Demas ingresos | |
| 127 | | 610 | Residentes en el Extranjero sin EP | |
| 128 | | 612 | Personas Fisicas con Actividades Empresariales y Profesionales | |
| 129 | | 616 | Sin obligaciones fiscales | |
| 130 | | 621 | Incorporacion Fiscal (historical) | |
| 131 | | 625 | Regimen Simplificado de Confianza (RESICO) | |
| 132 | | 626 | RESICO Personas Morales | |
| 133 | |
| 134 | --- |
| 135 | |
| 136 | ## Step 5: PAC (Proveedor Autorizado de Certificacion) [T1] |
| 137 | |
| 138 | **Legislation:** CFF Art. 29, fraccion IV |
| 139 | |
| 140 | | Detail | Value | |
| 141 | |--------|-------| |
| 142 | | Purpose | PACs validate and digitally stamp (timbrar) CFDIs | |
| 143 | | Requirement | Every CFDI must be certified by an authorized PAC | |
| 144 | | Timing | Within 72 hours of the transaction (or at time of issuance) | |
| 145 | | UUID | The PAC assigns a unique identifier (UUID / folio fiscal) | |
| 146 | | Cost | PACs charge per CFDI stamped (some free tiers for low volume) | |
| 147 | |
| 148 | ### Timbrado Process [T1] |
| 149 | |
| 150 | 1. Taxpayer generates CFDI XML with their CSD |
| 151 | 2. Sends to PAC for validation |
| 152 | 3. PAC validates against SAT catalogs and recipient data |
| 153 | 4. PAC stamps (timbra) the CFDI, adding Timbre Fiscal Digital |
| 154 | 5. Returns the stamped XML and optional PDF representation |
| 155 | 6. SAT receives a copy from the PAC |
| 156 | |
| 157 | --- |
| 158 | |
| 159 | ## Step 6: Complemento de Pago (Payment Complement) [T1] |
| 160 | |
| 161 | **Legislation:** RMF 2025, Regla 2.7.1.32 |
| 162 | |
| 163 | ### When Required [T1] |
| 164 | |
| 165 | | Scenario | Required? | |
| 166 | |----------|----------| |
| 167 | | Full payment at time of invoice (PUE) | No -- full CFDI with FormaPago is sufficient | |
| 168 | | Partial payments or deferred payment (PPD) | Yes -- must issue complemento de pago for each payment received | |
| 169 | |
| 170 | ### Complemento de Pago Structure [T1] |
| 171 | |
| 172 | | Field | Detail | |
| 173 | |-------|--------| |
| 174 | | TipoDeComprobante | "P" (pago) | |
| 175 | | Subtotal/Total | 0 (payment complements have zero amounts in the main body) | |
| 176 | | Complemento contains | Payment date, payment method, amount, currency, related CFDI UUID(s), amount applied per CFDI | |
| 177 | |
| 178 | ### Timing Rules [T1] |
| 179 | |
| 180 | | Rule | Deadline | |
| 181 | |------|----------| |
| 182 | | Issue complemento de pago | By the 5th day of the month following the month payment was received | |
| 183 | | Late issuance | May trigger SAT queries or penalties | |
| 184 | |
| 185 | --- |
| 186 | |
| 187 | ## Step 7: Cancellation Rules [T1] |
| 188 | |
| 189 | **Legislation:** CFF Art. 29-A, penultimo parrafo; RMF 2025 |
| 190 | |
| 191 | ### Cancellation Process [T1] |
| 192 | |
| 193 | | Rule | Detail | |
| 194 | |------|--------| |
| 195 | | Cancellation must state reason | Mandatory reason code (catalogo c_Motivocancelacion) | |
| 196 | | Reason 01 | Comprobante emitido con errores con relacion (replacement CFDI issued) | |
| 197 | | Reason 02 | Comprobante emitido con errores sin relacion (no replacement) | |
| 198 | | Reason 03 | No se llevo a cabo la operacion (transaction did not occur) | |
| 199 | | Reason 04 | Operacion nominativa relacionada en la factura global | |
| 200 | | Recipient acceptance | Required for CFDIs with total > MXN 1,000 (recipient has 72 hours to accept/reject via Buzon Tributario) | |
| 201 | | Cancellation deadline | Must cancel within the same fiscal year of issuance, or by the deadline for the annual return | |
| 202 | |
| 203 | ### Cancellation Without Recipient Acceptance [T1] |
| 204 | |
| 205 | No acceptance needed when: |
| 206 | - CFDI total <= MXN 1,000 |
| 207 | - CFDI is to general public (RFC generico XAXX010101000) |
| 208 | - Payroll CFDIs (nomina) |
| 209 | - Export CFDIs |
| 210 | - Traspasos between own accounts |
| 211 | |
| 212 | --- |
| 213 | |
| 214 | ## Step 8: Edge Case Registry |
| 215 | |
| 216 | ### EC1 -- Recipient name does not match SAT records [T1] |
| 217 | **Situation:** Client tries to issue CFDI but PAC rejects because recipient name doesn't match. |
| 218 | **Resolution:** CFDI 4.0 validates recipient name against SAT's database. Recipient must provide their exact legal name as shown on their Constancia de Situacion Fiscal. Even accent marks and abbreviations matter. |
| 219 | |
| 220 | ### EC2 -- Payment received in USD [T2] |
| 221 | **Situation:** Freelancer receives payment in USD for services. |
| 222 | **Resolution:** CFDI can be issued in USD (Moneda: USD). Must include TipoCambio (exchange rate). Use the exchange rate published by Banco de Mexico for the date. For tax purposes, income is converted to MXN. [T2] Flag for reviewer on exchange rate date selection. |
| 223 | |
| 224 | ### EC3 -- Forgot to issue complemento de pago [T1] |
| 225 | **Situation:** Client issued PPD CFDI 4 months ago, received payment, never issued complemento de pago. |
| 226 | **Resolution:** Issue the complemento de pago immediately. Late issuance may trigger SAT automated queries. The original CFDI with PPD method remains open until the complemento is issued. |
| 227 | |
| 228 | ### EC4 -- Client wants to cancel a CFDI from 6 months ago [T1] |
| 229 | **Situation:** CFDI issued in January, client wants to cancel in July. |
| 230 | **Resolution:** Cancellation is allowed within the same fiscal year (or before annual return deadline). If total > MXN 1,000, recipient must accept cancellation within 72 hours. If recipient rejects, cancellation fails. |
| 231 | |
| 232 | ### EC5 -- RESICO freelancer issuing CFDI [T1] |
| 233 | **Situation:** Client is under RESICO (Regimen Simplificado de Confianza). |
| 234 | **Resolution:** Use RegimenFiscal code 625. CFDIs are issued normally through PAC. RESICO does not exempt from CFDI obligations. IVA is still charged on the CFDI (RESICO replaces ISR, not IVA). |
| 235 | |
| 236 | ### EC6 -- CFDI to foreign client (non-resident) [T1] |
| 237 | **Situation:** Freelancer invoices a US company. |
| 238 | **Resolution:** Use recipient RFC generico for foreign residents: XEXX010101000. Recipient name as the foreign entity's legal name. RegimenFiscalReceptor: 616. UsoCFDI: S01. Exportacion field: 02 (definitive export of services) or 01 if service consumed in Mexico. |
| 239 | |
| 240 | --- |
| 241 | |
| 242 | ## Step 9: Test Suite |
| 243 | |
| 244 | ### Test 1 -- Standard services CFDI (PUE) |
| 245 | **Input:** Freelancer (RFC: GOPE850101AB1, Regime 612) invoicing Mexican company for MXN 10,000 consulting. Full payment at time of service. Recipient in regime 601. |
| 246 | **Expected output:** |
| 247 | - TipoDeComprobante: I |
| 248 | - MetodoPago: PUE |
| 249 | - SubTotal: 10,000.00 |
| 250 | - IVA Trasladado: 1,600.00 (16%) |
| 251 | - Total: 11,600.00 |
| 252 | - FormaPago: 03 (transferencia) |
| 253 | - Exportacion: 01 |
| 254 | |
| 255 | ### Test 2 -- CFDI with partial payments (PPD) |
| 256 | **Input:** Invoice for MXN 50,000. Client will pay in 2 instalments. |
| 257 | **Expected output:** |
| 258 | - Initial CFDI: MetodoPago PPD, FormaPago 99 (por definir), Total 58,000 (incl. IVA) |
| 259 | - After 1st payment of MXN 29,000: issue complemento de pago (Tipo P) referencing original UUID, amount applied 29,000 |
| 260 | - After 2nd payment: second complemento de pago for remaining 29,000 |
| 261 | |
| 262 | ### Test 3 -- CFDI to foreign client |
| 263 | **Input:** US company, services MXN 20,000 equivalent (billed in USD 1,142.86 at rate 17.50). |
| 264 | **Expected output:** |
| 265 | - Receptor RFC: XEXX010101000 |
| 266 | - Moneda: USD |
| 267 | - TipoCambio: 17.50 |
| 268 | - SubTotal: 1,142.86 (USD) |
| 269 | - IVA: 0% if export of services (verify applicable exemption) OR 16% if consumed in Mexico |
| 270 | - Exportacion: 02 (if definitive export) |
| 271 | |
| 272 | ### Test 4 -- Cancellation with replacement |
| 273 | **Input:** CFDI with error in amount. Must cancel and reissue. |
| 274 | **Expected output:** |
| 275 | - Issue new (correct) CFDI first |
| 276 | - Cancel original with Motivo 01 (con relacion) referencing the new CFDI's UUID |
| 277 | - If original total > MXN 1,000: wait for recipient acceptance (72 hours max) |
| 278 | |
| 279 | --- |
| 280 | |
| 281 | ## PROHIBITIONS |
| 282 | |
| 283 | - NEVER issue a CFDI without a valid CSD -- it will be rejected |
| 284 | - NEVER use CFDI version 3.3 -- only 4.0 is valid from April 2023 |
| 285 | - NEVER omit the recipient's RFC, name, regime, or postal code -- all are mandatory in 4.0 |
| 286 | - NEVER issue a PPD CFDI without following up with complemento de pago when payment is received |
| 287 | - NEVER cancel a CFDI without specifying a valid motivo de cancelacion code |
| 288 | - NEVER assume cancellation is automatic -- CFDIs over MXN 1,000 require recipient acceptance |
| 289 | - NEVER use FormaPago 99 with MetodoPago PUE -- 99 is only for PPD |
| 290 | - NEVER ignore the complemento de pago deadline (5th of the following month) |
| 291 | - NEVER present guidance as definitive -- always label as estimated and direct client to a Mexican contador publico |
| 292 | |
| 293 | --- |
| 294 | |
| 295 | ## Disclaimer |
| 296 | |
| 297 | This skill and its outputs are provided for informational and computational purposes only and do not constitute tax, legal, or financial advice. Open Accountants and its contributors accept no liability for any errors, omissions, or outcomes arising from the use of this skill. All outputs must be reviewed and signed off by a qualified professional (such as a contador publico or equivalent licensed practitioner in Mexico) before filing or acting upon. |
| 298 | |
| 299 | The most up-to-date, verified version of this skill is maintained at [openaccountants.com](https://openaccountants.com). Log in to access the latest version, request a professional review from a licensed accountant, and track updates as tax law changes. |
| 300 |
Run this skill, then get an accountant to check it
After running the full skill pack in your AI agent, sign up and upload your worksheet. We'll connect you with a trusted accountant in our network who can review your numbers before you file.
Quality
Q3: AI-drafted
AI-generated with structure and citations. Not independently verified.
Needs deep research against tax authority websites to reach Q2.
Accountant Review
About
Use this skill whenever asked about Mexican CFDI electronic invoicing. Trigger on phrases like "CFDI", "factura electronica", "PAC", "complemento de pago", "comprobante fiscal", "SAT factura", "CFDI 4.0", "timbrado", "cancelacion CFDI", or any question about issuing, receiving, or managing electronic invoices in Mexico. Covers CFDI 4.0 structure, PAC certification, complemento de pago, uso de CFDI, cancellation rules, and SAT obligations. ALWAYS read this skill before touching any Mexican CFDI work.
Use this skill
This skill is open source and free to use in any AI agent. Copy it, download it, or clone the repo. If you find an error, flag it — a licensed accountant will review.