STK Push
Prompt a customer to pay with M-Pesa.
Endpoint
Request
POST https://api.kipay.co.ke/mpesa/stkpush/v1/processrequestNaming your destination
Put the destination you want to collect into in the standard STK Push fields. KiPay signs the request and settles the collection to it.
| Destination | TransactionType | BusinessShortCode / PartyB | AccountReference |
|---|---|---|---|
| Till | CustomerBuyGoodsOnline | Your till number | Any reference |
| Paybill | CustomerPayBillOnline | Your paybill number | Account number |
| Bank | CustomerPayBillOnline | The bank's paybill number | Bank account number |
Request body
| Field | Description |
|---|---|
| BusinessShortCode | Your destination shortcode. |
| Password, Timestamp | Accepted so existing clients work unchanged. You do not need a passkey. |
| TransactionType | CustomerBuyGoodsOnline or CustomerPayBillOnline. |
| Amount | Whole shillings, greater than zero. |
| PartyA, PhoneNumber | Customer phone in 2547XXXXXXXX format. |
| PartyB | Destination shortcode. |
| CallBackURL | Your https endpoint for the result. |
| AccountReference | Account number for paybill and bank destinations. |
| TransactionDesc | Short description shown on the transaction. |
Example
cURL
curl -X POST "https://api.kipay.co.ke/mpesa/stkpush/v1/processrequest" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"BusinessShortCode": "123456",
"Password": "<base64-password>",
"Timestamp": "20260101120000",
"TransactionType": "CustomerPayBillOnline",
"Amount": 1500,
"PartyA": "254712345678",
"PartyB": "123456",
"PhoneNumber": "254712345678",
"CallBackURL": "https://example.com/mpesa/callback",
"AccountReference": "INV-1042",
"TransactionDesc": "Invoice 1042"
}'Response
JSON
{
"MerchantRequestID": "29115-34620561-1",
"CheckoutRequestID": "ws_CO_191220191020363925",
"ResponseCode": "0",
"ResponseDescription": "Success. Request accepted for processing",
"CustomerMessage": "Success. Request accepted for processing"
}ResponseCode 0 means the prompt was sent. The final outcome arrives at your CallBackURL, or you can fetch it with STK Query using the CheckoutRequestID.
Your CallBackURL must be https and publicly reachable. Live requests need approved KYC. Requests are rate limited per account and per customer phone number.