<?php // Using cURL POST $key="YOUR-ACCOUNT-KEY"; $customer_id="METER NUMBER OR SMARTCARD NUMBER"; $variation_id="PREPAID or POST PAID"; $amount="AMOUNT"; $service_provider="dstv, gotv, startimes, ikeja-electric, eko-electric, kano-electric, portharcourt-electric, jos-electric, ibadan-electric, kaduna-electric, abuja-electric, enugu-electric, benin-electric, aba-electric, yola-electric"; $response = httpPost("https://api.textng.xyz/bp-purchase-electricity/" ,array("key"=>"$key","customer_id"=>$customer_id,"variation_id"=>"$variation_id","service_provider"=>"$service_provider","amount"=>$amount)); // using php curlfunction httpPost($url, $data) { $curl =curl_init ($url);curl_setopt ($curl, CURLOPT_POST, true);curl_setopt ($curl, CURLOPT_POSTFIELDS, http_build_query($data));curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); curl_close($curl);echo $response; } ?>
| Parameters | Example | Description |
|---|---|---|
| Key | XXXXX-XXXX-XXXXX | Your developer API key. This authorizes every request and can be found on your Developer Dashboard. |
| service_provider |
eko-electric | Any of the following service providers; dstv, gotv, startimes, ikeja-electric, eko-electric, kano-electric, portharcourt-electric, jos-electric, ibadan-electric, kaduna-electric, abuja-electric, enugu-electric, benin-electric, aba-electric, yola-electric |
| customer_id |
45053841594 | Customers Meter or Smartcard number (depending on the selected service). |
| variation_id |
PREPAID | PREPAID or POSTPAID service (if allowed). |
| amount |
1000 | Amount of electricity units to buy. |
{
"status": true ,
"message": "ORDER-COMPLETED" ,
"data": {
"service_name": "Eko (EKEDC)",
"customer_id": "45053841594",
"token": "XXXX-XXXX-XXXX-XXXX",
"purchase_amount": 1000,
"amount_charged": 1000,
"discount": 0,
}
}
{
"status": false ,
"message": "Unable to process order at this time",
"reason": ""
}