Download invoice PDF
get_invoice_pdfRetrieve the PDF of an issued invoice to read, attach, or save. Returns the file as a path or base64.
Instructions
Fetch the PDF of an already-issued invoice, for when the user wants the document itself — to read it, attach it somewhere, or save a copy. Read-only.
Returns either a path on the server's filesystem or base64 bytes, depending on how the server is running; force one with as. To send the invoice to the client by email, use send_document_email instead — that does not require downloading it first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as | No | How to return the PDF: 'file' writes it to the server's download directory and returns the path; 'base64' returns the bytes inline. Defaults to whichever suits the transport in use. | |
| number | Yes | Invoice number, without the series prefix. | |
| seriesName | No | Invoice series. Falls back to the configured default. | |
| companyVatCode | No | Issuing company CIF. Falls back to SMARTBILL_VAT_CODE. |