unbill-node
A node.js client library for the Unbill API.
Table of Contents
Getting started
$ npm install unbill
var Unbill = require('unbill')(unbillKey)
Examples
Authenticate a user's bill credentials
var Unbill = require('unbill')(unbillKey)
Unbill.auth({
userId: userId,
companyId: companyId,
form: {
username: 'username',
password: 'password'
}
})
.then(function (response) {
if (response.status === 200) {
var billData = response.data
return billData
}
else if (response.status === 201) {
return Unbill.authStep({
token: response.data.token,
mfa: ['Secret Answer']
})
.then(function (response) {
})
}
})
.catch(function (e) {
var errMessage = e.response.data.message
))
API
The module supports all Unbill API endpoints. For complete information about the API, head over to the docs.
Every function requires a payload
as specified by the docs and returns a promise that can be used to access the response of the call.
Auth
Unbill.auth(payload)
Unbill.authStep(payload)
Bill
Unbill.getBillDetails(payload)
Unbill.getBills(payload)
Unbill.fixBillHold(payload)
Unbill.removeBill(payload)
Company
Unbill.getCompany(payload)
Unbill.searchCompanies(payload)
Unbill.getCompanyCategories(payload)
Payment
Unbill.addPaymentMethod(payload)
Unbill.getPaymentMethod(payload)
Unbill.retryPaymentMethod(payload)
Unbill.updateAutopay(payload)
Unbill.makePayment(payload)
User
Unbill.createUser
Support
We’ve tried to make this documentation user-friendly and example-filled, but please drop us a line with any questions.