E-Invoice Generation
E-Invoice Generation is a feature of the iVendNext Mexico Localization module. It integrates iVendNext POS with FacturaAPI to automatically create SAT-compliant CFDI (Comprobante Fiscal Digital por Internet) documents at the moment a POS Invoice is submitted. Mexican tax law (SAT) requires every business to issue a valid CFDI for each sale — this feature eliminates the need for a separate fiscal platform by handling the complete CFDI lifecycle — generation, download, cancellation, and payment complement issuance — entirely within iVendNext.
Path: iVendNext Desk → Mexico Localization → E Invoice Setting | iVendNext Desk → POS Invoice
Prerequisites
Before enabling this feature, confirm the following setup is complete. These requirements apply specifically to iVendNext deployments using the Mexico Localization module.
The Mexico Localization app (ivend_mexico_localization) is installed on your iVendNext instance.
You have an active FacturaAPI account with a valid Bearer token and server URL.
Every Customer record includes the following fiscal fields:
Tax ID (RFC) — the customer's Mexican federal tax ID (use XAXX010101000 for general public transactions)
Tax System — the SAT tax system code applicable to the customer (e.g., 616 – Sin obligaciones fiscales)
ZIP Code (custom_zip) — the customer's fiscal address ZIP code
Email (custom_email) — recommended for delivering the signed invoice electronically
Every Item sold has a Product Key (custom_product_key) — the SAT product/service catalog code (e.g., 43211500 for software, 01010101 for general use).
Multiple Transaction Mode is disabled in Retail Setting. This is enforced automatically when the Mexico Localization app is installed.
The iVendNext server has live internet connectivity at POS Invoice submission time. Offline CFDI generation is not supported.
If a customer is missing their RFC, Tax System, or ZIP Code — or if any line item is missing a Product Key — the POS Invoice submission is blocked with a clear error message before any API call is made.
How to Configure E-Invoice Generation
This configuration is part of the Mexico Localization module setup. Complete this step before processing any POS Invoice in a Mexico-facing store.
Go to iVendNext Desk → E Invoice Setting.
In the Server URL field, enter the FacturaAPI base URL (e.g., https://www.facturapi.io/v2). For sandbox testing, use the sandbox URL from your FacturaAPI account dashboard.
In the Secret Key field, enter your FacturaAPI Bearer token. The key is stored using iVendNext's encrypted Password fieldtype and is never visible after saving.
Check Generate E Invoice to activate automatic CFDI generation on every POS Invoice submission.
Optionally, check Cancel E Invoice to allow CFDI cancellation directly from iVendNext.
Click Ping Server to verify the connection. The system calls the FacturaAPI health check endpoint and displays a confirmation if your credentials and URL are valid.
Click Save.
Note: Ping Server to verify the connection. You should see a message indicating a successful connection.
Features
Automatic CFDI Generation on Sale
When a cashier submits a POS Invoice, iVendNext automatically calls FacturaAPI to generate a CFDI Type I (Ingreso) — a standard income invoice. No manual action is required from the cashier. Within 60 seconds, the following fields are populated on the POS Invoice record:
UUID — the unique SAT-assigned identifier for the CFDI
Invoice Status — set to valid when the CFDI is successfully stamped
SAT Signature and SAT Cert Number — digital stamps from the SAT authority
CFDI Version — typically 4.0 per current SAT requirements
Verification URL — a link to the SAT portal where the CFDI can be independently verified
Verification QR — a QR code image generated from the verification URL and attached directly to the invoice record
The payment method is determined automatically: if the outstanding amount is at or below the write-off limit configured in POS Profile, the CFDI uses PUE (paid in full); otherwise it defaults to PPD (deferred payment).
Downloading the Signed Invoice
Once a CFDI is generated, a Download E-Invoice button appears on the submitted POS Invoice form. Clicking it downloads a ZIP file containing two files: the signed XML (the official CFDI document recognised by SAT) and a PDF version of the invoice. You can share this bundle with the customer as their legal fiscal document.
Credit Note Generation for Returns
When you process a return at the POS, iVendNext automatically generates a CFDI Type E (Egreso) — a credit note — linked to the original sale. The credit note includes the original invoice's UUID in the related_documents field using SAT relationship code 01. The return POS Invoice record shows its own UUID once it has been stamped by FacturaAPI.
CFDI Cancellation
To cancel a stamped CFDI, open the submitted POS Invoice that has a UUID and click Cancel. A dialog appears requiring you to select a Reason of Cancellation from the four SAT-approved motives:
01 — Receipt issued with errors related to the receiver
02 — Receipt issued with errors unrelated to the receiver
03 — The operation was not carried out
04 — Nominative operation related to the global invoice
After you confirm, iVendNext calls FacturaAPI to cancel the CFDI at SAT, cancels the POS Invoice in iVendNext, and stores the selected motive on the invoice record. The Cancel E Invoice toggle in E Invoice Setting must be enabled for this action to be available.
Bulk CFDI Re-generation
If a batch of invoices was submitted while FacturaAPI was unreachable and therefore has no CFDI, you can recover them without reprocessing each transaction individually. In the POS Invoice list view, select the affected invoices (those without a UUID) and click Generate E-Invoice for Selected. iVendNext queues a background job for each invoice and returns a count of how many were queued.
For a single invoice, open the submitted record and click Submit E-Invoice — this button is visible whenever the invoice has been submitted but no E Invoice ID (custom_e_invoice_id) is present.
Payment Complement (Tipo P)
For deferred payment (PPD) transactions, when a Payment Entry is submitted against a POS Invoice, iVendNext automatically generates a CFDI Type P (Pago) — a payment complement. The complement captures the payment form (mapped from the mode of payment, or overridden via custom_payment_form), the related invoice reference, and applicable taxes. The resulting CFDI details — UUID, SAT Signature, Verification URL, and Folio Number — are stored in the E Invoice Payments child table on the POS Invoice. A per-row Download button lets you retrieve the payment complement ZIP directly.
API Audit Logging
Every call to FacturaAPI — whether for generation, cancellation, or payment complement — is recorded as an Integration Request in iVendNext Desk. Each log entry captures the full request URL, headers, payload, response output, and status (Completed or Failed). Failed calls are also written to the Error Log. This gives IT administrators and finance teams a complete, timestamped audit trail of all fiscal API activity specific to the Mexico Localization deployment.
Note: E-Invoice Generation is available exclusively to iVendNext deployments with the Mexico Localization module installed. It is not available for other country configurations or standard iVendNext instances.