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
  • Payment Channels
    • Get PH Bank Paybills
    • Register Payment Channel
    • Get Payment Channels
Powered by GitBook
On this page
  • GET payment channels
  • Sample Code-PHP

Was this helpful?

  1. Payment Channels

Get Payment Channels

This API enables you to retrieve all your payment channels registered on your account.

GET payment channels

GET

https://backend.payhero.co.ke/api/v2/payment_channels

<Description of the endpoint>

Headers

Name
Value

Content-Type

application/json

Authorization

Basic <token>

Parameters

Name
Type
Description

is_active

boolean

Can be true or false to filter active or inactive channels (optional)

Response

{
    "payment_channels": [
        {
            "id": 26703032,
            "transaction_type": "CustomerPayBillOnline",
            "channel_type": "bank",
            "account_id": 18563,
            "short_code": "522522",
            "account_number": "232323232",
            "description": "PESA BANK",
            "is_active": true,
            "balance_plain": null,
            "created_at": "2024-02-07T07:18:33.815944Z",
            "updated_at": "2024-02-07T07:18:33.814576Z"
        },
    ],
    "pagination": {
        "count": 1,
        "next_page": null,
        "num_pages": 1,
        "page": 1,
        "per": 20,
        "prev_page": null
    }
}
{
  "error_message": "Invalid request"
}

Sample Code-PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://backend.payhero.co.ke/api/v2/payment_channels?is_active=true',
  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 3dlhrQ0VWUWJHNDVVVnNaMEdDSw=='
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
PreviousRegister Payment Channel

Last updated 2 days ago

Was this helpful?