Complete and tested ES6 client for the fastbill API
Last tested on node v5.3.0
npm install node-fastbill
The module exposes API functionality for customers, invoices and subscriptions. Access through fastbill.customer and fastbill.invoice (like in the example below).
'use strict';
import Fastbill from 'node-fastbill';
const fastbill = Fastbill.instantiate(
{
email: 'YOUR_FASTBILL_EMAIL',
apikey: 'YOUR_FASTBILL_API_KEY'
}
);
// 1. create a customer
fastbill.customer.create(
{
CUSTOMER_NUMBER: 1,
CUSTOMER_TYPE: 'consumer',
FIRST_NAME: 'Max',
LAST_NAME: 'Michael'
})
.then(function(customerId){
console.log(`The customer's fastbillId is ${customerId}`);
})
.catch(function(err){
throw new Error('Customer creation failed');
});
-
Download the repository
-
Install dependencies
npm install
- Install babel
npm install babel -g
- Run tests
npm test
- Run ESLint
npm lint