list-saved-payment-methods
Method: GET
Path: /customers/{customer_id}/payment-methods
Tags: Customers
Summary
List all saved payment methods
Description
This endpoint acts as a proxy for JusPay's Fetch Saved Payment Methods API. It enables to securely retrieve a list of payment methods (such as saved cards, UPI handles, wallets) that have been previously stored for a given customer.
The operation helps streamline the checkout flow by allowing users to quickly select from existing payment methods, reducing input friction and improving conversion.
You can filter the results by payment method type using the payment_method query parameter. Multiple payment methods can be specified by separating them with commas (e.g., payment_method=upi_collect,card,wallet).
API documentation of JusPay can be found at below link:
https://juspay.io/in/docs/api-reference/docs/express-checkout/fetch-saved-payment-methods
Storefront SDK Usage
SDK Method: sdk.customer.listSavedPaymentMethods()
Example:
const { data, error } = await sdk.customer.listSavedPaymentMethods({
customer_id: "customer_123"
});
if (error) {
console.error("Failed to list saved payment methods:", error);
return;
}
console.log("Saved payment methods:", data.saved_payment_methods);TypeScript Definition
"list-saved-payment-methods": {
parameters: {
query?: {
/** @description Filter payment methods by type. Accepts multiple payment method types separated by commas. Example: payment_method=upi_collect,card,wallet. Available payment method types include: upi_collect, card, wallet. */
payment_methods?: string;
};
header?: never;
path: {
/** @description Customer Id */
customer_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message?: string;
success?: boolean;
content?: {
saved_payment_methods?: components["schemas"]["SavedPaymentMethod"];
};
};
};
};
401: components["responses"]["Unauthorized"];
404: components["responses"]["NotFound"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["SavedPaymentMethod"] | SavedPaymentMethod |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["NotFound"] | NotFound |
Parameters
- payment_methods (query): Filter payment methods by type. Accepts multiple payment method types separated by commas. Example: payment_method=upi_collect,card,wallet. Available payment method types include: upi_collect, card, wallet.
Responses
200
OK
401
Not authorized for given operation on the Resource
404
Requested resource not found
OpenAPI Definition
{
"tags": [
"Customers"
],
"operationId": "list-saved-payment-methods",
"summary": "List all saved payment methods",
"description": "This endpoint acts as a proxy for JusPay's Fetch Saved Payment Methods API. It enables to securely retrieve a list of payment methods (such as saved cards, UPI handles, wallets) that have been previously stored for a given customer.\n\nThe operation helps streamline the checkout flow by allowing users to quickly select from existing payment methods, reducing input friction and improving conversion.\n\nYou can filter the results by payment method type using the payment_method query parameter. Multiple payment methods can be specified by separating them with commas (e.g., payment_method=upi_collect,card,wallet).\n\nAPI documentation of JusPay can be found at below link:\n\nhttps://juspay.io/in/docs/api-reference/docs/express-checkout/fetch-saved-payment-methods",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/list-saved-payment-methods",
"description": "API reference for the list-saved-payment-methods operation"
},
"parameters": [
{
"name": "payment_methods",
"in": "query",
"description": "Filter payment methods by type. Accepts multiple payment method types separated by commas. Example: payment_method=upi_collect,card,wallet. Available payment method types include: upi_collect, card, wallet.",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"saved_payment_methods": {
"$ref": "#/components/schemas/SavedPaymentMethod"
}
},
"type": "object"
}
}
}
}
},
"links": {
"CreateOrder": {
"operationId": "create-order",
"description": "Create an order using a saved payment method. Use the saved payment method details to construct a `JusPayExpressCheckout` payment method payload."
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "customers",
"x-speakeasy-ignore": false,
"x-speakeasy-name-override": "listSavedPaymentMethods"
}Auto-generated from OpenAPI spec and TypeScript definitions