easybill-node-api

Node module to access Easybill API

Usage no npm install needed!

<script type="module">
  import easybillNodeApi from 'https://cdn.skypack.dev/easybill-node-api';
</script>

README

easybill node api

Usage

const Promise = require('bluebird');

const easybill = require('easybill-node-api')('your-easybill-token');

easybill.get('documents')
  .then((res) => console.log(res.items));

// Since this module uses Bluebird, this is also possible:

easybill.get('customers')
  .then(({items}) => items)
  .mapSeries(async (customer) => {
    const res = await easybill.get(`documents?customer_id=${customer.id}`);
    return {
      customer,
      documents: res.items
    };
  }
  .each(({customer, documents}) =>
    console.log(`Customer ${customer.id} has ${documets.length} documents`);
  );