Developers
USSD, Airtime & Data

Airtime & Mobile Data

OfficeUG can sell airtime and mobile data through your Africa's Talking account. Africa's Talking uses two callback URLs for each product.

Purpose Airtime Mobile data
Validation: asks OfficeUG to approve a transaction before it runs /africastalking/airtime/{company_slug}/validate /africastalking/data/{company_slug}/validate
Status: reports the result after it finishes /africastalking/airtime/{company_slug}/status /africastalking/data/{company_slug}/status

Each path goes after https://officeug.com. Copy the complete URLs from Settings → Africa's Talking and paste them into the matching fields in your Africa's Talking dashboard.

Status callbacks require a webhook username and password. Without them, results are ignored, and failed purchases won't be refunded automatically. See Securing Callbacks.

Validation

Africa's Talking sends:

Field Meaning
transactionId Its reference for this transaction.
phoneNumber The number receiving the airtime.
sourceIpAddress The address the request came from.
currencyCode For example UGX.
amount The amount.

OfficeUG replies with JSON:

{ "status": "Validated" }

Any request OfficeUG can't match to a real purchase gets { "status": "Failed" }.

Status

For airtime, Africa's Talking sends:

Field Meaning
requestId The transaction reference.
phoneNumber The number that received the airtime.
status The outcome.
value The value sent.
discount Your discount on the transaction.
description Extra detail about the result.

OfficeUG replies OK.