Skip to main content

Overview

The monei.bills namespace provides a full suite of methods to manage bill payments:
  • Discover available billers and biller items
  • Pay for airtime, mobile data, electricity, and cable TV
  • Validate customer bill details before payment
  • Retrieve bill payment records and generate receipts
All services require a properly configured MoneiClient instance.

Bill Discovery

Get Biller Items

Retrieve available biller items based on bill category and biller name.
const category = "electricity"; // e.g. electricity, airtime, data
const billerName = "ikeja-electric";

const items = await monei.billDiscovery.getBiller(category, billerName);

console.log(items);

Get Electricity Billers

Retrieve a list of available electricity billers.
const billers = await monei.billDiscovery.getElectricityBiller();

console.log(billers);

Bill Payments

Buy Airtime

const airtimeData = {
  phoneNumber: "+2348012345678",
  amount: 1000,
  network: "mtn"
};

const response = await monei.billPay.buyAirtime(airtimeData);

console.log(response);

Buy Mobile Data

const dataData = {
  phoneNumber: "+2348012345678",
  amount: 2000,
  network: "glo",
  dataPlan: "2GB"
};

const response = await monei.billPay.buyMobileData(dataData);

console.log(response);

Buy Electricity

const electricityData = {
  meterNumber: "1234567890",
  amount: 5000,
  meterType: "prepaid",
  serviceProvider: "ikeja-electric"
};

const response = await monei.billPay.buyElectricity(electricityData);

console.log(response);

Subscribe to Cable TV

const cableData = {
  smartCardNumber: "1234567890",
  bouquet: "dstv-padi",
  serviceProvider: "dstv"
};

const response = await monei.billPay.subscribeCableTv(cableData);

console.log(response);

Bill Validation

Validate customer bill information before making a payment.
const validateData = {
  customerId: "1234567890",
  billerCode: "ikeja-electric",
  amount: 5000
};

const response = await monei.billValidation.validate(validateData);

console.log(response);

Bill Records

Get Bills

Retrieve a paginated list of bill payment records.
const bills = await monei.billRecords.getBills();

console.log(bills);

Get Bill by Reference

Retrieve a bill record using a unique reference.
const reference = "TXN-123456";

const bill = await monei.billRecords.getBillByReference(reference);

console.log(bill);

Generate Receipt

Generate a receipt for a specific bill transaction.
const transactionId = "transaction-id";

const receipt = await monei.billRecords.generateReceipt(transactionId);

console.log(receipt);

Notes

  • All methods require a properly configured MoneiClient instance with authentication.
  • DTOs used by the SDK include:
    • BillerItemsResponseDto
    • ElectricityBillerResponseDto
    • PaginatedBillResponseDto
    • BillResponseDto
    • AirtimePurchaseDto
    • DataPurchaseDto
    • ElectricityPaymentDto
    • CableTvPaymentDto
    • BillPaymentResponseDto
    • ValidateBillDto
  • Validate bills before payment to avoid failed or incorrect transactions.
  • All responses are strongly typed, and some may include nested objects depending on the biller.