Get Electricity Providers
curl --request GET \
--url https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity \
--header 'Authorization: <authorization>'import requests
url = "https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"status": "<string>",
"data": [
{
"service_id": "<string>",
"name": "<string>",
"convenience_fee": 123
}
]
}API Reference
Get Electricity Providers
Fetch all active electricity distribution companies (DISCOs) and their convenience fees.
GET
/
api
/
v2
/
b2b
/
services
/
electricity
Get Electricity Providers
curl --request GET \
--url https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity \
--header 'Authorization: <authorization>'import requests
url = "https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"status": "<string>",
"data": [
{
"service_id": "<string>",
"name": "<string>",
"convenience_fee": 123
}
]
}Request
string
required
Bearer token:
Bearer <api-key>curl --request GET \
--url https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <api-key>'
const response = await fetch('https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <api-key>',
},
});
const data = await response.json();
// data.data = array of DISCO objects with service_id, name, convenience_fee
<?php
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://api.rapidtopup.com.ng/api/v2/b2b/services/electricity', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer <api-key>',
],
]);
$data = json_decode($response->getBody(), true);
// $data['data'] = array of DISCOs with service_id, name, convenience_fee
Response
string
successarray
200:
{
"status": "success",
"data": [
{ "service_id": "ikeja-electric", "name": "Ikeja Electric", "convenience_fee": 100.00 },
{ "service_id": "eko-electric", "name": "Eko Electric", "convenience_fee": 100.00 },
{ "service_id": "abuja-electric", "name": "Abuja Electric (AEDC)", "convenience_fee": 100.00 },
{ "service_id": "kano-electric", "name": "Kano Electric", "convenience_fee": 100.00 },
{ "service_id": "portharcourt-electric","name": "Port Harcourt Electric", "convenience_fee": 100.00 },
{ "service_id": "jos-electric", "name": "Jos Electric", "convenience_fee": 100.00 },
{ "service_id": "benin-electric", "name": "Benin Electric", "convenience_fee": 100.00 },
{ "service_id": "enugu-electric", "name": "Enugu Electric", "convenience_fee": 100.00 },
{ "service_id": "yola-electric", "name": "Yola Electric", "convenience_fee": 100.00 },
{ "service_id": "kaduna-electric", "name": "Kaduna Electric", "convenience_fee": 100.00 },
{ "service_id": "ibadan-electric", "name": "Ibadan Electric", "convenience_fee": 100.00 }
]
}
Meter Types
When callingPOST /purchase for electricity, use one of these variation_code values:
| variation_code | Description |
|---|---|
prepaid | Prepaid meter — returns a token in the response |
postpaid | Postpaid meter — pays outstanding bill |
Electricity purchases require a mandatory two-step verification. Call
GET /services/verify with the meter number before proceeding to /purchase.
