Export document pdf
export_document_pdfSave a document (invoice, quote, credit note or any other kind) as a PDF in the business's Files, drawn as the customer sees it. Answers the new file's id and name: cite it as a file tag so the user can open and download it. Each call saves a new copy, so call it once per request. The file is kept, not imported into the books. A missing or another business's id is refused with reason document-not-found. With share true it also turns on the document's PUBLIC link and answers it as link (shared true): anyone who holds the link can open the document and download its PDF, so send it only to the customer. The link is the one the app's Copy link hands out, the same each call; it is switched off from the document's share settings, not by deleting the file. share true needs invoice write.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "export_document_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The invoice, quote, credit note or other document to save as a PDF, from list_invoices or get_document. | |
| share | No | true also turns on the document's public link and returns it as link, for the user to send the customer. Needs invoice write. Omit it to only save the PDF. |