Developers
Partner API

Disbursements

Credits a member's savings account — money moving from you into the SACCO (for example, a loan disbursed through your bank into a member's savings).

POST /disbursements

Required scope: disbursement:write

Body parameters

Parameter Type Required Description
account_ref string yes The savings account number to credit.
amount number yes Must be more than 0.
currency string no Defaults to UGX. Must match the SACCO's own configured currency (see Balance Inquiry) — a mismatch is rejected as DISBURSEMENT_FAILED rather than silently ignored. Every SACCO on the platform is single-currency today, so in practice this just needs to match what GET /balance reports back for the account.
idempotency_key string yes See Idempotency below.
external_reference string no Your own reference for this disbursement — shown on the member's statement and matched against in webhook callbacks.

Idempotency

Every disbursement must carry an idempotency_key you generate (a UUID is fine). If you retry a request with the same key — because of a timeout, a network error, anything — the API returns the original result instead of crediting the account a second time. This is enforced at the database level, not just in application logic, so it holds even under concurrent retries.

Use a new idempotency_key for every distinct disbursement; reuse it only when retrying the exact same one.

Example request

Important: {sha256(body)} must be computed from the exact bytes you send. Build the JSON string once, hash that string, then send that same string — don't hash one serialization and let your HTTP client re-encode a slightly different one (different key order or whitespace produces a different hash, and the signature check will fail).

TIMESTAMP=$(date +%s)
REQUEST_URI="/api/partner/v1/disbursements"
BODY='{"account_ref":"SA-00123","amount":50000,"currency":"UGX","idempotency_key":"8f14e45f-ceea-4d0e-9f3a-0e2b1c4d5a6b","external_reference":"LOAN-8841"}'
BODY_HASH=$(printf '%s' "$BODY" | openssl dgst -sha256 | sed 's/^.* //')
SIGNATURE=$(printf '%s' "${TIMESTAMP}|POST|${REQUEST_URI}|application/json|${BODY_HASH}" | openssl dgst -sha256 -hmac "$API_SECRET" | sed 's/^.* //')

curl -X POST "https://prodsacco.officeug.com${REQUEST_URI}" \
  -H "X-Api-Key: $API_KEY" \
  -H "X-Timestamp: $TIMESTAMP" \
  -H "X-Signature: $SIGNATURE" \
  -H "Content-Type: application/json" \
  -d "$BODY"
<?php
$body = json_encode([
    'account_ref'        => 'SA-00123',
    'amount'             => 50000,
    'currency'           => 'UGX',
    'idempotency_key'    => '8f14e45f-ceea-4d0e-9f3a-0e2b1c4d5a6b',
    'external_reference' => 'LOAN-8841',
]);

$timestamp = (string) time();
$path      = '/api/partner/v1/disbursements';
$signature = hash_hmac('sha256', "{$timestamp}|POST|{$path}|application/json|" . hash('sha256', $body), $apiSecret);

$ch = curl_init("https://prodsacco.officeug.com{$path}");
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => $body, // the exact string that was hashed
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "X-Api-Key: {$apiKey}",
        "X-Timestamp: {$timestamp}",
        "X-Signature: {$signature}",
        'Content-Type: application/json',
    ],
]);
echo curl_exec($ch);
import json

body = json.dumps({
    "account_ref": "SA-00123",
    "amount": 50000,
    "currency": "UGX",
    "idempotency_key": "8f14e45f-ceea-4d0e-9f3a-0e2b1c4d5a6b",
    "external_reference": "LOAN-8841",
})

timestamp = str(int(time.time()))
path = "/api/partner/v1/disbursements"
body_hash = hashlib.sha256(body.encode()).hexdigest()
payload = f"{timestamp}|POST|{path}|application/json|{body_hash}"
signature = hmac.new(api_secret.encode(), payload.encode(), hashlib.sha256).hexdigest()

response = requests.post(
    f"https://prodsacco.officeug.com{path}",
    data=body,  # the exact string that was hashed — not requests' own json= re-encoding
    headers={
        "X-Api-Key": api_key,
        "X-Timestamp": timestamp,
        "X-Signature": signature,
        "Content-Type": "application/json",
    },
)
print(response.json())
const body = JSON.stringify({
  account_ref: 'SA-00123',
  amount: 50000,
  currency: 'UGX',
  idempotency_key: '8f14e45f-ceea-4d0e-9f3a-0e2b1c4d5a6b',
  external_reference: 'LOAN-8841',
});

const timestamp = Math.floor(Date.now() / 1000).toString();
const path = '/api/partner/v1/disbursements';
const bodyHash = crypto.createHash('sha256').update(body).digest('hex');
const payload = `${timestamp}|POST|${path}|application/json|${bodyHash}`;
const signature = crypto.createHmac('sha256', apiSecret).update(payload).digest('hex');

const response = await fetch(`https://prodsacco.officeug.com${path}`, {
  method: 'POST',
  body, // the exact string that was hashed
  headers: {
    'X-Api-Key': apiKey,
    'X-Timestamp': timestamp,
    'X-Signature': signature,
    'Content-Type': 'application/json',
  },
});
console.log(await response.json());

Example response — completed

{
  "success": true,
  "message": "Disbursement completed.",
  "data": {
    "operation_id": 412,
    "status": "completed",
    "transaction_ref": "TXN-20260612-0091",
    "balance_after": 452300.00
  },
  "request_id": "9c2d1a4e-3b5f-4e7a-8d6c-1f2e3a4b5c6d"
}

Example response — idempotent replay

If you send the same idempotency_key again, you get the original outcome back, not a fresh disbursement:

{
  "success": true,
  "message": "Idempotent replay — returning the original result.",
  "data": { "operation_id": 412, "status": "completed", "amount": 50000.00 },
  "request_id": "..."
}

Errors specific to this endpoint

HTTP error_code Meaning
404 ACCOUNT_NOT_FOUND No active account with this account_ref exists for your SACCO.
422 DISBURSEMENT_FAILED The disbursement could not be completed — message carries the specific reason.