API Reference
Welcome to the LegitData Sub API. Our RESTful architecture allows you to seamlessly integrate VTU purchases, bill payments, KYC verifications, and business registrations directly into your applications.
The API relies on standard HTTP methods, accepts application/json request bodies, and returns JSON-encoded responses.
Base URL
{
"status": "success",
"transaction_ref": "DAT_171000",
"amount_paid": 280,
"previous_balance": 5000,
"new_balance": 4720
}
Authentication
Authenticate your API requests by including your secret API key in the HTTP headers. You can retrieve your API key from the developer section of your dashboard.
Never share your API key publicly or commit it to client-side code (like frontend JavaScript).
Authorization: Token YOUR_API_KEY_HERE Content-Type: application/json
User Details & Balance
Retrieve your account profile and verify your current wallet balance before making transactions.
{
"status": "success",
"userid": "123",
"name": "John Doe",
"balance": "5000.00"
}
Buy Airtime
Top up airtime for any phone number across all networks in Nigeria.
/api/topup/. Also accepts mobile_number and Ported_number as aliases for phone and ported_number, for compatibility with common 3rd-party VTU API formats.$payload = json_encode([ "network" => "1", "phone" => "08012345678", "amount" => 100, "ref" => "AIR_" . time() ]);
{
"status": "success",
"amount_paid": 98.00,
"transaction_ref": "AIR_171000"
}
Buy Data
Purchase SME, Corporate Gifting, or Direct Data instantly.
mobile_number, plan, and Ported_number as aliases for phone, data_plan, and ported_number.$payload = json_encode([ "network" => "1", "phone" => "08012345678", "data_plan" => "10044", "ref" => "DAT_" . time() ]);
{
"status": "success",
"amount_paid": 280.00,
"transaction_ref": "DAT_171000"
}
Verify Electricity Meter
Validate customer details before purchasing electricity token.
GET /ajax/validate_meter_number/?meternumber=&disconame=&mtype=.$payload = json_encode([ "provider" => "1", "meternumber" => "12345678901", "metertype" => "prepaid" ]);
{
"status": "success",
"Customer_Name": "MUSA YUSUF"
}
Pay Electricity Bill
Generate electricity token for verified meters.
/api/billpayment/. Also accepts disco_name, meter_number, and MeterType as aliases for provider, meternumber, and metertype.{
"status": "success",
"plan_description": "Token: 8378-9287...",
"amount_paid": 1000
}
Verify Cable TV (IUC)
GET /ajax/validate_iuc/?smart_card_number=&cablename=.{
"status": "success",
"Customer_Name": "AMINA SULEIMAN"
}
Pay Cable TV
/api/cablesub/. Also accepts smart_card_number, cablename, and cableplan as aliases for iucnumber, provider, and plan.$payload = json_encode([ "provider" => "1", "iucnumber" => "7012345678", "plan" => "128", "ref" => "CAB_" . time() ]);
Generate Exam Pin
{
"status": "success",
"pin": "123456789012",
"amount_paid": 3600.00
}
Send Bulk SMS
Submit via URL-Encoded Form or Form-Data (Uses $_POST variables).
$post = [ 'sender_id' => 'LEGITDATA', 'phone_numbers' => '0801...,0902...', 'message_body' => 'Welcome!' ];
Verify Identity (NIN/BVN)
{
"status": "success",
"data": {
"firstname": "MUSA",
"nin": "12345678901"
}
}
CAC Registration
Submit via multipart/form-data for file uploads.
$post = [ 'type' => 'business_name', 'owner_fullname' => 'John Doe', 'passport' => new CURLFile('/pass.jpg') ];