Please wait...

Account Balance

Prerequisites

The following are required to successfully integrate to this service:

  1. Must be a fully registered M-Pesa Merchant
  2. API Credentials.
    The credential required are:
    • M-PESA ShortCode
    • Initiator Credentials. (username and password) - These are generated on the M-PESA portal
  3. Connectivity
    The API is accessible via the internet.
    The request is made via HTTP POST to https://api.dibon.co.ke

Generic API Request
Parameter Description Example
api_key This should match the api key that you have generated for your Dibon account here 2_aa67677e8bf1d4c8fe886a38c03a860
client_id This should match the id of your account; found on your dashboard 2
command_id Pass this as mpesa_account_balance mpesa_account_balance
business_shortcode The organization shortcode 12345

Generic API Response
Parameter Description Example
status_code Transaction Response code 200
descritpion Response description Success. Request Scheduled Successfully
request_id The unique referrence number as assigned by dpay Dibon20180307054639H4adfKDJDKQ7H
business_shortcode The organization short code 213484

Generic API Result

Note that in order to ensure that you do not miss any transaction notifications the instant they come onto our api, register a callback url that we will invoke whenever we receive a notification for your service.

This is done on your Dibon Account Account Balance Call Back Section.

Every time a transaction status changes, we will forward you the following information as POST variables as outlined below as a JSON object.

Parameter Description Example
request_id The unique reference number as assigned by the Dibon API Dibon_2_HR8584JDJD
third_party_trans_id The reference number as assigned by the mobile money provider HR8584JDJD
account The Paybill number being paid to 888555
account_balance The organization account balance 500.00
transaction_time The date and time stamp of the transaction. 2017-05-18 18:23:23
result_code Transaction result code 0
result_desc Result code description The service request is processed successfully


Sample API Request
                            {
                              "api_key":"2_aa67677e8bf1d4c8fe886a38c03a86020180302111157",
                              "client_id":"2",
                              "command_id":"mpesa_account_balance",
                              "business_shortcode":"213484"
                            }
                            


Sample API Response
                            {
                              "status_code":200,
                              "description":"Success. Request Scheduled Successfully", 
                              "request_id":"Dibon20180307054639H4adfKDJDKQ7H",
                              "business_shortcode":"213484"
                            }  
                          


Sample API Result
                              {
                                "request_id":"Dibon_2_HR8584JDJD",
                                "third_party_trans_id":"HR8584JDJD",
                                "account":"888555", 
                                "account_balance":"500.00", 
                                "transaction_time":"2017-05-18 18:23:23", 
                                "result_code":"0", 
                                "result_desc":"The service request is processed successfully."
                              }