get_invoice_pdf
Return the printable rendering of a document, as a PDF.
Works for both types — a DANFE for nfe, a DANFSe for nfse. The PDF comes back base64-encoded in content_base64, with its size in size_bytes; the XML, not this, is the legally valid document. A PDF above 2 MB is not inlined: the answer says to download it from the API instead. A 502 from here means the authorizer is unavailable, not that the invoice is wrong.
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": {
"access_key": "<access_key>",
"document_type": "<document_type>"
},
"name": "get_invoice_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| access_key | Yes | The access key (chave de acesso) the authorizer assigned, as issue_invoice and list_invoices return it. An NF-e key has 44 characters; the issuer's CNPJ inside it may carry letters since July 2026, so copy it exactly. | |
| company_id | No | UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both. | |
| document_type | Yes | nfse for a service invoice, nfe for goods. | |
| company_tax_id | No | CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| access_key | Yes | ||
| size_bytes | No | Size of the decoded PDF, in bytes. | |
| content_type | No | application/pdf | |
| content_base64 | Yes | The PDF bytes, base64-encoded. Decode before saving. |