Help Guide
M-pesa Hash Decoder
Safaricom M-Pesa now sends a hashed phone number instead of the actual customer phone number when a payment is made to your till or paybill.
Our portal has a Hash Decoder feature where you can query a phone number by simply providing the hash and clicking the query button.
(Note: If you integrate your till or paybill into our portal, you do not need to manually use the hash decoder. Our system automatically decodes customer phone numbers internally by default.)
Navigate to the Hash Decoder page on the side menu.
Enter a hash value into the provided box and click the query button.
Within a moment, the system will display the corresponding phone number if the hash is valid.
For developers, you can also decode hashes programmatically via our API.
Make a POST request to our endpoint, for example:
curl -X POST "https://transactions.prasams.com/api/v2/decode-hash" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_api_key_here" \
-d '{"hash": "your_hash_key_here"}'
✅ Successful response
{"http_code":200,"status":"success","description":"Hash decoded successfully","data":{"phone":"25472000000"}}
❌ Error response
{"http_code":404,"status":"error","description":"The error message"}
❌ Possible Error Responses
{
"http_code": 401,
"status": "error",
"description": "API key is required"
}
{
"http_code": 401,
"status": "error",
"description": "Invalid API key"
}
{
"http_code": 400,
"status": "error",
"description": "Please provide a hash"
}
{
"http_code": 429,
"status": "error",
"description": "You have reached the free usage limit! Please top up for unrestricted access or try again :time_to_resume."
}
{
"http_code": 402,
"status": "error",
"description": "Insufficient balance!"
}
{
"http_code": 402,
"status": "error",
"description": "Insufficient balance! Please top up or try again :time_to_resume."
}
{
"http_code": 404,
"status": "error",
"description": "No phone number found for the provided hash"
}
If you encounter issues while using the Hash Decoder, ensure your hash values are correct and that you have the necessary
API keys when using the API.
For further assistance, consult our support team.