Skip to content

OpenFacturaPDF

Downloads the PDF representation or the XML of an Electronic Tax Document (DTE) already issued in OpenFactura, given its internal ID. This is the final step of the typical flow: issue the DTE, confirm its status with the SII, and then fetch the document to hand it to the customer or archive it.

FieldTypeRequiredDescription
credentials_idcredentialsYesOpenFactura credential
dte_idtextYesDTE ID in OpenFactura
formatselectNoFormat to download: PDF or XML (default: pdf)

This module requires an openfactura credential type with the following fields:

  • API Key: OpenFactura/Haulmer API key (sent in the apikey header)
  • Environment: production (live environment) or any other value to use the test environment (sandbox)
{
"success": true,
"dte_id": "12345",
"format": "pdf",
"content": "...",
"content_type": "application/pdf",
"filename": "dte_12345.pdf",
"raw": { ... }
}
{
"credentials_id": "cred-openfactura-prod",
"dte_id": "12345",
"format": "pdf"
}
  • dte_id is required: it is the identifier returned by OpenFacturaDTE when the document was issued (not the SII trackId).
  • format only accepts pdf or xml; any other value results in an error.
  • The suggested filename in the response follows the pattern dte_{id}.{format}.
  • It is best to download the document only after confirming with OpenFacturaConsulta that the DTE was accepted by the SII.