Webhooks
Waka sends one POST to your callback URL when a payout or collection reaches a final status. For the full handling flow see the Webhooks guide.
Callback URL
Waka picks the destination in this order:
- The
callbackUrlin the payout or collection request (that transaction only) - Your business account’s saved default URL, set up by Waka
- No webhook if neither is set. Poll the status endpoint instead
callbackUrl must be an absolute URL. Use HTTPS in production.
Events
| Product | Event | Final statuses |
|---|---|---|
| Payouts | business.payout.updated | termination_success, termination_failure |
| Collections | business.collection.updated | collection_success, collection_failure, cancelled |
Each webhook is sent once. There are no automatic retries.
Payout payload
{
"event": "business.payout.updated",
"status": "termination_success",
"wakapayReference": "a82a7489-3c2f-780d-a083-d1940f49f721",
"partnerReference": "INV-1001",
"fxRate": 2580.46,
"feeAmount": 0.15,
"debitAmount": 10.00,
"totalDebit": 10.15,
"signature": "abc123..."
}| Field | Description |
|---|---|
event | Always business.payout.updated for payouts |
status | termination_success or termination_failure |
wakapayReference | Waka’s transaction ID. Use it to skip duplicates |
partnerReference | The businessReference you sent |
fxRate | Receiver-currency units per 1 sender unit. Left out for same-currency payouts |
debitAmount | Principal taken from your wallet |
feeAmount | Fee charged. Can be 0.00 |
totalDebit | debitAmount plus feeAmount |
signature | See Verify a payout webhook |
On termination_failure the funds return to your available balance.
Collection payload
{
"event": "business.collection.updated",
"collectionId": "019abc...",
"businessId": "biz_abc123",
"status": "collection_success",
"amount": 5000,
"currency": "TZS",
"mobile": "+2557XXXXXXXX",
"reference": "INV-1001",
"provider": "airtel",
"mnoPaymentReference": "AIRTEL123456",
"occurredAt": "2024-08-08T07:54:12Z"
}Webhook security
Verify a payout webhook
The signature field is the SHA-256 hash of apiKey:apiSecret:wakapayReference, hex-encoded. Rebuild it with your credentials and the wakapayReference from the payload, then compare ignoring case. For example, the input string is wk_live_xxx:secret_yyy:a82a7489-3c2f-780d-a083-d1940f49f721.
const crypto = require("crypto")
function isValidPayoutWebhook(apiKey, apiSecret, payload) {
const raw = `${apiKey}:${apiSecret}:${payload.wakapayReference}`
const expected = crypto.createHash("sha256").update(raw).digest("hex")
return expected.toLowerCase() === (payload.signature || "").toLowerCase()
}import hashlib
def is_valid_payout_webhook(api_key, api_secret, payload):
raw = f"{api_key}:{api_secret}:{payload['wakapayReference']}"
expected = hashlib.sha256(raw.encode()).hexdigest()
return expected.lower() == (payload.get("signature") or "").lower()Verify a collection webhook
The X-Wakapay-Signature header is the HMAC-SHA256 of the raw request body, keyed with your apiSecret, hex-encoded. Compute it on the raw bytes before parsing the JSON.
const crypto = require("crypto")
function isValidCollectionWebhook(apiSecret, rawBody, header) {
const expected = crypto.createHmac("sha256", apiSecret).update(rawBody).digest("hex")
return expected.toLowerCase() === (header || "").toLowerCase()
}import hashlib, hmac
def is_valid_collection_webhook(api_secret, raw_body: bytes, header):
expected = hmac.new(api_secret.encode(), raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected.lower(), (header or "").lower())Reject any webhook whose signature doesn’t match.
Status endpoints
The status endpoints are the source of truth. Poll them for anything still pending, or when a webhook doesn’t arrive.
| Product | Endpoint |
|---|---|
| Payouts | GET /business/transactions/{businessReference} |
| Collections | GET /business/collections/{collectionId} |
curl https://api.test.wakapay.io/business/transactions/EXT-INV-2026-0001 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"{
"code": 0,
"error": "transaction not found"
}A 404 means the payout was never created. Retry with the same reference.
Troubleshooting
| Problem | Check |
|---|---|
| Signature doesn’t match | Payouts: the string is exactly apiKey:apiSecret:wakapayReference. Collections: hash the raw body, not parsed JSON |
| Webhook never arrives | The URL is public, has a valid HTTPS certificate, and is the one Waka has on file |
| Your handler times out | Return 200 first and move slow work to a background queue |