Buy electricity
curl --request POST \
--url https://api.rexmfbank.com/baas/api/v1/services/bills-payment/electricity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"meter_number": "12345678901",
"service_type": "IKEDC",
"amount": 5000,
"phone": "08012345678",
"customer_reference": "customer-123"
}
'import requests
url = "https://api.rexmfbank.com/baas/api/v1/services/bills-payment/electricity"
payload = {
"meter_number": "12345678901",
"service_type": "IKEDC",
"amount": 5000,
"phone": "08012345678",
"customer_reference": "customer-123"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
meter_number: '12345678901',
service_type: 'IKEDC',
amount: 5000,
phone: '08012345678',
customer_reference: 'customer-123'
})
};
fetch('https://api.rexmfbank.com/baas/api/v1/services/bills-payment/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.rexmfbank.com/baas/api/v1/services/bills-payment/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([
'meter_number' => '12345678901',
'service_type' => 'IKEDC',
'amount' => 5000,
'phone' => '08012345678',
'customer_reference' => 'customer-123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.rexmfbank.com/baas/api/v1/services/bills-payment/electricity"
payload := strings.NewReader("{\n \"meter_number\": \"12345678901\",\n \"service_type\": \"IKEDC\",\n \"amount\": 5000,\n \"phone\": \"08012345678\",\n \"customer_reference\": \"customer-123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.rexmfbank.com/baas/api/v1/services/bills-payment/electricity")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"meter_number\": \"12345678901\",\n \"service_type\": \"IKEDC\",\n \"amount\": 5000,\n \"phone\": \"08012345678\",\n \"customer_reference\": \"customer-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rexmfbank.com/baas/api/v1/services/bills-payment/electricity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"meter_number\": \"12345678901\",\n \"service_type\": \"IKEDC\",\n \"amount\": 5000,\n \"phone\": \"08012345678\",\n \"customer_reference\": \"customer-123\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "<string>",
"data": {
"id": "101",
"company_id": "28",
"master_savings_id": "55",
"bill_type": "airtime",
"direction": "debit",
"amount": "1000.00",
"fee_amount": "0.00",
"balance_after": "49000.00",
"reference": "PROVIDER-REFERENCE",
"status": "successful",
"narration": "<string>",
"savings_transaction_id": "9001",
"meta": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Bills Payment
Buy electricity
Debits the partner Master account and pays an electricity meter.
Run Resolve a customer name first for the same meter_number and
service_type, or this returns 422 NAME_ENQUIRY_REQUIRED. Requires
an Idempotency-Key header.
POST
/
services
/
bills-payment
/
electricity
Buy electricity
curl --request POST \
--url https://api.rexmfbank.com/baas/api/v1/services/bills-payment/electricity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"meter_number": "12345678901",
"service_type": "IKEDC",
"amount": 5000,
"phone": "08012345678",
"customer_reference": "customer-123"
}
'import requests
url = "https://api.rexmfbank.com/baas/api/v1/services/bills-payment/electricity"
payload = {
"meter_number": "12345678901",
"service_type": "IKEDC",
"amount": 5000,
"phone": "08012345678",
"customer_reference": "customer-123"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
meter_number: '12345678901',
service_type: 'IKEDC',
amount: 5000,
phone: '08012345678',
customer_reference: 'customer-123'
})
};
fetch('https://api.rexmfbank.com/baas/api/v1/services/bills-payment/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.rexmfbank.com/baas/api/v1/services/bills-payment/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([
'meter_number' => '12345678901',
'service_type' => 'IKEDC',
'amount' => 5000,
'phone' => '08012345678',
'customer_reference' => 'customer-123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.rexmfbank.com/baas/api/v1/services/bills-payment/electricity"
payload := strings.NewReader("{\n \"meter_number\": \"12345678901\",\n \"service_type\": \"IKEDC\",\n \"amount\": 5000,\n \"phone\": \"08012345678\",\n \"customer_reference\": \"customer-123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.rexmfbank.com/baas/api/v1/services/bills-payment/electricity")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"meter_number\": \"12345678901\",\n \"service_type\": \"IKEDC\",\n \"amount\": 5000,\n \"phone\": \"08012345678\",\n \"customer_reference\": \"customer-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rexmfbank.com/baas/api/v1/services/bills-payment/electricity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"meter_number\": \"12345678901\",\n \"service_type\": \"IKEDC\",\n \"amount\": 5000,\n \"phone\": \"08012345678\",\n \"customer_reference\": \"customer-123\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "<string>",
"data": {
"id": "101",
"company_id": "28",
"master_savings_id": "55",
"bill_type": "airtime",
"direction": "debit",
"amount": "1000.00",
"fee_amount": "0.00",
"balance_after": "49000.00",
"reference": "PROVIDER-REFERENCE",
"status": "successful",
"narration": "<string>",
"savings_transaction_id": "9001",
"meta": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
See Authentication for the full explanation of session tokens vs. API keys and when each is used.
Headers
Required on purchase endpoints. Use a new key for each intended
purchase, and reuse that same key when retrying the same request
after a timeout. A completed key replays the original response. The
same key with a different body is rejected. Keys expire after 24
hours. A missing key returns 400 with no error_code.
Maximum string length:
255Body
application/json
Required string length:
9 - 15Disco code. Must match the name enquiry.
Maximum string length:
150Required range:
100 <= x <= 1000000Pattern:
^0\d{10}$Maximum string length:
100