M-Pesa payments, one API

Get paid on M-Pesa before lunch.

STK Push, tills, paybills, and wallets behind a single Pay Hero endpoint. Send a real request from these docs, then paste the sample into your app.

  • Live API tester
  • 11 language samples
  • Callbacks included
stk-push.shPOST /api/v2/payments
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"
  }'

Base URL https://backend.payhero.co.ke. Swap in your token and channel ID.