Skip to main content
Open Factura - Electronic invoicing for Ecuador

What is Open Factura?

Open Factura is an open source electronic invoicing library for Ecuador that is fully compatible with the technical specifications for electronic documents issued by the SRI (Servicio de Rentas Internas). Published as an npm library, you can use it by simply installing it as a dependency in your Node.js or Bun project.

Key features

TypeScript support

Fully typed fields for electronic invoices according to SRI specifications, providing type safety and IDE autocomplete.

Invoice generation

Generate electronic invoices in both JSON and XML formats that comply with SRI technical requirements.

Digital signature

Sign XML documents with .p12 certificates, compatible with Security Data and Banco Central providers.

SRI integration

Send documents to SRI reception endpoints and authorize them directly through their web services.

Flexible loading

Load digital signatures and XML files from local file system or remote URLs for maximum flexibility.

Access key generation

Automatic generation of access keys (clave de acceso) for electronic documents according to SRI standards.

How it works

Open Factura provides a complete workflow for electronic invoicing in Ecuador:
  1. Create invoice data - Use TypeScript types to build compliant invoice data structures
  2. Generate XML - Convert your invoice data to SRI-compliant XML format
  3. Sign document - Apply digital signatures using your .p12 certificate
  4. Submit to SRI - Send to reception endpoints and obtain authorization

SRI environments

The library supports both testing and production environments:
SRI_RECEPTION_URL="https://cel.sri.gob.ec/comprobantes-electronicos-ws/RecepcionComprobantesOffline?wsdl"
SRI_AUTHORIZATION_URL="https://cel.sri.gob.ec/comprobantes-electronicos-ws/AutorizacionComprobantesOffline?wsdl"
To use these endpoints with your RUC, you must activate the testing/production environment in your SRI account. Learn how to enable the production environment.

Ready to get started?

Follow our installation guide to add Open Factura to your project, or jump straight to the quickstart tutorial to create your first invoice.

Build docs developers (and LLMs) love