# Query Notifications

{% hint style="info" %}
Click the arrow (>) on the post API section  to see the body and response parameters details
{% endhint %}

## Notifications based on TransID, MobileNumber,TransAmount and TransDate

<mark style="color:green;">`POST`</mark> `http://40.114.209.253:87/merchants/query`

#### Request Body

| Name                                          | Type         | Description                                                                                                                                               |
| --------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| StoreNumber<mark style="color:red;">\*</mark> | 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                                                                                                                     |

{% tabs %}
{% tab title="200: OK Response is a Json object with an array of lists of transactions" %}

```javascript
{
   [{ "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" 
   }]
}
```

{% endtab %}

{% tab title="500: Internal Server Error Indicates errors on the API Side" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="403: Forbidden Indicates a failure in the Authentication" %}

```javascript
{
   "Message": "Access Denied" 
}
```

{% endtab %}
{% endtabs %}

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

<table><thead><tr><th width="204">Parameter name</th><th>Description</th><th width="150">Sample Value</th></tr></thead><tbody><tr><td>Content-Type</td><td>Indicates the original media <strong>type</strong> of the resource (prior to any <strong>content</strong> encoding applied for sending.</td><td>application/json</td></tr><tr><td>ShortCode</td><td>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.</td><td>835625***</td></tr><tr><td>UnixTime</td><td>This is the Timestamp of the transaction, normally in the format of YEAR+MONTH+DATE+HOUR+MINUTE+SECOND (<strong>YYYYMMDDHHMMSS</strong>).</td><td>1607590160***</td></tr><tr><td>Authorization</td><td>Basic Auth over HTTPS, this is a <strong>base64 encoded</strong> string of an app's consumer key and consumer secret</td><td>base64.encode(Shortcode+Passkey+Timestamp)</td></tr></tbody></table>

{% hint style="info" %}
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.
{% endhint %}

{% hint style="success" %}
The Username, Password, and the Shortcode will be issued for both sandbox environment apps and Live apps..
{% endhint %}
