Headers
| Parameter |
Type |
Description |
| Authorization* |
String |
Basic auth token |
Query Parameters
| Parameter |
Type |
Description |
| channel_id* |
Integer |
Your wallet payment channel ID |
Responses
200 OK
{
"id": 16823,
"transaction_type": "CustomerBuyGoodsOnline",
"channel_type": "wallet",
"account_id": 5234,
"short_code": "553125",
"account_number": "5234",
"description": "PAYMENT WALLET",
"is_active": true,
"balance_plain": {
"last_balance": 4700,
"balance": 4700,
"last_reference": "cost_TBH2D54JQA"
},
"created_at": "2026-01-02T15:39:14.5238Z",
"updated_at": "2026-01-02T06:29:28.485494Z"
}
Notes
You can withdraw funds held in your payments wallet to MPESA
Code Samples
curl -X GET \
'https://upesipay.com/api/v2/payment_channels/16823' \
-H 'Authorization: Basic YOUR_AUTH_TOKEN'
const url = 'https://upesipay.com/api/v2/payment_channels/16823';
const options = {
method: 'GET',
headers: {
'Authorization': 'Basic YOUR_AUTH_TOKEN'
}
};
fetch(url, options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const axios = require('axios');
const config = {
method: 'get',
url: 'https://upesipay.com/api/v2/payment_channels/16823',
headers: {
'Authorization': 'Basic YOUR_AUTH_TOKEN'
}
};
axios(config)
.then(response => console.log(response.data))
.catch(error => console.error(error));
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://upesipay.com/api/v2/payment_channels/16823',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
'Authorization: Basic YOUR_AUTH_TOKEN'
),
));
$response = curl_exec($curl);
echo $response;
import requests
url = 'https://upesipay.com/api/v2/payment_channels/16823'
headers = {
'Authorization': 'Basic YOUR_AUTH_TOKEN'
}
response = requests.get(url, headers=headers)
print(response.json())
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create("https://upesipay.com/api/v2/payment_channels/16823"))
.header("Authorization", "Basic YOUR_AUTH_TOKEN")
.GET()
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"net/http"
"io"
)
url := "https://upesipay.com/api/v2/payment_channels/16823"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Basic YOUR_AUTH_TOKEN")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
require 'net/http'
require 'json'
uri = URI('https://upesipay.com/api/v2/payment_channels/16823')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Basic YOUR_AUTH_TOKEN'
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
response = http.request(request)
puts JSON.parse(response.body)
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Basic YOUR_AUTH_TOKEN");
var response = await client.GetAsync("https://upesipay.com/api/v2/payment_channels/16823");
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
import Foundation
let url = URL(string: "https://upesipay.com/api/v2/payment_channels/16823")!
var request = URLRequest(url: url)
request.setValue("Basic YOUR_AUTH_TOKEN", forHTTPHeaderField: "Authorization")
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/16823")
.addHeader("Authorization", "Basic YOUR_AUTH_TOKEN")
.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())
}
})