Verify M-Pesa Payments via API — Real-Time, Non-Custodial

Quick Answer: ShegerPay verifies Safaricom M-Pesa Ethiopia payments in under 2 seconds through one REST API call. The customer pays from their M-Pesa wallet, the money lands in the merchant's M-Pesa account, and ShegerPay's webhook fires with payment.verified. ShegerPay never holds the funds — no merchant license required.

What is M-Pesa?

M-Pesa is the mobile money service originally launched by Safaricom in Kenya in 2007 and is the world's most-used mobile money platform. In 2023, Safaricom Ethiopia launched M-Pesa in the Ethiopian market, bringing the same Send/Lipa/Withdraw flows to Ethiopian consumers and merchants. It is one of the fastest-growing wallets in Ethiopia.

How M-Pesa verification works with ShegerPay

  1. Customer initiates payment from M-Pesa app or USSD to the merchant's M-Pesa number or Paybill/Till
  2. M-Pesa settles the transfer into the merchant's M-Pesa account and issues an M-Pesa confirmation code
  3. Merchant backend POSTs to /api/v1/verify with provider=mpesa and the confirmation code as transaction_id
  4. ShegerPay returns verified=true with sender, amount, and timestamp, then fires the webhook

Code example

curl -X POST https://api.shegerpay.com/api/v1/verify \
  -H "X-API-Key: sk_test_demo" \
  -H "Content-Type: application/json" \
  -d '{"provider":"mpesa","transaction_id":"SGH7QK2L1M","amount":500}'
import ShegerPay from '@shegerpay/sdk';
const sp = new ShegerPay('sk_test_demo');
const result = await sp.verify({
  provider: 'mpesa',
  transactionId: 'SGH7QK2L1M',
  amount: 500
});
from shegerpay import ShegerPay
sp = ShegerPay('sk_test_demo')
result = sp.verify(provider='mpesa', transaction_id='SGH7QK2L1M', amount=500)
$sp = new ShegerPay\Client('sk_test_demo');
$result = $sp->verify([
  'provider' => 'mpesa',
  'transaction_id' => 'SGH7QK2L1M',
  'amount' => 500
]);

M-Pesa-specific features

  • M-Pesa confirmation-code parsing — ShegerPay recognizes the 10-character M-Pesa code (e.g., SGH7QK2L1M) and validates structure
  • Paybill + Till + Send Money — single integration covers all merchant payment patterns
  • Ethiopia-native — verifies the M-Pesa Ethiopia rail (operated by Safaricom Ethiopia) rather than only the Kenyan rail
  • SMS detection — M-Pesa confirmation SMS can be POSTed to /api/v1/verify-text for code extraction
  • Receipt OCR — M-Pesa receipt screenshots upload cleanly to /api/v1/verify-image

Why ShegerPay for M-Pesa

  • Non-custodial — funds settle directly to your M-Pesa account
  • No merchant license required
  • Sub-2-second verification on the M-Pesa Ethiopia rail
  • Free tier includes M-Pesa
  • Works with WooCommerce plugin out of the box
  • HMAC-SHA256 webhook signatures
  • 12 official SDKs

Pricing for M-Pesa verification

  • Free: 100 verifications/month
  • Startup ($9/mo): 2,000 verifications
  • Business ($29/mo): 10,000 verifications + crypto
  • Enterprise: custom

Comparison

Feature ShegerPay Chapa Arifpay Manual
M-Pesa Ethiopia Yes Limited Limited Yes
Verification time <2s 5–30s 5–30s Minutes
Non-custodial Yes No No
Confirmation-code parse Yes No No
Free tier Yes Limited No

FAQ

How fast is M-Pesa verification with ShegerPay? Under 2 seconds typical.

Do I need an M-Pesa Paybill or Till? No — any M-Pesa number works. Paybill or Till makes checkout faster but is not required.

Can I verify M-Pesa from a screenshot? Yes — POST the receipt to /api/v1/verify-image. The OCR extracts the M-Pesa confirmation code, amount, and sender.

Does ShegerPay hold M-Pesa funds? No — funds settle directly to your M-Pesa account.

Is there a sandbox/demo for M-Pesa? Yes — use sk_test_demo on any endpoint without signup.

What happens if M-Pesa verification fails? API returns verified=false with reason: not_found, pending, amount_mismatch, or wrong_recipient.

Related: Pricing · Docs · ShegerPay vs Chapa · Verify Telebirr · Verify eBirr

Contact: [email protected] · +251 998 169 242