Mobile Money with Direct API
About this guide
This page explains how to add Mobile Money to your existing Direct API integration. Direct API integration is basically the same for all payment methods, only varying the payment_type_code
and some additional required fields.
Availability:
Mobile Money integration through Direct API is available to the following countries:
- Zambia
If you are not integrated with EBANX Direct API yet, please take a look in this basic guide about it. Are you not sure if EBANX Direct API is the best option for your e-commerce? Please, talk with one of our integration specialists.
What you will need
Before starting your integration, please make sure that you have:
- An EBANX Sandbox account. That's not the case? Please sign up for an Sandbox Account here;
- Mobile Money enabled in your EBANX Dashboard.
How it works
To complete Mobile Money integration through EBANX Direct API, please follow the steps below.
Enable Mobile Money
Mobile Money availability may vary depending on your contract. So the first step is to check if it is active in your EBANX dashboard.
All set? We can go ahead to next step, otherwise, please get in touch with our integration specialists.
Configure your Notification URL
For your Mobile Money transactions, once the payment is confirmed you will receive a notification changing the status from
pending
toconfirmed
. Check the instructions for configuring your URL on NotificationsBasic parameters:
Parameter Description operation
Operation must be request
integration_key
Your unique and secret integration key payment_type_code
For Mobile Networ Opperators in Zambia the types are Zamtel
,MTN
andAirtel
country
Two-letter country code - zm
for ZambiaCustomer data:
Parameter Description name
Customer name email
Customer email phone_number
Customer phone number, in full international format Charge parameters:
Parameter Description merchant_payment_code
Unique merchant payment code currency_code
ISO-4217 Currency code transaction. Supported value: ZMW
amount_total
Total amount to be charged info
The
phone_number
information is key for this payment flow and it's used to send a push notification for the customer to validate and confirm the charge. It must be sent in full international format, including the Country Code (260 for Zambia).Check the example:
curl -L -X POST 'https://sandbox.ebanxpay.com/ws/direct' \-H 'Content-Type: application/json' \--data-raw '{"integration_key": "{{integration_key}}","operation": "request","payment": {"name": "John Doe","email": "email@example.com","phone_number": "260000000000","country": "zm","payment_type_code": "airtel","merchant_payment_code": "63c9377be268e","currency_code": "ZMW","amount_total": "100"}}'A successful request will return a JSON response like the one below.
{"payment": {"hash": "63c9377bf0e9252be9fd2f8424bcaffd61cb587a4dbdde6c","country": "zm","merchant_payment_code": "63c9377be268e","order_number": "1234567","status": "PE","status_date": null,"open_date": "2023-01-01 01:01:01","confirm_date": null,"transfer_date": null,"amount_br": "100.00","amount_ext": "100.00","amount_iof": "0.00","currency_rate": "1.0000","currency_ext": "ZMW","due_date": "2023-01-01 01:06:01","instalments": "1","payment_type_code": "airtel","pre_approved": false,"capture_available": null,},"status": "SUCCESS"}info
The complete API reference for the end-point
ws/direct
can be found here. We strongly recommend you to take a look in all the available options.Wait for the payment
Shortly after a successful charge response your customer will receive a push notification, from the mobile operator network, on its mobile device requiring a PIN validation to confirm the payment.
Once the customer confirms it, payment status is modified from
pending
toconfirmed
.If your customers don't conclude the payment, it will be automatically canceled.
Getting help
We hope this article was enlightening, but in case we’ve failed to take out your doubts you have the following options to keep on seeking for answers:
- If you’re not our partner yet and would like to know more about our prices and conditions please fill our this form and our commercial team will get in touch with you.
- In case you’re already our partner please get in touch with our support team at integration@ebanx.com.