DgiEmitirCFE
Description
Section titled “Description”Issues a Uruguay Comprobante Fiscal Electronico (CFE) to the DGI. The node orchestrates the whole process: it atomically consumes a number from the CAE loaded for the corresponding type/series, builds the CFE XML with issuer, recipient and item data, digitally signs it (XMLDSig, using the credential’s .p12 certificate) and stores it with issued status.
The issued document is then ready for two follow-up steps: sending it to the recipient (DgiEnviarReceptor) and including it in the mandatory daily report to the DGI (DgiReporteDiario). It requires an active CAE, previously loaded with DgiCargarCAE, for the CFE type and series being issued.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | dgi credential (.p12 certificate + RUT + environment) |
| cfe | json | No | Receipt as JSON: tipoCfe (101 e-Ticket, 111 e-Invoice), recipient, items. If empty, the input data is used |
| firma_sha256 | boolean | No | Sign with SHA-256 instead of SHA-1 (per DGI requirement) |
Issuer data (RUT, company name, branch) and the series are automatically filled from the credential when not present in cfe.
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
- Head Office / Branch: identification of the issuing point
- Series: default series for issued CFE
- Environment:
test(homologation) orprod(production)
Output
Section titled “Output”{ "tipoCfe": 111, "serie": "A", "numero": 159, "codigoSeguridad": "AB12CD34", "montoTotal": 1220, "totals": { "neto": 1000, "iva": 220 }, "estado": "issued", "xml": "<CFE>...signed...</CFE>"}Usage Example
Section titled “Usage Example”e-Invoice with one item taxed at 22%
Section titled “e-Invoice with one item taxed at 22%”{ "credentials_id": "cred-dgi-prod", "cfe": { "tipoCfe": 111, "receptor": { "tipoDocumento": 2, "documento": "212345670010", "razonSocial": "Cliente SA" }, "items": [ { "descripcion": "Consulting service", "cantidad": 1, "precioUnitario": 1000, "indicadorIva": "22" } ] }}- The
cfe.itemsfield is required and must have at least one item; if missing, the node returns an error without consuming numbering. - The number is consumed atomically from the active CAE: if no CAE is loaded or it is exhausted for that type/series, issuance fails before generating the XML.
- If the credential’s .p12 certificate is expired, the node rejects issuance with an explicit error.
- The signed XML returned in
xmlis the same one needed by DgiEnviarReceptor and DgiReporteDiario; there is no need to regenerate it.
Related Nodes
Section titled “Related Nodes”- DgiCargarCAE - Load the CAE before issuing
- DgiEnviarReceptor - Send the issued CFE to the recipient
- DgiReporteDiario - Report the CFE to the DGI