Top up service wallet
Service Wallet
Top Up Service Wallet
Add funds to your service wallet via M-Pesa STK Push.
POST
Top up service wallet
Fund your service wallet to keep payments running without interruption.
If a top-up with the same
How it works
A top-up sends an STK Push to the phone number you specify. When the M-Pesa PIN is entered, the amount is deposited into your service wallet.- Top-ups appear in your transaction list with type
WALLET_TOPUP - Balance updates after the STK callback is received from M-Pesa — usually within 1–2 minutes
Idempotent retries
UseIdempotency-Key to safely retry without creating duplicate top-ups.
Idempotency-Key was already accepted, the original response is returned without initiating a new STK Push. Use a unique key per top-up attempt (include a date or sequence number).
When to top up
- Top up before your balance drops below your minimum operating threshold
- For high-volume operations, maintain a buffer of 2–5× your expected daily fee spend
- The result is delivered asynchronously — poll
GET /transactions/{id}to confirm the balance update
Authorizations
Use your API key as the username. Leave the password field empty.
Authorization: Basic <base64(apikey:)>You can also pass the raw API key:
Authorization: Basic <apikey>Headers
Optional unique key for idempotent retries. If a top-up with the same key was already processed, the original response is returned.
Body
application/json
Top-up amount in KES.
Required range:
x >= 1Example:
500
Phone number to send the STK Push prompt to.
Example:
"0712345678"
Optional reference label for this top-up. Appears in the M-Pesa statement.
Maximum string length:
120Example:
"TOPUP-001"
Optional description shown in your transaction history.
Maximum string length:
255Example:
"Service wallet top-up"