Tutorial: Purchase Airtime or Data Using Bitcoin or USDT (No Wallet Funding Required)

This tutorial shows you how to let your users pay for airtime or data bundles in real-time using Bitcoin or USDT, without needing to fund a wallet first. Bitnob lets you execute airtime or data purchases directly from crypto payment flows, across supported countries and operators.

This is perfect if you're building:

A mobile wallet with direct crypto spending

A cross-border utility app for diaspora users

A telco interface powered by Lightning or stablecoins

Key Concepts

Users don’t need to hold crypto inside Bitnob. Instead:

1.

You call the airtime or data API with the desired telco, amount, and phone number

2.

Bitnob returns a crypto payment request (on-chain or Lightning)

3.

Once the payment is made, Bitnob delivers the airtime/data instantly

This is a just-in-time crypto utility flow , not a wallet interaction.

Prerequisites

A Bitnob API key (sandbox or live)

The user specifies: phone number, amount, operator

You specify: crypto asset, payment method (Lightning or on-chain), country


Step 1: Get Airtime or Data Operators (if needed)

To dynamically list supported telcos and packages, your system should call an endpoint like:

Endpoint

GET /v1/airtime/operators"

Endpoint

GET /v1/data/operators

This helps you avoid hardcoding operators like MTN, Airtel, Safaricom, etc.


Step 2: Initiate Airtime or Data Purchase

This step creates the actual airtime/data request and returns a crypto payment instruction. Bitnob will only fulfill the airtime or data once payment is received.

Endpoint

POST /v1/airtime/purchase

Example Request

json

Explanation of Fields

FIELDDEFINITION
phoneNumber
Recipient's number (international format)
amount
In local fiat (e.g. 2000 NGN)
currency
Target currency of delivery (NGN, GHS, KES, etc.)
operator
Telco name (e.g. MTN, Airtel, Safaricom)
paymentAsset
USDT or BTC
paymentMethod
trc20, erc20, lightning, bitcoin (on-chain)
reference
Your internal transaction ID
callbackUrl
Where Bitnob sends confirmation events

Example Response

json

You should display the address (or Lightning invoice) and amount to the user. Once the payment is received and confirmed, Bitnob triggers the airtime top-up automatically.


Step 3: Track Payment and Delivery

You’ll receive webhook notifications to your callbackUrl with events like:

airtime.payment.received

airtime.delivered

airtime.failed

airtime.expired

airtime.underpayment

Use these to:

Mark the transaction complete in your UI

Retry if delivery fails

Notify users of status

You may also poll a status endpoint like:

Endpoint

GET /v1/airtime/status/:reference

If you haven’t implemented webhooks yet.


Best Practices

1.

Always let the user pick a supported operator from /v1/airtime/operators

2.

Match payment expiry (expiresAt) to a visible countdown timer

3.

Avoid pre-converting crypto or holding balances

4.

Handle underpayment by offering top-up option or cancel

5.

Log the reference, asset, address, and final delivery status

Summary

With just one API call and a crypto payment, you can let your users top up airtime or mobile data across supported countries using Bitcoin or USDT. The user doesn’t need to pre-fund anything — Bitnob converts and settles in real time.

This flow is ideal for remittance use cases, local crypto utility, or building consumer wallets with telco features baked in.

Did you find this page useful?