Verify Phone Number
This endpoint allows you to verify that the phone number you are using is valid. This is an important step before processing payments to ensure the recipient can receive the transaction.
Overview
Phone verification is crucial for successful payment processing. This endpoint validates:
- Phone number format
- Country code validity
- Network operator compatibility
- Number reachability
Supported Countries:
West Africa
| Country | Country Code | Operators |
|---|---|---|
| COTE D'IVOIRE (CI) | +225 | MTN, MOOV, ORANGE |
| TOGO (TG) | +228 | MOOV, TMONEY |
| SENEGAL (SN) | +221 | ORANGE, FREE |
| MALI (ML) | +223 | MOOV |
| BURKINA FASO (BF) | +226 | MOOV, ORANGE |
| BENIN (BJ) | +229 | MOOV |
Central Africa
| Country | Country Code | Operators |
|---|---|---|
| CAMEROUN (CM) | +237 | MTN, ORANGE |
| GABON (GA) | +241 | AIRTEL, MOOV |
| TCHAD (TD) | +235 | AIRTEL, MOOV |
| RCA (Centrafrique - CF) | +236 | ORANGE |
| CONGO (CG) | +242 | AIRTEL, MTN |
| GUINEE EQUATORIALE (GQ) | +240 | MUNI DINERO |
Request
Method: POST
URL: {{base_url}}clients/verify_phoneNumber
Headers:
SECRETKEY: Your API secret keyContent-Type:application/json
Parameters:
mobile_phone(required): The user mobile phone to whom the payment will be done
cURL Request
curl -X POST \
https://sandbox.peexit.com/api/v1/clients/verify_phoneNumber \
-H 'SECRETKEY: ########-####-####-####-############' \
-H 'Content-Type: application/json' \
-d '{
"mobile_phone": "+237677777777"
}'
Request Body
Request payload
{
"mobile_phone": "+237677777777"
}
Note: The phone number must be in international format with the country code (e.g., +237677777777 for Cameroon).
Response
Status 200 - Success
The verification response includes detailed information about the phone number:
phone: The verified phone numbervalid: Boolean indicating if the number is validmnc: Mobile Network Codelocal_format: Number in local formatinternational_format: Number in international formatcountry_prefix: Country calling codecountry_code: ISO country codecountry_name: Full country name
Success Response
{
"phone": "237677777777",
"valid": true,
"mnc": "mtn-cm",
"local_format": "677777777",
"international_format": "+237677777777",
"country_prefix": "+237",
"country_code": "cm",
"country_name": "Cameroon"
}
Error Handling
Status 401 - Unauthorized
This means you're not authorized to make requests on the server. This could happen if:
- You have not provided a correct secret key
- Your secret key is wrong or expired
Status 422 - Bad Request
The phone number format is invalid.
Error Response
{
"error": "Unauthorized",
"message": "Invalid or missing secret key"
}
Invalid phone format
{
"error": {
"statusCode": 422,
"name": "UnprocessableEntity",
"message": "Invalid wallet number",
"details": "+237 : the phone number does not respect my dialing format !",
}
}
Phone Number Format
Accepted Formats
- International format:
+237677777777
Invalid Formats
- With spaces:
+237 677 777 777 - With dashes:
+237-677-777-777 - Missing country code:
677777777 - Wrong country code:
+1677777777 - Letters in number:
+237abcdefgh
Network Codes
Common network codes returned:
mtn-cm: MTN Cameroonorange-cm: Orange Cameroon- Other operators as supported
Use Cases
Phone verification is typically used for:
- Pre-payment Validation - Verify recipient before creating payment
- Form Validation - Real-time validation in user interfaces
- Compliance - Ensure regulatory compliance for payments
Next Steps
After verifying a phone number, you can proceed with: