VTUAgent Logo

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
POST/v1/data/purchase
{
  "plan_id": "mtn_1gb_30d",
  "phone": "08012345678",
  "request_ref": "3c9e7d22-5a1b-4f6e-8d2c-1e2f3a4b5c6d"
}
Response200 · successful

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.

Data purchase docs
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"
}'

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.

All plans and prices
SizeMTNAirtelGlo
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

  1. Step 1

    Create an account

    Sign up for free with your email.

  2. Step 2

    Apply for API access

    On Upgrade Account, choose API User and add the website or app you’ll connect.

  3. 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.

  4. 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.

Connect your site to VTU Agent

Apply for API access, then follow the docs to make your first purchase.