Skip to content

list-saved-payment-methods ​

Method: GET
Path: /customers/{customer_id}/payment-methods

Tags: 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.

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:

typescript
// Uses customer_id from active session
const { data, error } = await sdk.customer.listSavedPaymentMethods();

// With explicit customer_id
const { data: explicit } = 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 ​

typescript
"list-saved-payment-methods": {
        parameters: {
            query?: {
                /** @description Comma-separated `UPI_COLLECT`, `CARD` and `WALLET`, case-insensitive. Unrecognized entries are ignored; with no recognized entry, returns all methods. */
                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"];
                        };
                    };
                };
            };
            /** @description `payment-gateway-error`: payment configuration failed. */
            400: components["responses"]["BadRequest"];
            401: components["responses"]["Unauthorized"];
            403: components["responses"]["Forbidden"];
            404: components["responses"]["NotFound"];
            500: components["responses"]["InternalServerError"];
            504: components["responses"]["GatewayTimeout"];
        };
    };

Component References ​

ReferenceResolves To
components["schemas"]["SavedPaymentMethod"]SavedPaymentMethod
components["responses"]["BadRequest"]BadRequest
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["Forbidden"]Forbidden
components["responses"]["NotFound"]NotFound
components["responses"]["InternalServerError"]InternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Parameters ​

  • payment_methods (query): Comma-separated UPI_COLLECT, CARD and WALLET, case-insensitive. Unrecognized entries are ignored; with no recognized entry, returns all methods.

Responses ​

200 ​

OK

400 ​

Bad request

401 ​

Authentication failed. Codes include token-required, token-expired and token_not_valid for an invalid or expired token.

403 ​

Access denied. token-required requires an authenticated session; permission-denied means the caller cannot access this resource. On POS, session-expired requires signing in again.

404 ​

Requested resource not found

500 ​

The request failed because of an unexpected error.

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "tags": [
    "Saved payment methods"
  ],
  "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": "Comma-separated `UPI_COLLECT`, `CARD` and `WALLET`, case-insensitive. Unrecognized entries are ignored; with no recognized entry, returns all methods.",
      "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."
        }
      }
    },
    "400": {
      "description": "`payment-gateway-error`: payment configuration failed.",
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "500": {
      "$ref": "#/components/responses/InternalServerError"
    },
    "504": {
      "$ref": "#/components/responses/GatewayTimeout"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "customers",
  "x-speakeasy-ignore": false,
  "x-speakeasy-name-override": "listSavedPaymentMethods"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: