Manage wallet operations including balance checks, top-ups, and withdrawals for your customers.
<?php
$url = "https://api.hashback.co.ke/walletbalance";
$data = array(
'api_key' => 'api_keyxxxxx',
'account_id' => 'WALLET_ID'
);
$options = array(
'http' => array(
'header' => "Content-type: application/json",
'method' => 'POST',
'content' => json_encode($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
?>
const response = await fetch('https://api.hashback.co.ke/v2/topup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
api_key: 'api_keyxxxxx',
walletid: 'WALLET_ID',
amount: '1',
msisdn: '0712345678'
})
});
const result = await response.json();
console.log(result);
POST
https://api.hashback.co.ke/V2/processwithdrawal
Request Parameters
| Parameter |
Type |
Required |
Description |
| api_key |
String |
Yes |
Your authentication API key |
| msisdn |
String |
Yes |
Customer phone number to receive withdrawal |
| amount |
String |
Yes |
Withdrawal amount |
| SecurityCredential |
String |
Yes |
Security credential generated from your portal |
Example Request
import requests
import json
url = "https://api.hashback.co.ke/V2/processwithdrawal"
data = {
"api_key": "API_KEY",
"msisdn": "07123456789",
"amount": 20,
"SecurityCredential": "SECURITY_CREDENTIAL"
}
response = requests.post(url, json=data)
result = response.json()
print(json.dumps(result, indent=2))
Example Response
{
"success": true,
"message": "Withdrawal processed successfully",
"details": {
"amount": 50,
"fee": 5,
"total": 55,
"balance": 92,
"transaction_reference": "HW1WH20250809175842864"
}
}
{
"success": false,
"message": "Insufficient funds. You need KES 18.00 more (KES 50.00 + KES 5.00 fee)"
}
Deprecated API Version
This V1 endpoint is obsolete and will be removed after October 26, 2025. Please migrate to the V2 endpoint.
POST
https://api.hashback.co.ke/processwithdrawal
Request Parameters
| Parameter |
Type |
Required |
Description |
| api_key |
String |
Yes |
Your authentication API key |
| msisdn |
String |
Yes |
Customer phone number to receive withdrawal |
| amount |
String |
Yes |
Withdrawal amount |
| SecurityCredential |
String |
Yes |
Security credential generated from your portal |
Example Request
import requests
import json
url = "https://api.hashback.co.ke/processwithdrawal"
data = {
"api_key": "API_KEY",
"msisdn": "07123456789",
"amount": 20,
"SecurityCredential": "SECURITY_CREDENTIAL"
}
response = requests.post(url, json=data)
result = response.json()
print(json.dumps(result, indent=2))
Example Response
{
"success": true,
"message": "Withdrawal processed successfully",
"details": {
"amount": 50,
"fee": 5,
"total": 55,
"balance": 92,
"transaction_reference": "HW1WH20250809175842864"
}
}