Skip to content
Log inSign up free
Payments

Getting your PayHero API keys

How to find your PayHero API username, password, and channel ID.

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:

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:

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:

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:

  1. API Username (e.g. your_username_abc123)
  2. API Password (a long random string)
  3. 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.

Still need help?

Can't find what you're looking for? Reach out and we'll get back to you.

Contact support
WhatsAppsupport@myduka.link+254797 560 650