O
Sureapi
Type to search the docs...

Electricity API

Process postpaid bill payments and generate prepaid tokens for electricity distribution companies.


Get Electricity Providers

Returns a list of supported electricity distribution companies (DisCos) and their IDs.

GET https://sureapi.ng/api/get-bill
curl -X GET "https://sureapi.ng/api/get-bill" \
      -H "Authorization: Token YOUR_API_KEY" \
      -H "Content-Type: application/json"
<?php
    $url = 'https://sureapi.ng/api/get-bill';
    $ch = curl_init($url);
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Token YOUR_API_KEY',
            'Content-Type: application/json',
        ]
    ]);
    $response = curl_exec($ch);
    curl_close($ch);
    print_r(json_decode($response, true));
    ?>
const response = await fetch('https://sureapi.ng/api/get-bill', {
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      }
    });
    const data = await response.json();
    console.log(data);
import requests

    url = "https://sureapi.ng/api/get-bill"
    headers = {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    }
    response = requests.get(url, headers=headers)
    print(response.json())

Response

✓ 200 OK
{
[
  { "id": "1",  "name": "Ikeja Electric",       "abb": "IE",    "apidiscount": "0.50" },
  { "id": "2",  "name": "Eko Electric",         "abb": "EKEDC", "apidiscount": "0.50" },
  { "id": "8",  "name": "Abuja Electric",       "abb": "AEDC",  "apidiscount": "0.60" },
  { "id": "6",  "name": "Ibadan Electric",      "abb": "IBEDC", "apidiscount": "0.55" },
  { "id": "12", "name": "Aba Electric",         "abb": "ABEDC", "apidiscount": "1.00" }
]
    }

Verify Meter Number

Always verify the customer's meter number before making a payment to ensure it exists and matches the expected customer name.

POST https://sureapi.ng/api/bill/bill-validation

Request Body

Parameter Type Required Description
disco Integer Yes Provider ID from /electricity/get-bill.
meter_number String Yes The customer's meter number.
meter_type String Yes Either prepaid or postpaid.
✓ 200 OK
{
     "status": "success",
     "name": "IBRAHIM MUSA",
     "customer_address": "NO 5 Amule, Ilorin Kwara state",
     "message": "verified, kindly check the name."
      }
    }

Pay Electricity Bill

Purchase electricity credit for a prepaid meter or pay a postpaid bill.

POST https://sureapi.ng/api/bill

Request Body

Parameter Type Required Description
disco Integer Yes Provider ID.
meter_number String Yes The customer's meter number.
meter_type String Yes Either prepaid or postpaid.
amount String|Integer Yes Amount in Naira.
request-id String Optional Idempotency key.
curl -X POST "https://sureapi.ng/api/bill" \
      -H "Authorization: Token YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "provider_id": 1,
        "meter_number": "1234567890",
        "meter_type": "prepaid",
        "amount": "2000",
        "request-id": "elec_123"
      }'
<?php
    $url = 'https://sureapi.ng/api/bill';
    $payload = [
        'provider_id' => 1,
        'meter_number' => '1234567890',
        'meter_type' => 'prepaid',
        'amount' => '2000',
        'request-id' => 'API_' . uniqid()
    ];
    $ch = curl_init($url);
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POST => true,
        CURLOPT_POSTFIELDS => json_encode($payload),
        CURLOPT_HTTPHEADER => [
            'Authorization: Token YOUR_API_KEY',
            'Content-Type: application/json',
        ]
    ]);
    $response = curl_exec($ch);
    curl_close($ch);
    print_r(json_decode($response, true));
    ?>
const response = await fetch('https://sureapi.ng/api/bill', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        provider_id: 1,
        meter_number: '1234567890',
        meter_type: 'prepaid',
        amount: '2000',
        'request-id': 'elec_123'
      })
    });
    const data = await response.json();
    console.log(data);
import requests

    url = "https://sureapi.ng/api/bill"
    headers = {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    }
    payload = {
        "provider_id": 1,
        "meter_number": "1234567890",
        "meter_type": "prepaid",
        "amount": "2000",
        "request-id": "elec_123"
    }
    response = requests.post(url, json=payload, headers=headers)
    print(response.json())

Responses

✓ 200 OK (Prepaid)
{
      "status": "success",
      "Status": "successful",
      "message": "Electricity Payment Successful.",
      "response": "IKEDC Payment Successful for 1234567890. Token: 1234 5678 9012 3456 7890",
      "api_response": "IKEDC Payment Successful for 1234567890. Token: 1234 5678 9012 3456 7890",
      "request-id": "API_66bbd45c67b7b",
      "service": "electricity",
      "amount": "2000",
      "old_balance": 5000,
      "new_balance": 3000,
      "token": "1234 5678 9012 3456 7890"
    }