Pay an electricity bill
curl --request POST \
--url https://api.useduro.com/v1/vas/electricity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"disco": "ikeja",
"customerId": "<string>",
"payerName": "Ada Lovelace",
"amount": 10000
}
'import requests
url = "https://api.useduro.com/v1/vas/electricity"
payload = {
"disco": "ikeja",
"customerId": "<string>",
"payerName": "Ada Lovelace",
"amount": 10000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
disco: 'ikeja',
customerId: '<string>',
payerName: 'Ada Lovelace',
amount: 10000
})
};
fetch('https://api.useduro.com/v1/vas/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.useduro.com/v1/vas/electricity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'disco' => 'ikeja',
'customerId' => '<string>',
'payerName' => 'Ada Lovelace',
'amount' => 10000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.useduro.com/v1/vas/electricity"
payload := strings.NewReader("{\n \"disco\": \"ikeja\",\n \"customerId\": \"<string>\",\n \"payerName\": \"Ada Lovelace\",\n \"amount\": 10000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.useduro.com/v1/vas/electricity")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"disco\": \"ikeja\",\n \"customerId\": \"<string>\",\n \"payerName\": \"Ada Lovelace\",\n \"amount\": 10000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useduro.com/v1/vas/electricity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"disco\": \"ikeja\",\n \"customerId\": \"<string>\",\n \"payerName\": \"Ada Lovelace\",\n \"amount\": 10000\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"category": "airtime",
"provider": "<string>",
"recipient": "<string>",
"amount": 123,
"currency": "<string>",
"status": "success",
"reference": "<string>",
"nombaReference": "<string>",
"meta": {},
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{}
]
}
}VAS
Pay an electricity bill
Debits the merchant balance and vends electricity. A PREPAID meter returns a token in the transaction meta. amount is in naira. Requires the invoice:write scope.
POST
/
v1
/
vas
/
electricity
Pay an electricity bill
curl --request POST \
--url https://api.useduro.com/v1/vas/electricity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"disco": "ikeja",
"customerId": "<string>",
"payerName": "Ada Lovelace",
"amount": 10000
}
'import requests
url = "https://api.useduro.com/v1/vas/electricity"
payload = {
"disco": "ikeja",
"customerId": "<string>",
"payerName": "Ada Lovelace",
"amount": 10000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
disco: 'ikeja',
customerId: '<string>',
payerName: 'Ada Lovelace',
amount: 10000
})
};
fetch('https://api.useduro.com/v1/vas/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.useduro.com/v1/vas/electricity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'disco' => 'ikeja',
'customerId' => '<string>',
'payerName' => 'Ada Lovelace',
'amount' => 10000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.useduro.com/v1/vas/electricity"
payload := strings.NewReader("{\n \"disco\": \"ikeja\",\n \"customerId\": \"<string>\",\n \"payerName\": \"Ada Lovelace\",\n \"amount\": 10000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.useduro.com/v1/vas/electricity")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"disco\": \"ikeja\",\n \"customerId\": \"<string>\",\n \"payerName\": \"Ada Lovelace\",\n \"amount\": 10000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useduro.com/v1/vas/electricity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"disco\": \"ikeja\",\n \"customerId\": \"<string>\",\n \"payerName\": \"Ada Lovelace\",\n \"amount\": 10000\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"category": "airtime",
"provider": "<string>",
"recipient": "<string>",
"amount": 123,
"currency": "<string>",
"status": "success",
"reference": "<string>",
"nombaReference": "<string>",
"meta": {},
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{}
]
}
}Authorizations
Paste your secret key as the bearer token: sk_test_… (test) or sk_live_… (live). That is all a normal API call needs. OAuth access tokens from POST /v1/oauth/token also work, but a client id/secret is only for platforms acting on another tenant's behalf, not for your own integration.
Body
application/json
Response
Bill transaction
Available options:
airtime, data, betting, cabletv, electricity Minor units (kobo).
Available options:
success, processing, failed Provider metadata, e.g. a prepaid electricity token.
Was this page helpful?