Airtime and data top-ups

Environment: Live

Sell airtime and data bundles to customers who pay with Mobile Money.

# Sell Airtime and Data in Your App

Let customers pay with Mobile Money and receive airtime or data bundles on MTN, Telecel, and AT. Combine Mobile Money Collection with the Sales APIs, and confirm every sale with Sales Status.

## Before you begin

Create a Sell on Our Platform Service in the Moolre App. Send its linked wallet as accountnumber on every Sales request. See the [Sales guide](https://docs.moolre.com/guides/sales).

## Top-up flow

1. The customer picks airtime (from GHS 1.00) or a data bundle from [Bundles](https://docs.moolre.com/api/sales/bundles).
2. Your server creates the order with a payment reference and a sale reference, then sends a [Mobile Money Collection](https://docs.moolre.com/api/payments/initiate) prompt.
3. Sell only after the [payment webhook](https://docs.moolre.com/api/payments/webhook) reports data.txstatus 1. Verify the callback secret and ignore duplicate callbacks.
4. Call [Airtime](https://docs.moolre.com/api/sales/airtime) or [Data](https://docs.moolre.com/api/sales/data) with the sale reference. ASL11 means in progress, not delivered.
5. Confirm with [Sales Status](https://docs.moolre.com/api/sales/status) using idtype 1 and the same sale reference.

## Handle every outcome

| txstatus | Outcome | Action |
| --- | --- | --- |
| 0 | Pending | Check Sales Status again later. Do not resend the sale. |
| 1 | Sent | Mark the order delivered and notify the customer. |
| 2 | Failed and refunded | The wallet was refunded (refundid). Retry with a new sale reference or refund the customer. |
| 3 | Not found | No sale exists for that reference in the wallet. Flag the order for review. |

If a sale request times out or returns ASL06, the sale may still have gone through. Check Sales Status with the original reference before any retry. Only a final txstatus 2 makes it safe to sell again with a new reference.

## Production checklist

- Use the wallet linked to your Sell on Our Platform Service for every Sales request.
- Look bundle prices up on the server at checkout; never trust a client-supplied price.
- Use one payment reference and one sale reference per order, unique within the wallet.
- Make webhook handling idempotent and verify the callback secret.
- Review orders needing attention daily and alert when the sales wallet runs low.

Back to the Moolre AI documentation index