Airtime, data, bills and listed products in a few key presses. No data bundle, no app, no smartphone. Try the menu on the phone here: it runs the same menu as the live code.
{{ reqJson }}
{{ resJson }}
Seven options. Press 0 to go back a step, 00 for the main menu. Mobile Money is only used to pay for what you choose.
Nalo carries the session over the network signalling channel and POSTs each key press to our endpoint as JSON. We answer with the next screen. No data connection or SMS cost for the customer.
{
"USERID": "ALLPAY",
"MSISDN": "233244000111",
"USERDATA": "*920*301#",
"MSGTYPE": true
}
{
"USERID": "ALLPAY",
"MSISDN": "233244000111",
"USERDATA": "*920*301#",
"MSG": "Welcome to ALLPAY\n1) Airtime\n2) Data bundles\n…\n7) Help",
"MSGTYPE": true
}
{
"USERID": "ALLPAY",
"MSISDN": "233244000111",
"USERDATA": "1",
"MSGTYPE": false
}
{
"USERID": "ALLPAY",
"MSISDN": "233244000111",
"USERDATA": "1",
"MSG": "Approve the Mobile Money prompt on your phone to pay GHS 10.00.\nRef: ALLPAY-…",
"MSGTYPE": false
}
curl -X POST "$ALLPAY_API/api/v1/ussd/allpay" \
-H "Content-Type: application/json" \
-d '{"USERID":"ALLPAY","MSISDN":"233244000111",
"USERDATA":"*920*301#","MSGTYPE":true,
"NETWORK":"MTN"}'
Payment receipts, agent details and callback requests go out through the Nalo SMS gateway as JSON.
{
"username": "$NALO_SMS_USERNAME",
"password": "$NALO_SMS_PASSWORD",
"msisdn": "233244000111",
"message": "ALLPAY: Payment of GHS 10.00 for Airtime received. Ref ALLPAY-…",
"sender_id": "ALLPAY"
}
{
"status": "1701",
"job_id": "api.0000011.20221221.0000099",
"msisdn": "233244000111"
}
Website orders with an email address get a receipt through the Nalo Email API. The sender address must be verified in the Nalo portal first.
{
"key": "$NALO_EMAIL_KEY",
"emailTo": ["customer@example.com"],
"emailFrom": "info@allpaygh.com",
"senderName": "ALLPAY",
"subject": "ALLPAY receipt WEB-…",
"emailBody": "Payment of GHS 50.00 for ECG Prepaid received…",
"html": "<!doctype html>…",
"callBackUrl": "…/api/v1/payments/email/callback"
}
mid, destination_address, timestamp and status_desc.