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:
Parameter | Type | Required | Description |
---|---|---|---|
pos_id | UUID | ✅ | Merchant's identifier (POS_ID ) |
mode | MODE | ✅ | direct |
method | METHOD | ✅ | Payment method (purchase ) |
amount | Number | ✅ | Transaction 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) |
currency | CURRENCY | ✅ | KES |
order_3ds_bypass | String | ✅ | 3-D Secure flow option |
order_id | String | ✅ | Unique identifier of order |
description | String | ✅ | Payment description |
payway | String | ✅ | mobile |
server_url | URL | Webhook notification will be sent to this URL | |
result_url | URL | Customer will be redirected to this URL after payment. | |
customer_fname | String | Customer first name | |
customer_lname | String | Customer last name | |
customer_email | String | Customer email address | |
customer_phone | String | Customer 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.