To accept M-Pesa payments through PayHero, you need three values from your PayHero account: an API Username, an API Password, and a Channel ID. This guide walks you through finding all three.
Step 1 — Create a PayHero account
If you don't already have one, go to app.payhero.co.ke and sign up. You'll need:
- A valid email address
- Your business name and phone number
- Identification (PayHero will guide you through KYC verification)
Approval usually happens within a business day. You won't be able to receive real payments until your account is approved.
Step 2 — Create a Payment Channel
Once logged in, go to Payment Channels in the PayHero menu. A payment channel is where customer M-Pesa payments are deposited. Tap Create Channel and choose:
- Channel Type: M-Pesa STK Push
- Account: the M-Pesa account or paybill where you want funds to land
- Channel Name: something memorable (e.g. "My Shop M-Pesa")
After saving, the channel will appear in your channels list with a numeric Channel ID next to it. Copy this ID — you'll need it in Step 4.
Step 3 — Get your API username and password
In your PayHero dashboard, go to Settings → API Credentials (the exact menu name may vary). You'll see:
- API Username — usually shown in plain text, sometimes labelled "Consumer Key"
- API Password — hidden by default, tap "Reveal" or "Show" to view it
Important: Treat your API password like a real password. Anyone with these credentials can charge customers on your behalf. Never share them in screenshots, email, or chat.
Step 4 — Note down all three values
You should now have:
- API Username (e.g.
your_username_abc123) - API Password (a long random string)
- Channel ID (a short number, e.g.
1234)
Step 5 — Paste them into your shop
Now follow Connecting PayHero to your shop to enter these values into your shop settings. We never display your password back in the shop dashboard once it's saved — it's stored securely and only used when sending payment requests.
If you lose or rotate your credentials
If you reset your PayHero API password (or PayHero rotates it for you), your shop will start showing "PayHero rejected your API credentials" at checkout. Open the PayHero setup in your shop, paste the new credentials, and save — the connection will be restored immediately.
Live mode vs test mode
PayHero has a sandbox for testing. If your account is in sandbox mode, real M-Pesa payments won't go through — only simulated ones. To start receiving real money, complete KYC verification and switch your channel to Live in your PayHero dashboard.