Fetching Customer Credit Balance via API

Last updated: November 20, 2024

To fetch the credit balance for a customer via the Orb API, you need to make a GET request to the following endpoint:

/customers/{customer_id}/credits?currency={currency}

Replace {customer_id} with either the Orb-generated customer ID or the external customer ID you have set. For the {currency} parameter, you need to use the identifier for the pricing unit, not the short name or display name.

For example, to fetch the credit balance in a custom pricing unit (`credits`) for a customer with ID fVEPERuJKnnzgiqv:

{{orb_url}}/customers/RuJKnnzfVEPEgiqv/credits?currency=credits

To fetch the balance in US Dollars (USD):

{{orb_url}}/customers/RuJKnnzfVEPEgiqv/credits?currency=USD

The API will return the credit balance information for the specified customer and currency, including details like the balance amount, effective date, expiry date, and cost basis.