If you are generating an electronic invoice and receive a message like “Error stamping the CFDI”, “Could not connect to the PAC”, or “Receiver RFC not valid”, you are not alone. CFDI stamping errors are among the most common problems in Mexican electronic invoicing and can appear in any compatible software — Aspel SAE, Contpaq, CONTPAQi, Siigo, or any other authorized provider. This guide will help you identify the exact error, understand its cause, and resolve it step by step.
The Error
The CFDI stamping error appears when your software tries to send the invoice to the PAC (Authorized Certification Provider) to obtain the SAT’s fiscal seal. The most common messages are:
- “Stamping error: code 601 — Certificate not valid or expired”
- “Could not connect to the stamping service”
- “Receiver RFC not found in the SAT registry”
- “The CFDI XML does not comply with the required schema”
- “Issuer seal does not match the certificate”
- “Error 307 — The taxpayer does not have a valid CSD”
These errors occur right after clicking “Stamp” or “Generate CFDI”. In some systems the error appears as a numeric code; in others as descriptive text. In Aspel SAE, the error typically shows in a pop-up window with the PAC code and description.
Root Cause
CFDI stamping errors have four main causes:
1. Expired or revoked Digital Seal Certificate (CSD) The CSD has a four-year validity period. If it has expired or was revoked by the SAT (for example, after a mass cancellation procedure), the PAC will reject all invoices. This produces error 601 and 307.
2. Invalid or unlocatable receiver RFC If the client’s RFC does not exist in the SAT registry, is suspended, or was entered with typographical errors (such as confusing O with 0, or I with 1), stamping fails with a receiver validation error.
3. PAC connection failure PAC services are online and can go down for maintenance, technical failures, or overload. If your software cannot reach the stamping service URL, you will receive a timeout or connection-refused error.
4. Malformed or out-of-schema XML CFDI 4.0 has strict requirements defined by the SAT. If the XML generated by your software contains empty required fields, out-of-catalog values (such as an invalid SAT product key), or structural errors, the PAC will reject it before stamping.
Step-by-Step Solution
Step 1: Read the full error code
Do not close the error message immediately. Write down or copy the numeric code and descriptive text. PAC codes have specific meanings. If your software only shows a generic message, check the system logs or contact your PAC support for details.
Step 2: Verify the CSD status
- Go to sat.gob.mx and log in with your e.firma or RFC + password.
- Navigate to “Procedures” > “Certifica” > “Consult certificates”.
- Verify that your CSD shows as “Current”.
- If it is expired, request a new one in the same portal using your e.firma.
- Once you download the new CSD (
.cerand.keyfiles), load it into your invoicing software.
Step 3: Validate the receiver RFC
- Ask your client to verify their official RFC on their SAT tax status certificate (Constancia de Situación Fiscal).
- Use the SAT’s free RFC verifier: “Procedures” > “RFC” > “Verify RFC”.
- Compare the business name exactly as it appears in the SAT — including capitalization, accents, and punctuation.
- Correct the RFC in your customer catalog before trying to stamp again.
Step 4: Review the PAC connection
- Open a browser and verify you have active internet access.
- Visit your PAC’s website (for example, Edicom, Finkok, SW SaaS) and check for any maintenance notices.
- In your software, open the PAC configuration and confirm the stamping service URL is correct and current.
- If you use a corporate firewall or proxy, confirm that port 443 is open to the PAC URLs.
- Try stamping at a different time if scheduled maintenance is in progress.
Step 5: Validate the XML before stamping
- Export or view the CFDI XML your software generates before sending it to the PAC.
- Use the SAT’s CFDI Validator available on the SAT portal to detect schema errors.
- Verify that the product/service key (
ClaveProdServfield) is in the SAT’s official catalog. - Confirm that the invoice type, payment method, and CFDI usage correspond to the actual transaction.
Step 6: Re-stamp
Once the root cause is corrected, regenerate the CFDI from your software and click “Stamp”. If the system saved the invoice as a draft with errors, delete it and create it from scratch to avoid carrying over incorrect data.
Alternative Solution
If the problem persists after the steps above, consider stamping directly from your PAC’s web portal:
- Access your PAC’s web portal (all authorized PACs have an online portal).
- Upload the CFDI XML manually.
- If the portal accepts the XML and stamps it correctly, the problem is in your software’s integration with the PAC — contact your invoicing software’s technical support.
- If the portal also rejects the XML, the problem is in the invoice content or your CSD — return to Step 2.
Prevention
- Renew the CSD in advance: The SAT allows CSD renewal up to 30 days before expiry. Set a reminder to renew it one month ahead.
- Validate RFC before creating customers: Incorporate the RFC verification step into your customer onboarding process. Many modern invoicing systems include this feature natively.
- Monitor PAC service status: Subscribe to your PAC’s service status notifications to receive maintenance alerts.
- Keep your software updated: SAT catalog updates (product keys, postal codes, etc.) are published frequently. Outdated software generates XMLs with invalid keys.
- Back up your CSD: Keep secure copies of your
.cerand.keyfiles in a safe location outside your main workstation.
Related Issues
Error generating XML reports in Aspel COI: If you also use Aspel COI and encounter errors exporting accounting reports to the SAT, see the guide on errors generating XML in Aspel COI.
Error importing CFDI XML in Aspel SAE: When receiving supplier invoices and Aspel SAE rejects them, see the solution at error importing CFDI XML in Aspel SAE.
Payroll CFDI stamping error in Aspel NOI: Payroll CFDI stamping has additional IMSS validations. See CFDI stamping error in Aspel NOI.
Error loading e.firma in Aspel SAE: If you cannot load your FIEL/e.firma in the software, see error loading e.firma in Aspel SAE.
CFDI cancellation error with SAT: For specific problems when cancelling invoices, see CFDI invoice cancellation error.
Summary
- CFDI stamping errors have four main causes: expired CSD, invalid RFC, PAC connection failure, and malformed XML.
- Always read the full error code before attempting any fix.
- Verify your CSD status on the SAT portal and renew it if expired.
- Validate the receiver RFC using the SAT’s official verifier.
- If you suspect a connection issue, check your PAC’s service status and network configuration.
- As an alternative, try stamping directly on your PAC’s web portal to isolate whether the problem is with the software or the invoice content.
- Prevent future errors by renewing the CSD early and keeping your software updated.