Skip to content
PokutsoftPokutsoft
GlobalLocalization/Costa Rica
Costa Rica Hacienda 4.4 icon

Costa Rica Hacienda 4.4

Costa Rica Ministerio de Hacienda comprobante electronico v4.4 (FE/TE/NC/ND/REP) with Clave, cedula validation, QR and BYOK clearance to the Hacienda recepcion API

Odoo 20.0Odoo 19.0Odoo 18.0

Costa Rica Hacienda 4.4 e-Invoicing

Comprobante electronico v4.4 — FE, TE, NC, ND, REP — with Clave, cedula validation, QR and BYOK clearance

Generate, validate, sign and clear the electronic comprobantes required by the Ministerio de Hacienda de Costa Rica, implementing the v4.4 comprobante electronico schema published at cdn.comprobanteselectronicos.go.cr. Built on the shared e-Invoice Core Engine, it adds the full Costa Rica format, numbering and clearance flow. Compatible with Odoo 18, Odoo 19 and Odoo 20.

All Five Document Families

Factura Electronica (FE), Tiquete Electronico (TE), Nota de Credito (NC), Nota de Debito (ND) and Recibo Electronico de Pago (REP), each built in the exact element order of the Hacienda v4.4 XSD sequence.

50-digit Clave Generator

Country + emission date + 12-digit emitter cedula + 20-digit consecutivo (sucursal / terminal / tipoDoc / numero) + situacion + 8-digit security code, with a verifiable mod-11 self-check.

Real Cedula Validation

Enforces the official type-to-length matrix: Cedula Fisica (9), Juridica (10), DIMEX (11/12), NITE (10) and foreign identification — on the company and on every partner.

CABYS from the Product, Never Guessed

Every product carries its own CABYS Code field (13 characters, from the official catalogue), and that is the value emitted as CodigoCABYS on each line. A product with no code blocks generation with a message naming it, instead of falling back to a catch-all code: Hacienda validates only the length of the code, so a wrong one is accepted and silently files the sale under the wrong classification. A company-wide default code exists but is off by default.

IVA Tariffs and Totals

Per-line IVA with the Hacienda tariff code, taken from the complete official CodigoTarifaIVA table (01 to 11, Nota 8.1 of the Hacienda Anexos): 13%, 4%, 2%, 1% and 0.5% follow from the rate, and a zero rate states its own code on the tax card, because Hacienda gives zero four different codes that are not interchangeable. A rate with no official code is refused rather than filed under the nearest one — Hacienda validates the code against a list only, so a wrong-but-listed code comes back accepted and the misstatement is never reported. ResumenFactura totals coherence (TotalComprobante = TotalVentaNeta + TotalImpuesto) is checked before the document is generated.

BYOK Hacienda Clearance

Submit signed comprobantes to the Hacienda recepcion API and poll the acceptance response. All five clearance states Hacienda documents — recibido, procesando, aceptado, rechazado and error — are recorded separately, so an invoice still sitting in Hacienda's queue no longer reads simply "Sent". Official sandbox and production endpoints are pre-filled as editable defaults. Your Hacienda credentials and e-seal certificate stay on your own database.

Verification QR & Onboarding

A QR linking to the Hacienda comprobante consultation page, a guided setup wizard, invoice Generate / Submit / Check-Status buttons, and a clearance-status polling cron that is enabled on installation and backs off on its own when Hacienda cannot see a Clave yet.

How It Works

  1. Run the Costa Rica setup wizard: identification, economic activity and Hacienda API credentials (BYOK).
  2. Post a customer invoice or credit note as usual.
  3. Generate the v4.4 comprobante — the Clave, consecutivo and QR are computed and validated.
  4. Submit to Hacienda; the module polls for the acceptance response every 30 minutes and records which of the five official clearance states came back.
  5. If it is rejected, read the reason on the invoice itself: the DetalleMensaje of the signed MensajeHacienda is decoded and shown as text, and the signed answer is kept as an attachment.

Disclosure: this module transmits invoice data only to the Hacienda recepcion endpoint you configure. No data is sent anywhere else, and your credentials and certificate / private key never leave your database.

Supports Odoo 18, Odoo 19 and Odoo 20. License OPL-1.

Screenshots

Posted Factura Electronica W

Posted Factura Electronica W

Generated V4 4 Comprobante D

Generated V4 4 Comprobante D

Validated Against the Official Schemas

The Ministerio de Hacienda v4.4 XSD files ship inside the module (static/xsd/, unmodified, with their download URLs and checksums recorded). The automated test suite validates the generated FE, TE, NC, ND and REP XML against those schemas with lxml.etree.XMLSchema — including the fact that a Recibo Electronico de Pago has its own, different body. Schema conformance is therefore measured on every test run, not asserted.

Update date: 2026-08-30

User guides (PDF)

Related modules