Table of Contents
Introduction
E-Dahab is a mobile money service provided by Somtel, a telecommunication company in Somalia. E-Dahab provides a mobile money API that allows developers to integrate mobile money services into their applications. This guide will help you to integrate E-Dahab mobile money API in your application.
Prerequisites
Before you start integrating E-Dahab mobile money API, you need to have the following:
- Merchant account: You need to have a merchant account to receive payments through the E-Dahab mobile money API. You can create a merchant account on the E-Dahab website.
- E-Dahab account: You need to have an E-Dahab account to access the mobile money API. You can sign up for an E-Dahab account on the E-Dahab website.
- API credentials: Once you have an E-Dahab account, you will receive API credentials, including an API key and a secret key. You will use these credentials to authenticate your requests to the E-Dahab mobile money API.
Integration steps
As we embark on the integration of the E-Dahab mobile money API, itβs crucial to understand that there are two primary methods for processing customer payments. The first option is via Web Payment, which utilizes the E-Dahab payment link. The second option is through Pop-Up Payment, which directly leverages the E-Dahab API. This guide will concentrate on these two integration methods.
Step 1: Create a payment request link (Via Web Payment)
To create a payment request link using this endpoint https://edahab.net/api/api/IssueInvoice?hash={{hash}}
where {{hash}}
was generated from Pre-request Script
in Postman with the following code:
Note: You need to replace
your-secret-key
with your secret key.
use this json body to create a payment request link:
After sending the request, you will receive a response with a payment request link. You can use this link to request payment from the customer.
Code Example
Iβll provide a different code examples for different programming languages to help you understand how to integrate E-Dahab mobile money API in your application.
python
weβre using via web payment method to create a payment request link using the following code:
Node.js
weβre using via web payment method to create a payment request link using the following code:
Note: Youβll need to replace
apiKey
,agentCode
, andsecret
with your actual API key, agent code, and secret key.
Step 2: Create a payment request link (Via Pop-Up Payment)
To create a payment request we will use the same endpoint https://edahab.net/api/api/IssueInvoice?hash={{hash}}
and the same Pre-request Script
in Postman to generate, and we will use the same json body to create a payment request link. but it will be different the phone number of the customer, if the phone number start 65,66 only 62 will not support pop-up payment.
Note: the Pop-Up Payment will not work if the phone number start with 62. you will need to do manual payment request for the customer if the phone number start with 62.
Conclusion
This guide has provided you with the necessary steps to integrate E-Dahab mobile money API in your application. You have learned how to create a payment request link using the E-Dahab mobile money API and how to use the payment request link to request payment from the customer. You have also learned how to use the E-Dahab mobile money API to create a payment request link using the Pop-Up Payment method. Also itβs very simple to understand and implement the E-Dahab mobile money API in your application.
I hope this guide has been helpful to you. If you have any questions or need further assistance, feel free to reach out to me on WhatsApp.
Happy coding!