STK Push

Prompt a customer to pay with M-Pesa.

Endpoint

Request
POST https://api.kipay.co.ke/mpesa/stkpush/v1/processrequest

Naming 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.

DestinationTransactionTypeBusinessShortCode / PartyBAccountReference
TillCustomerBuyGoodsOnlineYour till numberAny reference
PaybillCustomerPayBillOnlineYour paybill numberAccount number
BankCustomerPayBillOnlineThe bank's paybill numberBank account number

Request body

FieldDescription
BusinessShortCodeYour destination shortcode.
Password, TimestampAccepted so existing clients work unchanged. You do not need a passkey.
TransactionTypeCustomerBuyGoodsOnline or CustomerPayBillOnline.
AmountWhole shillings, greater than zero.
PartyA, PhoneNumberCustomer phone in 2547XXXXXXXX format.
PartyBDestination shortcode.
CallBackURLYour https endpoint for the result.
AccountReferenceAccount number for paybill and bank destinations.
TransactionDescShort 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.