Now live

M-Pesa API for developers

Connect your Till, Paybill or Bank account in minutes. STK Push, webhooks and real-time transaction tracking — built for scale.

Free signup No setup fees Sandbox included
1,900+businesses
99.9%uptime
24/7support
# Initiate STK Push
curl -X POST https://api.pesaflux.co.ke/v1/initiatestk \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "PSFX...",
    "email": "you@business.co.ke",
    "amount": "100",
    "msisdn": "254712345678",
    "reference": "INV-1024"
  }'

# Response
{
  "success": "200",
  "message": "Please enter your MPESA PIN to complete the transaction",
  "transaction_request_id": "PLFX0610202614..."
}
// Initiate STK Push
$payload = json_encode([
    'api_key'   => 'PSFX...',
    'email'     => 'you@business.co.ke',
    'amount'    => '100',
    'msisdn'    => '254712345678',
    'reference' => 'INV-1024',
]);

$ch = curl_init('https://api.pesaflux.co.ke/v1/initiatestk');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => $payload,
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
// $response['transaction_request_id']
// Initiate STK Push
const res = await fetch('https://api.pesaflux.co.ke/v1/initiatestk', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    api_key: 'PSFX...',
    email: 'you@business.co.ke',
    amount: '100',
    msisdn: '254712345678',
    reference: 'INV-1024',
  }),
});

const data = await res.json();
// data.transaction_request_id
Features

Built for production

Everything you need to accept M-Pesa payments — simple, secure and developer-first.

STK Push

Send a payment prompt straight to your customer's phone with a single POST request.

Webhooks

Get the result of every payment — receipt, amount and phone — posted to your callback URL in real time.

Transaction status

Look up any payment with transactionstatus to confirm it before you deliver.

Till, Paybill & Bank

Payments go directly to your linked Buy Goods Till, Paybill or bank account.

Payment links

No website? Create a link, share it on WhatsApp or SMS and get paid — no code needed.

Sandbox

Test your integration end to end with sandbox credentials before you go live.

How it works

Live in three steps

From signup to your first payment in under 10 minutes.

1

Create your account

Sign up and verify your business details. It takes about a minute.

FreeNo card needed
2

Link where you get paid

Add your Till, Paybill or Bank account and get an API key for it.

TillPaybillBank
3

Start collecting

Call the API or share a payment link. Track every transaction on your dashboard.

Real-time24/7
Pricing

Simple, flat pricing

One subscription per linked account, with unlimited transactions.

Monthly

KES 300 / month
per linked account
  • Unlimited transactions
  • STK Push & status API
  • Webhooks & payment links
  • Dashboard & reports
Get started

Start collecting M-Pesa payments today

Create a free account and link your Till, Paybill or Bank in minutes.

Create free account View docs

PesaFlux Support

Online • Typically replies instantly

Support is typing