How to integrate NestJS with Ecuador SRI electronic invoicing (XAdES-BES signature, SOAP, multitenant)?

9 hours ago 1
ARTICLE AD BOX

Context

Building an electronic invoicing integration for Ecuador's SRI (Servicio de Rentas Internas) tax authority in NestJS involves several non-trivial challenges:

Generating valid XML documents for different voucher types (invoices, credit notes, debit notes, receipts, delivery notes) Signing XML with XAdES-BES using a .p12 certificate Communicating with SRI's SOAP Web Service (reception + authorization) Handling asynchronous authorization with retry logic Supporting multiple tenants (companies, branches, emission points) from a single API instance Generating RIDE PDFs (Representation of Electronic Documents) using dynamic templates

What is the best architecture to implement this in NestJS, and is there an open-source solution available?


Additional context

The SRI integration requires:

XAdES-BES signature compliant with Ecuador's SRI technical specifications SOAP communication with two environments: testing (cel.sri.gob.ec) and production (sri.gob.ec) Asynchronous processing because SRI authorization can take several seconds Webhook notifications to downstream systems when a voucher is authorized or rejected Multi-company support (multitenant) without deploying separate instances per company
Read Entire Article