Convert Document
convert_documentConvert document details to an invoice, estimate, receipt, credit note, or refund PDF. HTTP calls can return a temporary download link.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"document": {
"to": {
"name": "Client"
},
"from": {
"name": "Acme"
},
"doc_type": "estimate"
},
"target_type": "invoice"
},
"name": "convert_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document | Yes | Stateless input document JSON payload to transform. | |
| due_days | No | Days until payment due. | |
| target_type | Yes | Target type (invoice, receipt, estimate, credit_note, refund). | |
| payment_link | No | HTTPS link supplied by the user to include in the document. | |
| credit_reason | No | Credit note or refund reason. | |
| payment_qr_code | No | Embed SVG vector QR code. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document | Yes | Converted document JSON. | |
| download | No | Temporary file link for HTTP tool calls. | |
| pdf_base64 | Yes | Base64 vector PDF. | |
| download_error | No | Why a temporary download link could not be created. The embedded PDF is still available. | |
| compile_time_ms | Yes | Compile time in ms. |