Skip to content

BillptDownloadDocument

Downloads the PDF file of a document created in Bill.pt using the public endpoint /documentos/download/{id}/{token}.

Key features:

  • No extra authentication: The download token is embedded in the URL — no authorization headers required.
  • First download / copies: The first download returns the original document; subsequent downloads include a second-copy watermark per Portuguese tax regulations.
  • Flexible output: Returns the PDF as base64 (compatible with email, HTTP, etc.) or as a binary buffer for storage nodes.
  • Automatic propagation: If document_id and token_download come from the previous node (BillptCreateDocument, BillptGetDocuments), no manual config is needed.
FieldTypeRequiredDescription
credentials_idcredentialsYesBill.pt credential (determines sandbox/production environment)
document_idtextNoDocument ID. Defaults to document_id or id from the previous node output
token_downloadtextNoDownload token. Defaults to token_download from the previous node output
output_formatselectNobase64 (default) or binary buffer
filenametextNoSuggested filename. Default: billpt_{document_id}.pdf

The token_download field is part of the Bill.pt response when creating or querying a document. It is included in the output of:

  • BillptCreateDocument — in data.document.token_download
  • BillptGetDocuments — in each data.documents[].token_download
  • BillptCreateInvoiceFromShopify — in data.document.token_download

If you connect this node directly after any of them, the field propagates automatically.

The node accepts the output of any Bill.pt node that returns document_id and token_download:

{
"success": true,
"document_id": 12345,
"token_download": "a1b2c3d4e5f6...",
"fiscal_doc_number": "FT 2025/1042"
}
{
"success": true,
"document_id": "12345",
"filename": "billpt_12345.pdf",
"content_type": "application/pdf",
"size_bytes": 45230,
"pdf_base64": "JVBERi0xLjQKJ...",
"message": "PDF descargado (45230 bytes) — billpt_12345.pdf"
}
BillptCreateInvoiceFromShopify
→ HubfiscalStoreBillpt
→ BillptDownloadDocument ← downloads the PDF
→ SendEmail (attach pdf_base64)
  • The download endpoint is not under the /api/1.0/ prefix — it uses https://app.bill.pt/documentos/download/{id}/{token} directly.
  • If the token is incorrect or the document does not exist, Bill.pt returns HTTP 404/403, which the node captures and returns as a workflow error.
  • The size_bytes field lets downstream nodes validate that the PDF is not empty before attaching or storing it.