get_adjustment_credit_note
Retrieve a temporary link to download or view a credit note PDF for a refund or credit adjustment in Paddle, providing customers with immediate documentation.
Instructions
This tool will retrieve a link to a credit note PDF for an adjustment from Paddle.
Credit note PDFs are created for refunds and credits as a record of an adjustment. Return this if record is needed to be given to the customer immediately after the adjustment is created.
The link returned is not a permanent link. It expires after an hour.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adjustmentId | Yes | Paddle ID of the adjustment. | |
| disposition | No | Determine whether the generated URL should download the PDF as an attachment saved locally, or open it inline in the browser. |
Implementation Reference
- src/functions.ts:230-245 (handler)The main handler function that executes the tool logic by calling paddle.adjustments.getCreditNotePDF to retrieve the credit note PDF for the specified adjustment ID, with optional query parameters.export const getAdjustmentCreditNote = async ( paddle: Paddle, params: z.infer<typeof Parameters.getAdjustmentCreditNoteParameters>, ) => { try { const { adjustmentId, ...queryParams } = params; const hasQueryParams = Object.keys(queryParams).length > 0; const adjustment = await paddle.adjustments.getCreditNotePDF( adjustmentId, hasQueryParams ? queryParams : undefined, ); return adjustment; } catch (error) { return error; } };
- src/tools.ts:492-503 (schema)Tool definition including the Zod schema reference for input parameters (params.getAdjustmentCreditNoteParameters).{ method: "get_adjustment_credit_note", name: "Get a PDF credit note for an adjustment", description: prompts.getAdjustmentCreditNotePrompt, parameters: params.getAdjustmentCreditNoteParameters, actions: { adjustments: { read: true, get: true, }, }, },
- src/api.ts:27-27 (registration)Maps the tool method constant to the handler function in the toolMap used by PaddleAPI to execute tools.[TOOL_METHODS.GET_ADJUSTMENT_CREDIT_NOTE]: funcs.getAdjustmentCreditNote,
- src/constants.ts:19-19 (registration)Defines the tool method string constant used in tool registration.GET_ADJUSTMENT_CREDIT_NOTE: "get_adjustment_credit_note",
- src/prompts.ts:494-500 (helper)Prompt providing description and usage guidance for the tool.export const getAdjustmentCreditNotePrompt = ` This tool will retrieve a link to a credit note PDF for an adjustment from Paddle. Credit note PDFs are created for refunds and credits as a record of an adjustment. Return this if record is needed to be given to the customer immediately after the adjustment is created. The link returned is not a permanent link. It expires after an hour. `;