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
  • Register Channel
  • Sample Code-PHP

Was this helpful?

  1. Payment Channels

Register Payment Channel

Get to easily register your payment channel e.g.: MPESA Pay bill, Till number or bank account on Pay Hero,

Register Channel

POST

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

You can register paybill,till or bank

Headers

Name
Value

Content-Type

application/json

Authorization

Basic <token>

Body

Name
Type
Description

channel_type

string

Can be: paybill, till or bank

account_id

number

Your pay Hero account id, you can check your profile details to get it.

number

Your MPESA paybill, till or bank paybill number

string

Your bank account number or paybill account number (if any)

string

Your bank name or beneficiary name for till or paybill

Response

{
    "id": 2429,
    "transaction_type": "CustomerPayBillOnline",
    "channel_type": "bank",
    "account_id": 5000,
    "short_code": "522522",
    "account_number": "1280006242",
    "description": "KCB Bank",
    "is_active": true,
    "balance_plain": null,
    "created_at": "2025-06-05T14:56:01.513658753Z",
    "updated_at": "2025-06-05T14:56:01.513658753Z"
}
{
  "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',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "channel_type": "bank",
    "account_id": 5000,
    "short_code": "522522", 
    "account_number": "1280006242",
    "description": "KCB Bank" 
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic cmpTWVWREVOdEZzZDV5cg=='
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
PreviousGet PH Bank PaybillsNextGet Payment Channels

Last updated 11 days ago

Was this helpful?

short_code
account_number
description