Skip to content

DgiEmitirCFE

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.

FieldTypeRequiredDescription
credentials_idcredentialsYesdgi credential (.p12 certificate + RUT + environment)
cfejsonNoReceipt as JSON: tipoCfe (101 e-Ticket, 111 e-Invoice), recipient, items. If empty, the input data is used
firma_sha256booleanNoSign 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.

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) or prod (production)
{
"tipoCfe": 111,
"serie": "A",
"numero": 159,
"codigoSeguridad": "AB12CD34",
"montoTotal": 1220,
"totals": { "neto": 1000, "iva": 220 },
"estado": "issued",
"xml": "<CFE>...signed...</CFE>"
}
{
"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.items field 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 xml is the same one needed by DgiEnviarReceptor and DgiReporteDiario; there is no need to regenerate it.