M-Pesa STK Push (also called Lipa Na M-Pesa Express) lets you initiate a payment from your server. When you call the API, Safaricom sends a prompt to your customer’s phone asking them to enter their M-Pesa PIN. Once they confirm, the payment is processed and you receive a webhook notification. No redirect or hosted checkout page is required.Documentation Index
Fetch the complete documentation index at: https://developers.kulmipay.com/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Send the STK push request
Call
POST /api/v1/payment/mpesa-stk-push/ with the customer’s phone number and the amount to collect.Customer receives a prompt
Safaricom sends a push notification to the customer’s phone with your business name and the payment amount.
Customer enters their PIN
The customer opens the prompt and enters their M-Pesa PIN to authorise the payment.
Send an STK push
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
phone_number | string | Yes | Kenyan phone number in international format, e.g. 254712345678. |
amount | decimal string or number | Yes | Amount in KES. The backend rounds decimal values up to the nearest whole shilling before sending the STK push. |
api_ref | string | No | Your internal reference for this payment, e.g. an order ID. Defaults to MPesa Express when omitted and is returned in the webhook payload. |
wallet_id | string | No | The ID of a specific KES wallet to receive funds. Defaults to your primary settlement wallet. |
mobile_tarrif | string | No | Who pays the transaction fee. BUSINESS-PAYS (default) or CUSTOMER-PAYS. |
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.