SW SwiftWallet
Base URL https://swiftwallet.co.ke/v3

STK Push

Prompt a customer's phone to pay into one of your payment channels.

POST /v3/stk-initiate Initiate STK push Try it

Sends an M-Pesa PIN prompt to the customer. The result arrives by callback; confirm it with the Transactions API.

Scope: stk_push

Parameters

FieldInTypeRequiredDescription
amount body integer yes Whole KES. Between 1 and 250000.
Range 1 – 250000
phone_number body string yes Customer phone. Format 2547XXXXXXXX, 2541XXXXXXXX, 07XXXXXXXX or 01XXXXXXXX.
external_reference body string no Your own id, max 100 characters (A-Z, 0-9 and . _ : - /). Reusing one returns 409 DUPLICATE_REFERENCE.
customer_name body string no Stored for your records, max 150.
channel_id body integer no Your payment channel id from GET /v3/channels/. Omit to use your default channel.
Range 1 – …
account_number body string no Overrides the account number on paybill channels only (max 20, A-Z, 0-9, - and .). Rejected on other channel types.
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/stk-initiate" \
  -H "Authorization: Bearer $SWIFTWALLET_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"amount":100,"phone_number":"0712345678","external_reference":"ORDER-1001","customer_name":"Jane Wanjiku"}'

Response fields

success status (INITIATED) message transaction_id reference external_reference checkout_request_id merchant_request_id channel_type amount service_fee livemode routing_info.party_b routing_info.transaction_type routing_info.description