Account
Get balance
Read available credit, reservations, and expiring promotional grants.
Available credit excludes holds and expired grants. All USD amounts are exact decimal strings with nine fractional digits; use decimal or integer arithmetic.
GET
/
v1
/
balance
Get balance
curl --request GET \
--url https://d1-staging-5gh8d.ondigitalocean.app/v1/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://d1-staging-5gh8d.ondigitalocean.app/v1/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://d1-staging-5gh8d.ondigitalocean.app/v1/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"available_usd": "<string>",
"currency": "USD",
"expiring_grants": [
{
"amount_usd": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"financial_shortfall_usd": "<string>",
"paid_usd": "<string>",
"promotional_usd": "<string>",
"reserved_usd": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
Successful Response
Pattern:
^\d+\.\d{9}$Allowed value:
"USD"Show child attributes
Show child attributes
Pattern:
^\d+\.\d{9}$Pattern:
^\d+\.\d{9}$Pattern:
^\d+\.\d{9}$Pattern:
^\d+\.\d{9}$Get balance
curl --request GET \
--url https://d1-staging-5gh8d.ondigitalocean.app/v1/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://d1-staging-5gh8d.ondigitalocean.app/v1/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://d1-staging-5gh8d.ondigitalocean.app/v1/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"available_usd": "<string>",
"currency": "USD",
"expiring_grants": [
{
"amount_usd": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"financial_shortfall_usd": "<string>",
"paid_usd": "<string>",
"promotional_usd": "<string>",
"reserved_usd": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}