Responses
200 OK
{
"payment_channels": [
{
"id": 26703032,
"transaction_type": "CustomerPayBillOnline",
"channel_type": "bank",
"account_id": 18563,
"short_code": "522522",
"account_number": "232323232",
"description": "PESA BANK",
"is_active": true,
"balance_plain": null,
"created_at": "2026-01-02T07:18:33.815944Z",
"updated_at": "2026-01-02T07:18:33.814576Z"
}
],
"pagination": {
"count": 1,
"next_page": null,
"num_pages": 1,
"page": 1,
"per": 20,
"prev_page": null
}
}
400 Bad Request
{
"error_message": "Invalid request"
}
Try It Out
Please set your authentication token in the sidebar to test this API.
Code Samples
curl.exe -X GET 'https://upesipay.com/api/v2/payment_channels?is_active=true' -H 'Authorization: Basic YOUR_AUTH_TOKEN' -H 'Content-Type: application/json'
const url = 'https://upesipay.com/api/v2/payment_channels?is_active=true';
const options = {
method: 'GET',
headers: {
'Authorization': 'Basic YOUR_AUTH_TOKEN',
'Content-Type': 'application/json'
}
};
fetch(url, options)
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
import requests
import json
url = 'https://upesipay.com/api/v2/payment_channels?is_active=true'
headers = {
'Authorization': 'Basic YOUR_AUTH_TOKEN',
'Content-Type': 'application/json',
}
response = requests.get(url, headers=headers)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://upesipay.com/api/v2/payment_channels?is_active=true',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Basic YOUR_AUTH_TOKEN',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
const axios = require('axios');
const config = {
method: 'GET',
url: 'https://upesipay.com/api/v2/payment_channels?is_active=true',
headers: {
'Authorization': 'Basic YOUR_AUTH_TOKEN',
'Content-Type': 'application/json',
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.http.HttpRequest.BodyPublishers;
import java.net.http.HttpResponse.BodyHandlers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create("https://upesipay.com/api/v2/payment_channels?is_active=true"))
.get(BodyPublishers.noBody());
requestBuilder.header("Authorization", "Basic YOUR_AUTH_TOKEN");
requestBuilder.header("Content-Type", "application/json");
HttpRequest request = requestBuilder.build();
try {
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
System.out.println(response.body());
} catch (Exception e) {
e.printStackTrace();
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://upesipay.com/api/v2/payment_channels?is_active=true"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Basic YOUR_AUTH_TOKEN")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://upesipay.com/api/v2/payment_channels?is_active=true')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Basic YOUR_AUTH_TOKEN'
request['Content-Type'] = 'application/json'
response = http.request(request)
puts JSON.parse(response.body)
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Basic YOUR_AUTH_TOKEN");
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
var request = new HttpRequestMessage(HttpMethod.GET, "https://upesipay.com/api/v2/payment_channels?is_active=true");
var response = await client.SendAsync(request);
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
import Foundation
let url = URL(string: "https://upesipay.com/api/v2/payment_channels?is_active=true")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.setValue("Basic YOUR_AUTH_TOKEN", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let data = data {
if let json = try? JSONSerialization.jsonObject(with: data) {
print(json)
}
}
}
task.resume()
import okhttp3.*
import java.io.IOException
val client = OkHttpClient()
val request = Request.Builder()
.url("https://upesipay.com/api/v2/payment_channels?is_active=true")
.get(null)
.addHeader("Authorization", "Basic YOUR_AUTH_TOKEN")
.addHeader("Content-Type", "application/json")
.build()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
e.printStackTrace()
}
override fun onResponse(call: Call, response: Response) {
println(response.body?.string())
}
})