balances
Creates, updates, deletes, gets or lists a balances resource.
Overview
| Name | balances |
| Type | Resource |
| Id | digitalocean.billing.balances |
Fields
The following fields are returned by SELECT queries:
- balance_get
The response will be a JSON object that contains the following attributes
| Name | Datatype | Description |
|---|---|---|
account_balance | string | Current balance of the customer's most recent billing activity. Does not reflect month_to_date_usage. (example: 12.23) |
generated_at | string (date-time) | The time at which balances were most recently generated. (example: 2019-07-09T15:01:12Z) |
month_to_date_balance | string | Balance as of the generated_at time. This value includes the account_balance and month_to_date_usage. (example: 23.44) |
month_to_date_usage | string | Amount used in the current billing period as of the generated_at time. (example: 11.21) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
balance_get | select | To retrieve the balances on a customer's account, send a GET request to /v2/customers/my/balance. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|
SELECT examples
- balance_get
To retrieve the balances on a customer's account, send a GET request to /v2/customers/my/balance.
SELECT
account_balance,
generated_at,
month_to_date_balance,
month_to_date_usage
FROM digitalocean.billing.balances
;