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

# List customer payment accounts

> This endpoint allows fetching the payment accounts associated with a customer.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/payment-accounts/by-customer
openapi: 3.1.0
info:
  title: API Reference
  version: '1.0'
  description: Aira API Reference
  x-logo:
    url: https://static.useaira.com/images/airalogo.svg
    backgroundColor: '#FFFFFF'
    altText: Aira Logo
servers:
  - url: https://api.useaira.com
    description: API base URL
security:
  - ApiKey: []
paths:
  /v1/payment-accounts/by-customer:
    get:
      tags:
        - Payment Accounts
      summary: List customer payment accounts
      description: >-
        This endpoint allows fetching the payment accounts associated with a
        customer.
      parameters:
        - schema:
            type: string
            format: uuid
          in: query
          name: customerId
          required: true
          description: The unique identifier of the customer.
        - schema:
            type: boolean
            default: false
          in: query
          name: includeSubsidiaries
          required: false
          description: Whether payment accounts of subsidiaries should be returned as well.
        - schema:
            type: boolean
            default: false
          in: query
          name: includeArchived
          required: false
          description: Whether archived payment accounts should be returned.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      description: Schema representing a payment account.
                      properties:
                        id:
                          description: >-
                            The unique identifier of the payment account in our
                            system.
                          type: string
                          format: uuid
                        customerId:
                          description: >-
                            The unique identifier of the customer that owns the
                            payment account.
                          type: string
                          format: uuid
                        archivedAt:
                          description: >-
                            Archive timestamp for payment accounts that were
                            archived.
                          type:
                            - 'null'
                            - string
                          format: date-time
                        legalEntity:
                          type: object
                          description: Schema representing a legal entity.
                          properties:
                            id:
                              type: string
                              format: uuid
                            tradeName:
                              type: string
                              nullable: true
                            businessName:
                              type: string
                            emails:
                              type: array
                              items:
                                type: string
                                format: email
                              default: []
                            taxId:
                              type: string
                              pattern: ^(^\d{14}$|^\d{11}$)$
                            taxIdType:
                              type: string
                              enum:
                                - cnpj
                                - cpf
                            zipCode:
                              type: string
                              pattern: ^[0-9]{8}$
                              nullable: true
                            street:
                              type: string
                              nullable: true
                            number:
                              type: string
                              nullable: true
                            neighborhood:
                              type: string
                              nullable: true
                            city:
                              type: string
                              nullable: true
                            state:
                              type: string
                              enum:
                                - AC
                                - AL
                                - AP
                                - AM
                                - BA
                                - CE
                                - DF
                                - ES
                                - GO
                                - MA
                                - MT
                                - MS
                                - MG
                                - PA
                                - PB
                                - PR
                                - PE
                                - PI
                                - RJ
                                - RN
                                - RS
                                - RO
                                - RR
                                - SC
                                - SP
                                - SE
                                - TO
                              nullable: true
                            country:
                              type: string
                              enum:
                                - Brasil
                              nullable: true
                            complement:
                              type: string
                              nullable: true
                            customFields:
                              type: object
                              description: >-
                                Custom fields that can be associated with the
                                entity. The fields must be previously created in
                                the system before they can be used.
                              additionalProperties:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      type: string
                              default: {}
                              example:
                                customField1: value1
                                customField2:
                                  - value2
                                  - value3
                          required:
                            - id
                            - businessName
                            - taxId
                            - taxIdType
                            - customFields
                          additionalProperties: false
                      required:
                        - id
                        - customerId
                        - archivedAt
                        - legalEntity
                      additionalProperties: false
                    description: A list of items.
                required:
                  - items
                additionalProperties: false
        '404':
          description: Error object returned to the client when a resource is not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A human-readable description of the error
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      description: API Key Authentication.
      name: X-API-KEY
      in: header

````