stk_push_and_wait
Send an M-Pesa payment prompt and wait for the customer to accept or decline. Returns the settled outcome with receipt number on success to confirm payment completion.
Instructions
Send an M-Pesa payment prompt and wait for the customer to accept or decline. Returns the settled outcome including the receipt number on success. Use this when you need to know whether the payment actually completed.
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. | |
| timeoutSeconds | No | How long to wait for the customer. Prompts expire after about 60 seconds. | |
| 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. |