List available payment networks
curl --request POST \
--url https://prod-api.pcxpay.com/v1/externals/networks \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"country_code": "KE"
}
'import requests
url = "https://prod-api.pcxpay.com/v1/externals/networks"
payload = { "country_code": "KE" }
headers = {
"Authorization": "<authorization>",
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'X-Api-Key': '<x-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({country_code: 'KE'})
};
fetch('https://prod-api.pcxpay.com/v1/externals/networks', 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://prod-api.pcxpay.com/v1/externals/networks",
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([
'country_code' => 'KE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$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://prod-api.pcxpay.com/v1/externals/networks"
payload := strings.NewReader("{\n \"country_code\": \"KE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Api-Key", "<x-api-key>")
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://prod-api.pcxpay.com/v1/externals/networks")
.header("Authorization", "<authorization>")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"country_code\": \"KE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.pcxpay.com/v1/externals/networks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country_code\": \"KE\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"networks": [
{
"name": "Mobile Wallet (M-PESA)",
"code": "<string>",
"id": "<string>",
"type": "bank"
}
]
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}Payment Initiation
List available payment networks
Returns the available payment networks (banks and mobile money operators) for a given country. The upstream provider is selected automatically based on the country code.
Use the code value returned here as the provider field inside mobile_money_details, or as the bank_code for bank-transfer beneficiaries, when initiating a payment.
POST
/
externals
/
networks
List available payment networks
curl --request POST \
--url https://prod-api.pcxpay.com/v1/externals/networks \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"country_code": "KE"
}
'import requests
url = "https://prod-api.pcxpay.com/v1/externals/networks"
payload = { "country_code": "KE" }
headers = {
"Authorization": "<authorization>",
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'X-Api-Key': '<x-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({country_code: 'KE'})
};
fetch('https://prod-api.pcxpay.com/v1/externals/networks', 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://prod-api.pcxpay.com/v1/externals/networks",
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([
'country_code' => 'KE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$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://prod-api.pcxpay.com/v1/externals/networks"
payload := strings.NewReader("{\n \"country_code\": \"KE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Api-Key", "<x-api-key>")
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://prod-api.pcxpay.com/v1/externals/networks")
.header("Authorization", "<authorization>")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"country_code\": \"KE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.pcxpay.com/v1/externals/networks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country_code\": \"KE\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"networks": [
{
"name": "Mobile Wallet (M-PESA)",
"code": "<string>",
"id": "<string>",
"type": "bank"
}
]
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}Headers
Bearer JWT for user-facing flows (Bearer eyJraWQ...), or the literal string NONE when authenticating via API key.
Example:
"Bearer eyJraWQ..."
API key for server-to-server flows, or the literal string NONE when authenticating via JWT.
Example:
"pcx_abc123_xxxx"
Body
application/json
ISO alpha-2 country code. Supported values are GH, NG, BJ, BW, CG, CI, CM, ET, GA, KE, MW, RW, SN, TG, TZ, ZA, and ZM.
Example:
"KE"