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