Validate an electricity meter
Verify a meter number. Request fields, response examples and integration guidance.
/customer-validation/electricity
Example request
curl --request POST \
--url "https://api.strongmb.ng/v1/customer-validation/electricity" \
--header "Authorization: Bearer $STRONGMB_API_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{
"meter_number": "0123456789",
"meter_type": "prepaid",
"product_code": "smb_ked_pre"
}'
// Server-side Node.js 22+; never expose your key in a browser.
async function main() {
const response = await fetch("https://api.strongmb.ng/v1/customer-validation/electricity", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.STRONGMB_API_KEY}`,
Accept: "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
"meter_number": "0123456789",
"meter_type": "prepaid",
"product_code": "smb_ked_pre"
}),
signal: AbortSignal.timeout(30000)
});
const result = await response.json();
console.log(response.status, result);
}
main().catch(console.error);
<?php
// Requires the PHP cURL extension.
$client = curl_init('https://api.strongmb.ng/v1/customer-validation/electricity');
curl_setopt_array($client, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('STRONGMB_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{
"meter_number": "0123456789",
"meter_type": "prepaid",
"product_code": "smb_ked_pre"
}',
]);
$raw = curl_exec($client);
if ($raw === false) {
throw new RuntimeException(curl_error($client));
}
$status = curl_getinfo($client, CURLINFO_HTTP_CODE);
curl_close($client);
$result = json_decode($raw, true, 512, JSON_THROW_ON_ERROR);
print_r(['http_status' => $status, 'response' => $result]);
require 'net/http'
require 'json'
uri = URI('https://api.strongmb.ng/v1/customer-validation/electricity')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'
http.open_timeout = 10
http.read_timeout = 30
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer ' + ENV.fetch('STRONGMB_API_KEY')
request['Accept'] = 'application/json'
request['Content-Type'] = 'application/json'
request.body = '{
"meter_number": "0123456789",
"meter_type": "prepaid",
"product_code": "smb_ked_pre"
}'
begin
response = http.request(request)
result = JSON.parse(response.body)
puts({ http_status: response.code, response: result }.to_json)
rescue StandardError => error
warn error.message
end
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError, URLError
headers = {
"Authorization": "Bearer " + os.environ["STRONGMB_API_KEY"],
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {'meter_number': '0123456789',
'meter_type': 'prepaid',
'product_code': 'smb_ked_pre'}
body = json.dumps(payload).encode("utf-8")
request = Request(
"https://api.strongmb.ng/v1/customer-validation/electricity",
data=body, headers=headers, method="POST"
)
try:
with urlopen(request, timeout=30) as response:
result = json.load(response)
print(response.status, result)
except HTTPError as error:
print(error.code, error.read().decode("utf-8"))
except URLError as error:
print("Network error:", error.reason)
Verifies that a meter number belongs to a valid account. On success, returns the customer details and a
verify_token required in the purchase request.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| meter_number | string | Required | The customer's meter number (10–15 digits) |
| meter_type | string | Required |
prepaid or postpaid — must match the product from
/products/electricity
|
| product_code | string | Required | Product code from /products/electricity — identifies the DISCO provider |
Request Example
{
"meter_number": "0123456789",
"meter_type": "prepaid",
"product_code": "smb_ked_pre"
}
{
"status": true,
"message": "Meter number verified successfully.",
"data": {
"details": {
"customer_name": "Strongmb User",
"address": "123 Example Street, Example City",
"provider": "kedco",
"meter_number": "0123456789",
"meter_type": "prepaid"
},
"verify_token": "R2RGWmFIbmJLSm9SQ0xpdElKVmo2NHZsTkRrT0Z6cjBOL0Zwd0J0QVh5az0="
},
"metadata": { "code": "ELECTRICITY_METER_VERIFIED", "timestamp": 1786315618, "trace_id": "492FA8565B" }
}
{
"status": false,
"message": "Invalid meter number or the account is inactive.",
"data": null,
"metadata": { "code": "ERR_INVALID_ELECTRICITY_ACCOUNT", "timestamp": 1786315707, "trace_id": "25D2EAF951" }
}
{
"status": false,
"message": "Invalid product code or the product is inactive.",
"data": null,
"metadata": { "code": "ERR_INVALID_PRODUCT_CODE_OR_INACTIVE", "timestamp": 1786315732, "trace_id": "2B70560DA2" }
}
Response Codes
| Code | HTTP | Meaning |
|---|---|---|
| ELECTRICITY_METER_VERIFIED | 200 | Meter is valid. Save the verify_token — it is required in the purchase request. |
| ERR_INVALID_ELECTRICITY_ACCOUNT | 400 | Meter number not found or the account is inactive. |
| ERR_INVALID_PRODUCT_CODE_OR_INACTIVE | 404 | The product_code does not exist or the product is currently inactive. |
Understand the request fields
| Field | Integration guidance |
|---|---|
meter_number
|
The electricity meter identifier. Use the same value for validation and purchase. |
meter_type
|
Use prepaid or postpaid as supported by the selected product and customer meter. |
product_code
|
An exact identifier from the matching product list, not a provider name or an identifier from a different API. |
Response fields and types
Expand an object to explore its fields. [] indicates an array item. Error responses may return
data: null.
| Field path | JSON type | Meaning and handling |
|---|---|---|
status |
boolean | Whether this API request succeeded. Check the HTTP status and metadata.code when handling errors. |
message |
string | Human-readable description of the result. Use metadata.code for programmatic error handling instead of parsing this text. |
data |
null | object | Response data. Check the result before reading nested fields; an error may return null or validation details. |
data.details |
object | Transaction details for the purchased service. Fields vary by service. |
data.details.customer_name |
string | Customer name returned by validation. Show it to the user for confirmation before purchasing. |
data.details.address |
string | Customer address returned during validation. Display only where needed and treat it as personal information. |
data.details.provider |
string | Provider identifier associated with the purchased service. |
data.details.meter_number |
string | Electricity meter identifier validated by the provider. Use the same string when purchasing. |
data.details.meter_type |
string | Meter category used for electricity validation or purchase, such as prepaid or postpaid. |
data.verify_token |
string | Opaque token returned by validation. Send it unchanged for the same customer and product when purchasing; do not display it publicly. |
metadata |
object | Diagnostic information about the response. |
metadata.code |
string | Machine-readable result code. Use it to distinguish validation, authentication and service errors. |
metadata.timestamp |
integer | Unix timestamp in seconds associated with the response. |
metadata.trace_id |
string | Correlation identifier for troubleshooting. Retain it with a redacted request when contacting support. |
Customer names, phone numbers, meter and smart-card numbers in these examples are fictional placeholders. Replace them with valid customer details for real requests.
Always check metadata.code; do not rely on HTTP status alone. See response codes and recommended
handling.
Test your integration Use the sandbox test values and examples.
Questions? Let’s work through them.
Having an issue or need help with your integration? Join the Strongmb Slack community to ask questions and get assistance from our team and other developers.
Keep API keys and customer details private when sharing examples.
Experiencing a service issue? Check Strongmb’s service status for incident updates.
Did this page help you?
Up to 100 characters. Please leave out personal details, account information and API keys.