curl --request POST \
--url https://api.sandbox.pawapay.io/v1/predict-correspondent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"msisdn": "+260 763-456789"
}
'import requests
url = "https://api.sandbox.pawapay.io/v1/predict-correspondent"
payload = { "msisdn": "+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({msisdn: '+260 763-456789'})
};
fetch('https://api.sandbox.pawapay.io/v1/predict-correspondent', 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/v1/predict-correspondent",
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([
'msisdn' => '+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/v1/predict-correspondent"
payload := strings.NewReader("{\n \"msisdn\": \"+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/v1/predict-correspondent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"msisdn\": \"+260 763-456789\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.pawapay.io/v1/predict-correspondent")
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 \"msisdn\": \"+260 763-456789\"\n}"
response = http.request(request)
puts response.read_body{
"country": "ZMB",
"operator": "MTN",
"correspondent": "MTN_MOMO_ZMB",
"msisdn": "260763456789"
}{
"errorId": "94bd5e86-9bc4-4328-b128-c705f6496db8",
"errorCode": 1,
"errorMessage": "INVALID_INPUT: Missing required property 'msisdn'"
}{
"errorId": "cad1529e-040b-4c9d-a21d-2ba3056ff750",
"errorCode": 2,
"errorMessage": "Authentication error"
}{
"errorId": "daa495f0-541d-4192-b636-a8877b25a510",
"errorCode": 3,
"errorMessage": "Authorization error"
}{
"errorId": "94bd5e86-9bc4-4328-b128-c705f6496db8",
"errorCode": 0,
"errorMessage": "Internal error"
}Predict Correspondent
curl --request POST \
--url https://api.sandbox.pawapay.io/v1/predict-correspondent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"msisdn": "+260 763-456789"
}
'import requests
url = "https://api.sandbox.pawapay.io/v1/predict-correspondent"
payload = { "msisdn": "+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({msisdn: '+260 763-456789'})
};
fetch('https://api.sandbox.pawapay.io/v1/predict-correspondent', 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/v1/predict-correspondent",
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([
'msisdn' => '+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/v1/predict-correspondent"
payload := strings.NewReader("{\n \"msisdn\": \"+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/v1/predict-correspondent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"msisdn\": \"+260 763-456789\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.pawapay.io/v1/predict-correspondent")
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 \"msisdn\": \"+260 763-456789\"\n}"
response = http.request(request)
puts response.read_body{
"country": "ZMB",
"operator": "MTN",
"correspondent": "MTN_MOMO_ZMB",
"msisdn": "260763456789"
}{
"errorId": "94bd5e86-9bc4-4328-b128-c705f6496db8",
"errorCode": 1,
"errorMessage": "INVALID_INPUT: Missing required property 'msisdn'"
}{
"errorId": "cad1529e-040b-4c9d-a21d-2ba3056ff750",
"errorCode": 2,
"errorMessage": "Authentication error"
}{
"errorId": "daa495f0-541d-4192-b636-a8877b25a510",
"errorCode": 3,
"errorMessage": "Authorization error"
}{
"errorId": "94bd5e86-9bc4-4328-b128-c705f6496db8",
"errorCode": 0,
"errorMessage": "Internal error"
}Authorizations
See Authentication.
Body
The phone number (MSISDN) to predict the correspondent of. Must contain the country code.
The input will be sanitized by:
- removing the leading + sign
- removing all whitespace
- removing non-numeric characters
"+260 763-456789"
Response
Correspondent prediction was successful
The name of the MMO associated with the specified MSISDN.
"MTN"
The correspondent code refers to the specific MMO that the specified phone number (MSISDN) has an active mobile money wallet with.
You can find all the supported correspondents listed here.
The active configuration endpoint provides the list of correspondents configured for your account.
You can use the predict correspondent enpoint to predict the correct correspondent to use based on the phone number (MSISDN).
"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.
"260763456789"
Was this page helpful?