Accounts

Endpoints for enumerating the authenticated user's accounts and reading their balances. Use these to discover the debited_account_id you'll pass on /v1/purchases/validate and /v1/purchases/confirm.

List accounts

http
GET /v1/accounts

Returns every active account owned by the authenticated user, with the current balance embedded directly so you don't need a second round trip.

curl
bash
curl https://api.scratchpower.com/v1/accounts \
  -H "Authorization: Bearer $TOKEN"

Response

200 OK
json
[
  {
    "id": 13209,
    "name": "Test Admin Account",
    "currency": "BWP",
    "category": "CURRENT",
    "type": "WALLET",
    "status": "ACTIVE",
    "rank": 1,
    "balance": "BWP 2878.86"
  }
]

Fields

FieldTypeNotes
idintegerPass as debited_account_id on purchases
namestringDisplay label set by the user / admin
currencystringISO 4217 (e.g. BWP)
categorystringCURRENT, COMMISSION, or TOPUP
typestringAlways WALLET for now
statusstringACTIVE only — closed/suspended accounts are filtered out
rankintegerDisplay order if the user has multiple accounts
balancestring<CCY> <amount> — e.g. "BWP 2878.86"

The balance string mirrors the format used on Transaction.entry / net / total / charge / commission. Parse with the same logic.

Get a single account

http
GET /v1/accounts/{id}
curl
bash
curl https://api.scratchpower.com/v1/accounts/13209 \
  -H "Authorization: Bearer $TOKEN"

Returns the same shape as a single element of the list response. Returns 404 if the id doesn't belong to the authenticated user (defence in depth — the permission gate already restricts to your own accounts).