README
Fakturoid SDK for NodeJS
Installation
yarn add fakturoid-sdk
or npm i fakturoid-sdk
Usage
import fakturoidSDK from 'fakturoid-sdk';
const fakturoid = fakturoidSDK({
email: 'email', // account email
token: 'token', // API token
slug: 'applecorp', // your account / domain
});
const account = await fakturoid.account();
All methods are using Either approach - no error is thrown. Utility functions for handling either are exported.
import fakturoidSDK, { isLeft, isRight } from 'fakturoid-sdk';
const fakturoid = fakturoidSDK({
email: 'email', // account email
token: 'token', // API token
slug: 'applecorp', // your account / domain
});
const account = await fakturoid.account();
// response successful
if(isRight(account)) {
// Server response available under account.value
console.log(account.value);
}
// response error
if(isLeft(account)) {
// Thrown error available under account.value
console.error(account.value);
}
Available functions
Function | Description | |
---|---|---|
fakturoid.account() |
Account details | docs |
fakturoid.invoices() |
List of invoices | docs |
fakturoid.invoice() |
Invoice detail | docs |
fakturoid.createInvoice() |
Create new invoice | docs |
fakturoid.subject() |
Subject detail | docs |
fakturoid.subjects() |
List of subjects | docs |
fakturoid.createSubject() |
Create new subject | docs |