M-Pesa integration

Accept M-Pesa payments directly from your website or app.

No paybill numbers read out over the phone, no account references typed wrong. Your customer gets a prompt with the amount already filled in, approves it, and your system receives the confirmation.

Transaction fee1%
Works withWeb, app, ERP, POS
ConfirmationAPI + webhook

Payment request

Amount

KES 4,500

Pay toKilimani Traders
ReferenceORDER-4821
Account2547•• ••1042

Enter M-Pesa PIN

Cancel Confirm
How STK Push works

Five stages, and the customer only sees one of them.

STK Push flow
01Customer checkout
02STK Push sent
03M-Pesa payment
04Payment confirmation
05Business system

Fewer failed payments

The amount and reference are filled in for the customer, so there is nothing to mistype.

Faster checkout

The customer stays in your flow instead of leaving to open the M-Pesa menu.

Confirmed, not assumed

The confirmation comes back through ScanPay rather than from the customer telling you they paid.

Your reference, kept

The reference you send is carried through and returned with the confirmation.

Integration process

What connecting it actually involves.

The integration is a server-side call and a callback URL. Everything else is your existing checkout.

01

Get your credentials

Talk to the ScanPay team to set up your account and receive API credentials for your environment.

02

Call the STK Push endpoint

Send the amount, the customer's phone number and your own order reference from your server.

03

Customer approves the prompt

The request appears on their phone with the amount already set. They confirm with their M-Pesa PIN.

04

Receive the confirmation

ScanPay posts the result to your callback URL, and the same status is available on the API and the dashboard.

05

Update your system

Mark the order paid, activate the service, or release the account — using the reference you sent in step two.

POST /v1/stk-push
// Prompt the customer to pay on their phone
await scanpay.stkPush({
  amount: 4500,
  phone: "2547XXXXXXXX",
  reference: "ORDER-4821",
  callback: "https://yourapp.co/webhooks/scanpay"
});

// Callback payload once the payment settles
{
  status: "verified",
  ref: "SPV-8F2A41C9",
  reference: "ORDER-4821",
  amount: 4500,
  method: "M-PESA"
}

Set up and go-live timelines depend on your account and systems. The ScanPay team confirms what applies before you start.

Pricing

One fee, on transactions that go through.

M-Pesa integration

1%

per transaction processed through the ScanPay M-Pesa integration.

  • M-Pesa STK Push on websites, apps and business systems
  • Transaction references and payment status included
  • Access to the transaction dashboard

Pricing for verification, escrow and billing solutions depends on transaction type and volume.

Use cases

Where STK Push fits.

E-commerce checkout

  • Customer picks M-Pesa at checkout
  • Prompt arrives on their phone
  • Order is marked paid

ISP subscriptions

  • Monthly invoice falls due
  • Subscriber gets the prompt
  • Account stays active

In-person POS

  • Cashier enters the amount
  • Customer confirms on their phone
  • Receipt is issued

In-app payments

  • App initiates the payment
  • Customer approves
  • App receives confirmation
Questions

M-Pesa integration FAQs.

STK Push sends a payment prompt directly to a customer's phone. Instead of reading out a paybill number and an account reference, the customer receives the request with the amount already filled in and approves it with their PIN.

Your system calls the ScanPay STK Push endpoint with the amount, the customer's phone number and your own reference. The customer approves the prompt on their phone, and ScanPay sends the confirmation back to your callback URL.

A 1% transaction fee applies to transactions processed through the ScanPay M-Pesa integration.

Websites, mobile applications, ERP systems, POS systems and other business systems that can make a server-side API call.

The transaction does not complete and the status reflects that. Your system is told the outcome, so you can retry or cancel rather than being left waiting.

ScanPay posts the result to the callback URL you supply, and the same status is available through the API and in the dashboard.

Start M-Pesa integration.

Bring M-Pesa STK Push into your checkout, your app or your business systems, with confirmation coming back to you rather than from the customer.