Wallet
Balances of your service wallet (fees, subscriptions) and payments wallet (collections, payouts), and STK top-ups.
Both balances, or one when balance is given.
Scope: account_api
Parameters
| Field | In | Type | Required | Description |
|---|---|---|---|---|
balance |
query | string | no |
Return one balance. Also accepts payment, service_wallet_balance and payments_wallet_balance.
One of: service, payments |
Request
curl -X GET "https://swiftwallet.co.ke/v3/wallet?balance=…" \ -H "Authorization: Bearer $SWIFTWALLET_API_KEY" \ -H "Accept: application/json"
Response fields
success service_wallet_balance payments_wallet_balance currency
Sends an STK prompt to fund one of your wallets. Poll GET /v3/wallet/status with the returned reference_number.
Scope: account_api
Parameters
| Field | In | Type | Required | Description |
|---|---|---|---|---|
action |
body | string | yes |
deposit defaults to the payments wallet, topup to the service wallet.
One of: deposit, topup |
wallet_type |
body | string | no |
Overrides the target wallet. "payment" is accepted as an alias of payments.
One of: service, payments |
amount |
body | integer | yes |
Whole KES. Between 1 and 250000.
Range 1 – 250000 |
phone_number |
body | string | yes | Phone that receives the STK prompt. Format 2547XXXXXXXX, 2541XXXXXXXX, 07XXXXXXXX or 01XXXXXXXX. |
user_callback_url |
body | url | no | Public HTTPS URL for the signed result callback, max 500. Overrides the key's webhook URL for this transaction. |
Request
curl -X POST "https://swiftwallet.co.ke/v3/wallet" \
-H "Authorization: Bearer $SWIFTWALLET_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"action":"topup","amount":500,"phone_number":"0712345678"}'Response fields
success status (pending) message reference_number transaction_id wallet_type amount checkout_request_id livemode
Status of a wallet top-up. A pending row is re-queried from M-Pesa at most once per cooldown.
Scope: account_api
Parameters
| Field | In | Type | Required | Description |
|---|---|---|---|---|
reference |
query | string | yes | The reference_number returned by POST /v3/wallet/ (TOPUP-... or DEPOSIT-...). |
Request
curl -X GET "https://swiftwallet.co.ke/v3/wallet/status?reference=…" \ -H "Authorization: Bearer $SWIFTWALLET_API_KEY" \ -H "Accept: application/json"
Response fields
success reference_number status amount wallet_type mpesa_receipt_number result_desc completed_at wallet_balances (when completed)