> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monei.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Bills Services

> Discover billers, pay bills, validate bills, and track bill records using the Monei Node.js / TypeScript SDK

# Overview

The `Bills Services` provides a full suite of methods to manage bill payments:

Included services:

* **Discovery**:   available billers and biller items
* **Payment**: for airtime, mobile data, electricity, and cable TV
* **Validation**: Validate customer bill details before payment
* **Records**: 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.

```typescript theme={null}
const category = "electricity"; // e.g. electricity, airtime, data
const billerName = "ikeja-electric";

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

console.log(items);
```

### Get Electricity Billers

Retrieve a list of available electricity billers.

```typescript theme={null}
const billers = await monei.billsDiscovery.getElectricityBiller();

console.log(billers);
```

***

## Bill Payments

### Buy Airtime

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

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

console.log(response);
```

### Buy Mobile Data

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

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

console.log(response);
```

### Buy Electricity

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

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

console.log(response);
```

### Subscribe to Cable TV

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

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

console.log(response);
```

***

## Bill Validation

Validate customer bill information before making a payment.

```typescript theme={null}
const validateData = {
  customerId: "1234567890",
  billerCode: "ikeja-electric",
  amount: 5000
};

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

console.log(response);
```

***

## Bill Records Service

Retrieve bill payment history and receipts.

### Get All Bills

Retrieve a paginated list of bill payment records.

```typescript theme={null}
const bills = await monei.billsRecord.getBills();

console.log(bills);
```

### Get Bill by Reference

Retrieve a bill record using a unique reference.

```typescript theme={null}
const reference = "TXN-123456";

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

console.log(bill);
```

### Generate Receipt

Generate a receipt for a specific bill transaction.

```typescript theme={null}
const transactionId = "transaction-id";

const receipt = await monei.billsRecord.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.
