GET: Payments Wallet Balance

On Pay Hero Kenya when you create an account, you get a payments wallet, this wallet is used to hold funds that customers Pay You via 3rd party services that we have integrated with.

You can withdraw funds held in your payments wallet to MPESA, Airtel Money, T-Kash, or Bank Accounts.

API Method

This endpoint is used to query for your payments wallet balance

GET https://backend.payhero.co.ke/api/v2/payment_channels/{WalletChannelID}

Query Parameters

Name
Type
Description

WalletChannelID*

Integer

Your wallet payment channel ID

Headers

Name
Type
Description

Authorization:*

String

Basic basicAuthToken

{
    "id": 16823,
    "transaction_type": "CustomerBuyGoodsOnline",
    "channel_type": "wallet",
    "account_id": 5234,
    "short_code": "553125",
    "account_number": "5234",
    "description": "SASAPAY WALLET",
    "is_active": true,
    "balance_plain": {
        "last_balance": 4700,
        "balance": 4700,
        "last_reference": "cost_TBH2D54JQA"
    },
    "created_at": "2025-02-13T15:39:14.5238Z",
    "updated_at": "2025-02-17T06:29:28.485494Z"
}

Sample Code

This represents PHP Curl example of how to make the request, you can implement this in your specific language of choice

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://backend.payhero.co.ke/api/v2/payment_channels/16823',
  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 => array(
    'Authorization: Basic b2pjSGc3OEVVanNHdDduU0lLQlVySlhkZk9SaFIwZw=='
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Last updated

Was this helpful?