API Documentation - Meenal Data Sub

Developer API Reference

Simple, powerful endpoints to integrate Meenal Data Sub services into your platform.

🌐 Base URL

All API requests must be directed to the following base endpoint. Ensure all requests use HTTPS.

https://minaldatasub.com.ng

🔐 Authentication

Exchange your credentials for a Bearer token. This token must be included in the headers of all subsequent API requests.

POST /api/auth/login
Request Body
{
    "email": "user@gmail.com",
    "password": "your_secure_password"
}
Response (200 OK)
{
    "status": "success",
    "message": "Authenticated successfully",
    "data": {
        "token": "1|JWT",
        "user": {
            "id": 1,
            "name": "John Doe",
            "balance": 5000.00
        }
    }
}

📡 Networks Required: Bearer Token

Retrieve a list of all active telecommunication networks currently supported. Use the network IDs returned here for purchase transactions.

GET /api/services/networks
Headers
Authorization: Bearer {your_token}
Accept: application/json
Response (200 OK)
[
    { 
        "id": 1, 
        "title": "MTN", 
        "status": "active" 
    },
    { 
        "id": 2, 
        "title": "AIRTEL", 
        "status": "active" 
    }
]

📦 Plans Required: Bearer Token

Fetch all active data plans mapped to a specific telecommunication network.

GET /api/services/plans/{network_id}
Headers
Authorization: Bearer {your_token}
Accept: application/json
Response (200 OK)
[
    {
        "id": 344,
        "title": "500MB Share - Monthly",
        "status": "active",
        "network_id": 1,
        "amount_user": 400
    },
    {
        "id": 345,
        "title": "1GB Share - Monthly",
        "status": "active",
        "network_id": 1,
        "amount_user": 250
    }
]

📶 Data Purchase Required: Bearer Token

Seamlessly vend data to any valid mobile number using a specific plan ID. The transaction amount will be deducted from your wallet balance.

POST /api/purchase/data
Headers
Authorization: Bearer {your_token}
Content-Type: application/json
Request Body
{
    "network_id": 1,
    "mobile": "08000000000",
    "plan_id": 344,
    "customer_reference": "REF-345854858"
}
Response (200 OK)
{
  "msg": "success",
  "data": {
    "msg": "Transaction successful",
    "success" "Data Purchased Successful"
  }
}

📞 Airtime Purchase Required: Bearer Token

Top up the airtime balance instantly for any supported network provider.

POST /api/purchase/airtime
Headers
Authorization: Bearer {your_token}
Content-Type: application/json
Request Body
{
    "network_id": 2,
    "mobile": "08011112222",
    "amount": 500,
    "customer_reference": "AIR-999888777"
}
Response (200 OK)
{
    "status": "success",
    "message": "Airtime top-up successful",
    "data": {
        "transaction_id": "TXN_888777666",
        "amount": 500,
        "balance_after": 4250
    }
}

📺 Cable TV Required: Bearer Token

Process subscriptions for cable providers like DSTV, GOTV, and Startimes using the customer's IUC/Smartcard number.

POST /api/purchase/cable
Headers
Authorization: Bearer {your_token}
Content-Type: application/json
Request Body
{
    "provider": "gotv",
    "smartcard_number": "2020202020",
    "plan_id": 15,
    "customer_reference": "CAB-11223344"
}
Response (200 OK)
{
    "status": "success",
    "message": "Cable subscription activated",
    "data": {
        "transaction_id": "TXN_112233445",
        "customer_name": "JOHN DOE",
        "amount": 2800,
        "balance_after": 1450
    }
}

⚡ Electricity Required: Bearer Token

Generate electricity tokens across multiple DisCos (Prepaid and Postpaid) using the meter number.

POST /api/purchase/electricity
Headers
Authorization: Bearer {your_token}
Content-Type: application/json
Request Body
{
    "disco_id": 1,
    "meter_number": "11112222333",
    "meter_type": "prepaid",
    "amount": 2000,
    "customer_reference": "ELEC-555666"
}
Response (200 OK)
{
    "status": "success",
    "message": "Electricity token generated successfully",
    "data": {
        "transaction_id": "TXN_444555666",
        "token": "1234 5678 9012 3456 7890",
        "customer_name": "JANE DOE",
        "units": "34.5 kWh",
        "amount": 2000
    }
}