Query Notifications

Get Lipa Na M-pesa Transaction Notifications From M-PAY

Click the arrow (>) on the post API section to see the body and response parameters details

Notifications based on TransID, MobileNumber,TransAmount and TransDate

POST http://40.114.209.253:87/merchants/query

Request Body

Name
Type
Description

StoreNumber*

5748673

This is the organization's shortcode (Paybill or Buy goods - A 5 to 7 digit account number) used to identify an organization and receive the transaction.

MobileNumber

254702021629

The customer's mobile number doing the transaction

TransId

MF76TNO4KG

Unique identifier to identify a transaction on M-Pesa

TransAmount

5000

The amount of money being sent from the customer.

TransDate

10-12-2020

The date when the transaction occured

{
   [{ "SalmansId": "12456",
    "TransactionType": "Customer Merchant Payment",
    "TransID": "OAH3FEH5DT",
    "TransTime": "20200804120859",
    "TransAmount": "300.00",
    "BusinessShortCode": "12345",
    "BillRefNumber": "WATER", 
    "OrgAccountBalance": "0.25", 
    "MSISDN": "0702021629",
    "FirstName": "John",
    "MiddleName": "Doe", 
    "LastName": "John",
     "CreatedOn": "2020-08-03 12:10:50.487000" 
   }]
}

The above request made on the base Url must use the following header info:

Parameter name
Description
Sample Value

Content-Type

Indicates the original media type of the resource (prior to any content encoding applied for sending.

application/json

ShortCode

A shortcode is a unique number that is allocated to a pay bill or buys goods organization through they will be able to receive customer payment. It could be a Pay bill, Buy Goods, or Till Number.

835625***

UnixTime

This is the Timestamp of the transaction, normally in the format of YEAR+MONTH+DATE+HOUR+MINUTE+SECOND (YYYYMMDDHHMMSS).

1607590160***

Authorization

Basic Auth over HTTPS, this is a base64 encoded string of an app's consumer key and consumer secret

base64.encode(Shortcode+Passkey+Timestamp)

The base64 string is a combination of Shortcode+Passkey+Timestamp). You can quickly get a base64 string by going to the following link:https://www.base64encode.org/ then paste the combination of the string data. The result will be an encoded string that you can use in the header's authorization parameter.

Last updated