DgiRepresentacion
Description
Section titled “Description”Generates the printable representation of a Uruguay Comprobante Fiscal Electronico (CFE), including its security code and the lookup QR code required by the DGI. It can take an already-issued CFE (identified by type, series and number, retrieving the signed XML stored in the database) or build a preview from a CFE in JSON format that has not been issued yet.
Returns HTML ready to print or convert to PDF, together with the QR image and the content it encodes.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | dgi credential |
| tipo_cfe | text | No | Type of the already-issued CFE (to fetch it from the database) |
| serie | text | No | Series of the already-issued CFE |
| numero | text | No | Number of the already-issued CFE |
| cfe | json | No | CFE as JSON to preview (if type/series/number are not provided) |
Either tipo_cfe + serie + numero must be provided to represent an already-issued document, or cfe with items to preview one that has not been issued yet.
Credentials
Section titled “Credentials”This module requires a dgi credential type with the following fields:
- Certificate (.p12): advanced signature certificate in base64
- Certificate password: password for the .p12 file
- RUT: issuer’s tax ID
- Company Name: issuer’s legal name
- Environment:
test(homologation) orprod(production)
Output
Section titled “Output”{ "tipoCfe": 111, "serie": "A", "numero": 159, "html": "<html>...printable representation...</html>", "qrUrl": "https://efactura.dgi.gub.uy/...", "qrImage": "data:image/png;base64,...", "codigoSeguridad": "AB12CD34", "digestValue": "sha1-abc123..."}Usage Example
Section titled “Usage Example”Representation of an already-issued CFE
Section titled “Representation of an already-issued CFE”{ "credentials_id": "cred-dgi-prod", "tipo_cfe": "111", "serie": "A", "numero": "159"}Preview of a CFE not yet issued
Section titled “Preview of a CFE not yet issued”{ "credentials_id": "cred-dgi-prod", "cfe": { "tipoCfe": 111, "receptor": { "tipoDocumento": 2, "documento": "212345670010" }, "items": [ { "descripcion": "Consulting service", "cantidad": 1, "precioUnitario": 1000, "indicadorIva": "22" } ] }}- When representing an already-issued CFE, the HTML includes the real security code stored at issuance; in a preview the code may be provisional.
- The
htmlfield is meant to be rendered directly or passed to a node that converts it to PDF. qrImagecomes as a data URL, ready to embed in the HTML or send by email without uploading a separate file.- If the CFE cannot be found by type/series/number, the node returns an error; to preview one,
cfewith at least one item must be provided.
Related Nodes
Section titled “Related Nodes”- DgiEmitirCFE - Issue the CFE before representing it
- DgiConsultarCFE - Check the status of the represented CFE