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

Lipa na M-Pesa

Prompt a customer to pay a paybill or till you name in the request.

POST /v3/lipa-na-mpesa Initiate Lipa na M-Pesa Try it

Like STK push, but the destination paybill or till comes from the request instead of a saved channel.

Scope: stk_push

Parameters

FieldInTypeRequiredDescription
amount body integer yes Whole KES. Between 1 and 70000.
Range 1 – 70000
phone_number body string yes Customer phone. Format 2547XXXXXXXX, 2541XXXXXXXX, 07XXXXXXXX or 01XXXXXXXX.
payment_type body string yes Destination type.
One of: paybill, till
paybill_number body string when payment_type is paybill Paybill shortcode, 5-7 digits.
account_number body string when payment_type is paybill Paybill account, max 20 (A-Z, 0-9, - and .).
till_number body string when payment_type is till Till number, 5-7 digits.
external_reference body string no Your own id, max 100 characters (A-Z, 0-9 and . _ : - /). Reusing one returns 409 DUPLICATE_REFERENCE.
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/lipa-na-mpesa" \
  -H "Authorization: Bearer $SWIFTWALLET_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"amount":100,"phone_number":"0712345678","payment_type":"paybill","paybill_number":"400200","account_number":"INV42"}'

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