Skip to main content
POST
Validate phone number
Checks a recipient before you pay them: the number format, the country it belongs to, and whether that corridor is supported. Send phone numbers in international format, with the country code. If we can’t determine the country from the number, the response tells you so rather than guessing a corridor and validating the wrong one. For paybill and till, there is no useful format check: a shortcode is just digits, and whether it exists is exactly what the lookup answers. Those two types therefore require name lookup to be enabled on your account.

Reading the result

nameLookupStatus tells you whether the name resolved, and nameLookupReason says why when it didn’t — so you can tell a number that doesn’t exist from a corridor that can’t resolve names from something worth retrying. isValid reports the number format, and flips to false once a lookup proves the destination unusable. A name mismatch is different: the number is real, so isValid stays true and nameMatch.matched is what tells you the holder isn’t who you expected.
Full status meanings, retry guidance, and how these fields relate are on Account Validation.
Use the account test values to reproduce unresolvable numbers, timeouts and mismatched names on demand.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
accountType
enum<string>
default:mobile_money

What to validate. Defaults to mobile_money; paybill and till take shortCode instead of phoneNumber.

Available options:
mobile_money,
paybill,
till
phoneNumber
string

Required unless accountType is paybill or till. Send it in international format, including the country code.

Example:

"+254712345678"

shortCode
string

Required when accountType is paybill or till. The M-PESA shortcode.

Example:

"247247"

accountReference
string

Account number on a paybill — what a payer would enter. Paybill only.

Example:

"0670179741746"

countryCode
string

Country code (ISO2). Only needed for paybill and till, where it defaults to KE.

Example:

"KE"

network
enum<string>

Mobile network, used to route the name lookup. Optional — it is resolved from the phone number prefix when omitted. Supply it only if the number has been ported, or if the response tells you the network could not be determined.

Available options:
MTN,
AIRTEL,
VODAFONE,
TIGO,
YAS,
ORANGE,
NOT_SUPPORTED,
ZAMTEL,
MPESA,
CHECKOUT,
BKTRX,
CRDTRX,
MOOV,
TMONEY,
FREE,
EXPRESSO,
HALOPESA,
VODACOM,
WAVE
Example:

"MPESA"

accountName
string

Name you expect on this account. Returns a nameMatch score against the real one.

Example:

"Jane Doe"

Response

success
boolean
Example:

true

message
string
Example:

"Phone number validated successfully."

data
object