stk_push
Initiate an M-Pesa STK push payment request to a customer. Returns an acknowledgement immediately; does not confirm payment completion.
Instructions
Send an M-Pesa payment prompt (STK push) to a customer. Returns immediately with an acknowledgement; it does NOT confirm payment. Use stk_push_and_wait if you need the outcome.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"phoneNumber": "<phoneNumber>",
"amount": "<amount>"
},
"name": "stk_push"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount in KES. Whole numbers only. | |
| shortCode | No | Overrides DARAJA_SHORTCODE. | |
| callbackUrl | No | Overrides the built-in receiver URL. | |
| phoneNumber | Yes | Customer phone number. Accepts 07..., +2547..., or 2547... and is normalised. | |
| transactionDesc | No | Short description. Max 13 characters. | |
| transactionType | No | PayBill or Buy Goods. Must match the shortcode type. | CustomerPayBillOnline |
| accountReference | No | Account identifier shown on the customer statement. Max 12 characters. |