Validate phone number
curl --request POST \
--url https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phoneNumber": "+254719399210"
}
'import requests
url = "https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money"
payload = { "phoneNumber": "+254719399210" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({phoneNumber: '+254719399210'})
};
fetch('https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '+254719399210'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money"
payload := strings.NewReader("{\n \"phoneNumber\": \"+254719399210\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"+254719399210\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"+254719399210\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Phone number validated successfully.",
"data": {
"isValid": true,
"isSupported": true,
"requiresInternationalization": false,
"countryCode": "KE",
"countryName": "Kenya",
"callingCode": "<string>",
"internationalNumber": "+254719399210",
"nationalNumber": "0719399210",
"bankName": "<string>",
"currency": "KES",
"message": "<string>"
}
}{
"success": false,
"message": "Invalid request",
"data": {}
}{
"success": false,
"message": "Unauthorized",
"data": {}
}Customer Management
Validate Mobile Money Account
Validates a phone number in any format (with or without country code). Returns validation status, country information, formatted number, and whether the country is supported for mobile money.
POST
/
api
/
v3
/
customer
/
validate
/
mobile-money
Validate phone number
curl --request POST \
--url https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phoneNumber": "+254719399210"
}
'import requests
url = "https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money"
payload = { "phoneNumber": "+254719399210" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({phoneNumber: '+254719399210'})
};
fetch('https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '+254719399210'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money"
payload := strings.NewReader("{\n \"phoneNumber\": \"+254719399210\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"+254719399210\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.kotanipay.io/api/v3/customer/validate/mobile-money")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"+254719399210\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Phone number validated successfully.",
"data": {
"isValid": true,
"isSupported": true,
"requiresInternationalization": false,
"countryCode": "KE",
"countryName": "Kenya",
"callingCode": "<string>",
"internationalNumber": "+254719399210",
"nationalNumber": "0719399210",
"bankName": "<string>",
"currency": "KES",
"message": "<string>"
}
}{
"success": false,
"message": "Invalid request",
"data": {}
}{
"success": false,
"message": "Unauthorized",
"data": {}
}Validates a mobile money account by checking the phone number format and country support. Optionally verifies if the account exists and returns account holder information.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Phone number to validate (with or without country code). Examples: 0719399210, +254719399210, +27123456789
Example:
"+254719399210"
⌘I