Skip to main content

M-Pesa

To enable the M-Pesa payment method for accepting payments in Kenya, you need to use direct integration. When creating a payment, send a request with the following parameters:

ParameterTypeRequiredDescription
pos_idUUIDMerchant's identifier (POS_ID)
modeMODEdirect
methodMETHODPayment method (purchase)
amountNumberTransaction amount. Must be a positive number. The number of decimal digits must be less than or equal to 2 (e.g., 100.00, 250, 50.50)
currencyCURRENCYKES
order_3ds_bypassString3-D Secure flow option
order_idStringUnique identifier of order
descriptionStringPayment description
paywayStringmobile
server_urlURLWebhook notification will be sent to this URL
result_urlURLCustomer will be redirected to this URL after payment.
customer_fnameStringCustomer first name
customer_lnameStringCustomer last name
customer_emailStringCustomer email address
customer_phoneStringCustomer phone number
info

The name of the mobile operator and the phone number are specified at the checkout of the payment method.

Request example:

{
"pos_id": "00000000-0000-0000-0000-000000000000",
"mode": "direct",
"amount": 1000,
"method": "purchase",
"currency": "KES",
"payway": "mobile",
"order_3ds_bypass": "supported",
"description": "Description",
"order_id": "123456789",
"server_url": "http://callback-stub:9000/consume",
"result_url": "https://google.com"
}
info

To process payouts via M-Pesa, please refer to the instructions.