Electricity API Integration
Electricity API Integration
This section contains your RESTful API for Electricity API integration..
Electricity API Integration
Electricity API Integration
This section contains your RESTful API for Electricity API integration..
The VTU Africa API uses API Key for Authentication.
Please use your APIKEY for authentication
Base URL: https://vtuafrica.com.ng/portal/api/electric
Parameters: as specified in the parameters below:
PARAMETERS | Required/Optional | TYPE | DESCRIPTION |
apikey | R | String | The reseller gateway API key created at vtuafrica.com.ng . Example kDe5dbBw3AeyxnxFCCJA9c9Agl2kxxt8pCB174AC472r38BCM |
service | R | String | Service as specified. These includes, ikeja-electric, eko-electric, portharcourt-electric, jos-electric, kano-electric, ibadan-electric |
meterNo | R | Number | The meter number to load the electricity token |
metertype | R | String | This is the meter type. Example: prepaid or postpaid |
amount | R | Number | The amount of electricity token you want to buy |
ref | R | String | This is a unique reference with which you can use to execute and query the transaction. |
SAMPLE CODE
$host ="https://vtuafrica.com.ng/portal/api/electric?apikey=1234&service=ikeja-electric&meterNo=100221233&metertype=prepaid&amount=1000&ref=8284666332234"; //Initialize cURL. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $host); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $data = curl_exec($ch); //Close the cURL handle. curl_close($ch); $response = json_decode($data);
EXPECTED RESPONSE
{"code":101, "description":{"Status":"Completed", "Token":"40364652026905256691", "Units":"500 kWh", "meterNumber":"100221233", "product_name":"Ikeja Electric Payment - PHCN" } }