Responses
200 OK
{
"id": 2429,
"transaction_type": "CustomerPayBillOnline",
"channel_type": "bank",
"account_id": 5000,
"short_code": "522522",
"account_number": "1280006242",
"description": "KCB Bank",
"is_active": true,
"balance_plain": null,
"created_at": "2026-01-02T14:56:01.513658753Z",
"updated_at": "2026-01-02T14:56:01.513658753Z"
}
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 POST 'https://upesipay.com/api/v2/payment_channels' -H 'Authorization: Basic YOUR_AUTH_TOKEN' -H 'Content-Type: application/json' -d '{"channel_type":"bank","account_id":1219,"short_code":"522522","account_number":"1299006242","description":"KCB Bank"}'
const url = 'https://upesipay.com/api/v2/payment_channels';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic YOUR_AUTH_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
channel_type: 'bank',
account_id: 1219,
short_code: '522522',
account_number: '1299006242',
description: 'KCB Bank'
})
};
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'
headers = {
'Authorization': 'Basic YOUR_AUTH_TOKEN',
'Content-Type': 'application/json',
}
payload = {
'channel_type': 'bank',
'account_id': 1219,
'short_code': '522522',
'account_number': '1299006242',
'description': 'KCB Bank'
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://upesipay.com/api/v2/payment_channels',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"channel_type": "bank",
"account_id": 1219,
"short_code": "522522",
"account_number": "1299006242",
"description": "KCB Bank"
}',
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: 'POST',
url: 'https://upesipay.com/api/v2/payment_channels',
headers: {
'Authorization': 'Basic YOUR_AUTH_TOKEN',
'Content-Type': 'application/json',
},
data: {
channel_type: 'bank',
account_id: 1219,
short_code: '522522',
account_number: '1299006242',
description: 'KCB Bank'
}
};
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"))
.post(BodyPublishers.ofString("{\"channel_type\":\"bank\",\"account_id\":1219,\"short_code\":\"522522\",\"account_number\":\"1299006242\",\"description\":\"KCB Bank\"}"));
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"
payload := map[string]interface{}{
"channel_type": "bank",
"account_id": 1219,
"short_code": "522522",
"account_number": "1299006242",
"description": "KCB Bank",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
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')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Basic YOUR_AUTH_TOKEN'
request['Content-Type'] = 'application/json'
request.body = '{\"channel_type\":\"bank\",\"account_id\":1219,\"short_code\":\"522522\",\"account_number\":\"1299006242\",\"description\":\"KCB Bank\"}'
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.POST, "https://upesipay.com/api/v2/payment_channels");
var json = JsonSerializer.Serialize(new {
channel_type = "bank",
account_id = 1219,
short_code = "522522",
account_number = "1299006242",
description = "KCB Bank"
});
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
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")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Basic YOUR_AUTH_TOKEN", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let body: [String: Any] = [
"channel_type": "bank",
"account_id": 1219,
"short_code": "522522",
"account_number": "1299006242",
"description": "KCB Bank"
]
request.httpBody = try? JSONSerialization.data(withJSONObject: body)
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 okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
import java.io.IOException
val client = OkHttpClient()
val json = """{"channel_type":"bank","account_id":1219,"short_code":"522522","account_number":"1299006242","description":"KCB Bank"}"""
val mediaType = "application/json".toMediaType()
val body = json.toRequestBody(mediaType)
val request = Request.Builder()
.url("https://upesipay.com/api/v2/payment_channels")
.post(body)
.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())
}
})