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

# List a customer's payment methods

> Returns a list of payment methods attached to the specified customer, sorted by ID in descending order (most recently created first).



## OpenAPI

````yaml /openapi.json get /v1/customers/{id}/payment_methods
openapi: 3.1.0
info:
  title: Flex API
  description: >-
    The Flex API powers HSA/FSA payment processing for healthcare commerce:
    checkout sessions, payment intents, subscriptions, customers, refunds,
    disputes, and eligibility. Authenticate with your partner API key as a
    Bearer token. All endpoints are scoped to your partner account, and test
    mode is fully supported via test API keys.
  version: 0.1.0
servers:
  - url: https://api.withflex.com
security:
  - BearerAuth: []
tags:
  - name: Balance Transactions
  - name: Captures
  - name: Checkout Sessions
  - name: Coupons
  - name: Customers
  - name: Disputes
  - name: Events
  - name: Exports
  - name: Files
  - name: Invoices
  - name: Letters
  - name: Orders
  - name: Payment Intents
  - name: Payment Links
  - name: Payouts
  - name: Prices
  - name: Products
  - name: Promo Codes
  - name: Receipts
  - name: Refunds
  - name: Setup Intents
  - name: Shipping Rates
  - name: Subscriptions
paths:
  /v1/customers/{id}/payment_methods:
    get:
      tags:
        - Customers
      summary: List a customer's payment methods
      description: >-
        Returns a list of payment methods attached to the specified customer,
        sorted by ID in descending order (most recently created first).
      operationId: v1.payment_methods.list
      parameters:
        - in: path
          name: id
          required: true
          schema:
            examples:
              - fcus_01J9XR8M3K7VZ8N2YB4WJ6T0RA
            type: string
          style: simple
          example: fcus_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        - in: query
          name: limit
          description: >-
            A limit on the number of objects to be returned. Limit can range
            between 1 and 100, and the default is 10.
          schema:
            description: >-
              A limit on the number of objects to be returned. Limit can range
              between 1 and 100, and the default is 10.
            examples:
              - 10
            type:
              - integer
              - 'null'
            format: int32
          style: form
          example: 10
        - in: query
          name: offset
          description: Number of objects to skip before returning results.
          schema:
            description: Number of objects to skip before returning results.
            examples:
              - 3
            type:
              - integer
              - 'null'
            format: int32
          style: form
          example: 3
        - in: query
          name: include_org
          description: >-
            Resolve payment methods for a customer owned by a sibling partner in
            the same organization (PII opt-in). Defaults to `false`; a
            sibling-owned customer returns `404` unless this is `true` and the
            caller shares an organization with the owner. A sibling-owned
            payment method's `metadata` is returned as `null`.
          schema:
            description: >-
              Resolve payment methods for a customer owned by a sibling partner
              in the same organization (PII opt-in). Defaults to `false`; a
              sibling-owned customer returns `404` unless this is `true` and the
              caller shares an organization with the owner. A sibling-owned
              payment method's `metadata` is returned as `null`.
            type:
              - boolean
              - 'null'
          style: form
      responses:
        '200':
          description: An envelope wrapping a list of payment method objects.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/MultiplePaymentMethodsBody_for_V1PaymentMethod
              example:
                payment_methods:
                  - payment_method_id: fpm_01J9XR8M3K7VZ8N2YB4WJ6T0RA
                    billing_details: {}
                    metadata:
                      order_id: '8842'
                      channel: shopify
                    card: {}
                    created_at: '2026-06-15T14:30:00Z'
                    test_mode: false
                    off_session: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              example:
                detail:
                  - loc:
                      - string
                    msg: string
                    type: string
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
      security:
        - BearerAuth:
            - customers:read
components:
  schemas:
    MultiplePaymentMethodsBody_for_V1PaymentMethod:
      description: An envelope wrapping a list of payment method objects.
      type: object
      required:
        - payment_methods
      properties:
        payment_methods:
          description: The list of payment methods.
          type: array
          items:
            $ref: '#/components/schemas/V1PaymentMethod'
      example:
        payment_methods:
          - payment_method_id: fpm_01J9XR8M3K7VZ8N2YB4WJ6T0RA
            billing_details: {}
            metadata:
              order_id: '8842'
              channel: shopify
            card: {}
            created_at: '2026-06-15T14:30:00Z'
            test_mode: false
            off_session: false
    HttpErrorOut:
      title: HttpError
      description: The error response returned when a request cannot be completed.
      type: object
      required:
        - code
        - detail
      properties:
        code:
          description: A short machine-readable error code identifying the type of error.
          type: string
        detail:
          description: A human-readable explanation of what went wrong.
          type: string
      example:
        code: string
        detail: string
    HTTPValidationError:
      description: The error response returned when request validation fails (HTTP 422).
      type: object
      required:
        - detail
      properties:
        detail:
          description: The list of validation errors, one entry per invalid field.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
      example:
        detail:
          - loc:
              - string
            msg: string
            type: string
    V1PaymentMethod:
      description: >-
        A PaymentMethod object represents a customer's payment instrument (such
        as a card) that can be used to collect payments. Attach it to a Customer
        to reuse it across checkout sessions, invoices, and subscriptions.
      type: object
      required:
        - billing_details
        - card
        - created_at
        - customer
        - off_session
        - payment_method_id
        - test_mode
      properties:
        payment_method_id:
          description: The ID of the PaymentMethod.
          type: string
          example: fpm_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        billing_details:
          $ref: '#/components/schemas/BillingDetails'
          description: >-
            Billing information associated with the PaymentMethod that may be
            used or required by particular types of payment methods.
        customer:
          $ref: '#/components/schemas/Expandable_for_Customer'
          description: >-
            The customer this payment method is attached to. Returned as the
            customer ID by default; expandable to the full Customer object.
        metadata:
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
          type:
            - object
            - 'null'
          additionalProperties:
            type: object
          example:
            order_id: '8842'
            channel: shopify
        card:
          $ref: '#/components/schemas/V1Card'
          description: User card details.
        created_at:
          $ref: '#/components/schemas/Timestamptz'
          description: Time at which the object was created. ISO 8601 format.
          example: '2026-06-15T14:30:00Z'
        test_mode:
          description: Whether this PaymentMethod is in test mode.
          type: boolean
          example: false
        off_session:
          description: >-
            Whether this PaymentMethod is valid for off_session (customer not
            present) purchase flows.
          type: boolean
          example: false
      example:
        payment_method_id: fpm_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        billing_details:
          address: {}
          email: john.doe@example.com
          name: Example
          phone: '+14155550142'
        customer: fcus_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        metadata:
          order_id: '8842'
          channel: shopify
        card:
          brand: american_express
          country: example_value
          exp_month: 12
          exp_year: 2027
          funding: credit
          last4: example_value
        created_at: '2026-06-15T14:30:00Z'
        test_mode: false
        off_session: false
    ValidationErrorItem:
      description: >-
        Validation errors have their own schema to provide context for invalid
        requests eg. mismatched types and out of bounds values. There may be any
        number of these per 422 UNPROCESSABLE ENTITY error.
      type: object
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          description: >-
            The location as a [`Vec`] of [`String`]s -- often in the form
            `["body", "field_name"]`, `["query", "field_name"]`, etc. They may,
            however, be arbitarily deep.
          type: array
          items:
            type: string
        msg:
          description: The message accompanying the validation error item.
          type: string
        type:
          description: >-
            The type of error, often "type_error" or "value_error", but
            sometimes with more context like as "value_error.number.not_ge"
          type: string
      example:
        loc:
          - string
        msg: string
        type: string
    BillingDetails:
      description: >-
        Billing information associated with a PaymentMethod, such as the
        cardholder's billing address, email, name, and phone number.
      type: object
      properties:
        address:
          description: The billing address.
          anyOf:
            - $ref: '#/components/schemas/BillingAddress'
            - type: 'null'
        email:
          description: The billing email address.
          type:
            - string
            - 'null'
          example: john.doe@example.com
        name:
          description: The billing name.
          type:
            - string
            - 'null'
          example: Example
        phone:
          description: The billing phone number.
          type:
            - string
            - 'null'
          example: '+14155550142'
      example:
        address:
          city: San Francisco
          country: US
          line1: 123 Main St
          line2: Suite 100
          postal_code: '94107'
          state: CA
        email: john.doe@example.com
        name: Example
        phone: '+14155550142'
    Expandable_for_Customer:
      anyOf:
        - type: string
          example: fcus_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        - $ref: '#/components/schemas/Customer'
      example: fcus_01J9XR8M3K7VZ8N2YB4WJ6T0RA
      description: An expandable field — either a string ID or an expanded Customer object.
    V1Card:
      description: >-
        The card backing a PaymentMethod, as returned by the public API: brand,
        country, expiration, funding type, and the last four digits.
      type: object
      required:
        - brand
        - country
        - exp_month
        - exp_year
        - funding
        - last4
      properties:
        brand:
          $ref: '#/components/schemas/CardBrand'
          description: The brand of the card.
        country:
          description: >-
            Two-letter ISO country code of the card's issuing country (e.g.,
            `US`).
          type: string
          example: example_value
        exp_month:
          description: The card's expiration month.
          type: integer
          format: int32
          example: 12
          minimum: -128
          maximum: 127
        exp_year:
          description: The card's expiration year.
          type: integer
          format: int32
          example: 2027
        funding:
          $ref: '#/components/schemas/CardFunding'
          description: The funding type of the card.
        last4:
          description: The last four digits of the card.
          type: string
          example: example_value
      example:
        brand: american_express
        country: example_value
        exp_month: 12
        exp_year: 2027
        funding: credit
        last4: example_value
    Timestamptz:
      description: >-
        A timestamp encoded as an RFC 3339 / ISO 8601 string (e.g.
        `2026-06-15T14:30:00Z`).
      type: string
      example: string
    BillingAddress:
      description: A billing address attached to a PaymentMethod's billing details.
      type: object
      properties:
        city:
          description: City, district, suburb, town, or village.
          type:
            - string
            - 'null'
          example: San Francisco
        country:
          description: Two-letter ISO country code (e.g., `US`).
          type:
            - string
            - 'null'
          example: US
        line1:
          description: Address line 1, such as the street, PO box, or company name.
          type:
            - string
            - 'null'
          example: 123 Main St
        line2:
          description: Address line 2, such as the apartment, suite, unit, or building.
          type:
            - string
            - 'null'
          example: Suite 100
        postal_code:
          description: ZIP or postal code.
          type:
            - string
            - 'null'
          example: '94107'
        state:
          description: State, county, province, or region.
          type:
            - string
            - 'null'
          example: CA
      example:
        city: San Francisco
        country: US
        line1: 123 Main St
        line2: Suite 100
        postal_code: '94107'
        state: CA
    Customer:
      description: >-
        A Customer object represents a customer of your business. Use it to
        track payments, store reusable payment methods, and reference the
        customer on checkout sessions, invoices, and subscriptions.
      type: object
      required:
        - created_at
        - customer_id
        - email
        - first_name
        - last_name
        - test_mode
      properties:
        customer_id:
          description: The unique identifier for the customer.
          type: string
          example: fcus_01HACM7FZ1084XB1GB6053VM0D
        owner_partner_id:
          description: >-
            The partner that owns this customer. When a customer is shared with
            you by another partner in your organization, this is that sibling
            partner; otherwise it is your own partner id.
          type:
            - string
            - 'null'
          example: obj_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        first_name:
          description: The customer's first name.
          type: string
          example: John
        last_name:
          description: The customer's last name.
          type: string
          example: Doe
        email:
          description: The customer's email address.
          type: string
          format: email
          example: joh.doe@example.com
        phone:
          description: The customer's phone number.
          type:
            - string
            - 'null'
          format: phone
          example: '+15555555555'
        employer:
          description: The customer's employer.
          type:
            - string
            - 'null'
          example: Flex
        shipping:
          description: The customer's shipping address.
          anyOf:
            - $ref: '#/components/schemas/ShippingAddress'
            - type: 'null'
        metadata:
          description: Metadata associated with the customer.
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
          example:
            order_id: '8842'
            channel: shopify
        created_at:
          $ref: '#/components/schemas/Timestamptz'
          description: The time the customer was created.
          example: '2026-06-15T14:30:00Z'
        test_mode:
          description: Whether the customer was created in test mode.
          type: boolean
          example: false
      example:
        customer_id: fcus_01HACM7FZ1084XB1GB6053VM0D
        owner_partner_id: obj_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        first_name: John
        last_name: Doe
        email: joh.doe@example.com
        phone: '+15555555555'
        employer: Flex
        shipping:
          shipping_address_id: fsh_01J9XR8M3K7VZ8N2YB4WJ6T0RA
          line1: 123 Main St
          line2: Suite 100
          city: San Francisco
          state: CA
          postal_code: '94107'
          country: US
        metadata:
          order_id: '8842'
          channel: shopify
        created_at: '2026-06-15T14:30:00Z'
        test_mode: false
    CardBrand:
      description: The card's network (brand).
      type: string
      enum:
        - american_express
        - diners_club
        - discover
        - eftpos_au
        - JCB
        - master_card
        - union_pay
        - visa
        - unknown
      example: american_express
    CardFunding:
      description: >-
        The card's funding type, such as credit, debit, prepaid, or an HSA/FSA
        benefits card.
      type: string
      enum:
        - credit
        - debit
        - hsa_fsa
        - prepaid
        - unknown
      example: credit
    ShippingAddress:
      description: >-
        A ShippingAddress represents the postal address a physical order is
        delivered to. It is referenced by checkout sessions and customers.
      type: object
      required:
        - shipping_address_id
      properties:
        shipping_address_id:
          description: Unique identifier for the shipping address.
          type: string
          example: fsh_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        line1:
          description: The first line of the street address (e.g., street number and name).
          type:
            - string
            - 'null'
          example: 123 Main St
        line2:
          description: >-
            The second line of the street address (e.g., apartment, suite, or
            unit).
          type:
            - string
            - 'null'
          example: Suite 100
        city:
          description: City, district, suburb, town, or village.
          type:
            - string
            - 'null'
          example: San Francisco
        state:
          description: State, county, province, or region.
          type:
            - string
            - 'null'
          example: CA
        postal_code:
          description: ZIP or postal code.
          type:
            - string
            - 'null'
          example: '94107'
        country:
          description: Two-letter country code (ISO 3166-1 alpha-2, e.g., `US`).
          type:
            - string
            - 'null'
          example: US
      example:
        shipping_address_id: fsh_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        line1: 123 Main St
        line2: Suite 100
        city: San Francisco
        state: CA
        postal_code: '94107'
        country: US
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Use a Bearer token to access this API.

````