> ## Documentation Index
> Fetch the complete documentation index at: https://polar.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List Customer Payment Methods

> Get saved payment methods of the authenticated customer.

<Note>
  To change the default payment method, call the [`PATCH /v1/customer-portal/customers/me`](/api-reference/customer-portal/update-customer) endpoint with the desired `default_payment_method_id`.
</Note>


## OpenAPI

````yaml get /v1/customer-portal/customers/me/payment-methods
openapi: 3.1.0
info:
  title: Polar API
  summary: Polar HTTP and Webhooks API
  description: Read the docs at https://polar.sh/docs/api-reference
  version: 0.1.0
servers:
  - url: https://api.polar.sh
    description: Production environment
    x-speakeasy-server-id: production
  - url: https://sandbox-api.polar.sh
    description: Sandbox environment
    x-speakeasy-server-id: sandbox
security:
  - access_token: []
tags:
  - name: public
    description: >-
      Endpoints shown and documented in the Polar API documentation and
      available in our SDKs.
  - name: private
    description: >-
      Endpoints that should appear in the schema only in development to generate
      our internal JS SDK.
  - name: mcp
    description: Endpoints enabled in the MCP server.
paths:
  /v1/customer-portal/customers/me/payment-methods:
    get:
      tags:
        - customer_portal
        - customers
        - public
      summary: List Customer Payment Methods
      description: Get saved payment methods of the authenticated customer.
      operationId: customer_portal:customers:list_payment_methods
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            exclusiveMinimum: 0
            description: Page number, defaults to 1.
            default: 1
            title: Page
          description: Page number, defaults to 1.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            exclusiveMinimum: 0
            description: Size of a page, defaults to 10. Maximum is 100.
            default: 10
            title: Limit
          description: Size of a page, defaults to 10. Maximum is 100.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_CustomerPaymentMethod_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Customers.ListPaymentMethods(ctx, operations.CustomerPortalCustomersListPaymentMethodsSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, polargo.Pointer[int64](1), polargo.Pointer[int64](10))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomerPaymentMethod != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customers.list_payment_methods(security=polar_sdk.CustomerPortalCustomersListPaymentMethodsSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customers.listPaymentMethods({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalCustomersListPaymentMethodsSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $responses = $sdk->customerPortal->customers->listPaymentMethods(
                security: $requestSecurity,
                page: 1,
                limit: 10

            );



            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
components:
  schemas:
    ListResource_CustomerPaymentMethod_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CustomerPaymentMethod'
            title: CustomerPaymentMethod
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[CustomerPaymentMethod]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CustomerPaymentMethod:
      anyOf:
        - $ref: '#/components/schemas/PaymentMethodCard'
        - $ref: '#/components/schemas/PaymentMethodGeneric'
    Pagination:
      properties:
        total_count:
          type: integer
          title: Total Count
        max_page:
          type: integer
          title: Max Page
      type: object
      required:
        - total_count
        - max_page
      title: Pagination
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PaymentMethodCard:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation timestamp of the object.
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
          description: Last modification timestamp of the object.
        processor:
          $ref: '#/components/schemas/PaymentProcessor'
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        type:
          type: string
          const: card
          title: Type
        method_metadata:
          $ref: '#/components/schemas/PaymentMethodCardMetadata'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - processor
        - customer_id
        - type
        - method_metadata
      title: PaymentMethodCard
    PaymentMethodGeneric:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation timestamp of the object.
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
          description: Last modification timestamp of the object.
        processor:
          $ref: '#/components/schemas/PaymentProcessor'
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        type:
          type: string
          title: Type
      type: object
      required:
        - id
        - created_at
        - modified_at
        - processor
        - customer_id
        - type
      title: PaymentMethodGeneric
    PaymentProcessor:
      type: string
      enum:
        - stripe
      title: PaymentProcessor
    PaymentMethodCardMetadata:
      properties:
        brand:
          type: string
          title: Brand
        last4:
          type: string
          title: Last4
        exp_month:
          type: integer
          title: Exp Month
        exp_year:
          type: integer
          title: Exp Year
        wallet:
          anyOf:
            - type: string
            - type: 'null'
          title: Wallet
      type: object
      required:
        - brand
        - last4
        - exp_month
        - exp_year
      title: PaymentMethodCardMetadata
  securitySchemes:
    access_token:
      type: http
      scheme: bearer
      description: >-
        You can generate an **Organization Access Token** from your
        organization's settings.
    customer_session:
      type: http
      description: >-
        Customer session tokens are specific tokens that are used to
        authenticate customers on your organization. You can create those
        sessions programmatically using the [Create Customer Session
        endpoint](/api-reference/customer-portal/sessions/create).
      scheme: bearer
    member_session:
      type: http
      description: >-
        Member session tokens are specific tokens that are used to authenticate
        members on your organization. You can create those sessions
        programmatically using the [Create Member Session
        endpoint](/api-reference/member-portal/sessions/create).
      scheme: bearer

````