Airtime API, SMS API, Payment API (pesalink, airtel and Mpesa b2c, b2b, stk-push)

Please wait...

B2B Documentation


Initiates a direct debit from M-pesa Customer To Business (C2B) account to a Business To Customer (B2C) account or Business To Customer (B2C) account to Customer To Business (C2B). The account is then credited of the amount.

Once completed, we send an Instant Transaction Notification or webhook event to your callback URL for you to process the transaction.

Getting started

Getting started is easy. All you will need is a Payment Product configuration in your Dibon's account. You can have as many products as you wish, and each will be linked to a payment provider (such as Safaricom's M-PESA) through one of their payment channels.

Integration

This documentation is intended to guide third party application developers interact with the Dibon Payments platform in an easy way using HTTP Post and JSON.

(i) C2B TO B2C
To use this service, you need to set up the Customer To Business (C2B) account set up, refer to C2B API documentation
(i) B2C TO C2B
To use this service, you need to set up the Business To Customer (B2C) account set up, refer to B2C API documentation

The API request is made via HTTP POST to

https://api.dibon.co.ke
All parameters below are compulsory. The parameters are:

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_b2b mpesa_b2b
initiator_shortcode Paybill/Bulk number who wants to pay 75678
receiver_shortcode Paybill/till/Bulk number to be paid 459308
amount Amount to be paid out 75678
operation Request type BusinessTransferFromMMFToUtility
BusinessTransferFromUtilityToMMF
MerchantTransferFromMerchantToWorking MerchantServicesMMFAccountTransfer
API Response

The response from the Dibon API will be a JSON object which the client application can process.

Please note that in order to ensure that you do not miss any transaction notifications the instant they come onto our api, you will need to register a call back url that we will invoke whenever we receive a notification for your service transaction. This is done on your Dibon Account B2C 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.

The following POST parameters that will be passed will be as follows

Parameter Description Example
result_code The result code. 100
result_desc The result description of the result code. Success
third_party_trans_id The reference number as assigned by the mobile money provider HR8584JDJD
account_balance The Paybill, Buygoods account balance. 34000.00
amount The transaction amount. 10.00
transaction_time The date and time stamp of the transaction. 2017-05-18 18:23:23

Sample API Request
    {
	"api_key":"hRUdPCE5uyl6R2U14P1DzHmtq9Va9tyldyatuQw739220181211100837",
	"client_id":"392",
	"command_id":"mpesa_b2b",
	"initiator_shortcode":"123456",
	"receiver_shortcode":"123456",
	"amount":"10",
	"sender_identifier": "1",
        "reciever_identifier_type": "1",
        "operation":"BusinessTransferFromMMFToUtility"
    }
          


Sample API Response
{
    "status_code": 200,
    "description": "Success. Request Scheduled Successfully",
    "request_id": "Dibon20181211112521150ujxOZpJOy8",
    "operation": "BusinessTransferFromMMFToUtility",
    "initiator_shortcode": "123456",
    "receiver_shortcode": "123456",
    "sender_identifier": "1",
    "reciever_identifier_type": "1",
    "amount": "10"
}