Mobile Money - Direct Charge
This is one of the ways to process payments using Mobile Money. The section below will guide you through the process of accepting Mobile Money using the direct API method.
Last updated
This is one of the ways to process payments using Mobile Money. The section below will guide you through the process of accepting Mobile Money using the direct API method.
Last updated
The currently supported mobile money channels are listed (to be updated from time to time). Test mobile money phone numbers are also described in section. We equally recommend that you go through the section to have a high-level understanding of the funds collection process.
The table below describes the request parameters that are used for the collection/charge request. Most/all will be collected from the paying customer.
merchant_reference
String
true
The unique reference for this request. It must be at least 8 characters long. Alternatively, the value auto can be passed, and a unique reference will be created for you by the API
transaction_method
String
true
The transaction method to be used. This will be MOBILE_MONEY for this request
currency
String
true
The 3-character ISO currency code for the request currency
amount
Number
true
The amount being requested
provider_code
String
true
msisdn
String
true
The phone number from which the payment is being requested. This should be sent in international format e.g. 256777000001 for Ugandan numbers
customer_name
String
false
The name of the customer
customer_email
String
false
The email of the customer
description
String
true
The description/narration for the transaction. Between 10-30 characters
charge_customer
Boolean
false
Whether or not the customer should bear the charge for the transaction. By default, this is false to mean that the merchant bears the charge
allow_final_status_change
Boolean
false
After collecting the necessary mobile money payment information from your customer, prepare your request payload as demonstrated below.
POST
https://sandboxapi.dusupay.com/collections/initialize
The request is sent as a JSON body as demonstrated by the sample request below. Sample responses (acknowledgement and failure) are also shared.
If the request in step 1 is successful and responds with an acknowledgement (HTTP code 202), you should listen and handle the payment instructions webhook/callback. This will be sent to the collection callback URL that's configured on your merchant account. The callback is sent as a JSON POST request and the payload will help you determine the next course of action. The tabs below show the two possible payload structures.
If the payment instructions webhook in step 2 above is sent, the transaction status being PROCESSING and the authorization mode is OTP, this means the OTP has been set to the customer's phone number. The merchant therefore needs to collect the OTP from the customer and submit it in order to verify the phone number and authorize the transaction to proceed.
The parameter authorization.required_parameters
holds an object array of the parameters the merchant should obtain and submit. In every object, parameter_name
is the name of the parameter that's going to carry the required value (OTP in this case). Form the payload as demonstrated in the sample request below.
POST
https://sandboxapi.dusupay.com/collections/authorize
If OTP verification is successful, a PIN prompt will be sent to the mobile money phone number in the request for the customer to approve the transaction. If the customer has sufficient balance for the transaction and is eligible to transact, the request will be successful otherwise the API will send an appropriate error message as shared by the telecom.
The provider code as obtained from the payment options
Whether or not the final transaction status can be altered as described . By default, this is true to mean DusuPay will alter the final transaction status under the circumstances described.
Every merchant account is expected to have configured a callback/webhook URL for collections. For all collections that transition to the final state (COMPLETED, FAILED or CANCELLED), a JSON POST request will be made to the callback URL. Sample callback payloads (request bodies) are shared below. Be sure to check out to see how you should verify the signature(s) in the request headers and how to respond.