Skip to main content
Docs

iamfredric/fortnox

Introduction

This package is a wrapper for the Fortnox API.

Requirements

Installation

Install via composer

composer require iamfredric/fortnox

Configuration

\Iamfredric\Fortnox\Fortnox::setClientCredentials(
    clientId: 'your-app-client-id',
    clientSecret: 'your-app-client-secret',
    redirectUrl: 'http://your-app-url/fortnox/callback',
    scope: 'your scopes separated by spaces'
);

Authentication

// Redirect user to Fortnox for authentication
$url = \Iamfredric\Fortnox\Fortnox::authUrl();
 
// In your response handler, when fortnox redirects user back to your app,
$response = \Iamfredric\Fortnox\Fortnox::verifyAuthCode($_GET['code']);
$response['access_token'];
$response['refresh_token'];
$response['scope'];
$response['expires_in'];
$response['token_type'];

Issues

Issues are handled on github

For security issues, please contact me in private.

License

This package is open-sourced software licensed under the MIT license.