PAY HERO DOCS
  • Introduction-Pay Hero Developer APIs
  • Creating Account
  • Authorization
  • GET: Service Wallet Balance
  • GET: Payments Wallet Balance
  • POST: Service Wallet Top Up
  • POST: Initiate MPESA STK Push Request
  • Payment Button
  • Lipwa Link
  • POST: Pay Hero Wallet- Withdraw To Mobile
  • GET: Account Transactions
  • GET: Transaction Status
  • WooCommerce Plugin
    • Plugin Installation
  • Shopify
  • Videos
  • Other Integrations
  • Email API Reference
    • Register SMTP
    • Send Email
    • Mail status
  • WhatsApp API Reference
    • Introduction
    • Getting Started
    • Send API Whats App Text
    • Bulk WhatsApp API Messaging
    • Bulk WhatsApp Using UI/CSV File
Powered by GitBook
On this page
  • API Method
  • This endpoint is used to query for your service wallet balance
  • Sample Code:

Was this helpful?

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

Name
Type
Description

wallet_type*

String

Value : service_wallet

Headers

Name
Type
Description

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;
PreviousAuthorizationNextGET: Payments Wallet Balance

Last updated 9 months ago

Was this helpful?