Back
ND
NG DATALINK
Get API Key
Developer API

Data & Airtime API at cost price

Integrate instant MTN, Airtel, Glo and 9mobile data and airtime into your own platform. Pricing is live — it updates the moment the owner edits or imports new prices.

Get started

Three steps to go live

Register & fund wallet

Create an account and fund your wallet — purchases are debited from it.

Generate an API key

Create a key from the API Keys page. Copy it immediately — it's shown only once.

Send requests

Pass your key in the x-api-key header on every purchase and balance call.

Reference

Endpoints

Base URL

Auto-detected
https://ngdatalink.base44.app/functions

This is your app's own domain — every clone detects its URL automatically. Reach each endpoint at <base-url>/<function-name>, e.g. https://ngdatalink.base44.app/functions/apiPurchase.

GET/apiPlansPublic

List plans & pricing

Returns every active data plan with its live cost price, grouped by network, plus airtime limits. Use this to look up plan_id values — these are our stable, provider-agnostic IDs that never change.

POST/apiPurchasex-api-key

Buy data / airtime

Charges your wallet at cost price and delivers data or airtime to the recipient phone. Supports idempotency via request_id.

POST/apiBalancex-api-key

Check wallet balance

Returns your current wallet balance in NGN.

Authentication

API keys

Every purchase and balance request must include your secret API key in the x-api-key header. Keys are hashed at rest and shown to you only once when created. Revoke and rotate keys anytime from the API Keys page.

x-api-key: nglive_YOUR_SECRET_API_KEY

Reference

Network mapping & required fields

Supported networks

Send the exact purchase.network string below — case-insensitive, uppercased internally. All four networks support both data and airtime.

MTN

MTN Nigeria

AIRTEL

Airtel Ng

GLO

Globacom

9MOBILE

9mobile

Phone number format

Always a 11-digit Nigerian mobile number starting with 070, 080, 081, 090 or 091. Examples: 08031234567, 07061234567. Any other length is rejected.

Data purchase — required fields

POST /apiPurchase

You're charged the plan's cost price (live value from /apiPlans). The recipient gets the full data bundle.

typerequired
"data"

Transaction type.

purchase.networkrequired
MTN | AIRTEL | GLO | 9MOBILE

One of the four networks above.

purchase.plan_idrequired
1, 2, 3 …

A number from GET /apiPlans — our stable per-network ID, not the provider's.

purchase.phonerequired
08031234567

11-digit Nigerian number on the chosen network.

request_idoptional
req_1700000001

Optional idempotency key — prevents duplicate charges on retry.

Airtime purchase — required fields

POST /apiPurchase

You're charged 99% of the amount (cost price). The phone is credited with the full face value you request. Amount must be a whole number of naira.

typerequired
"airtime"

Transaction type.

purchase.networkrequired
MTN | AIRTEL | GLO | 9MOBILE

One of the four networks above.

purchase.amountrequired
100 – 50000

Whole naira face value the phone receives. You're charged 99%.

purchase.phonerequired
08031234567

11-digit Nigerian number on the chosen network.

request_idoptional
req_1700000002

Optional idempotency key — prevents duplicate charges on retry.

Every purchase and balance request must also include your secret key in the x-api-key header, and your wallet must hold enough balance to cover the cost price — the call is debited before the provider is contacted.

Pricing

Live pricing (cost price)

Data Plans

Live cost price · sorted small → big

9MOBILE

9MOBILE · 10 plans

SME6 plans

500MB (SME)

500MB30 days

₦275

cost price

1GB (SME)

1GB30 days

₦535

cost price

1.5GB (SME)

1.5GB30 days

₦785

cost price

2GB (SME)

2GB30 days

₦1,085

cost price

7.5GB (SME)

7.5GB30 days

₦3,755

cost price

11GB (SME)

11GB30 days

₦5,695

cost price

GIFTING4 plans

2.3GB

2.3GB30 days

₦1,255

cost price

3.2GB

3.2GB30 days

₦1,555

cost price

4.5GB

4.5GB30 days

₦2,085

cost price

5.2GB

5.2GB30 days

₦2,585

cost price

Airtime

99% cost · full face value delivered

MTNMTN
AIRTELAIRTEL
GLOGLO
9MOBILE9MOBILE
You pay99% of the amount

Min ₦100 · Max ₦50,000. The recipient phone is always credited with the full face value you request.

Pricing updates instantly when the owner edits or imports plans.

Examples

Buy data

Request body — type: "data", purchase.network, purchase.plan_id (our stable plan_id from /apiPlans), purchase.phone (11 digits), optional request_id for idempotency.
curl -X POST https://ngdatalink.base44.app/functions/apiPurchase \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "type": "data",
    "request_id": "req_1700000001",
    "purchase": {
      "network": "MTN",
      "plan_id": "1",
      "phone": "08031234567"
    }
  }'

Examples

Buy airtime

Request body — type: "airtime", purchase.network, purchase.amount (₦100–₦50,000), purchase.phone. You're charged 99% of the amount; the phone gets the full value.
curl -X POST https://ngdatalink.base44.app/functions/apiPurchase \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "type": "airtime",
    "request_id": "req_1700000002",
    "purchase": {
      "network": "MTN",
      "amount": 500,
      "phone": "08031234567"
    }
  }'

Examples

Check balance

curl -X POST https://ngdatalink.base44.app/functions/apiBalance \
  -H "x-api-key: YOUR_API_KEY"

Webhooks

Transaction callbacks

Get notified when purchases complete

Set a webhook URL on any of your API keys (from the API Keys page). Whenever a data or airtime purchase made with that key succeeds or fails, we POST a JSON payload to your URL with an HMAC-SHA256 signature so you can verify it's genuinely from us.

Headers

x-webhook-signature: <HMAC-SHA256 of the raw body, hex>
x-webhook-timestamp: 2026-09-05T12:00:00.000Z
content-type: application/json

Payload

{
  "event": "purchase.success",
  "transaction_id": "abc123",
  "reference": "API-DAT-...",
  "request_id": "req_1700000001",
  "type": "data",
  "network": "MTN",
  "phone": "08031234567",
  "plan_id": "1",
  "plan_name": "1GB SME - 30 days",
  "amount": 120,
  "status": "success",
  "message": "Purchase successful.",
  "wallet_balance": 880,
  "currency": "NGN",
  "timestamp": "2026-09-05T12:00:00.000Z"
}

event is purchase.success or purchase.failed. On failure, the wallet has already been refunded.

Verify the signature (Node.js)

import crypto from "crypto";

const raw = await request.text(); // raw body
const sig = request.headers.get("x-webhook-signature");
const expected = crypto
  .createHmac("sha256", YOUR_WEBHOOK_SECRET)
  .update(raw)
  .digest("hex");
if (sig === expected) {
  const payload = JSON.parse(raw);
  // trust it — update your records
}

Always verify the signature with the signing secret shown on your key before acting on a webhook. Compare the raw body (not a re-serialized copy), and reject requests older than 5 minutes.

Response

Success & error format

Success response

{
  "success": true,
  "status": "success",
  "reference": "API-DAT-...",
  "transaction_id": "abc123",
  "amount": 120,
  "wallet_balance": 880
}

Error response

{
  "success": false,
  "message": "Insufficient wallet balance. Fund your wallet to continue.",
  "wallet_balance": 50,
  "required": 120
}

Instant delivery

Orders resolve in seconds

Wallet-based

Fund once, spend per request

Idempotent

request_id prevents duplicate charges

Ready to build?

Generate your API key and start integrating in minutes.

Get your API key