Skip to content

Simskii/Fortnox-Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI npm version

Fortnox Javascript API wrapper

Unofficial Javascript wrapper for Fortnox API http://developer.fortnox.se/getting-started/

Installation

$ npm install fortnox or yarn install fortnox

Get a developer account

First of all you need to register as a developer.

To register you just need to fill out this form.

Get your Access Token

You’ve got your Authorization-Code and your Client-Secret. These will be the keys to get the final Access-Token.

The Authorization-Code is valid for seven days before becoming invalid and can only be used once to retrieve the Access-Token.

If the Authorization-Code is used again after an Access-Token has been retrieved the Authorization-Code will become invalid and the integration will become deactivated.

The Access-Token combined with the Client-Secret is unique for your application and connects to a specific Fortnox account.

To retrieve your Access-Token you simply send a request to our API using the headers “Authorization-Code” and “Client-Secret”.

Here’s an example using cURL

curl -X "GET" "https://api.fortnox.se/3/" \
     -H "Authorization-Code: YOUR_AUTHORIZATION_CODE" \
     -H "Client-Secret: YOUR_CLIENT_SECRET" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json"

Usage

Create a new fortnox api instance

const fortnox = require('fortnox')
const client = new Fortnox('secret', 'accessToken')

Get Customers

const customers = await client.getCustomers()