Overview
CFDI (Comprobante Fiscal Digital por Internet) is Mexico’s electronic invoicing system mandated by SAT. All business transactions in Mexico must be documented using CFDI invoices, which are digitally signed XML documents that can also have PDF representations.What are CFDI Invoices?
CFDI invoices are the foundation of Mexico’s digital tax system. Every sale, purchase, service, or transfer of goods must be documented with a CFDI that:- Contains structured data in XML format
- Is digitally signed by the issuer
- Is validated and stamped by SAT
- Includes unique fiscal identifiers (UUID)
CFDI Structure
CFDI Structure
Every CFDI contains essential fiscal information:
Digital Signatures
Digital Signatures
CFDI invoices include multiple digital signatures:
- Issuer Signature: Created by the issuer using their FIEL
- SAT Stamp: Applied by SAT’s authorized providers (PAC)
- UUID: Unique identifier assigned by SAT for each CFDI
Available Formats
Available Formats
CFDI invoices can be retrieved in multiple formats:
- XML: Original structured data with all fiscal information
- PDF: Human-readable representation for printing and sharing
- Metadata: Extracted key fields for integration
CFDI Types and Use Cases
Invoice Directions
Inbound Invoices
Received by your company
- Supplier invoices
- Expense documentation
- Accounts payable
- Tax deductible expenses
Outbound Invoices
Issued by your company
- Customer invoices
- Revenue documentation
- Accounts receivable
- Tax obligations
Common CFDI Document Types
| Type Code | Description | Use Case |
|---|---|---|
I | Ingreso (Income) | Sales invoices, service billing |
E | Egreso (Expense) | Credit notes, refunds |
T | Traslado (Transfer) | Goods movement, inventory transfers |
P | Pago (Payment) | Payment complements |
N | Nómina (Payroll) | Employee salary payments |
Extracting CFDI Invoices
Basic Extraction Request
Advanced Filtering
CFDI Data Fields
Key Invoice Information
When you extract CFDI invoices, you get access to structured data including:Basic Information
Basic Information
- UUID: Unique fiscal identifier
- Issue Date: When the invoice was created
- Certification Date: When SAT validated the invoice
- Total Amount: Invoice total including taxes
- Currency: Usually MXN (Mexican Peso)
Parties
Parties
Issuer (Emisor):
- RFC, business name, address
- Tax regime information
- RFC, name, address
- CFDI usage purpose
Line Items
Line Items
Each invoice contains detailed line items:
- Product/service description
- Quantity and unit price
- Tax classifications
- Discount information
Tax Information
Tax Information
Detailed tax breakdown:
- VAT (IVA) calculations
- Retention taxes
- Other applicable taxes
- Tax rates and amounts
Best Practices for CFDI Processing
Data Validation
Duplicate Detection
Storage Recommendations
- Store both XML and PDF versions
- Maintain original digital signatures
- Implement backup and disaster recovery
- Use secure, encrypted storage solutions
Integration Examples
Accounting System Integration
Expense Management
Troubleshooting CFDI Issues
Common Problems
Invalid CFDI Format
Invalid CFDI Format
Symptoms: XML parsing errors, missing required fieldsSolutions:
- Verify CFDI was properly issued by authorized PAC
- Check for complete digital signatures
- Validate against SAT’s official XSD schemas
Missing PDF Representation
Missing PDF Representation
Symptoms: Only XML available, no PDF formatSolutions:
- Some CFDIs may not have PDF representations
- Generate PDF from XML data if needed
- Check with issuer for PDF availability
Large Volume Processing
Large Volume Processing
Symptoms: Timeouts, memory issues with large extractionsSolutions:
- Process invoices in smaller date ranges
- Implement pagination for large datasets
- Use streaming processing for XML parsing