Natural Performance Manager
Wondering what’s next for npm?Check out our public roadmap! »

This package has been deprecated

Author message:

Outdated and no longer useful

unbill

1.0.5 • Public • Published

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) {
      // Repeat until 200 status is returned
    })
  }
 
})
.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

// Auth
Unbill.auth(payload)
// Auth step
Unbill.authStep(payload)

Bill

// Bill details
Unbill.getBillDetails(payload)
// Bill list
Unbill.getBills(payload)
// Fix bill hold
Unbill.fixBillHold(payload)
// Remove bill
Unbill.removeBill(payload)

Company

// Get company
Unbill.getCompany(payload)
// Search companies
Unbill.searchCompanies(payload)
// Get company categories
Unbill.getCompanyCategories(payload)

Payment

// Add payment method
Unbill.addPaymentMethod(payload)
// Get payment method
Unbill.getPaymentMethod(payload)
// Retry payment method
Unbill.retryPaymentMethod(payload)
// Update autopay
Unbill.updateAutopay(payload)
// Make payment
Unbill.makePayment(payload)

User

// Create 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.

Install

npm i unbill

DownloadsWeekly Downloads

1

Version

1.0.5

License

MIT

Last publish

Collaborators

  • avatar