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

# List credits

Retrieves an array of credits.

<CodeGroup>
  ```py Python theme={null}
  lotus.list_credits(customer_id='cust_0569173ee6654369')
  ```

  ```ts Typescript theme={null}
  await lotus.listCredits({
    customer_id: "cust_0569173ee6654369",
  });
  ```
</CodeGroup>


## OpenAPI

````yaml GET /api/credits/
openapi: 3.0.3
info:
  title: Lotus API
  version: 0.9.3
  description: >-
    Lotus is an open-core pricing and billing engine. We enable API companies to
    automate and optimize their custom usage-based pricing for any metric.
servers: []
security: []
paths:
  /api/credits/:
    get:
      tags:
        - api
      operationId: api_credits_list
      parameters:
        - in: query
          name: currency_code
          schema:
            type: string
            minLength: 1
          description: Filter to adjustments in a specific currency
        - in: query
          name: customer_id
          schema:
            type: string
            nullable: true
            minLength: 1
          description: >-
            The id provided when creating the customer, we suggest matching with
            your internal customer id in your backend
          required: true
        - in: query
          name: effective_after
          schema:
            type: string
            format: date-time
          description: Filter to adjustments that are effective after this date
        - in: query
          name: effective_before
          schema:
            type: string
            format: date-time
          description: Filter to adjustments that are effective before this date
        - in: query
          name: expires_after
          schema:
            type: string
            format: date-time
          description: Filter to adjustments that expire after this date
        - in: query
          name: expires_before
          schema:
            type: string
            format: date-time
          description: Filter to adjustments that expire before this date
        - in: query
          name: issued_after
          schema:
            type: string
            format: date-time
          description: Filter to adjustments that were issued after this date
        - in: query
          name: issued_before
          schema:
            type: string
            format: date-time
          description: Filter to adjustments that were issued before this date
        - in: query
          name: status
          schema:
            type: array
            items:
              enum:
                - active
                - inactive
              type: string
              description: |-
                * `active` - Active
                * `inactive` - Inactive
            default:
              - active
              - inactive
          description: >-
            Filter to a specific set of adjustment statuses. Defaults to both
            active and inactive.
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerBalanceAdjustment'
          description: ''
      security:
        - knoxTokenAuth: []
        - OrganizationApiKeyAuth: []
          TokenAuth: []
components:
  schemas:
    CustomerBalanceAdjustment:
      type: object
      properties:
        credit_id:
          type: string
        customer:
          $ref: '#/components/schemas/LightweightCustomer'
        amount:
          type: number
          format: double
          maximum: 10000000000
          minimum: 0
          exclusiveMaximum: true
        amount_remaining:
          type: number
          format: double
          maximum: 10000000000
          minimum: 0
          exclusiveMaximum: true
          readOnly: true
        currency:
          $ref: '#/components/schemas/PricingUnit'
        description:
          type: string
          nullable: true
          readOnly: true
        effective_at:
          type: string
          format: date-time
          readOnly: true
        expires_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        status:
          enum:
            - active
            - inactive
          type: string
          description: |-
            * `active` - Active
            * `inactive` - Inactive
          readOnly: true
        amount_paid:
          type: number
          format: double
          maximum: 10000000000
          minimum: -10000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          readOnly: true
        amount_paid_currency:
          allOf:
            - $ref: '#/components/schemas/PricingUnit'
          nullable: true
        drawdowns:
          type: array
          items:
            $ref: '#/components/schemas/CreditDrawdown'
          readOnly: true
      required:
        - amount
        - amount_paid
        - amount_paid_currency
        - amount_remaining
        - credit_id
        - currency
        - customer
        - description
        - drawdowns
        - effective_at
        - expires_at
        - status
    LightweightCustomer:
      type: object
      properties:
        customer_name:
          type: string
          readOnly: true
          nullable: true
          description: The display name of the customer
        email:
          type: string
          format: email
          readOnly: true
          nullable: true
          description: >-
            The primary email address of the customer, must be the same as the
            email address used to create the customer in the payment provider
        customer_id:
          type: string
          readOnly: true
          nullable: true
          description: >-
            The id provided when creating the customer, we suggest matching with
            your internal customer id in your backend
      required:
        - customer_id
        - customer_name
        - email
    PricingUnit:
      type: object
      properties:
        code:
          type: string
          maxLength: 10
        name:
          type: string
          maxLength: 100
        symbol:
          type: string
          maxLength: 10
      required:
        - code
        - name
        - symbol
    CreditDrawdown:
      type: object
      properties:
        credit_id:
          type: string
        amount:
          type: number
          format: double
          maximum: 0
          minimum: -10000000000
          exclusiveMinimum: true
        description:
          type: string
          nullable: true
        applied_at:
          type: string
          format: date-time
      required:
        - amount
        - applied_at
        - credit_id
  securitySchemes:
    knoxTokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"
    OrganizationApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````