To automate CFDI 4.0 invoicing in an online store, you connect every sale to a system that generates the invoice with the customer's tax details, seals it with your digital seal certificate and has it stamped by an Authorized Certification Provider (PAC). The most practical setup combines a self-invoicing portal for customers who request an invoice with a global invoice for sales to the general public. For businesses that sell over WhatsApp, the customer gets a self-invoicing link instead of being asked for their tax details in the chat.
- CFDI 4.0 requires the customer's name, RFC (tax ID), ZIP code and tax regime exactly as they appear on their tax certificate.
- Stamping is done by a SAT-authorized PAC, never directly by your store.
- The global invoice groups the uninvoiced sales made to the general public.
- Credit or installment sales require a payment complement.
- A self-invoicing portal keeps you from collecting tax details over WhatsApp.
What CFDI 4.0 is and what changed
The CFDI (Comprobante Fiscal Digital por Internet) is Mexico's electronic invoice, issued under the rules of the SAT, Mexico's tax authority. Version 4.0 has been mandatory since 2023 and brought a change that directly affects online stores: the customer's details must match the SAT's records exactly. To invoice someone you need:
- The customer's RFC (Mexican taxpayer ID).
- Name or legal business name exactly as it appears on their Constancia de Situación Fiscal, the official tax status certificate (for companies, without the corporate type suffix, such as "S.A. de C.V.").
- The ZIP code of their tax address.
- The customer's tax regime.
- The CFDI use code, which must be compatible with their regime.
If any of those details doesn't match, the PAC rejects the invoice. That's why manual data entry causes so many errors and so much back-and-forth over WhatsApp. This article is for information only: always confirm the details of your specific case with your accountant.
How the process works under the hood
- Sale: the customer buys in your online store, at the point of sale or over WhatsApp.
- Data: the system takes the products, quantities, prices, taxes and payment method, plus the customer's tax details.
- Generation: the XML is built using the product and unit codes from the SAT catalog.
- Seal: the XML is sealed with your Certificado de Sello Digital (CSD), a digital seal certificate that is different from your e.firma (advanced electronic signature) and is obtained from the SAT.
- Stamping: a PAC (Proveedor Autorizado de Certificación, an authorized certification provider) validates and stamps the invoice.
- Delivery: the customer receives the XML and PDF by email or WhatsApp, and you keep a copy.
Automating means steps 2 through 6 happen without anyone typing anything. Your CSD should be stored encrypted and with restricted access, because it can be used to issue invoices in your name.
Three ways to invoice your online sales
| Model | How it works | Advantage | Drawback |
|---|---|---|---|
| Manual | Someone enters each invoice into an invoicing system | No implementation needed | Slow, error-prone and dependent on one person |
| Self-invoicing portal | The customer enters their order number and details and gets their invoice instantly | Customers serve themselves, at any hour | Requires connecting sales to the portal |
| Automatic at checkout | The customer requests an invoice when buying and it's issued once payment is confirmed | Zero extra steps | Makes checkout longer for everyone if it isn't designed well |
In practice we recommend combining them: an optional "I need an invoice" checkbox at checkout, a self-invoicing portal for anyone who asks later and a global invoice at the end of the period. That's how MonkeyFactura works, connecting to your store, point of sale or sales spreadsheet.
The global invoice for the general public
Sales that nobody asked to have invoiced still have to be covered by a CFDI: the global invoice. It's issued to the generic RFC for the general public (XAXX010101000), stating the frequency you chose (daily, weekly, biweekly, monthly or bimonthly, depending on your tax regime) and the period it covers.
- It must include only the sales that weren't invoiced individually.
- It's issued within the deadline set by the SAT's current rules after the period closes; confirm it with your accountant.
- Set a clear policy on how long after a purchase a customer can request an invoice, and publish it in your store.
An automated system cross-checks sales against invoices already issued and builds the global invoice without anyone adding up receipts.
Credit sales: PUE, PPD and the payment complement
If you collect payment up front, the invoice is issued with the payment method PUE (payment in a single installment). If you sell on credit or in installments, for example to a business customer on 30-day terms, the invoice uses the PPD method (installment or deferred payment) and, each time you receive a payment, you must issue a payment complement (also called a REP) linked to the original invoice. Current rules require issuing it no later than the fifth calendar day of the month after the payment.
This is a spot where many small businesses slip, because one person records the payment and another handles invoicing, and overdue complements pile up until month-end close, when the accountant asks for all of them at once. With automation, recording the payment triggers the complement without depending on anyone remembering.
If you sell on WhatsApp: don't ask for tax details in the chat
In La Laguna a huge number of sales close over WhatsApp, and invoice time is often chaos: the customer sends a blurry photo of their tax certificate, someone retypes it by hand, the ZIP code comes out wrong and the invoice is rejected. A better workflow:
- When payment is confirmed, the system sends the customer a link to your self-invoicing portal with their order number.
- The customer enters their details once; the portal validates them and remembers them for the next purchase.
- The invoice reaches the customer by email and WhatsApp, with a copy to your accountant if you choose.
Besides saving time, you avoid storing photos of tax certificates on personal phones, since that's personal and tax data you're required to protect. To organize the rest of your customer service on this channel, read the guide to customer service on WhatsApp.
Cancellations, returns and common errors
Under CFDI 4.0, canceling an invoice requires stating a reason and, where applicable, linking the invoice that replaces it; in some cases the recipient must accept the cancellation. For a return, the normal approach is to issue an outgoing CFDI (egreso, effectively a credit note) linked to the original invoice, rather than canceling it.
The errors we see most often when reviewing online stores' invoicing:
- The customer's name including "S.A. de C.V." or abbreviations that differ from the certificate.
- The shipping ZIP code used instead of the tax-address ZIP code.
- A CFDI use code that's incompatible with the customer's regime.
- Generic or incorrect SAT product codes across the entire catalog.
- Free shipping or discounts broken down incorrectly, which throws the taxes off.
- Sales invoiced twice: once individually and again in the global invoice.
- Invoices issued with an expired or soon-to-expire CSD.
What pushes the cost of automating up or down
There's no single price, because every business invoices differently. These are the factors that weigh the most:
- Monthly invoice volume, because PACs and invoicing systems usually charge per stamp or per bundle.
- Number of sales channels to connect: online store, point of sale, WhatsApp, marketplaces.
- Tax complexity: credit sales with payment complements, multiple tax regimes, withholdings or products with different tax treatment.
- Catalog condition: whether your products already have the correct SAT codes or need to be reviewed one by one.
- Customization of the self-invoicing portal and branded emails.
In most cases, the savings in data-entry hours and corrected errors pay for the implementation within a few months; run the numbers with the automation savings calculator.
How to implement it step by step
- Review with your accountant: tax regime, global invoice frequency, invoicing policy and product codes.
- A clean catalog: every product with its SAT product and unit codes and its tax treatment.
- A valid CSD uploaded securely to the invoicing system.
- Connection to your sales: the online store, point of sale or a sales spreadsheet.
- A branded self-invoicing portal and the invoice checkbox at checkout.
- Testing with real low-value sales before opening it up to everyone.
An office supply store in Torreón that sells to companies in the region went from spending several afternoons a week on invoicing to reviewing only the exceptions: invoices rejected because the customer entered their details incorrectly, which the portal already flags. If you don't have a store yet, compare platforms in Shopify, WooCommerce or custom and review the must-have online store features. To connect payments, read online payments in Mexico. If you need to integrate invoicing with other systems, our automation team can handle it.







