Predict Provider
curl --request POST \
--url https://api.sandbox.pawapay.io/v2/predict-provider \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phoneNumber": "+260 763-456789"
}
'import requests
url = "https://api.sandbox.pawapay.io/v2/predict-provider"
payload = { "phoneNumber": "+260 763-456789" }
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: '+260 763-456789'})
};
fetch('https://api.sandbox.pawapay.io/v2/predict-provider', 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://api.sandbox.pawapay.io/v2/predict-provider",
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' => '+260 763-456789'
]),
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://api.sandbox.pawapay.io/v2/predict-provider"
payload := strings.NewReader("{\n \"phoneNumber\": \"+260 763-456789\"\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://api.sandbox.pawapay.io/v2/predict-provider")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"+260 763-456789\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.pawapay.io/v2/predict-provider")
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\": \"+260 763-456789\"\n}"
response = http.request(request)
puts response.read_body{
"country": "ZMB",
"provider": "MTN_MOMO_ZMB",
"phoneNumber": "260763456789"
}Toolkit
Predict Provider
POST
/
v2
/
predict-provider
Predict Provider
curl --request POST \
--url https://api.sandbox.pawapay.io/v2/predict-provider \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phoneNumber": "+260 763-456789"
}
'import requests
url = "https://api.sandbox.pawapay.io/v2/predict-provider"
payload = { "phoneNumber": "+260 763-456789" }
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: '+260 763-456789'})
};
fetch('https://api.sandbox.pawapay.io/v2/predict-provider', 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://api.sandbox.pawapay.io/v2/predict-provider",
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' => '+260 763-456789'
]),
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://api.sandbox.pawapay.io/v2/predict-provider"
payload := strings.NewReader("{\n \"phoneNumber\": \"+260 763-456789\"\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://api.sandbox.pawapay.io/v2/predict-provider")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"+260 763-456789\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.pawapay.io/v2/predict-provider")
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\": \"+260 763-456789\"\n}"
response = http.request(request)
puts response.read_body{
"country": "ZMB",
"provider": "MTN_MOMO_ZMB",
"phoneNumber": "260763456789"
}Predicts the provider for the specified phone number.
Average misprediction rate when using this endpoint is 0.12%.
Benin has a relatively high level of number portability and therefore has an average misprediction rate of 6%.
Authorizations
See Authentication.
Body
application/json
The phone number (MSISDN) to predict the provider of. Must contain the country code.
The input will be sanitized by:
- removing the leading + sign
- removing all whitespace
- removing non-numeric characters
Example:
"+260 763-456789"
Response
Provider prediction was completed
The provider represents the mobile money operator or processor that can process payments.
Find here a list of all the supported providers.
The active configuration endpoint provides the list of provider configured for your account.
You can use the predict provider enpoint to predict the provider to use based on the phone number (MSISDN).
Example:
"MTN_MOMO_ZMB"
The correctly formatted phone number (MSISDN) from your original request that is in a valid format for the rest of the PawaPay Merchant API.
Example:
"260763456789"
Was this page helpful?