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

# List Balance Transactions

> Lists one of your billing customers' balance transactions, newest first: the record of credit granted or clawed back through `POST /billing-customers/{provider_customer_id}/balance-transactions`, and of credit applied to invoices. Paginated: pass the previous page's `after` as `starting_after`.



## OpenAPI

````yaml /openapi.json get /billing-customers/{provider_customer_id}/balance-transactions
openapi: 3.1.0
info:
  title: OpenLoop API
  version: 0.1.0
  description: >-
    Unified reference for the OpenLoop Patient (clinical) and Payments & Revenue
    APIs.
servers:
  - url: https://api.openloophealth.com/v0.1
    description: Production partner edge
  - url: https://api-staging.openloophealth.com/v0.1
    description: Staging partner edge (sandbox credentials)
security: []
paths:
  /billing-customers/{provider_customer_id}/balance-transactions:
    get:
      tags:
        - Billing Customers
      summary: List Balance Transactions
      description: >-
        Lists one of your billing customers' balance transactions, newest first:
        the record of credit granted or clawed back through `POST
        /billing-customers/{provider_customer_id}/balance-transactions`, and of
        credit applied to invoices. Paginated: pass the previous page's `after`
        as `starting_after`.
      parameters:
        - in: path
          name: provider_customer_id
          required: true
          schema:
            type: string
          description: Provider customer ID. Must belong to your own configuration.
          example: test_customer_id
        - in: query
          name: size
          required: false
          schema:
            type: integer
          description: Page size, `1`–`100`. Default `10`.
          example: 10
        - in: query
          name: starting_after
          required: false
          schema:
            type: string
          description: >-
            A `provider_balance_transaction_id`; returns the page after it. Pass
            the previous page's `after`.
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    description: Balance transactions, newest first.
                    items:
                      type: object
                      properties:
                        provider_balance_transaction_id:
                          type: string
                          description: Provider balance transaction ID.
                        provider_customer_id:
                          type: string
                          description: Provider customer ID.
                        amount:
                          type: integer
                          description: >-
                            Change to the balance: negative adds credit,
                            positive removes it (a clawback, or credit applied
                            to an invoice; see `type`).
                        currency:
                          type: string
                          description: Lowercase ISO currency code.
                        description:
                          type:
                            - string
                            - 'null'
                          description: >-
                            As sent for transactions created through `POST
                            /billing-customers/{provider_customer_id}/balance-transactions`;
                            set by the payment provider (often `null`)
                            otherwise.
                        ending_balance:
                          type: integer
                          description: >-
                            The customer's balance after this transaction
                            (negative is credit available).
                        type:
                          type: string
                          description: >-
                            Transaction type from the payment provider, passed
                            through (for example `adjustment` for a transaction
                            created here, `applied_to_invoice` when credit pays
                            an invoice).
                        provider_invoice_id:
                          type:
                            - string
                            - 'null'
                          description: >-
                            The invoice the transaction relates to; `null` when
                            it is not tied to an invoice (for example an
                            `adjustment`).
                        created:
                          type: integer
                          description: Unix timestamp (seconds).
                        metadata:
                          type: object
                          additionalProperties:
                            type: string
                          description: >-
                            As sent for transactions created through `POST
                            /billing-customers/{provider_customer_id}/balance-transactions`;
                            `{}` when none.
                  after:
                    type: string
                    description: >-
                      The last item's `provider_balance_transaction_id`. Present
                      only when there are more pages.
              example:
                items:
                  - provider_balance_transaction_id: test_balance_transaction_id_2
                    provider_customer_id: test_customer_id
                    amount: 300
                    currency: usd
                    description: Referral refunded
                    ending_balance: -200
                    type: adjustment
                    provider_invoice_id: null
                    created: 1400
                    metadata: {}
                  - provider_balance_transaction_id: test_balance_transaction_id_1
                    provider_customer_id: test_customer_id
                    amount: -500
                    currency: usd
                    description: Referral reward
                    ending_balance: -500
                    type: adjustment
                    provider_invoice_id: null
                    created: 1300
                    metadata:
                      referral_id: test_referral_id
                after: test_balance_transaction_id_1
        '400':
          description: >-
            Missing `provider_customer_id`; `size` not an integer from `1` to
            `100`; or a malformed `starting_after`.
        '401':
          description: Missing or invalid bearer token.
        '403':
          description: >-
            No configuration exists for your account, or provider access has
            been disabled for it.
        '404':
          description: >-
            The customer was not found within your configuration, or, with
            `starting_after` sent, the customer or the cursor was not found.
        '500':
          description: An upstream provider error.
      security:
        - serviceToken: []
        - userToken: []
components:
  securitySchemes:
    serviceToken:
      type: oauth2
      description: >-
        Service (M2M) access token issued by POST /auth/token using the
        client_credentials grant. Required scopes, where known, are listed on
        each operation below.
      flows:
        clientCredentials:
          tokenUrl: https://api.openloophealth.com/v0.1/auth/token
          scopes: {}
    userToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        User access token issued by POST /auth/token via the verification-code
        grant (after Verify a one-time code) or the refresh_token grant.

````

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