No data, no app, no smartphone needed — dial from any phone in Ghana
0596762508 info@allpaygh.com
ALLPAY Digital Space
Developer docs
USSD menu

Pay For Anything From Any Phone

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.

Dial {{ shortCode }} MTN · Telecel · AT
{{ netLabel }} 12:00
Press the green key to dial
{{ dial }}
USSD code running…
{{ msg }}
{{ msg }}
What the server sees Demo · no payment is made
Nalo → ALLPAY
{{ reqJson }}
ALLPAY → Nalo
{{ resJson }}
Demo product code: FC100. Payments you make here show up under 5) My payments.

What's On The Menu

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.

{{ b.n }} {{ b.title }}
{{ s }}
For developers

How The Menu Talks To Nalo

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.

Setup
User ID
Issued by Nalo for the ALLPAY integration
Endpoint URL
/api/v1/ussd/allpay on the ALLPAY API, given to Nalo
Method
POST
Data format
JSON
Content type
application/json
Fields
USERID
Our Nalo user ID. Echoed back.
MSISDN
Customer number, 233XXXXXXXXX. The only field guaranteed unique, so it keys the session when no SESSIONID is sent.
USERDATA
The dialled code on the first request, then whatever the customer typed.
MSGTYPE
Request: true new dial, false a reply. Response: true waits for input, false ends the session.
MSG
Response only. The screen text, lines split with \n.
A session, step by step
1 · Customer dials, Nalo sends
{
  "USERID": "ALLPAY",
  "MSISDN": "233244000111",
  "USERDATA": "*920*301#",
  "MSGTYPE": true
}
2 · We answer with the main menu
{
  "USERID": "ALLPAY",
  "MSISDN": "233244000111",
  "USERDATA": "*920*301#",
  "MSG": "Welcome to ALLPAY\n1) Airtime\n2) Data bundles\n…\n7) Help",
  "MSGTYPE": true
}
3 · Customer replies 1
{
  "USERID": "ALLPAY",
  "MSISDN": "233244000111",
  "USERDATA": "1",
  "MSGTYPE": false
}
4 · Last screen closes the session
{
  "USERID": "ALLPAY",
  "MSISDN": "233244000111",
  "USERDATA": "1",
  "MSG": "Approve the Mobile Money prompt on your phone to pay GHS 10.00.\nRef: ALLPAY-…",
  "MSGTYPE": false
}
Test it with cURL
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"}'
Behind the menu
Sessions are kept in Redis for three minutes, keyed by SESSIONID or MSISDN.
Payment is a Mobile Money prompt through Interpay on the customer's own number.
Delivery: airtime and data arrive automatically once the payment clears. Bills and products are recorded as paid for our team to complete.
One menu, two places. The phone on this page runs the same menu file as the server.
SMS notifications

Payment receipts, agent details and callback requests go out through the Nalo SMS gateway as JSON.

POST /smsbackend/Resl_Nalo/send-message/
{
  "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"
}
Response codes
{{ c.code }}
{{ c.text }}
Email receipts

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.

POST /clientapi/Nal_resl/send-email/
{
  "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"
}
HTTP status
{{ c.code }}
{{ c.text }}
Delivery status is posted back with mid, destination_address, timestamp and status_desc.