> ## 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 credit pools

> This endpoint allows fetching the credit pools associated with a customer.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/credit-pools/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/credit-pools/by-customer:
    get:
      tags:
        - Credit Pools
      summary: List customer credit pools
      description: >-
        This endpoint allows fetching the credit pools associated with a
        customer.
      parameters:
        - schema:
            type: string
            format: uuid
          in: query
          name: customerId
          required: true
          description: The unique identifier of the customer.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      description: >-
                        Schema representing a credit pool with its top up
                        settings.
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: >-
                            The unique identifier of the credit pool in our
                            system.
                        customerId:
                          type: string
                          format: uuid
                          description: >-
                            The unique identifier of the customer the credit
                            pool belongs to.
                        currencyUnitId:
                          type: string
                          format: uuid
                          description: >-
                            The unique identifier of the currency unit the
                            pool's credits are denominated in.
                        startDate:
                          type: string
                          format: date
                          description: >-
                            Date the credit pool starts, when the initial
                            credits are loaded.
                        renewalCreditAmount:
                          type: string
                          pattern: ^\d+(\.\d{1,6})?$
                          description: >-
                            Amount of credits granted to the pool on each
                            renewal, as a decimal string in the pool's currency
                            unit.
                        availableAmount:
                          type: string
                          pattern: ^\d+(\.\d{1,6})?$
                          description: >-
                            Current credit balance available for consumption, as
                            a decimal string in the pool's currency unit.
                        scheduleRenewalDate:
                          type: string
                          format: date
                          description: >-
                            Date of the next scheduled renewal, when
                            renewalCreditAmount is granted to the pool.
                        topUpSettings:
                          type: object
                          description: >-
                            Schema representing the top-up settings of a credit
                            pool: the credit package purchased when the pool's
                            balance needs replenishing. Purchases appear on
                            invoices as credit purchase line items.
                          properties:
                            createdBy:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the user who configured
                                the top-up settings.
                            creditPackageAmount:
                              type: string
                              pattern: ^\d+(\.\d{1,6})?$
                              description: >-
                                Amount of credits granted per purchased package,
                                as a decimal string in the pool's currency unit.
                            price:
                              type: number
                              multipleOf: 1
                              minimum: 1
                              description: Price billed per purchased package, in cents.
                          required:
                            - createdBy
                            - creditPackageAmount
                            - price
                          additionalProperties: false
                        currencyUnit:
                          type: object
                          description: >-
                            Schema representing a currency unit: the unit
                            credits and credit-consuming usage are denominated
                            in. BRL is the default; tenants can define custom
                            credit units.
                          properties:
                            id:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the currency unit in
                                our system.
                            name:
                              type: string
                              description: Display name of the currency unit.
                            code:
                              type: string
                              description: Short code of the currency unit (e.g. BRL).
                              example: BRL
                          required:
                            - id
                            - name
                            - code
                          additionalProperties: false
                      required:
                        - id
                        - customerId
                        - currencyUnitId
                        - startDate
                        - renewalCreditAmount
                        - availableAmount
                        - scheduleRenewalDate
                        - topUpSettings
                        - currencyUnit
                      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
        '429':
          description: >-
            The tenant reached one of its limits of reads: 20 reads in flight or
            50 reads per second.
          headers:
            Retry-After:
              schema:
                type: integer
              description: The seconds to wait before the next read.
            RateLimit-Limit:
              schema:
                type: integer
              description: >-
                The limit that the read hit: 20 for the reads in flight, 50 for
                the reads per second.
            RateLimit-Remaining:
              schema:
                type: integer
              description: The reads left under that limit, which is 0.
            RateLimit-Reset:
              schema:
                type: integer
              description: >-
                The seconds to wait before the next read, as in Retry-After. The
                limit of reads per second takes new reads in the next second,
                but the limit of reads in flight takes a new read only once one
                of the reads in flight ends.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A human-readable description of the limit that the read
                      hit
                  code:
                    type: string
                    enum:
                      - too_many_reads_in_flight
                      - too_many_reads_per_second
                    description: The limit that the read hit
                required:
                  - code
                  - message
                additionalProperties: false
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      description: API Key Authentication.
      name: X-API-KEY
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.