Verified settlement
Payment verification before anything counts as paid
A forged callback, a replayed one or a typo in an amount should never ship an order. Mypayments confirms every outcome with M-PESA or KopoKopo directly, records what you asked for and what was paid, and fails closed.
Money that cannot be verified is parked for review, never dropped and never credited.
Prompt sent
STK Push to 07•• ••• 678 · KES 1,500 · INV-2041
Customer entered PIN
Safaricom callback received: claims success
Verified with Safaricom
STK Query: paid · receipt TL3A9K2XQ7 · amount matches
Webhook delivered
POST https://shop.example/payments · 200 OK · signed
X-MyPayments-Event: payment.settled
X-MyPayments-Signature: t=1796313600,v1=9f2c…e41a
{ "event": "payment.settled",
"transaction": { "reference": "INV-2041",
"amount": "1500.00", "status": "settled",
"verified": true, "provider_receipt": "TL3A9K2XQ7", … }
}
How verified settlement works
Requested and reported, side by side
We store the amount you asked for and the amount the provider reports. If they differ we flag the payment and tell you; we never correct one from the other.
One settlement per payment
Receipts, checkout ids and your references are unique keys. A settlement is one atomic database update, so two servers racing on the same callback cannot both win.
Poll the same truth
GET /api/v1/transactions/{reference} returns the verified status. Webhooks are a convenience; the lookup is the source of truth.
Questions about verified settlement
How long does verification take?
Usually seconds after the customer enters their PIN. Payments still in flight are retried until they reach a final state.