You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Express initiates online payment on behalf of the customer using USSD Push.
1. Authentication
1.1 Register for a Safaricom Developer Account
For authentication credentials to be used only for the sandbox, Safaricom Developer Account is required. To log in or register, go to https://developer.safaricom.co.ke/. The Organization Information must be provided when applying for new credentials when going live.
1.2 Create an app
Using https://developer.safaricom.co.ke/MyApps, you can create an app and select the Lipa Na M-Pesa and M-Pesa Sandbox check boxes. By creating an app, you can obtain the Consumer Key and Consumer Secret that will be used for Basic Authentication.
{"MerchantRequestID": "68444-143235050-2","CheckoutRequestID": "ws_CO_22112022152650652748458100","ResponseCode": "0","ResponseDescription": "Success. Request accepted for processing","CustomerMessage": "Success. Request accepted for processing"}
Response Fields
NAME
DESCRIPTION
TYPE
MerchantRequestID
This is a globally unique identifier for any submitted payment request
String
CheckoutRequestID
This is a globally unique identifier of the processed checkout transaction request
String
ResponseDescription
An acknowledgement message from API that gives the status of the request submission usually maps to a specific ResponseCode value
Numeric
ResponseCode
This is a Numeric status code that indicates the status of the transaction submission. 0 means successful submission and any other means code means an error occurred
Numeric
CustomerMessage
This is a message that your system can display to the Customer as an acknowledgment of the payment request submission
String
Data sent to the Callback URL
{"Body": {"stkCallback": {"MerchantRequestID": "68444-143235050-2","CheckoutRequestID": "ws_CO_22112022152650652748458100","ResultCode": 0,"ResultDesc": "The service request is processed successfully.","CallbackMetadata": {"Item": [{"Name": "Amount","Value": 1},{"Name": "MpesaReceiptNumber","Value": "QKM0FXE6RK"},{"Name": "TransactionDate","Value": 20221122152706},{"Name": "PhoneNumber","Value": 2547484581XX}]}}}}
This is a globally unique identifier of the processed checkout transaction request
Integer
Successful Response
{"ResponseCode": "0","ResponseDescription": "The service request has been accepted successsfully","MerchantRequestID": "5468-13551780-2","CheckoutRequestID": "ws_CO_22112022164548577748458100","ResultCode": "0","ResultDesc": "The service request is processed successfully."}
Response Fields
NAME
DESCRIPTION
TYPE
ResponseCode
0 means successful submission
Integer
ResponseDescription
Acknowledgment message of successful submission request
String
MerchantRequestID
Timestamp of the transaction with format(YEAR+MONTH+DATE+HOUR+MINUTE+SECOND)
Timestamp
CheckoutRequestID
Global unique identifier of the processed transaction checkout
String
ResultCode
0 means successful transaction by customer, any other means an error occurred.
Integer
ResultDesc
Acknowledgment message describing the transaction status