Package com.flutterwave.services
Class Bills
java.lang.Object
com.flutterwave.services.Bills
APIs endpoints needed to purchase bill payments.
Supported Bill Payments include - Airtime, Data purchase, Electricity bills, Cable bills and Government remittance.
- Author:
- cleopatradouglas
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve a history of all purchased bill services including commission earnedgetCategories(Optional<Integer> airtime, Optional<Integer> data_bundle, Optional<Integer> power, Optional<Integer> internet, Optional<Integer> toll, Optional<Integer> cable, Optional<String> biller_code) Retrieve the information for each Biller.Get the status of a bill purchaserunBulkTransaction(List<BillRequest> billRequests) Create bulk bills paymentrunTransaction(BillRequest billRequest) Initiate the bill payment.validateBillService(String item_code, String code, String customer) Validate services like DSTV smartcard no, Meter number etc.
-
Constructor Details
-
Bills
public Bills()
-
-
Method Details
-
runTransaction
Initiate the bill payment. You can create Airtime, Data, Cable, Power, Toll and other bill payment you need. Kindly note that your balance should be funded as your wallet would be debited for successful API calls.- Parameters:
billRequest- bean- Returns:
- Response
-
runBulkTransaction
Create bulk bills payment- Parameters:
billRequests- bean- Returns:
- Response
-
getStatus
Get the status of a bill purchase- Parameters:
reference- String This is the tx_ref of the bill transaction- Returns:
- Response
-
getBills
Retrieve a history of all purchased bill services including commission earned- Parameters:
from- String This is the start date it can be in any of this formats: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDto- String This is the end date, it can be in any of this formats: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD- Returns:
- ListResponse
-
validateBillService
Validate services like DSTV smartcard no, Meter number etc.- Parameters:
item_code- String This code is returned from the /getBillCategory endpoint as data[i].item_code, where i is the index in the data array contained in the response object.code- String This is the biller code. It is returned in the /getBillCategory endpoint as data[i].biller_code, where i is the index in the data array contained in the response object.customer- String This is the customer identifier for the bill payment e.g. for airtime, the identifier would be the customer's mobile number.- Returns:
- Response
-
getCategories
public ListResponse getCategories(Optional<Integer> airtime, Optional<Integer> data_bundle, Optional<Integer> power, Optional<Integer> internet, Optional<Integer> toll, Optional<Integer> cable, Optional<String> biller_code) Retrieve the information for each Biller. These information are important as they are required for the bill payment attempt. You can filter your query by biller type and biller_code.- Parameters:
airtime- Optional This parameter allows you filter the response object for airtime billers only (MTN, Vodafone, Airtel, 9mobile). You should set this to 1 if you would like to filter only airtime billers. Expected values are 0 and 1.data_bundle- Optional This parameter allows you filter the response object for data billers only (MTN, Vodafone, Airtel, 9mobile). You should set this to 1 if you would like to filter only data billers. Expected values are 0 and 1.power- Optional This parameter allows you filter the response object for power billers only (EKEDC, IKEDC, KDLC). You should set this to 1 if you would like to filter only power billers. Expected values are 0 and 1.internet- Optional This parameter allows you filter the response object for internet billers only (SWIFT, Smile, ipNX). You should set this to 1 if you would like to filter only internet billers. Expected values are 0 and 1.toll- Optional This parameter allows you filter the response object for toll billers only. You should set this to 1 if you would like to filter only toll billers. Expected values are 0 and 1.cable- Optional This parameter allows you filter the response object for cable billers only (DSTV, Startimes, GOTV). You should set this to 1 if you would like to filter only cable billers. Expected values are 0 and 1.biller_code- Optional This parameter allows you filter the response object for a specific Biller using the biller_code.- Returns:
- ListResponse
-