> For the complete documentation index, see [llms.txt](https://docs.milientsoftware.com/help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.milientsoftware.com/help/moment-by-topic/integrations/real-time-integrations/fortnox/oauth-2-authorization.md).

# OAuth 2 authorization

To authorize Moment with Fortnox an administrator needs to go through a process where Moment is given permission to access areas requested. The user/administrator needs to have authorization (behörighet) to control the customers and projects.

Fortnox supports service account, this can be selected prior to beginning the authorization process. Only system administrators in Fortnox can authorize when selecting this option. (Recommended)

## Configure integration

1. Search for and select Fortnox in the list of integrations.\
   ![](https://lh4.googleusercontent.com/go0ZYsRPDxQeLYcDBsPwlz0fAqPfIs9xZToV5Wnw8sWGGS-JE8uf_-V98ECU0TnAjOBlpDgd-lDnz6nVvX7Z-aJgGemBcJwGNd5weKIvgImsF0RkiZE-73m4BBeHhiNRejVyFtXyBQIj6AFmZg)
2. Configure integration with what you want to transfer (this can also be done afterwards).&#x20;

   * Fortnox has added an option to use a service account. This must be selected prior to starting the authorization.

   Click "Save" to start authorization.\
   ![](/files/3bkbYFgPDNbiWsIw72ax)
3. Fortnox login screen appears. Log in with your user and password.\
   ![](https://lh3.googleusercontent.com/wCzTZbulW6EKqd_vq50idOZfEdYD5reRjqcEPNjQM7VRqn_nQL_B0cR8Z_fg-kSxSw0CzjO-I1hnL--npULT8456dzy4_rTRk5HKIbPNytTJrVLWYfhsQq9-OHGsBX7joBdpj_5UBdKkSB5LOA)
4. When you are logged in, you must agree that Moment can have permissions to the requested sections of Fortnox.\
   ![](https://lh5.googleusercontent.com/Gwhfx7wn5m03F0AHyoJypIDJNEw_LE7T5UGPKGWP5cFgCoLaBuKD0-oubWzYeHwpuPOwPT9yRtfFv5OH_hK9tTJvurUl-1SdoogawiVI0T4dtH-obhWSCouYFQxu5zA3X8BKH_ZAcF176lXqlw)
5. Once you have clicked on "Approve authorization" you will be sent back to Moment, this may take some time. Please wait.&#x20;
6. Back in Moment, you see that the authorization has been successful.\
   ![](https://lh3.googleusercontent.com/5zkPGuWFxyzmFF-LpBn-0g3NDqR1OBxETPSHVYtCVaZoCSiS0jFdrge-6mwAAwzrsWtawzYo7O-1iAuv0_xfORuQFRIeR6R4wJwmro2u9b8_tyNXTt22DpChCqJCA3a8qiVn98bpPi8Cpbhpcw)
7. Enable integration and make any additional configurations, then save the changes.\
   ![](https://lh3.googleusercontent.com/sYP825ofZqHRMVS_LBCtAWaJk98KYvIldRM3XwS3rqXVm3dNEqICrL1YczSJZGeJChnurEL_bv8V0prp98bDTOYLWgFO4r3yA_rptjkZA85xu8zRdFhZnSNU5vivzSKV1L_UbD3gYVYlYBUpHg)

## **Re-authorize**

If you need to re-authorize, you can also choose to do so, click on the link "Re-authorize" and start at step 3. If you want to switch method user/service account, the integration must be deleted and added again.

## Errors

If something goes wrong in the authorization, for example registration of the wrong user / password or if you accidentally close a page, you will be sent back to the Moment page and see the marking "authorization failed". \
![](https://lh5.googleusercontent.com/AB73pgDsWtScyk40h7HyMGp2EEPnuoA0KfoIwrNRtR7c3IaTKQ1gaAKZWol9RIes8g2Fcp1bPbMSdZeIt1TTy2KmeFe4lsFmegpYZeDZsBNxMHmRzXd_funJUUimin4usMYq_K7JVXueKzs4UQ)

If this should happen, the process can be started again by clicking the blue "Authorize" button, follow the steps from step 3.

### Authorization (Behörighet)

A typical error that can occur is related to the authorization the user that is authorizing the integration has. If the user is missing some authorization (behörighet), it will be seen as an error message in the company log. If the error message contains the text as shown in the image below, it's referencing the users authorization within Fortnox.&#x20;

![](/files/TCQnkQntTJ1IbIkLleY0)

There are two solutions to this issue

1. Change the authorization (behörighet) for the user in Fortnox.\
   Find the location where one defines authorizations (behörigheter). Turn this on for customer and projects. (See screenshot below)
2. Select to use a service account when authorizing the integration. \
   If an authorization has been done and you want to switch to using a service account, the current integration needs to be deleted, and then added/configured again.

![](/files/6A7qaVjKn9GETa26Aqh7)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.milientsoftware.com/help/moment-by-topic/integrations/real-time-integrations/fortnox/oauth-2-authorization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
