1.0.5 • Published 3 years ago

fakturoid-sdk v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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

FunctionDescription
fakturoid.account()Account detailsdocs
fakturoid.invoices()List of invoicesdocs
fakturoid.invoice()Invoice detaildocs
fakturoid.createInvoice()Create new invoicedocs
fakturoid.subject()Subject detaildocs
fakturoid.subjects()List of subjectsdocs
fakturoid.createSubject()Create new subjectdocs
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago