Ask a payer to send you KES over M-PESA
Sends an STK Push prompt to the number you name. The payer approves it on their own handset with their PIN — there is no OTP for you to handle and no way for you to complete it on their behalf. The deposit lands in your own KES account, which is resolved from your verified business and is not something you can specify. This returns as soon as the prompt is out, so treat the response as pending: the completion signal is the credit.received webhook, and a prompt the payer declines or ignores produces no event at all. There is no idempotency key. A repeated call is a second prompt, and if the payer approves both then both deposits land and each raises its own credit.received.
Authorization
partner-key In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/funding/mpesa-push" \ -H "Content-Type: application/json" \ -d '{ "phone": "254700000000", "amount": "1000" }'{ "pushId": "SBXTX0000001", "status": "pending"}Convert USD to KES POST
Debits the USD from your USD account and credits the KES to your KES account, asynchronously. Poll GET /v1/conversions/:id or wait for conversion.settled or conversion.failed. If the exchange cannot be completed after your USD was debited, the USD is returned to you and the conversion ends failed with the reason. No confirmation code: both accounts are your own.
Simulate a payment into a collection (sandbox only) POST
Sandbox only. Behaves as if a payer paid this collection, so you can test your integration end to end without sending real money. The collection must be open. Answers 200 once the collection has been marked as received, or 202 when the payment was accepted and the collection has not caught up yet: read it with GET /v1/collections/{id} a little later. No real money moves. While sandbox crediting is enabled, a collection created in sandbox is then credited at the bank simulator: read it until its status is credited. Otherwise it stays received. Not available in production: the route answers 404 there.