> ## 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, and supplier invoices 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, or how a supplier invoice was booked, 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.

***

## 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

<Steps>
  <Step title="Open the integration">
    In Dema, go to **Agents → Settings → Integrations**, find **Fortnox**, and click **Connect**.
  </Step>

  <Step title="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.

    <Check>
      You are returned to Dema with the integration marked as Active.
    </Check>
  </Step>

  <Step title="Check the connection">
    Ask the agent a read-only question, for example: *"Which invoices are unpaid and overdue?"*
  </Step>
</Steps>

To use the connection with an agent you created, open that agent and add it under **Configuration → Integrations**. See [Your agents](/guides/agent/your-agents#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                         |

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

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Fortnox says administrator approval is required">
    A Fortnox administrator must approve Dema for your Fortnox account. After approval, return to Dema and reconnect.
  </Accordion>

  <Accordion title="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>

  <Accordion title="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.
  </Accordion>
</AccordionGroup>

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/)
