Developer API
VTU API for airtime, data, electricity and cable TV
Sell airtime, MTN, Airtel and Glo data, electricity tokens and cable TV renewals from your own website or app. One API key, wholesale prices, and a refund on every failed purchase.
- REST and JSON
- Webhooks
- API prices on every product
/v1/data/purchase{
"plan_id": "mtn_1gb_30d",
"phone": "08012345678",
"request_ref": "3c9e7d22-5a1b-4f6e-8d2c-1e2f3a4b5c6d"
}One key, four products
Each page shows the endpoints, a working example and today's API prices.
Data API
Fetch every plan we sell with its API price, then buy a bundle for any number with one request. Gifting, SME (Datashare), corporate and awoof plans all come through the same endpoint.
GET /v1/data/plansPOST /v1/data/purchaseAirtime API
Send airtime to any Nigerian number with one request. You choose the amount, we deliver it and pay commission back on every successful top-up.
POST /v1/airtime/purchaseElectricity API
Check a meter, then sell prepaid units or settle a postpaid bill with one request. Prepaid purchases return the token and units in the response, and we also text the token to the customer.
POST /v1/electricity/verifyPOST /v1/electricity/purchaseCable TV API
Fetch the current packages, check the smartcard or IUC number, then renew or change a subscription with one request.
POST /v1/cabletv/variationsPOST /v1/cabletv/verifyPOST /v1/cabletv/purchase
Built so your customers don't lose money
Idempotent purchases
Every purchase carries your own request_ref. A reference you already used is rejected with 400, so a retry can’t charge twice.
Automatic refunds
If the network, DISCO or provider rejects a purchase you get HTTP 424, and the amount is already back in your wallet.
An answer within 15 seconds
Airtime and data requests wait up to 15 seconds for the network. Anything slower returns 202 pending instead of timing out.
Webhooks
Register one URL and get success and failure events for airtime and data purchases, signed with a hash you can verify.
Status by your reference
POST /v1/transaction/status returns the outcome, amount and wallet balance before and after, for any request_ref.
Verify before you charge
Check a meter or smartcard first. You get the customer details back, so your customer can confirm before paying.
Buy a data bundle in one request
Get a plan_id from GET /v1/data/plans, then send it with the phone number and your own reference.
curl -X POST https://api.vtuagent.com/v1/data/purchase \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"plan_id": "mtn_1gb_30d",
"phone": "08012345678",
"request_ref": "3c9e7d22-5a1b-4f6e-8d2c-1e2f3a4b5c6d"
}'const res = await fetch('https://api.vtuagent.com/v1/data/purchase', {
method: 'POST',
headers: {
Authorization: 'Bearer ' + process.env.VTUAGENT_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"plan_id": "mtn_1gb_30d",
"phone": "08012345678",
"request_ref": "3c9e7d22-5a1b-4f6e-8d2c-1e2f3a4b5c6d"
}),
});
const result = await res.json();$ch = curl_init('https://api.vtuagent.com/v1/data/purchase');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('VTUAGENT_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'plan_id' => 'mtn_1gb_30d',
'phone' => '08012345678',
'request_ref' => '3c9e7d22-5a1b-4f6e-8d2c-1e2f3a4b5c6d',
]),
]);
$result = json_decode(curl_exec($ch), true);import os, requests
res = requests.post(
"https://api.vtuagent.com/v1/data/purchase",
headers={"Authorization": f"Bearer {os.environ['VTUAGENT_API_KEY']}"},
json={
"plan_id": "mtn_1gb_30d",
"phone": "08012345678",
"request_ref": "3c9e7d22-5a1b-4f6e-8d2c-1e2f3a4b5c6d"
},
)
result = res.json()Response
{
"status": "successful",
"status_code": 200,
"message": "Data purchase successful - MTN 1GB (SME) for 08012345678",
"reference": "3c9e7d22-5a1b-4f6e-8d2c-1e2f3a4b5c6d",
"data": {
"amount": "270",
"phone": "08012345678",
"plan": "MTN 1GB (SME)"
}
}API data prices today
What an API account pays for the cheapest plan of each size, straight from our price list. Every plan is returned by GET /v1/data/plans.
| Size | MTN | Airtel | Glo |
|---|---|---|---|
| 1GB | ₦414.40 | ₦777.60 | ₦348.70 |
| 2GB | ₦727.20 | ₦583.20 | ₦830 |
| 5GB | ₦1,163.52 | ₦1,458.01 | ₦1,745.75 |
| 10GB | ₦4,363.20 | ₦2,810 | ₦4,100 |
Get your API key
- Step 1
Create an account
Sign up for free with your email.
- Step 2
Apply for API access
On Upgrade Account, choose API User and add the website or app you’ll connect.
- Step 3
Get your key
Once you’re approved, generate your key in Settings → API Keys. Send it as Authorization: Bearer <key> on every request.
- Step 4
Fund your wallet
Purchases are paid from your wallet balance at API prices, so top it up by bank transfer or card.
Questions people ask
How do I get a VTU Agent API key?
Create a free account, then apply for API access from Upgrade Account by choosing API User and adding the website or app you’ll connect. Once you’re approved, generate your key in Settings → API Keys.
How much does the API cost?
There is no monthly or setup fee. Each purchase is paid from your wallet at API prices, the lowest of our three account types, and API accounts earn the highest commission on airtime, electricity and cable TV.
What happens if a purchase fails?
You get HTTP 424 with status failed, and the amount is already refunded to your wallet.
What if the network is slow to respond?
Airtime and data requests wait up to 15 seconds. After that you get 202 pending; the result follows by webhook, or you can check it with POST /v1/transaction/status.
Can I connect a WordPress or PHP VTU website?
Yes. It is a plain REST API with JSON bodies and a Bearer key, so any language works. Each API page has PHP, Node.js, Python and cURL examples.
Where is the full documentation?
Every endpoint, field and error is documented at docs.vtuagent.com, along with the OpenAPI specification.
API pages
Connect your site to VTU Agent
Apply for API access, then follow the docs to make your first purchase.
