Skip to main content
ERPNext Mexico CFDI 4.0 E-Invoicing — A build-to-order ERPNext app that generates SAT-compliant CFDI 4 — 1/1Illustrative preview

A build-to-order ERPNext app that generates SAT-compliant CFDI 4.0 XML,

stamps it through your PAC, and handles payment complementos and cancellations directly inside Sales Invoice and Payment Entry.

ECOSIRE scopes, builds, installs and supports it for your Frappe/ERPNext v15/v16 site.

What is ERPNext Mexico CFDI 4.0 E-Invoicing?

A build-to-order ERPNext app that generates SAT-compliant CFDI 4.0 XML, stamps it through your PAC, and handles payment complementos and cancellations directly inside Sales Invoice and Payment Entry. ECOSIRE scopes, builds, installs and supports it for your Frappe/ERPNext v15/v16 site. Built to order by ECOSIRE for ERPNext v15, v16 — indicative price from $999.00 USD; request a quote for a scoped proposal.

Key Features

Custom `CFDI Document` DocType linked 1:1 to Sales Invoice, storing UUID, SAT seal, stamp timestamp and full XML/PDF attachments
`PAC Settings` single DocType for PAC credentials, CSD certificate (`.cer`/`.key`) upload and sandbox/production environment switching
CFDI 4.0 XML builder that populates `cfdi:Comprobante`, `Emisor`, `Receptor`, `Conceptos` and the `Impuestos` block from invoice, item and tax data
`hooks.py` `on_submit` doc event on Sales Invoice that auto-generates and stamps the CFDI through your PAC's API
Adapter layer for common PACs (Finkok, SW Sapien, Facturama and others) behind one whitelisted stamping method
Payment complemento (`Complemento de Pago 2.0` / `Pagos20`) generated from Payment Entry with correct `ImpSaldoAnt`/`ImpPagado` references
SAT-compliant cancellation flow with motive codes 01-04 and substitution-UUID handling for code 01, recording the acuse
Scheduler event that polls the PAC for pending cancellation acknowledgements and updates document status
Field validation for `UsoCFDI`, `RegimenFiscalReceptor`, `FormaPago`, `MetodoPago` and `ObjetoImp` before stamping to reduce SAT rejections
IVA and retenciones (retention) tax mapping wired to ERPNext tax templates and item tax rows
Whitelisted REST API methods so stamped XML, PDF and UUID are retrievable by external systems
Dedicated role profile and DocType permissions so only authorized accounting users can stamp or cancel
Rendered CFDI PDF representation attached alongside the stamped XML for customer delivery
Idempotent stamping guard preventing double-timbrado on re-submitted or amended invoices

Built to order, done for you

No DIY setup — a working app, built, installed and supported by ECOSIRE.

  1. 1

    You order

    Start with a one-time build price. We scope it with you at kickoff.

  2. 2

    We build & install

    ECOSIRE builds, configures and installs it on your ERPNext.

  3. 3

    Go live + support

    You go live in about one working week, with two weeks of go-live support. Defects in the code we deliver are fixed free of charge.

Technical Specifications

ERPNext Compatibility
—
License
Licence confirmation required
Python Requirement
Python 3.10+
Database
MariaDB 10.6+

About this Product

If you sell in Mexico, every invoice has to become a SAT-stamped CFDI 4.0 with a valid UUID before it is legally issued — and ERPNext core has no idea what a CFDI, a PAC, or a complemento de pago is. Teams typically bridge the gap with brittle spreadsheets, a separate portal from their PAC (Finkok, SW Sapien, Facturama, etc.), and manual re-keying that drifts out of sync with the actual Sales Invoice. The moment SAT rejects an XML for a bad RegimenFiscalReceptor, a missing UsoCFDI, or a wrong ObjetoImp, the finance team is stuck reconciling paper against a portal that the ERP never sees.

ECOSIRE builds a proper Frappe app that makes CFDI 4.0 a native part of your ERPNext document flow. We add a custom CFDI Document DocType linked one-to-one to Sales Invoice, plus a PAC Settings single DocType holding your credentials, CSD certificate (.cer/.key), and environment (sandbox vs. production). On submit, a hooks.py doc event (Sales Invoice: on_submit) builds the CFDI 4.0 XML from the invoice, its items, customer RFC and tax rows — populating cfdi:Comprobante, cfdi:Emisor, cfdi:Receptor, cfdi:Conceptos and the cfdi:Impuestos block with correct IVA/retenciones — then calls your PAC's stamping API through a whitelisted server method. The returned TimbreFiscalDigital (UUID, SAT seal, certificate number, stamp timestamp) is written back onto the linked record and the stamped XML plus a rendered PDF are attached to the invoice.

Payment complementos are handled where the money actually moves: a doc event on Payment Entry builds the Complemento de Pago 2.0 (Pagos20) referencing the related CFDIs, their IdDocumento UUIDs, ImpSaldoAnt/ImpPagado amounts and payment method, then stamps it through the same PAC lane. Cancellations follow the SAT 4.0 motive codes (01–04) with the substitution-UUID requirement for code 01; we expose a guarded cancel action that calls the PAC's cancellation endpoint, records the acuse, and reflects the accepted/pending status back on the document. A scheduler event polls for pending cancellation acknowledgements so nobody has to babysit the PAC portal. Everything is permission-gated with a dedicated role profile so only authorized accounting users can stamp or cancel, and the stamped artifacts are reachable over the Frappe REST API for downstream integrations.

Because this is build-to-order, nothing ships until we agree on scope. We start with a short scoping call to confirm your PAC, CFDI use cases (ingreso, egreso, pago, traslado), regimes and edge cases, then build against your chart of accounts and tax templates. You get the work validated on a staging bench first, a UAT sign-off, and a clean cutover to production on Frappe/ERPNext v15 or v16. Typical delivery is one working week from confirmed scope, and you receive the full source as an installable Frappe app plus the git repository so you are never locked in.

What you get

  • Installable Frappe app (source code) for your ERPNext v15 or v16 site, versioned for your build
  • Installation and configuration on your bench, including PAC credential and CSD certificate setup
  • Technical documentation: DoctType schema, hooks, whitelisted methods and PAC adapter configuration
  • End-user guide plus a live training session for your accounting/finance team
  • UAT on a staging bench with a documented test matrix and a rollback plan before go-live
  • Post-go-live support window for defect fixes and stamping/cancellation issues
  • Git repository handover so you fully own the code with no vendor lock-in

Who this is for

Mexico-based finance controller

Runs ERPNext for a company that must issue CFDI 4.0 for every sale and needs stamping, complementos and cancellations to happen inside the ERP instead of a separate PAC portal.

ERPNext implementation partner

Rolling out ERPNext for a Mexican client and needs a reliable, source-available CFDI 4.0 app they can install, extend and support rather than building SAT compliance from scratch.

Multi-entity CFO / group finance lead

Operates several Mexican legal entities on one ERPNext site and needs consistent, auditable e-invoicing with per-entity CSD certificates, RFCs and PAC settings.

ERPNext system administrator

Owns the bench and wants a clean Frappe app with well-defined hooks, permissions and REST endpoints that integrates with existing tax templates and doesn't fight future upgrades.

How ERPNext Mexico CFDI 4.0 E-Invoicing Compares

CriterionECOSIRECustom BuildCompetitorERPNext Native
SAT CFDI 4.0 stampingBuilt into Sales Invoice submit via PAC adapterYou build the XML and PAC integration yourselfGeneric app, may not match your PAC or regimesNot supported at all
Payment complemento (Pagos20)Generated from Payment Entry with correct referencesExtra scope you must design and testSometimes partial or add-on onlyNone
Cancellation flow (motives 01-04)Guarded cancel with acuse and substitution UUIDHand-rolled against SAT rulesVaries; often manual via PAC portalNone
ERPNext integrationNative DoctTypes, hooks, permissions, REST APIDepends on your team's Frappe depthBolt-on, may fight your tax templatesN/A
Source code ownershipFull source plus git repo handoverYou own it but carry all the build costOften closed or subscription-lockedN/A
Fit to your PAC and regimesScoped to your PAC, RFCs and use casesFully bespoke if you invest the timeOne-size-fits-most defaultsNone
Delivery and supportone working week, UAT, training, support windowUnpredictable timeline, self-supportedInstant install but generic supportN/A
Version support (v15/v16)Built and validated for your versionYou handle upgrade compatibilityDepends on maintainer's roadmapN/A

Frequently Asked Questions about ERPNext Mexico CFDI 4.0 E-Invoicing

How long does delivery take?

This is build-to-order, not an instant download. Typical delivery is one working week from confirmed scope. After the scoping call we agree on your PAC, CFDI use cases and edge cases, build against your ERPNext configuration, validate on staging, and then cut over to production.

Which PACs do you support?

The stamping layer is built as an adapter, so we integrate the PAC you already use or plan to use — common ones include Finkok, SW Sapien and Facturama. We confirm the exact PAC and its sandbox/production endpoints during scoping so the app is built against your real credentials.

How do updates and support work?

Every build includes a post-go-live support window for defect fixes and stamping/cancellation issues. Because you receive the full source and git repository, you can also extend it yourself. SAT format changes and version upgrades (for example moving from ERPNext v15 to v16) can be handled under a support or maintenance arrangement.

Which ERPNext versions are supported?

We build for Frappe/ERPNext v15 and v16. We confirm your exact version and bench setup at scoping so the app, its DoctTypes and hooks are validated against the version you run in production.

Does it handle payment complementos and cancellations, not just invoices?

Yes. Beyond the CFDI 4.0 ingreso invoice, the app builds the payment complemento (`Complemento de Pago 2.0`) from Payment Entry and implements SAT cancellation flows with the 01-04 motive codes, including the substitution-UUID requirement for code 01.

Do we own the code, or is it locked to ECOSIRE?

You own it. We hand over the full source as an installable Frappe app plus the git repository. There is no license server or vendor lock-in — you can host, extend and maintain it independently.

How is stamping protected against duplicate or wrong invoices?

Stamping is idempotent and guarded, so re-submitting or amending an invoice won't produce a double-timbrado. We also validate SAT fields like `UsoCFDI`, `RegimenFiscalReceptor` and `ObjetoImp` before calling the PAC to cut down on rejections, and only users in the dedicated role profile can stamp or cancel.

Request a quote

ERPNext Mexico CFDI 4.0 E-Invoicing

A build-to-order ERPNext app that generates SAT-compliant CFDI 4.0 XML, stamps it through your PAC, and handles payment complementos and cancellations directly inside Sales Invoice and Payment Entry. ECOSIRE scopes, builds, installs and supports it for your Frappe/ERPNext v15/v16 site.

  • Custom `CFDI Document` DocType linked 1:1 to Sales Invoice, storing UUID, SAT seal, stamp timestamp and full XML/PDF attachments
  • `PAC Settings` single DocType for PAC credentials, CSD certificate (`.cer`/`.key`) upload and sandbox/production environment switching
  • CFDI 4.0 XML builder that populates `cfdi:Comprobante`, `Emisor`, `Receptor`, `Conceptos` and the `Impuestos` block from invoice, item and tax data
  • `hooks.py` `on_submit` doc event on Sales Invoice that auto-generates and stamps the CFDI through your PAC's API

Request a Quotation

Tell us about your ERPNext Mexico CFDI 4.0 E-Invoicing requirements and we'll send pricing, licensing options and a tailored proposal — usually within one business day.

No payment now. This sends a quote request to our team — we'll follow up by email with pricing and next steps.