0.10.4 • Published 4 months ago

@waltermedia/fortnox-client v0.10.4

Weekly downloads
-
License
Commercial
Repository
github
Last release
4 months ago

@waltermedia/fortnox-client

A opinionated client library for interacting with the Fortnox API, designed to help developers easily fetch data from Fortnox and integrate it into their applications.

Installation

Install the package using npm:

npm install @waltermedia/fortnox-client

Or using Yarn:

yarn add @waltermedia/fortnox-client

Usage

Import the FortnoxClient class from the package and create a new instance with your Fortnox API credentials:

import { FortnoxClient } from '@waltermedia/fortnox-client';

const fortnoxClient = new FortnoxClient({
  accessToken: 'your-access-token',
});

// Fetch account data
async function fetchAccounts() {
  const accounts = await fortnoxClient.getAccounts(1000, 1999);
  console.log(accounts);
}

async function fetchVouchers() {
  const fromDate = '2023-01-01';
  const toDate = '2023-12-31';
  const vouchers = await fortnoxClient.getVouchers(fromDate, toDate, 500, true);
  console.log(vouchers);
}

fetchVouchers();
fetchAccounts();

Methods

Below are some of the primary methods available with the FortnoxClient:

getAccounts(accountNumberFrom: number, accountNumberTo: number, financialYear?: number, limit?: number, paginate?: boolean): Promise<AccountCollection>
getVoucherDetails(voucherSeries: string, voucherNumber: number): Promise<Voucher>
getVoucherSeries(paginate?: boolean): Promise<VoucherSeriesCollection>
getVouchers(fromDate?: string, toDate?: string, limit?: number, paginate?: boolean): Promise<VoucherCollection>
getFinancialYears(paginate?: boolean): Promise<FinancialYearsCollection>
getCompanyInformation(): Promise<CompanyInformationWrapper>

Note: The paginate parameter in the methods above, when set to true, fetches all pages of data. When set to false (default), it fetches only the first page.

0.10.2

4 months ago

0.10.3

4 months ago

0.10.4

4 months ago

0.8.4

4 months ago

0.9.0

4 months ago

0.9.2

4 months ago

0.9.1

4 months ago

0.9.8

4 months ago

0.9.7

4 months ago

0.9.9

4 months ago

0.9.4

4 months ago

0.9.3

4 months ago

0.9.6

4 months ago

0.9.5

4 months ago

0.10.0

4 months ago

0.8.2

6 months ago

0.8.1

6 months ago

0.8.0

6 months ago

0.7.4

6 months ago

0.7.3

6 months ago

0.7.2

6 months ago

0.7.1

6 months ago

0.7.0

6 months ago

0.6.5

6 months ago

0.6.4

6 months ago

0.6.3

6 months ago

0.6.2

6 months ago

0.6.1

6 months ago

0.6.0

6 months ago

0.5.2

6 months ago

0.5.1

6 months ago

0.5.0

6 months ago

0.4.9

6 months ago

0.4.8

6 months ago

0.4.7

6 months ago

0.4.6

6 months ago

0.4.5

6 months ago

0.4.4

6 months ago

0.4.3

6 months ago

0.4.2

6 months ago

0.4.1

6 months ago

0.4.0

6 months ago

0.3.5

6 months ago

0.3.4

6 months ago

0.3.3

6 months ago

0.3.2

6 months ago

0.3.1

6 months ago

0.3.0

6 months ago

0.2.5

6 months ago

0.2.4

6 months ago

0.2.3

6 months ago

0.2.2

7 months ago

0.2.1

7 months ago

0.2.0

7 months ago

0.1.0

7 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago