Transaction Lifecycle
Payments should not be a black box. Know exactly where every transaction is at all times. Both STK Push and B2C payouts share the same state model. Understanding the lifecycle lets you handle every outcome correctly — including failures.Transaction states
Terminal states — no further updates:
SUCCESS, FAILED, REVERSED, CANCELLED
STK Push lifecycle
B2C payout lifecycle
Receiving state updates
Webhooks (recommended)
Supply acallbackUrl on every payment request. PalPluss delivers a POST to that URL when the transaction reaches a terminal state.
See the Webhooks guide for payload structure and retry policy.
Polling
PollGET /transactions/{id} if webhooks are unavailable.
- Wait 15 seconds after initiation.
- Poll every 10 seconds while status is
PENDINGorPROCESSING. - Stop at any terminal state.
- After 5 minutes without a terminal state, treat the transaction as likely failed.
Idempotency
- Each
POST /payments/stkcreates a distinct transaction and a distinct M-Pesa checkout. - Retrying without customer action sends a new prompt — do not retry unless the customer requests it.
- Service wallet top-ups support the
Idempotency-Keyheader to prevent duplicate funding requests.