The Request is an initiator for an STK push yet to be paid transaction i.e. it Triggers the wallet user's SIM ToolKit for authorization of payment on their handset.
This is only available for MPESA.
BODY PARAMS
Parameter |
Data Type |
Description |
Required |
acc_no |
alphanumeric |
Business wallet account number assigned by Lemonade Payment |
Y |
reference |
alphanumeric |
Order reference this unique per request |
Y |
acc_name |
string |
Customer name |
Y |
acc_no |
numeric |
Customer M-Pesa registered phone number. Format 2547XXXXXXXX /2541XXXXXXXX |
Y |
amount |
numeric |
Order amount to be paid (DO NOT PASS any commas as a thousands separator). e.g. amt=1234 and NOT amt=1,234 |
Y |
currency |
string |
Currency. KES By Default for MPESA. |
Y |
description |
alphanumeric |
Your order descriptions. |
Y |
channel |
numeric |
Channel unique code. use 100000 for M-PESA on live and test |
Y |
result_url |
alphanumeric |
This parameter holds the URL to your server to which callback response will be sent. |
Y |
HEADER PARAMS
Parameter |
Data Type |
Description |
Required |
Authorization |
alphanumeric |
bearer token used to access the API |
Y |
200 Success Response Schema
Parameter |
Data Type |
Description |
success |
bool |
Response code |
message |
string |
Response message. |
data.transaction_id |
alphanumeric |
transactions id |
data.status |
string |
transactions status |
data.status |
string |
transactions status_description |
Example Request
curl --location --request POST 'https://here-prod-api-url.com/collect/mpesa'
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"wallet_no": "667038229",
"reference": "13047D",
"acc_name": "John Doe",
"acc_no": "0722XXXXXXX,
"currency": "KES",
"amount": 50,
"channel": 100000,
"description": "Deposit to wallet",
"result_url":"https://webhook.site/1712d2f0-c63b-45fb-80c3-6389ad374b0b"
}'
Example Response
{
"success": true,
"message": "Successfully initiated",
"data": {
"transaction_id": "169525162620",
"status": "PENDING",
"status_description": "Transaction Initiated successfully"
}
}