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
    }
}

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;

Last updated

Was this helpful?