> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dema.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Fortnox

> Let the Dema Agent read customers, invoices, sales orders, articles, supplier invoices, accounts, balances, and vouchers from Fortnox accounting.

## Overview

Once Fortnox is connected, the Dema Agent can look up records from your Fortnox accounting environment through the Fortnox API v3. Use it to answer questions about who your customers are, which invoices are unpaid, what an order contained, how a supplier invoice was booked, or what moved an account balance in a given month, without opening Fortnox.

The agent only reads from Fortnox. It does not create or modify records.

### What the agent can do

* **Customers** — list customers with filters for name, city, and active or inactive status, and load one customer's full record (addresses, contact details, payment terms, VAT type, currency).
* **Customer invoices** — list invoices, filter by customer, date range, and status (`cancelled`, `fullypaid`, `unpaid`, `unpaidoverdue`, `unbooked`), and load one invoice with its line items for revenue analysis.
* **Sales orders** — list orders with the same filter shape as invoices and load one order with its line items.
* **Articles** — list the articles (products and services) in your Fortnox catalog.
* **Supplier invoices** — list supplier invoices with date and status filters to review accounts payable.
* **Financial years** — list the company's financial years, or find the year that contains a given date. The account, balance, and voucher tools use the current financial year unless you ask about another one.
* **Chart of accounts** — list the general ledger accounts for a financial year with their opening balances, and load one account by its four-digit number with its opening and closing balance.
* **Account balances** — load the opening balance, closing balance, result, and month-by-month movement for every account with activity in a financial year. Optionally break each account down by cost center or project. Fortnox provides this data through its SIE export.
* **Account transactions** — list every entry posted to one account, optionally limited to a date range within the financial year. Use it to see the individual entries behind a balance or profit and loss figure.
* **Vouchers** — list vouchers (journal entries) for a financial year, filtered by date range and voucher series, and load one voucher with its debit and credit rows.

The account, balance, transaction, and voucher tools need the `bookkeeping` scope. See [Scopes Dema requests](#scopes-dema-requests).

***

## Prerequisites

* A Fortnox account with access to the company data the agent should use.
* A Fortnox administrator to approve Dema on the first connection from your account.

***

## Connect Fortnox

**1. Open the integration**

In Dema, go to **Agents → Settings → Integrations**, find **Fortnox**, and click **Connect**.

**2. Sign in and approve**

You are redirected to `apps.fortnox.se` to sign in to Fortnox and approve the scopes Dema requests. The first connection from your Fortnox account may need a Fortnox administrator to approve access.

> [!TIP]
>
> You are returned to Dema with the integration marked as Active.

**3. Check the connection**

Ask the agent a read-only question, for example: *"Which invoices are unpaid and overdue?"* or *"How did the balance on account 1930 change month by month this year?"*

To use the connection with an agent you created, open that agent and add it under **Configuration → Integrations**. See [Your agents](https://docs.dema.ai/guides/agent/your-agents.md#integrations).

***

## Scopes Dema requests

| Scope | What it allows |
| - | - |
| `customer` | Read customer records |
| `invoice` | Read customer invoices and their line items |
| `order` | Read sales orders and their line items |
| `article` | Read the article (product and service) catalog |
| `supplierinvoice` | Read supplier invoices |
| `bookkeeping` | Read financial years, accounts, balances, and vouchers (optional) |

Fortnox grants read and write on each of these resources. The agent uses them for read operations only.

The `bookkeeping` scope is optional. Connections made before Dema requested it keep working for customers, invoices, orders, articles, and supplier invoices. To let the agent read financial years, accounts, balances, transactions, and vouchers, click **Reconnect** on the Fortnox integration card and approve the `bookkeeping` scope in Fortnox.

***

## Troubleshooting

> [accordion] Fortnox says administrator approval is required
>
> A Fortnox administrator must approve Dema for your Fortnox account. After approval, return to Dema and reconnect.

> [accordion] Dema says my connection has expired
>
> This happens when Dema cannot refresh the access token, usually because access was revoked in Fortnox. Click **Reconnect** on the integration card to re-authorize.

> [accordion] The agent cannot find a record
>
> Fortnox references records by their exact identifier. Ask for a customer by its Fortnox customer number, or an invoice or order by its numeric Fortnox document number. Accounts use their four-digit account number, and vouchers use their series and number, for example `A15`. Voucher numbers restart each financial year, so mention the year when the voucher is not from the current one.

> [accordion] The agent cannot read accounts, balances, or vouchers
>
> Your connection was approved without the `bookkeeping` scope. Click **Reconnect** on the Fortnox integration card and approve the `bookkeeping` scope in Fortnox.

If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see.

***

## Additional resources

* [Fortnox Developer Portal](https://developer.fortnox.se/)
* [Fortnox API v3 reference](https://developer.fortnox.se/documentation/)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.