list_saved_payment_methods
Retrieve saved payment methods for a customer to present at checkout, filtering by address and checkout support with paginated results.
Instructions
This tool will list payment methods for a customer in Paddle.
These are payment methods saved by the customer at checkout to be presented for future purchases. They aren't payment methods stored for transactions related to a recurring subscription. View a customers most recently used payment method for purchases or subscriptions by listing transactions (with the list_transactions tool) with a filter of customerId or subscriptionId, and looking at the returned payments[].methodDetails object.
Use the maximum perPage by default (200) to ensure comprehensive results. Filter payment methods by addressId and supportsCheckout as needed. Results are paginated - use the 'after' parameter with the last ID from previous results to get the next page. Sort and order results using the orderBy parameter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customerId | Yes | Paddle ID of the customer. | |
| addressId | No | Return entities related to the specified address. Use a comma-separated list to specify multiple address IDs. | |
| after | No | Return entities after the specified Paddle ID when working with paginated endpoints. | |
| orderBy | No | Order returned entities by the specified field and direction. | |
| perPage | No | Set how many entities are returned per page. Returns the maximum number of results if a number greater than the maximum is requested. | |
| supportsCheckout | No | Return entities that support being presented at checkout (`true`) or not (`false`). |
Implementation Reference
- src/functions.ts:384-397 (handler)The core handler function implementing the logic to list saved payment methods for a given customer using the Paddle SDK. It handles pagination and errors.export const listSavedPaymentMethods = async ( paddle: Paddle, params: z.infer<typeof Parameters.listSavedPaymentMethodsParameters>, ) => { try { const { customerId, ...queryParams } = params; const collection = paddle.paymentMethods.list(customerId, queryParams); const paymentMethods = await collection.next(); const pagination = paginationData(collection); return { pagination, paymentMethods }; } catch (error) { return error; } };
- src/tools.ts:638-648 (schema)Tool configuration including the Zod input schema reference, description prompt, and required permissions/actions for listing saved payment methods.method: "list_saved_payment_methods", name: "List payment methods saved for a customer", description: prompts.listSavedPaymentMethodsPrompt, parameters: params.listSavedPaymentMethodsParameters, actions: { savedPaymentMethods: { read: true, list: true, }, }, },
- src/api.ts:41-41 (registration)Maps the tool method constant to its handler function in the PaddleAPI toolMap for execution.[TOOL_METHODS.LIST_SAVED_PAYMENT_METHODS]: funcs.listSavedPaymentMethods,
- src/constants.ts:33-33 (registration)Defines the string constant for the tool method name used across the codebase.LIST_SAVED_PAYMENT_METHODS: "list_saved_payment_methods",
- src/functions.ts:10-13 (helper)Helper function used by the handler to extract pagination metadata from the Paddle collection.const paginationData = (collection: PaginatedCollection) => ({ hasMore: collection.hasMore, estimatedTotal: collection.estimatedTotal, });