The FanitePay NSWC payment API allows you to Pay water bills.
Make an API request to the NSWC verify endpoint to verify the meter number. If successful, you will receive a JSON snippet with details of verification.
NSWC verify:
var axios = require("axios").default;
var options = { method: 'POST', url: '{host}/nswc/verify', headers: { Accept: '*/*', Authorization: 'Bearer FNTPPUBK_LIVE-***************', 'Content-Type': 'application/json' }, data: { acc_no: "2xxxxxx", }};
axios.request(options).then(function (response) { console.log(response.data);}).catch(function (error) { console.error(error);});If successful, a JSON response containing details of the meter will be returned, the response will contain the Name under meter number as well as the outstanding balance
Response:
{"CustomerName":"Customer name","outstanding":"234730"}After verifying the NSWC meter number, the next step is to make your bill payment. This can be done by making a request to the NSWC bill payment endpoint using the following parameters:
Parameters for the NWSC Payment endpoint.
| Field | Description |
|---|---|
| name | Customer Full Names |
| The Customer Email | |
| phone_number | This indicates the phone number of the user. |
| billtype | The supported Bill type is nwsc |
| type | The supported types is NWSC |
| amount | The indicates the amount to be charged |
| acc_no | The NWSC account number |
| currency | Currency is UGX |
NSWC Payment:
var axios = require("axios").default;
var options = { method: 'POST', url: '{host}/utilpay', headers: { Accept: '*/*', Authorization: 'Bearer FNTPPUBK_LIVE-***************', 'Content-Type': 'application/json' }, data: { name: "Customer Name", email: "customer@email.com", phone_number: "07XXXXXXXX", billtype: "nwsc", type: "NWSC", amount: "70000", acc_no: "2XXXXXX", currency: "UGX", }};
axios.request(options).then(function (response) { console.log(response.data);}).catch(function (error) { console.error(error);});