v1
latestOpenAPI 3.1.02026-07-2691531.2 KBSTK Push
Initiate STK Push
Sends an M-Pesa STK Push prompt to the customer's phone. The customer enters their M-Pesa PIN to authorise payment.
Payment results are delivered asynchronously to the callbackUrl you supply. Poll GET /transactions/{id} if you need to check status programmatically.
Fees: A transaction fee is deducted from your service wallet balance at the time the request is accepted. If your balance is insufficient the request returns 402.
post/payments/stk
Request body
Example request
{
"amount": 1000,
"phone": "0712345678",
"accountReference": "INV-2024-001",
"transactionDesc": "Payment",
"callbackUrl": "https://yourserver.com/webhooks/mpesa"
}Response
STK Push accepted. Transaction is in PENDING state.
Example response
{
"success": true,
"data": {
"type": "STK",
"status": "PENDING",
"amount": 1000,
"currency": "KES",
"phone": "254712345678",
"accountReference": "INV-2024-001",
"transactionDesc": "Payment",
"transactionFee": 2.5
},
"requestId": "c1b2a3d4-e5f6-7890-abcd-ef1234567890"
}