Get balance
GET /io/wallet/balance — read a user's universal credit balance. 1 credit = $1.
Returns the current credit balance for a user. 1 credit = $1.
GET https://api.misar.io/io/wallet/balance
Authentication
Either mode is accepted:
- SSO bearer (self):
Authorization: Bearer <token>— balance is for the token's user; omituser_id. - Service key:
x-wallet-service-key: <key>plus?user_id=<id>.
Query parameters
user_idstringThe Misar SSO user id. Required when authenticating with the service key. Ignored (and not needed) when authenticating with an SSO bearer token.
Request
curl "https://api.misar.io/io/wallet/balance?user_id=usr_123" \
-H "x-wallet-service-key: $WALLET_SERVICE_KEY"curl "https://api.misar.io/io/wallet/balance" \
-H "Authorization: Bearer $SSO_ACCESS_TOKEN"Response
{
"credits": 42
}creditsnumberThe user's current credit balance. 0 if the user has never held a balance. Always a whole number (1 credit = $1).
Notes
- Responses are never cached (
Cache-Control: no-store); the balance is always read live from the ledger. - A non-existent user resolves to
0rather than an error.