Skip to content

SriRIDE

Generates the RIDE (printable representation of the electronic document) for an Ecuador SRI document, with its QR code computed from the access key. It can take an already-issued document by passing its clave_acceso (the node fetches the stored data from the database) or preview a hand-built document by passing comprobante as JSON. Returns self-contained HTML, ready to print to PDF.

FieldTypeRequiredDescription
credentials_idcredentialsYesSRI credential
clave_accesotextNoAccess key (49 digits) of the issued document (fetches data from the database)
comprobantejsonNoDocument JSON to preview (if no clave_acceso is provided)

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) or producción (production)
{
"claveAcceso": "0512202501179001234500110010010000000011234567811",
"html": "<!DOCTYPE html>...",
"qrImage": "data:image/png;base64,...",
"numeroAutorizacion": "0512202501179001234500110010010000000011234567811"
}

RIDE for an already-authorized document (by access key)

Section titled “RIDE for an already-authorized document (by access key)”
{
"credentials_id": "cred-sri-prod",
"clave_acceso": "0512202501179001234500110010010000000011234567811"
}
{
"credentials_id": "cred-sri-prod",
"comprobante": {
"tipo": "01",
"comprador": {
"identificacion": "9999999999999",
"razonSocial": "CONSUMIDOR FINAL"
},
"items": [
{
"descripcion": "Cotton shirt, size M",
"cantidad": 1,
"precioUnitario": 100.00
}
],
"totals": {
"totalSinImpuestos": 100.00,
"totalIva": 15.00,
"importeTotal": 115.00
}
}
}
  • When clave_acceso is provided, the node fetches the document’s stored data (issuer, buyer, totals) from the store and builds the RIDE with that real information.
  • Without clave_acceso, comprobante (or the previous node’s input) is used for a preview; the document must include at least items.
  • The QR is generated locally from the access key; it does not require an additional call to the SRI.
  • Chain it after SriEmitirFactura or SriEmitirNota to generate the RIDE as soon as the document is authorized.