Skip to main content

Introduction

A CFDI stamped by the SAT can only be withdrawn by requesting its cancellation. The request carries a reason (motivo), and for most B2B invoices and payment receipts the receiver must accept it within three business days, otherwise it is accepted automatically. See Cancellations in Mexico for the rules. In this guide you’ll learn how to cancel invoices and payment receipts (comprobantes de pago) issued with the SAT Mexico app. A cancellation is requested with a GOBL status document that references the CFDI to cancel.

Prerequisites

  • A document issued through Invopop: the CFDI must have been stamped by the SAT Mexico app, following the CFDI issuing guide, and its sat-uuid stamp is needed to reference it.
  • The cancellation reason: one of the four SAT motivos listed below.
  • For motivo 01: the replacement CFDI, already issued with the original in its preceding list and relation type 04 (mx-cfdi-rel-type).

Setup

All of the following steps must be carried out from the Invopop Console.
1

Set up the SAT cancel CFDI workflow

SAT cancel CFDI workflow

Add to my workspace →

How it works

1

Sign envelope

The status document is signed. Only signed status documents can be cancelled.
2

Cancel CFDI at SAT

The app checks the CFDI’s current status at the SAT and sends the cancellation request. The SAT acknowledgement (acuse) is attached to the status document as cancel-acuse.xml. The step then waits for the outcome, checking every minute, or every four hours while the receiver has to accept.
3

Set state

Once the SAT confirms the cancellation, the status document is set to completed. If the request fails or the receiver rejects it, the rescue step sets it to error.

Cancel a document

Create a status document of type update with one rejected line referencing the CFDI to cancel, then run the cancel workflow on it.
The recommended approach for running jobs is to perform two steps: first upload the document to the silo, then create a job.
The rejected line must include:
  • doc.code with the document’s code, and the sat-uuid stamp of the CFDI.
  • ext with the reason in mx-cfdi-cancel-reason.
For motivo 01, add a second line with key issued that references the replacement CFDI and its sat-uuid stamp. Each status document cancels a single CFDI.
A newly issued CFDI can take a few minutes to be available for cancellation. If the job fails with a message asking to wait, run it again after a few minutes.

Outcomes

The cancel step ends with one of these results, and the error codes can be used to route the workflow:

FAQ

Individual CFDIs are not required for sales under MXN $100, but those sales must still be included in the global CFDI. Often issuing all invoices will simplify your operation.
Yes. We obtain the supplier’s CSD (digital seal) and credentials to issue invoices in that company’s name. Read more in our white label use case.
Yes. The mx-cfdi-v4 addon supports both PUE and PPD on the original invoice, and Invopop also issues the subsequent payment receipts (REPs / Pago / comprobante de pago) that must be emitted as payments are collected. Model each receipt as a GOBL bill.Payment referencing the PPD invoices being settled and run it through the SAT issue payment workflow. See the payment receipt example in the issuing guide.
Yes, if the original was issued as PUE and payment is not received by the last day of the issuance month, rule 2.7.1.32 RMF requires cancelling the original and re-issuing as PPD with FormaPago = 99, then issuing REPs as payments come in. This is calendar-driven, not payment-event-driven, and it surprises most non-Mexican implementations. The conservative approach is to issue PPD whenever there is any uncertainty about same-month payment.
REPs must be issued by the fifth calendar day of the month following payment receipt (rule 2.7.1.35 RMF). Missing the deadline does not invalidate the underlying invoice, but it prevents the customer from deducting the expense in the correct period and exposes the issuer to fines. This is a recurring source of friction and the reason customers will sometimes refuse to accept cancellations from a supplier with poor REP discipline.
Install the SAT Mexico app (uses SW Sapien as PAC) plus the SW Sapien app for credentials. Onboard each issuing supplier with their CSD certificate and mx-cfdi-issue-place. Run invoices through the Issue CFDI workflow.
The library that transforms GOBL into CFDI documents is publicly available as an open-source project and can be found at github.com/invopop/gobl.cfdi.For further details on how GOBL prepares data for conversion, see the Mexico Tax Regime.
The most common cause is a mismatch between the receiver’s postal code in the CFDI and the postal code SAT has on file for that RFC. Resolution: ask the customer for their CIF (Constancia de Situación Fiscal) and use the postal code printed there, exactly. Secondary causes:
  • The postal code is real but not yet in c_CodigoPostal. Use the closest catalog code from the place of issuance.
  • The receiver is XAXX010101000 or XEXX010101000 and DomicilioFiscalReceptor differs from LugarExpedicion. They must be equal for generic RFCs.
  • The branch issuing the document is configured with the matriz’s postal code instead of its own.
In Mexico, a reduced VAT rate of 8% applies to transactions in border zones (northern and southern border regions). To successfully issue invoices with this rate, both of the following conditions must be met:
  1. The supplier’s RFC must be enabled by the SAT to invoice with the reduced rate in border zones.
  2. Both the mx-cfdi-issue-place field and the customer’s postal code (when included) must correspond to border zones.
If either condition is not met, the SAT will reject the invoice with an error.
CFDI40999 is a generic “unclassified error” returned by the SAT when no other, more specific error code applies. This error can have multiple causes.A common scenario is invoicing in border zones with the reduced 8% VAT rate. If you receive this error in that context, verify:
  1. RFC registration: The supplier’s RFC must be registered in the taxpayers registry for the appropriate border region tax incentive. Without this registration, the SAT will reject all invoices with the reduced rate. See SAT’s registration requirements and procedures for more information.
  2. Issue place postal code: The mx-cfdi-issue-place field must contain a postal code from a municipality within a border zone.
  3. Tax rate: Ensure you’re applying the correct percentage (typically 8%) for the border zone.
If the error persists after verifying these points, or you’re getting this error for other reasons, please reach out to our support team.
This error appears when you try to issue an invoice for a supplier (identified by its RFC) that has not been registered in your workspace. Before you can issue on a supplier’s behalf, its CSD certificate must be uploaded and validated through the registration flow.To fix it, make sure the supplier is correctly registered by following the Register a supplier steps in the supplier registration guide.In Sandbox you may also hit this error for suppliers that were registered in the past. This is due to a change in how supplier registration is now enforced before sending invoices. To resolve it, open the supplier’s Silo Entry in the Console and run the registration process again from the start, completing every step.
The UsoCFDI must be allowed for the receiver’s RegimenFiscal. The catalog defines the valid combinations; not every code works for every régimen. For example, D01–D10 (personal deductions) are only valid for individuals, never for legal entities. RESICO contributors (régimen 626) have a restricted set. When in doubt, default to S01 (Sin efectos fiscales) — it is always valid but produces a non-deductible invoice for the receiver. Always ask the customer which UsoCFDI they need before issuing.
By default, Invopop uses Mexico City’s time zone (UTC-6) when automatically setting the issue_date and issue_time fields. However, the SAT validates these fields based on the time zone of the postal code specified in mx-cfdi-issue-place.If the issuing location is in a different time zone, the SAT may reject the invoice with an error indicating the timestamp is in the future, as it only allows up to 5 minutes ahead of the local time.To avoid this, explicitly set issue_date and issue_time in your GOBL invoice using the local time zone of the issuing location when operating outside Mexico City’s time zone.
For non-MXN invoices, TipoCambio must be present and use the FIX rate published by Banxico in the DOF the day prior to the operation (Article 20 CFF, Article 56 Ley Aduanera). Common errors:
  • Using the day-of rate instead of the prior day’s.
  • Quoting the inverse (USD per MXN instead of MXN per USD).
  • Setting TipoCambio on an MXN invoice (it must be 1 or absent).
  • Rounding inconsistently between line totals and document totals — Anexo 20 has specific rounding rules.
See the Mexico tax regime in GOBL for tax categories, RFC structure, and CFDI extensions. The mx-cfdi-v4 addon documents required fields including UsoCFDI, RegimenFiscal, and place-of-issue.
More available in our Mexico FAQ section

Participate in our community

Ask and answer questions about invoicing in Mexico →