CFDI Invoice Guide: Mexico's CFDI 4.0 Factura Electrónica Rules
CFDI invoice basics for Mexico: what CFDI 4.0 requires, the RFC and receiver data SAT checks, PUE vs PPD, retentions, cancellation rules and a worked example.
Quick answer: A CFDI invoice is Mexico's mandatory electronic invoice: an XML file in CFDI 4.0 format, sealed by the issuer and certified by a PAC or SAT's free service. It must include the issuer's and buyer's RFC, the buyer's exact name, tax postal code, tax regime and uso CFDI, or SAT will reject it.
Mexico has required electronic invoicing for years, and it runs one of the most comprehensive clearance systems in the world. Whether you are a Mexican freelancer issuing your first factura electrónica or a foreign company receiving CFDIs from suppliers, this guide covers what you need. If you are outside Mexico and simply need a professional invoice for a Mexican client, our free invoice generator handles that.
Important: This is general information, not tax advice. SAT rules change every year through the Resolución Miscelánea Fiscal, so confirm details with a contador.
What a CFDI invoice is and how certification works
A CFDI (Comprobante Fiscal Digital por Internet) is not just an invoice that happens to be digital. It is a structured XML file built to SAT's Anexo 20 standard. The process works like this:
- The issuer creates the XML in billing software or SAT's free service.
- The issuer signs it with their digital seal certificate (CSD), obtained from SAT using an e.firma.
- A PAC (Proveedor Autorizado de Certificación) validates the file against SAT rules, including a real-time check of the receiver's RFC, name, postal code and regime.
- If valid, the PAC adds the timbre fiscal digital with a unique folio fiscal (UUID) and reports it to SAT.
- The issuer sends the XML and a PDF representation to the customer.
Only the stamped XML has legal value. The PDF is a convenience. This is a classic clearance model, similar in spirit to Italy's SDI, and different from network models like Peppol. Our comparison of Peppol vs clearance models explains the trade-offs, and the e-invoicing guide covers the basics.
CFDI 4.0 requirements: the data SAT checks
CFDI 4.0 has been the only valid version since 1 April 2023. Its biggest change was stricter receiver data. Article 29-A of the Federal Tax Code (CFF) lists the core requirements, which this table summarises:
| Field | What to enter | Common mistake |
|---|---|---|
| Issuer RFC, name and régimen fiscal | Your RFC and regime code, such as 612 or 626 | Using an outdated regime after switching to RESICO |
| Lugar de expedición | Postal code where the invoice is issued | Using a branch address that is not registered |
| Receiver RFC | The buyer's 12 or 13 character RFC | Typos; using a generic RFC when the buyer has one |
| Receiver name | Exactly as in SAT records, without the legal form suffix such as "SA de CV" | Adding the company type or trade name |
| Receiver tax postal code | Postal code of the buyer's domicilio fiscal | Using the delivery address |
| Receiver régimen fiscal | The buyer's current regime code | Not rechecking after the buyer changes regime |
| Uso CFDI | How the buyer will use it, such as G03 general expenses | A code incompatible with the buyer's regime |
| Product and unit keys | SAT catalogue codes for each line | Using a generic code for everything |
| Payment method and form | PUE or PPD, plus forma de pago such as 03 transfer | Marking PUE when the invoice is unpaid |
| Exportación and objeto de impuesto | Whether it is an export and whether the line is subject to tax | Leaving defaults that do not match the sale |
The simplest fix for nearly every rejection is to ask the client for their Constancia de Situación Fiscal and copy the data exactly. It is the same principle behind putting the correct tax ID on any invoice, but SAT enforces it automatically.
The most common CFDI 4.0 rejection errors
When a PAC refuses to stamp an invoice, the error message usually points to one of a short list of problems:
- Name mismatch: the receiver name differs from SAT records by a single letter, an accent or an added "SA de CV".
- Postal code mismatch: the code is the buyer's delivery or branch address instead of the domicilio fiscal on their certificate.
- Regime and uso CFDI conflict: for example, a uso CFDI that is only valid for companies sent to an individual.
- Expired or revoked seal certificate: CSDs expire after a few years and must be renewed with the e.firma.
- Tax object flag: a line marked as not subject to tax while VAT is still calculated on it.
Fix the data at the source, in your customer list, rather than editing each invoice, and most rejections disappear.
CFDI document types
CFDI is not only for sales. Each file carries a type: I (ingreso) for invoices, E (egreso) for credit notes, discounts and returns, P (pago) for payment receipts, N (nómina) for payroll and T (traslado) for goods in transit. A freelancer typically uses I, P and occasionally E. Credit notes (E) must reference the related invoice UUID, which keeps the chain auditable for SAT.
PUE vs PPD and the complemento de pago
CFDI 4.0 makes you declare up front whether the invoice is already paid:
- PUE (pago en una sola exhibición): paid in full at issue or within the same month. No further document needed.
- PPD (pago en parcialidades o diferido): paid later or in instalments. When each payment arrives, you issue a separate payment receipt CFDI, the complemento de pago (REP), generally by the fifth day of the following month.
Freelancers on net-30 terms should usually use PPD, then issue an REP when the client pays. If you take deposits and final payments, the logic mirrors our guide to partial payment invoices, just with SAT documents attached to each step.
Withholdings on professional services (retenciones)
When an individual (persona física) bills a company (persona moral) for professional services or rent, the company typically withholds tax and the CFDI must show it. Under the general business regime (612), the usual retentions are 10% income tax (ISR) and two-thirds of the 16% VAT. Under RESICO (626), the ISR retention is 1.25% instead. RESICO is a simplified regime for individuals with annual income up to 3.5 million pesos, where income tax is charged at low rates on gross income. Many freelancers move to it for that reason, but it changes the retention on every invoice to companies, so update your billing software the day your regime changes. Clients will also check that the regime on your invoice matches your Constancia, so a stale regime code can delay payment even when the arithmetic is right. For context on how withholding appears on invoices in other countries, see our explainer on withholding tax on invoices.
Worked example: a CFDI with retentions
Ana is a freelance web developer in Guadalajara registered under regime 612. She invoices a client company for a website at a subtotal of 20,000 pesos, marked PPD because the client pays in 30 days.
| Line | Regime 612 | RESICO (626) |
|---|---|---|
| Subtotal | 20,000.00 | 20,000.00 |
| VAT 16% | +3,200.00 | +3,200.00 |
| ISR retention | -2,000.00 (10%) | -250.00 (1.25%) |
| VAT retention (two-thirds of 3,200) | -2,133.33 | -2,133.33 |
| Total payable | 19,066.67 | 20,816.67 |
Check the regime 612 column: 20,000 plus 3,200 is 23,200, minus 2,000 is 21,200, minus 2,133.33 is 19,066.67 pesos. When the client pays, Ana issues an REP for 19,066.67 pesos referencing the invoice UUID. If you want to double-check percentages before stamping, our sales tax calculator handles the VAT part.
Público en general, factura global and foreign buyers
Not every buyer has or gives an RFC. CFDI 4.0 handles this with generic RFCs:
- Domestic buyers without an RFC: use XAXX010101000 with the name PUBLICO EN GENERAL. Retailers often group these sales in a periodic factura global, which must include the InformacionGlobal node showing the period, month and year.
- Foreign buyers: use XEXX010101000, plus the buyer's country and foreign tax ID. Exports of services may qualify for 0% VAT if the conditions in the VAT law are met, so check before you zero-rate.
If you are on the other side, a foreign business billing a Mexican company, you do not issue a CFDI. Send a standard commercial invoice in the agreed currency; our guide to invoicing international clients covers the details, including how to state currency and exchange rates.
How to cancel a CFDI
You cannot edit a stamped CFDI. You cancel it and, if needed, issue a replacement. The rules:
- Choose a reason code. SAT uses four: 01 invoice issued with errors and replaced (you must cite the replacement UUID), 02 errors with no replacement, 03 operation did not take place, and 04 nominative operation related to a factura global.
- Request cancellation through SAT's portal or your PAC.
- Get receiver acceptance where required. The receiver generally has three business days to accept or reject. If they do not respond, the request is treated as accepted, with some exceptions in the 2026 Miscellaneous Tax Resolution.
- Meet the deadline. Under Article 29-A of the CFF, cancellation must happen no later than the month in which the annual income tax return for the year of issue is due.
- Document the reason for any cancelled income invoice, because SAT can verify it.
SAT's CFDI cancellation scheme document describes the receiver acceptance flow. For a non-Mexican view of fixing invoice errors, our guide on how to correct an invoice covers credit notes and voiding in general.
Getting set up to issue CFDIs
- Register with SAT and get your RFC.
- Obtain your e.firma at a SAT office.
- Generate your CSD (digital seal certificate) using the e.firma.
- Choose SAT's free invoicing service or a PAC-connected billing platform.
- Load your regime, postal code and product keys into the software.
- Collect each client's Constancia de Situación Fiscal before the first invoice.
- Store every XML; the XML, not the PDF, is your legal record.
Plan for the first month to take longer than you expect. Most new issuers spend more time collecting clients' fiscal data and learning the catalogue codes than on the invoices themselves. Once your customer list and product keys are set up correctly, issuing a CFDI takes about as long as filling in a normal invoice, and the stamped XML gives both you and your client a record SAT already holds.
Keep a predictable internal series as well. Even though the UUID is the legal identifier, a clean serie and folio scheme makes reconciliation easier, which is where an invoice number generator helps.
How Mexico compares with other e-invoicing regimes
Mexico's CFDI is broader than most systems: it covers invoices, payments, payroll and transport waybills. Countries building newer mandates, from Nigeria's NRS rollout to Romania's e-Factura, use similar validation-before-validity logic. Our roundup of e-invoicing mandates for 2027 puts them side by side.
Create your invoice for Mexican clients
A valid CFDI invoice comes down to accurate receiver data, the right PUE or PPD choice, correct retentions and disciplined cancellation. If you are a foreign supplier billing a Mexican company, create a clear commercial invoice with the client's RFC and legal name in our free invoice generator, then pick a layout from our corporate invoice template. No sign-up is needed, and your PDF invoice is ready to send in a few minutes.
Frequently asked questions
What is a CFDI invoice?
CFDI stands for Comprobante Fiscal Digital por Internet, Mexico's mandatory electronic invoice. It is an XML file built to SAT's Anexo 20 specification, sealed with the issuer's digital seal and then certified (timbrado) by an authorised provider (PAC) or SAT's own free service. Only a certified CFDI is a valid tax receipt. The PDF most people see is just a printed representation of the XML.
Is CFDI 4.0 mandatory?
Yes. CFDI 4.0 has been the only accepted version since 1 April 2023, when the transition period with version 3.3 ended. Every invoice, credit note, payment receipt (complemento de pago) and payroll receipt issued in Mexico must use version 4.0. Issuers who try to stamp an older version will be rejected by their PAC.
What receiver data does CFDI 4.0 require?
You need the buyer's RFC, their name or company name exactly as it appears in SAT records, the postal code of their tax address, their tax regime code and the uso CFDI code describing how they will use the invoice. Article 29-A of the Federal Tax Code lists these requirements. The quickest way to get them right is to ask the client for their Constancia de Situación Fiscal.
What is the difference between PUE and PPD?
PUE (Pago en una sola exhibición) means the invoice was paid in full when issued or within the same month. PPD (Pago en parcialidades o diferido) means payment comes later or in instalments. If you mark an invoice PPD, you must issue a payment receipt CFDI, the complemento de pago or REP, when each payment arrives, generally by the fifth day of the following month.
How do I invoice a customer without an RFC?
Use the generic RFC XAXX010101000 for domestic buyers who do not give an RFC, with the name PUBLICO EN GENERAL. Many businesses group these sales into a factura global with the InformacionGlobal node showing the period. For foreign customers without a Mexican RFC, the generic foreign RFC XEXX010101000 is used along with their country and foreign tax ID.
How long do I have to cancel a CFDI?
Under Article 29-A of the Federal Tax Code, a CFDI can be cancelled no later than the month in which the annual income tax return for the year of issue is due, which is March for companies and April for individuals. Most cancellations also require the receiver's acceptance, and you must choose one of four official cancellation reasons. Income invoices that are cancelled must be supported with documentation.
Can freelancers outside Mexico issue a CFDI?
Generally no. A CFDI requires a Mexican RFC, an e.firma and a digital seal certificate, so it is issued by Mexican taxpayers. A foreign freelancer billing a Mexican company usually sends a normal commercial invoice. The Mexican client then handles any tax obligations on imported services. Your invoice should still show the client's RFC and full legal name to help their accounting.
Does SAT offer a free CFDI tool?
Yes. SAT's free invoicing service, accessed with your RFC and e.firma or password in the SAT portal, lets taxpayers create and stamp CFDI 4.0 invoices without paying a PAC. It suits low volumes. Businesses issuing many invoices, payment receipts or invoices with complex complements usually use paid billing software connected to a PAC for speed and automation.
Invoice Creator Editorial Team
Guides on invoicing, cash flow and small-business finance from Invoice Creator, operated by Next Software Development Company. Content is reviewed for accuracy against the fields our own invoice generator produces.
Try the invoice generator