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

# List credit ledger entries

> Every movement of a customer's credit in one currency or credit unit, newest first, with the
credit on account after it: credit granted, applied to invoices, given back, expired or
rolled over.



## OpenAPI

````yaml https://api.meteroid.com/api-docs/openapi.json get /api/v1/customers/{id_or_alias}/credit-ledger
openapi: 3.1.0
info:
  title: meteroid
  description: ''
  license:
    name: LicenseRef-Proprietary
    identifier: LicenseRef-Proprietary
  version: 0.1.0
servers: []
security: []
tags:
  - name: Meteroid
    description: Meteroid API
  - name: Add-ons
  - name: Batch Jobs
  - name: Budgets
    description: >-
      Beta: may change before general availability. Spending limits on a
      customer's usage, or one subscription's, per currency, with alerts at
      percentages of the amount.
    x-beta: true
  - name: Checkout Sessions
  - name: Checks
    description: >-
      Beta: may change before general availability. Whether a customer may
      consume more of a feature right now.
    x-beta: true
  - name: Connect
    description: Manage connected accounts (Express & Standard)
  - name: Coupons
  - name: Credit Notes
  - name: Credit units
    description: >-
      Custom denominations, such as "credits", that usage can be priced in and
      credit granted or sold in, instead of money.
  - name: Credits
    description: >-
      Prepaid credit: a customer's wallets, credit grants, ledger and top-ups.
      Promotional credit applies before tax like a discount; paid credit applies
      after tax like a payment.
  - name: Custom Properties
  - name: Customers
  - name: Entitlements
  - name: Events
  - name: Features
  - name: Invoices
  - name: Licenses
    description: >-
      Licenses for your customers' self-hosted installations: signed tokens
      carrying their plan's entitlements, activated and refreshed by the
      installation over the public licensing endpoints.
  - name: Metrics
  - name: OAuth
    description: OAuth 2.0 token endpoints (public, client-credentials auth)
  - name: OAuth Apps
    description: Manage OAuth applications for Connect integrations
  - name: Plans
  - name: Product Families
  - name: Products
  - name: Subscriptions
  - name: Usage
  - name: Usage costs
    description: >-
      Beta: may change before general availability. A customer's or a
      subscription's usage events and usage over time, with what they cost.
    x-beta: true
  - name: Webhook Endpoints
    description: Manage outbound webhook endpoints and inspect their deliveries
paths:
  /api/v1/customers/{id_or_alias}/credit-ledger:
    get:
      tags:
        - Credits
      summary: List credit ledger entries
      description: >-
        Every movement of a customer's credit in one currency or credit unit,
        newest first, with the

        credit on account after it: credit granted, applied to invoices, given
        back, expired or

        rolled over.
      operationId: list_ledger_entries
      parameters:
        - name: id_or_alias
          in: path
          description: Customer ID or alias
          required: true
          schema:
            type: string
        - name: currency
          in: query
          description: Defaults to the customer's currency.
          required: false
          schema:
            $ref: '#/components/schemas/Currency'
        - name: credit_unit
          in: query
          description: >-
            The ledger of this credit unit (its code) instead of a currency;
            excludes `currency`.
          required: false
          schema:
            type: string
        - name: page
          in: query
          description: Page number (0-indexed)
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: per_page
          in: query
          description: Number of items per page
          required: false
          schema:
            type: integer
            format: int32
            maximum: 100
            minimum: 1
      responses:
        '200':
          description: Ledger entries, newest first
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LedgerListResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    Currency:
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHF
        - CLP
        - CNH
        - CNY
        - COP
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - IRR
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRU
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLL
        - SOS
        - SRD
        - SSP
        - STD
        - STN
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
        - ZWL
      examples:
        - EUR
    LedgerListResponse:
      type: object
      description: A page of ledger entries, newest first.
      required:
        - data
        - pagination_meta
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/LedgerEntry'
        pagination_meta:
          $ref: '#/components/schemas/PaginationResponse'
    RestErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
    LedgerEntry:
      type: object
      description: One movement of a customer's credit.
      required:
        - id
        - credit_grant_id
        - sequence
        - type
        - applies_to
        - amount
        - balance_after
        - reason
        - effective_at
        - recorded_at
      properties:
        amount:
          type: integer
          format: int64
          description: Signed change to the credit on account, in minor units.
        applies_to:
          $ref: '#/components/schemas/CreditAppliesTo'
          description: >-
            What the moved credit's grant pays: ALL any charge, USAGE only usage
            charges.
        balance_after:
          type: integer
          format: int64
          description: The credit on account after this entry, whatever it applies to.
        cost:
          oneOf:
            - $ref: '#/components/schemas/CreditCost'
              description: >-
                The share of its grant's cost this entry moved, signed like
                `amount`: for credit applied

                to an invoice it is recognized revenue, for expired credit
                breakage, for a reversal a

                refund. Absent when the grant has no cost.
            - type: 'null'
        credit_grant_id:
          type: string
          description: The grant the credit moved in or out of.
        credit_note_id:
          type:
            - string
            - 'null'
          description: The credit note that gave the credit back or took it back.
        credit_unit:
          type:
            - string
            - 'null'
          description: >-
            The credit unit (its code) the amounts are in; absent for a
            currency.
        credit_unit_precision:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Decimal places of `credit_unit`: amounts are integers of
            10^-precision credit.
          minimum: 0
        currency:
          oneOf:
            - $ref: '#/components/schemas/Currency'
              description: Absent in a credit unit ledger.
            - type: 'null'
        effective_at:
          type: string
          format: date-time
          description: When the movement took effect; the ledger is ordered by it.
        id:
          type: string
          description: The entry's id (`wle_…`).
        invoice_id:
          type:
            - string
            - 'null'
          description: The invoice the credit was applied to, bought on, or given back by.
        reason:
          type: string
          description: Why the credit moved, as shown on the ledger.
        recorded_at:
          type: string
          format: date-time
          description: When the movement was recorded.
        reference:
          type:
            - string
            - 'null'
          description: Your own reference, e.g. a contract or support ticket.
        sequence:
          type: integer
          format: int64
          description: >-
            Position within the currency's ledger in the order the movements
            took effect, from 1. A

            movement recorded later with an earlier date shifts the positions
            after it: identify an

            entry by its `id`.
        subscription_id:
          type:
            - string
            - 'null'
          description: >-
            The subscription the moved credit's grant belongs to; null when it
            pays any of the

            customer's subscriptions.
        type:
          $ref: '#/components/schemas/LedgerEntryType'
          description: What moved the credit.
    PaginationResponse:
      type: object
      required:
        - page
        - per_page
        - total_items
        - total_pages
      properties:
        page:
          type: integer
          format: int32
          minimum: 0
        per_page:
          type: integer
          format: int32
          minimum: 0
        total_items:
          type: integer
          format: int64
          minimum: 0
        total_pages:
          type: integer
          format: int32
          minimum: 0
    ErrorCode:
      type: string
      enum:
        - BAD_REQUEST
        - NOT_FOUND
        - CONFLICT
        - FORBIDDEN
        - UNAUTHORIZED
        - TOKEN_EXPIRED
        - TOO_MANY_REQUESTS
        - INTERNAL_SERVER_ERROR
    CreditAppliesTo:
      type: string
      description: >-
        Which charges credit pays: ALL pays any part of an invoice, USAGE only
        its usage charges.
      enum:
        - ALL
        - USAGE
    CreditCost:
      type: object
      description: Money in minor units of `currency`, net of tax.
      required:
        - amount
        - currency
      properties:
        amount:
          type: integer
          format: int64
          description: In minor units of `currency`.
        currency:
          $ref: '#/components/schemas/Currency'
    LedgerEntryType:
      type: string
      enum:
        - CREDIT
        - INVOICE_APPLICATION
        - INVOICE_RETURN
        - CREDIT_REVERSAL
        - CREDIT_REINSTATEMENT
        - CREDIT_EXPIRY
        - CREDIT_ROLLOVER
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````

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