BillptDownloadDocument
Description
Section titled “Description”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 binarybufferfor storage nodes. - Automatic propagation: If
document_idandtoken_downloadcome from the previous node (BillptCreateDocument, BillptGetDocuments), no manual config is needed.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Bill.pt credential (determines sandbox/production environment) |
| document_id | text | No | Document ID. Defaults to document_id or id from the previous node output |
| token_download | text | No | Download token. Defaults to token_download from the previous node output |
| output_format | select | No | base64 (default) or binary buffer |
| filename | text | No | Suggested filename. Default: billpt_{document_id}.pdf |
Where to get token_download
Section titled “Where to get token_download”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"}Output (base64)
Section titled “Output (base64)”{ "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"}Typical Workflow
Section titled “Typical Workflow”BillptCreateInvoiceFromShopify → HubfiscalStoreBillpt → BillptDownloadDocument ← downloads the PDF → SendEmail (attach pdf_base64)- The download endpoint is not under the
/api/1.0/prefix — it useshttps://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_bytesfield lets downstream nodes validate that the PDF is not empty before attaching or storing it.
Related Nodes
Section titled “Related Nodes”- BillptCreateDocument - Create a document and obtain token_download
- BillptCreateInvoiceFromShopify - Create an invoice from a Shopify order
- BillptGetDocuments - Query documents and their tokens
- HubfiscalStoreBillpt - Store Bill.pt result in Hub Fiscal