Prerequisites
You need:- An API key from the Pesaswap dashboard.
- A
profile_idfrom the dashboard. - A phone number that can receive an M-Pesa STK prompt.
1
Create and confirm the payment
Send a A successful call returns a The money has not moved yet.
POST request to /payments with confirm: true. This creates the payment and immediately attempts to confirm it in one call, so a customer-facing STK prompt is triggered as soon as the request returns.200 with a payment object. The fields that matter right now:status: requires_customer_action means the STK prompt is now on the customer’s phone, waiting for them to act. Nothing settles until they respond.2
The customer approves
The customer sees the STK push notification on their handset and enters their M-Pesa PIN. Nothing else for you to build here — this happens on their phone, outside your API calls.
3
Poll for the result
Once the customer has approved (or rejected, or ignored) the prompt, retrieve the payment to find out what happened. Use
force_sync=true so the request checks with the connector instead of returning a stale status.Status reference
You may also see other values from the full status set (
requires_confirmation, requires_payment_method, requires_merchant_action, cancelled, requires_capture, partially_captured, partially_captured_and_capturable) depending on the payment method and configuration, but a straightforward M-Pesa Express flow moves through requires_customer_action → processing → succeeded or failed.
Next steps
Wallet payments
M-Pesa Express, Airtel Money, and MTN MoMo in one place.
Card payments and 3DS
Cards, redirects, and authentication.
Mandates and recurring
Save a payment method and charge it later.
Refunds
Send money back to a customer.
Payouts
Send money out to a recipient.