Skip to Content
Pay HeroDocs

Overview

Guides, API references, and tools for building payment experiences with Pay Hero.

All API requests use HTTPS. The production base URL is https://backend.payhero.co.ke.

Authenticate with HTTP Basic Auth. You can save an API username and password in the sidebar and use them when you send a test request.

Quick start

Trigger an M-Pesa STK Push. Replace the token and channel ID with your own.

curl -X POST https://backend.payhero.co.ke/api/v2/payments \
  -H "Authorization: Basic <your_basic_auth_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 100,
    "phone_number": "0787677676",
    "channel_id": 133,
    "provider": "m-pesa",
    "external_reference": "INV-009",
    "callback_url": "https://example.com/callback.php"
  }'

Getting Started

Create an account, generate credentials, and authorize your requests.

Payment Channels

Register and list the M-Pesa tills, paybills, and bank accounts you collect into.

Payments

Collect payments with STK Push, payment buttons, Lipwa links, and callbacks.

Wallets

Check balances, top up your service wallet, and withdraw to mobile.

Transactions

Look up the status and history of your transactions.

Pricing

Understand the fees applied to each transaction.

Plugins

Drop-in integrations for WooCommerce and WordPress.

On this page