Get phone number operator
curl --request POST \
--url https://api.tandapay.io/api/b2b/utilities/operators/phone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "KES",
"country": "KE",
"phoneNumber": "+254712345678"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({currency: 'KES', country: 'KE', phoneNumber: '+254712345678'})
};
fetch('https://api.tandapay.io/api/b2b/utilities/operators/phone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tandapay.io/api/b2b/utilities/operators/phone"
payload = {
"currency": "KES",
"country": "KE",
"phoneNumber": "+254712345678"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tandapay.io/api/b2b/utilities/operators/phone",
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([
'currency' => 'KES',
'country' => 'KE',
'phoneNumber' => '+254712345678'
]),
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;
}{
"success": true,
"data": [
"safaricom"
]
}{
"success": false,
"message": "Unknown network prefix.",
"errorCode": "E-API-GN-UTL.S-232"
}{
"success": false,
"message": "Unauthorized"
}Reference data
Get phone number operator
Find which network a phone number is on.
POST
/
api
/
b2b
/
utilities
/
operators
/
phone
Get phone number operator
curl --request POST \
--url https://api.tandapay.io/api/b2b/utilities/operators/phone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "KES",
"country": "KE",
"phoneNumber": "+254712345678"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({currency: 'KES', country: 'KE', phoneNumber: '+254712345678'})
};
fetch('https://api.tandapay.io/api/b2b/utilities/operators/phone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tandapay.io/api/b2b/utilities/operators/phone"
payload = {
"currency": "KES",
"country": "KE",
"phoneNumber": "+254712345678"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tandapay.io/api/b2b/utilities/operators/phone",
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([
'currency' => 'KES',
'country' => 'KE',
'phoneNumber' => '+254712345678'
]),
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;
}{
"success": true,
"data": [
"safaricom"
]
}{
"success": false,
"message": "Unknown network prefix.",
"errorCode": "E-API-GN-UTL.S-232"
}{
"success": false,
"message": "Unauthorized"
}Authorizations
Token from Generate bearer token.
Body
application/json

