Skip to main content
Glama
PaddleHQ
by PaddleHQ

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

TableJSON Schema
NameRequiredDescriptionDefault
customerIdYesPaddle ID of the customer.
addressIdNoReturn entities related to the specified address. Use a comma-separated list to specify multiple address IDs.
afterNoReturn entities after the specified Paddle ID when working with paginated endpoints.
orderByNoOrder returned entities by the specified field and direction.
perPageNoSet how many entities are returned per page. Returns the maximum number of results if a number greater than the maximum is requested.
supportsCheckoutNoReturn entities that support being presented at checkout (`true`) or not (`false`).

Implementation Reference

  • 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; } };
  • 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",
  • Helper function used by the handler to extract pagination metadata from the Paddle collection.
    const paginationData = (collection: PaginatedCollection) => ({ hasMore: collection.hasMore, estimatedTotal: collection.estimatedTotal, });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PaddleHQ/paddle-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server