🔢GET: Service Wallet Balance

On Pay Hero Kenya when you create an account, you get a service wallet, this wallet is used to fund your service usage like payments transaction costs, SMS, WhatsApp and withdrawals

API Method

This endpoint is used to query for your service wallet balance

GET https://backend.payhero.co.ke/api/v2/wallets

Query Parameters

NameTypeDescription

wallet_type*

String

Value : service_wallet

Headers

NameTypeDescription

Authorization:*

String

Basic basicAuthToken

{
"id":22156,
"account_id":22183,
"wallet_type":"service_wallet",
"currency":"KES",
"available_balance":15101.36,
"created_at":"2024-01-12T08:36:38.209573Z",
"updated_at":"2024-01-15T12:40:33.157508Z"
}

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/wallets?wallet_type=service_wallet',
  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 3A6anVoWFZrRk5qSVl0MGNMOERGMlR3dlhrQ0VWUWJHNDVVVnNaMEdDSw=='
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Last updated