SriEmitirFactura
Description
Section titled “Description”Issues an electronic invoice (type 01) to Ecuador’s SRI. The node builds the document’s XML, computes the 49-digit access key, digitally signs it (XAdES) with the certificate from the credential, and runs the full two-step flow: first reception (schema validation), then authorization with the SRI. The document is only valid once the SRI responds AUTHORIZED; RECEIVED is not enough.
If no sequential is provided, the node auto-numbers it per establishment and emission point for the tenant. The issuer (RUC, legal name, main address) comes from the sri credential.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | SRI credential (certificate + RUC) |
| factura | json | No | Invoice JSON: comprador (tipoIdentificacion, identificacion, razonSocial), items (with precioUnitario and codigoPorcentajeIva: 4=15%, 0=0%). Optional sequential (auto-numbered otherwise). If omitted, the previous node’s input is used |
Credentials
Section titled “Credentials”This module requires an sri credential type with the following fields:
- Certificate (.p12): the issuer’s digital certificate, PKCS#12 format
- Certificate password: password to open the .p12 file
- RUC: issuer’s tax ID (13 digits)
- Environment:
pruebas(testing) orproducción(production)
Output
Section titled “Output”{ "claveAcceso": "0512202501179001234500110010010000000011234567811", "estado": "authorized", "numeroAutorizacion": "0512202501179001234500110010010000000011234567811", "fechaAutorizacion": "2025-12-05T14:32:10-05:00", "total": 113.00, "iva": 13.00, "xml": "<?xml version=\"1.0\"?><autorizacion>...</autorizacion>"}If the SRI leaves the document IN PROCESSING, the output returns estado: "received" with enProceso: true; reconcile it afterwards with SriConsultarAutorizacion.
Usage Example
Section titled “Usage Example”Invoice for a single item to a final consumer
Section titled “Invoice for a single item to a final consumer”{ "credentials_id": "cred-sri-prod", "factura": { "comprador": { "tipoIdentificacion": "07", "identificacion": "9999999999999", "razonSocial": "CONSUMIDOR FINAL" }, "items": [ { "codigo": "0001", "descripcion": "Cotton shirt, size M", "cantidad": 1, "precioUnitario": 100.00, "codigoPorcentajeIva": 4 } ] }}Invoice to a company with the buyer’s tax ID
Section titled “Invoice to a company with the buyer’s tax ID”{ "credentials_id": "cred-sri-prod", "factura": { "comprador": { "tipoIdentificacion": "04", "identificacion": "1790012345001", "razonSocial": "Comercial Andina S.A." }, "items": [ { "codigo": "SRV-01", "descripcion": "Monthly maintenance service", "cantidad": 2, "precioUnitario": 250.00, "codigoPorcentajeIva": 4 } ] }}- The document is only legally valid once the SRI responds AUTHORIZED; RECEIVED (the reception step) is not enough.
- The SRI VAT percentage codes used by the node are: 0=0%, 4=15% (rate in force since 2024).
- If the credential’s certificate (.p12) is expired, the node returns an error without attempting to issue.
- The output’s
xmlfield carries the authorized document returned by the SRI (or the signed XML if the SRI does not resend it).
Related Nodes
Section titled “Related Nodes”- SriConsultarAutorizacion - Reconcile documents left IN PROCESSING
- SriRIDE - Generate the RIDE with QR for the issued invoice
- SriEmitirNota - Issue a credit or debit note