curl https://api.zbdpay.com/api/v1/users/4ac4fd8a-cc2c-4d03-af09-a76f4e89d652/balances \
-H "x-api-key: YOUR_API_KEY"
{
"success": true,
"message": "Balances retrieved.",
"data": {
"user_id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
"balances": [
{ "currency": "USD", "available": 5000, "cashable": 3000 },
{ "currency": "GEMS", "available": 1700, "cashable": 0 }
]
},
"error": null
}
Earnings
Get Balances
Read the balances ZBD holds for a user, in each currency.
GET
/
api
/
v1
/
users
/
{userId}
/
balances
curl https://api.zbdpay.com/api/v1/users/4ac4fd8a-cc2c-4d03-af09-a76f4e89d652/balances \
-H "x-api-key: YOUR_API_KEY"
{
"success": true,
"message": "Balances retrieved.",
"data": {
"user_id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
"balances": [
{ "currency": "USD", "available": 5000, "cashable": 3000 },
{ "currency": "GEMS", "available": 1700, "cashable": 0 }
]
},
"error": null
}
Only for programs where ZBD tracks earnings. If you track earnings yourself, this returns
403 feature_not_enabled.Configuration
Header Parameters
string
required
Your ZBD API key.
Path Parameters
string
required
The ZBD user ID returned by Create a User.
curl https://api.zbdpay.com/api/v1/users/4ac4fd8a-cc2c-4d03-af09-a76f4e89d652/balances \
-H "x-api-key: YOUR_API_KEY"
{
"success": true,
"message": "Balances retrieved.",
"data": {
"user_id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
"balances": [
{ "currency": "USD", "available": 5000, "cashable": 3000 },
{ "currency": "GEMS", "available": 1700, "cashable": 0 }
]
},
"error": null
}
Response
string
The user the balances belong to.
object[]
One entry per currency the user holds.
string
The currency code.
integer
What the user can spend, in the currency’s smallest unit.
integer
The part of
available the user can cash out now. It depends on how the value arrived, so it can be less than available.Errors
| HTTP | code | When |
|---|---|---|
403 | feature_not_enabled | You track earnings yourself |
404 | user_not_found | The user doesn’t exist under your key |
Was this page helpful?