Initiates an M-Pesa STK Push: the customer’s phone shows a payment prompt, and once they act on it the transaction settles into a terminal state.

Request parameters

integer
required
Amount to collect in minor units (KES cents). 15000 = KES 150. Must be ≥ 1. M-Pesa moves whole shillings only, so send multiples of 100.
string
required
Customer’s Kenyan mobile number. Accepted formats: 0712345678, 0112345678, 254712345678, +254712345678 (and the 01/2541 equivalents).
string
required
Your reference for this payment, max 12 characters. Shown to you on the transaction — use your invoice or order number.
integer
Which of your approved payment channels (shortcodes) to collect on. Omit to use your first approved channel. If you pass a channel that does not exist or is not approved for you, the request fails with 503 CHANNEL_NOT_APPROVED.

Response

201 Created
string
Unique ID of this transaction — use it to retrieve status.
string
Always pending at creation. Follows the lifecycle.
integer
Platform fee for this transaction in minor units, quoted and reserved from your prepaid wallet at initiation.
string
The payment provider’s transaction reference.
After 201, the transaction is processed in the background: the customer acts on the phone prompt, we confirm the result with the provider, and the status moves to a terminal state (usually within two minutes). Subscribe to webhooks or poll GET /transactions/.

Errors

Do not blindly retry a timed-out STK request. If the connection drops after we accepted it, a retry would create a second payment prompt. On network errors, first list your recent transactions for the same account_reference and only re-send if none exists.