Logo
OpenScaler

Get Customer Balance

To retrieve the balances on a customer's account, send a GET request to /v2/customers/my/balance.

GET
/v1/customers/my/balance

Authorization

AuthorizationRequiredBearer <token>

OAuth Authentication

OpenScaler API uses OAuth, a standard for secure authorization. To access the API, obtain a token via the OpenScaler Platform.

Use the access_token in the Authorization header for requests:

Authorization: Bearer <token>

Always keep your token secure and do not share it with anyone.

In: header

Query Parameters

project_idRequiredstring

Project to fetch balance for.

include_detailsboolean

If set to true, the response will include the balance and usage of each resource category.

Default: true
curl -X GET "https://api.alpha.openscaler.net/v1/customers/my/balance?project_id=default" \
  -H "Authorization: Bearer <token>"

The response will be a JSON object that contains the following attributes

{
  "account_balance": "0.00661",
  "generated_at": "2024-04-20T00:52:19.278Z",
  "product_charges": [
    {
      "name": "bandwidth",
      "count": 1,
      "cost": 0,
      "usage": "2.44301 GiB"
    },
    {
      "name": "VM",
      "count": 1,
      "cost": 0.00661,
      "usage": "0.37003 hours"
    }
  ]
}