An API client for

0.2.4 2020-09-04 15:45 UTC

This package is auto-updated.

Last update: 2021-09-11 07:47:14 UTC


Latest Version Build Status Code Coverage Quality Score Total Downloads


Via Composer

composer require friendsofapi/fortnox


You need to follow the steps described on to get an access token. Once you got that token you can start playing with the API client.

$apiClient = new ApiClient();
$total = $apiClient->stats()->total();
echo $total->getCount(); // 22;


See a list of error codes on Fortnox.


APIs are usually split into categories, called Resources. In your implementation you should also reflect these categories, for example by having their own classes in Api/. Let's take a look at Api/Stats in our case. The response of any call should be an object in Model/Stats/X, like Model/Stats/Total.


The end user chooses which hydrator to use. The default one should return domain objects.

Request builder

The request builder creates a PSR-7 request with a multipart stream when necessary If the API does not require multipart streams you should remove the RequestBuilder and replace it with a RequestFactory.


The MIT License (MIT). Please see License File for more information.