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:- Create invoice data - Use TypeScript types to build compliant invoice data structures
- Generate XML - Convert your invoice data to SRI-compliant XML format
- Sign document - Apply digital signatures using your .p12 certificate
- Submit to SRI - Send to reception endpoints and obtain authorization
SRI environments
The library supports both testing and production environments: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.