How it works
1
Send the STK push request
Call
POST /api/v1/payment/mpesa-stk-push/ with the customer’s phone number and the amount to collect.2
Customer receives a prompt
Safaricom sends a push notification to the customer’s phone with your business name and the payment amount.
3
Customer enters their PIN
The customer opens the prompt and enters their M-Pesa PIN to authorise the payment.
4
Webhook fires
Kulmi Pay sends a
collection_event webhook to your configured endpoint with the invoice’s final state (COMPLETE or FAILED). You can also poll the payment status endpoint to check the result.Send an STK push
Request fields
Success response
invoice.invoice_id field is the value you use to check payment status. Save it with your order record.
Sandbox URL
Use the sandbox host with the same path while testing:After sending the request, poll
POST /api/v1/payment/status/ with the invoice.invoice_id from the response to check whether the customer completed the payment. Alternatively, configure a webhook to receive automatic notifications.