get_transaction_invoice
Retrieve a temporary link to download or view transaction invoice PDFs from Paddle for payment verification and tax reporting purposes.
Instructions
This tool will retrieve a link to an invoice PDF for a transaction from Paddle.
Invoice PDFs are available for both automatically and manually-collected transactions:
The PDF for manually-collected transactions includes payment terms, purchase order number, and notes for the customer. It's a demand for payment from the customer. Available for transactions billed or completed.
The PDF for automatically-collected transactions lets the customer know that payment was taken successfully. Customers may require this for for tax-reporting purposes. Available for transactions completed.
Invoice PDFs aren't available for zero-value transactions.
The link returned isn't a permanent link. It expires after an hour.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| transactionId | Yes | Paddle ID of the transaction. | |
| disposition | No | Determine whether the generated URL should download the PDF as an attachment saved locally, or open it inline in the browser. If omitted, defaults to `attachment`. |
Implementation Reference
- src/functions.ts:703-718 (handler)The main handler function that retrieves the invoice PDF for a given transaction ID using the Paddle SDK. Handles optional query parameters and returns the result or error.export const getTransactionInvoice = async ( paddle: Paddle, params: z.infer<typeof Parameters.getTransactionInvoiceParameters>, ) => { try { const { transactionId, ...queryParams } = params; const hasQueryParams = Object.keys(queryParams).length > 0; const transaction = await paddle.transactions.getInvoicePDF( transactionId, hasQueryParams ? queryParams : undefined, ); return transaction; } catch (error) { return error; } };
- src/tools.ts:457-467 (schema)Defines the tool configuration including the method name, human-readable name, description prompt, Zod input schema reference, and required permissions (read and get on transactions). Used for MCP tool registration.method: "get_transaction_invoice", name: "Get a PDF invoice for a transaction", description: prompts.getTransactionInvoicePrompt, parameters: params.getTransactionInvoiceParameters, actions: { transactions: { read: true, get: true, }, }, },
- src/api.ts:65-65 (registration)Registers the getTransactionInvoice handler function under the tool method constant in the toolMap. This mapping is used by PaddleAPI.run() to dispatch calls to the correct function.[TOOL_METHODS.GET_TRANSACTION_INVOICE]: funcs.getTransactionInvoice,
- src/constants.ts:57-57 (helper)Exports the string constant for the tool method name, used in tool mappings, registrations, and configurations across the codebase.GET_TRANSACTION_INVOICE: "get_transaction_invoice",
- src/prompts.ts:1076-1087 (helper)Provides the detailed description/prompt for the tool, explaining usage, availability conditions, and link expiration. Referenced in tools.ts.export const getTransactionInvoicePrompt = ` This tool will retrieve a link to an invoice PDF for a transaction from Paddle. Invoice PDFs are available for both automatically and manually-collected transactions: - The PDF for manually-collected transactions includes payment terms, purchase order number, and notes for the customer. It's a demand for payment from the customer. Available for transactions billed or completed. - The PDF for automatically-collected transactions lets the customer know that payment was taken successfully. Customers may require this for for tax-reporting purposes. Available for transactions completed. Invoice PDFs aren't available for zero-value transactions. The link returned isn't a permanent link. It expires after an hour. `;