Partner API
Balance Inquiry
Returns the current balance of a savings account.
GET /accounts/{account_ref}/balanceRequired scope: balance:read
Path parameters
| Parameter | Description |
|---|---|
account_ref |
The savings account number (account_no), not an internal numeric ID. |
Example request
Full signing steps are in Authentication — these show the same thing end to end for this specific endpoint.
TIMESTAMP=$(date +%s)
REQUEST_URI="/api/partner/v1/accounts/SA-00123/balance"
BODY_HASH=$(printf '%s' '' | openssl dgst -sha256 | sed 's/^.* //')
SIGNATURE=$(printf '%s' "${TIMESTAMP}|GET|${REQUEST_URI}||${BODY_HASH}" | openssl dgst -sha256 -hmac "$API_SECRET" | sed 's/^.* //')
curl "https://prodsacco.officeug.com${REQUEST_URI}" \
-H "X-Api-Key: $API_KEY" \
-H "X-Timestamp: $TIMESTAMP" \
-H "X-Signature: $SIGNATURE"
<?php
$timestamp = (string) time();
$path = '/api/partner/v1/accounts/SA-00123/balance';
$signature = hash_hmac('sha256', "{$timestamp}|GET|{$path}||" . hash('sha256', ''), $apiSecret);
$ch = curl_init("https://prodsacco.officeug.com{$path}");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"X-Api-Key: {$apiKey}",
"X-Timestamp: {$timestamp}",
"X-Signature: {$signature}",
],
]);
echo curl_exec($ch);
timestamp = str(int(time.time()))
path = "/api/partner/v1/accounts/SA-00123/balance"
body_hash = hashlib.sha256(b"").hexdigest()
payload = f"{timestamp}|GET|{path}||{body_hash}"
signature = hmac.new(api_secret.encode(), payload.encode(), hashlib.sha256).hexdigest()
response = requests.get(
f"https://prodsacco.officeug.com{path}",
headers={"X-Api-Key": api_key, "X-Timestamp": timestamp, "X-Signature": signature},
)
print(response.json())
const timestamp = Math.floor(Date.now() / 1000).toString();
const path = '/api/partner/v1/accounts/SA-00123/balance';
const bodyHash = crypto.createHash('sha256').update('').digest('hex');
const payload = `${timestamp}|GET|${path}||${bodyHash}`;
const signature = crypto.createHmac('sha256', apiSecret).update(payload).digest('hex');
const response = await fetch(`https://prodsacco.officeug.com${path}`, {
headers: { 'X-Api-Key': apiKey, 'X-Timestamp': timestamp, 'X-Signature': signature },
});
console.log(await response.json());
Example response — 200 OK
{
"success": true,
"message": "OK",
"data": {
"account_ref": "SA-00123",
"balance": 452300.00,
"unlocked_balance": 452300.00,
"currency": "UGX"
},
"request_id": "b6e0c2b4-1a2d-4f3e-9c1a-2f8e0b5a7c3d"
}unlocked_balance differs from balance only for fixed-deposit accounts still within their locked term — it's always the figure that actually matters for whether money can move.
Errors specific to this endpoint
| HTTP | error_code | Meaning |
|---|---|---|
| 404 | ACCOUNT_NOT_FOUND |
No active account with this account_ref exists for your SACCO. |
See Error Codes for the full list of authentication/authorization errors that can occur on any endpoint.