get_saved_payment_method
Retrieve a customer's saved payment method from Paddle using customer and payment method IDs to access stored checkout details for future purchases.
Instructions
This tool will retrieve a payment method for a customer from Paddle using its ID and related customer ID.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customerId | Yes | Paddle ID of the customer. | |
| paymentMethodId | Yes | Paddle ID of the payment method. |
Implementation Reference
- src/functions.ts:399-410 (handler)The core handler function that executes the tool logic: retrieves a specific saved payment method for a customer using the Paddle SDK's paymentMethods.get method.export const getSavedPaymentMethod = async ( paddle: Paddle, params: z.infer<typeof Parameters.getSavedPaymentMethodParameters>, ) => { try { const { customerId, paymentMethodId } = params; const paymentMethod = await paddle.paymentMethods.get(customerId, paymentMethodId); return paymentMethod; } catch (error) { return error; } };
- src/tools.ts:650-660 (schema)Tool schema definition including the method name, description, Zod parameters schema reference, and required actions for the get_saved_payment_method tool.method: "get_saved_payment_method", name: "Get a payment method saved for a customer", description: prompts.getSavedPaymentMethodPrompt, parameters: params.getSavedPaymentMethodParameters, actions: { savedPaymentMethods: { read: true, get: true, }, }, },
- src/api.ts:41-43 (registration)Registration of the getSavedPaymentMethod handler in the toolMap object, mapping the tool method constant to its implementation.[TOOL_METHODS.LIST_SAVED_PAYMENT_METHODS]: funcs.listSavedPaymentMethods, [TOOL_METHODS.GET_SAVED_PAYMENT_METHOD]: funcs.getSavedPaymentMethod, [TOOL_METHODS.DELETE_SAVED_PAYMENT_METHOD]: funcs.deleteSavedPaymentMethod,
- src/constants.ts:33-35 (helper)Constant definition for the tool method name used across registration and tool definitions.LIST_SAVED_PAYMENT_METHODS: "list_saved_payment_methods", GET_SAVED_PAYMENT_METHOD: "get_saved_payment_method", DELETE_SAVED_PAYMENT_METHOD: "delete_saved_payment_method",