Skip to main content
Customers pay with M-Pesa or Airtel Money. Mavapay sends an STK prompt to their phone. They authorize with their mobile-money PIN. The payout or wallet credit then completes on its own.
paymentSource.phoneNumber must be the paying customer’s phone number, in international format (+254...). The STK prompt is sent to that number.

What happens

  1. Create a quote with paymentMethod: "MOBILEMONEY" and paymentSource.phoneNumber.
  2. The API returns the quote immediately.
  3. Within a few seconds, an STK prompt is sent to that phone.
  4. The customer enters their M-Pesa or Airtel Money PIN.
  5. The prompt expires in 20 seconds. If they miss it, create a new quote.
  6. After they authorize, do nothing else. Mavapay processes the payment and sends a webhook.
No invoice to pay and no accept call.

Where the funds go

paymentCurrency is what amount means. It must be sourceCurrency or targetCurrency.
  • USDTCENT — USDT cents (1000 = 10 USDT)
  • BTCSAT — satoshis
  • KESCENT — Kenyan shilling cents (100 = 1 KES)
Buying BTC uses the same request as buying USDT. Change targetCurrency and, when the amount is in BTC, paymentCurrency.

Buy USDT into the internal wallet

Tell the customer to approve the prompt. If it expires, create the quote again.

Buy BTC into the internal wallet

Same request. Set the target to Bitcoin. Here paymentCurrency is BTCSAT, so amount is satoshis.
To charge a fixed shilling amount instead, set paymentCurrency to KESCENT and pass amount in cents.

Buy BTC to an external address

Set autopayout to true and targetCurrency to BTCSAT. The customer must provide one of lnInvoice, lnAddress, or onChainAddress. Lightning invoice
Lightning address
On-chain address
On-chain payouts have a minimum of 6000 sats. The Lightning invoice must still be valid when the customer authorizes the STK prompt.

Send USDT to an external address

Set autopayout to true and pass a USDT beneficiary. See beneficiary formats.

Instant cross-border payouts

The same KES payment can settle straight to another currency. Pass autopayout: true and the beneficiary for that currency. Settlement starts once the customer authorizes the STK prompt. NGN bank account
ZAR bank account Amounts are in cents (100 = 1 ZAR).
GHS (MTN)
Supported beneficiary formats: NGN, ZAR, GHS, BTC, USDT.

Webhooks

After the customer authorizes, Mavapay sends the usual payment webhooks. You do not confirm the STK prompt yourself. See webhook examples.