DGII e-CF Contingency for the Dominican Republic
Keep invoicing when the DGII service is down - buffer offline, retransmit in the right order when it returns.
What is e-CF contingency?
Under Ley 32-23 (Ley General de Facturacion Electronica), every e-CF (Comprobante Fiscal Electronico) is an XML document transmitted in real time to the DGII for validation. When the DGII reception service, your connectivity, or your signing service is unavailable, commerce cannot stop: the e-CF is issued in contingency mode with a reserved e-NCF, a printed representation is handed to the customer, and the document must be retransmitted to the DGII once the service is restored. This module manages that entire lifecycle inside Odoo.
Local offline buffering
When you declare contingency, posted customer invoices and credit notes are generated as fully-formed e-CF XML, sealed with a SHA-256 integrity digest, and stored locally in a contingency buffer instead of being transmitted in real time.
Resequenced retransmission
When the service returns, buffered documents are retransmitted in their lawful order: per e-CF type, by ascending e-NCF sequence number, then by issue time. The DGII receives a contiguous, monotonic sequence with no gaps and no out-of-order arrival.
Gap and duplicate preflight
Before any retransmission the buffer is checked for missing sequence numbers and duplicate e-NCFs. A broken buffer is blocked so you fix it before the DGII rejects the batch.
Automatic recovery
A debounced health probe watches your DGII endpoint and, once it is stably reachable, closes contingency and triggers retransmission automatically. Transient transport failures are retried with exponential backoff.
Feature list
| Feature | Description |
|---|---|
| e-CF XML generation | Canonical, deterministic e-CF XML with Encabezado, IdDoc, Emisor, Comprador, Totales, DetallesItems and InformacionReferencia, in the DGII dd-mm-yyyy date format. |
| All 10 e-CF types | 31 Credito Fiscal, 32 Consumo, 33 Nota de Debito, 34 Nota de Credito, 41 Compras, 43 Gastos Menores, 44 Regimenes Especiales, 45 Gubernamental, 46 Exportaciones, 47 Pagos al Exterior. |
| e-NCF structure | Composes and validates the 13-character e-NCF (E + 2-digit type + 10-digit sequence). |
| RNC / Cedula validation | DGII modulus-11 RNC check digit and modulus-10 Cedula validation on company and partners. |
| Authorised sequence pools | Per-type e-NCF ranges authorised by the DGII, with offline next-number reservation, expiry tracking and exhaustion guard. |
| Contingency buffer | Offline document store with integrity seal, lifecycle states and a transmission log. |
| Resequencer | Lawful retransmission ordering by type, sequence and issue time. |
| Preflight | Sequence-gap and duplicate detection across the buffer. |
| Retry scheduler | Exponential backoff with cap and max-attempts parking. |
| Health probe | Debounced auto-recovery gate that avoids flapping on intermittent service. |
| BYOK transport | Retransmission uses your own DGII endpoint and certificate; no credentials are shipped. |
BYOK and compliance boundary
This module is a format generator and contingency buffer. It builds the sign-ready e-CF XML and manages the offline buffer and the resequenced retransmission. Digital signing uses your own XAdES certificate and retransmission uses your own DGII credentials and endpoint (bring-your-own-key). We are not a certified e-CF provider and never impersonate one; your credentials never leave your database.
Technical
- Odoo 18.0 and 19.0 compatible.
- Depends only on
account(Community); no Enterprise dependency. - Framework-free core services, fully unit-tested.
- Cron-driven health probe and retransmission.
Screenshots
Contingency Buffer
Retransmit Buffer
E Ncf Sequences
Update date: 2026-07-02