Account Lookup
Account Lookup allows you to check if a particular mobile money or bank account exists and is valid before initiating a payment or transfer. This helps prevent failed payment attempts due to incorrect or non-existent account numbers.
Currently, Modem Pay supports account lookup for Afrimoney accounts.
Endpoint
GET /misc/account-lookup/:network/:account_number
:network— The network you want to check on (currently onlyafrimoneyis supported).:account_number— The account number you wish to validate.
Note: Use the 7-digit Afrimoney number without the country code.
Example:
GET https://api.modempay.com/h2h/v1/misc/account-lookup/afrimoney/7012345
Curl Example
curl -X GET "https://api.modempay.com/h2h/v1/misc/account-lookup/afrimoney/7012345" \
-H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
"is_active": true,
"account_number": "7012345"
}
- If the account is valid, you'll receive
is_active: trueand, when possible, the account holder's name. - If the account does not exist or is not valid, you'll receive
is_active: false.
Notes
- Always enter the Afrimoney account number as 7 digits with no country code (e.g.,
7012345instead of2207012345). - Use account lookup to provide instant feedback to users when they enter an account number, especially in your UI forms.
- This can reduce payment failures and customer support issues due to incorrect account details.
- Future updates may extend support to other networks.