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

# API reference: Fortnox

> All 60 tools in the Fortnox connector: 32 read tools across company, bookkeeping, registers, invoices, offers, orders, prices, time and warehouse; 28 guardrailed write tools for master data, sales, bookkeeping and warehouse. Covers financialYearId, pagination, the unpaged time and warehouse lists, the preview-first confirm gate with expectedState, access levels, errors and data minimisation.

Fortnox is a read and guardrailed-write connector for Swedish accounting, called
via `tools/call` over `POST /fortnox/mcp`. The connector is connected through OAuth
by logging in to Fortnox (see [Connect Fortnox](https://docs.consile.ai/en/connect/connect-fortnox.md)).
Your organization needs access to Fortnox (a subscription, or a plan that covers
it, see [What decides access](https://docs.consile.ai/developers/authentication.md#what-decides-access)),
and your user must hold a seat or plan licence (assigned under **Team** in the
portal, see [Team](https://docs.consile.ai/en/portal/team.md)).

> [!NOTE]
>
> Endpoint: `https://mcp.consile.ai/fortnox/mcp`. Fortnox is its own named
> connector with only its own tools. Each tool is exposed as `fortnox__<tool>`
> (e.g. `fortnox__list_invoices`); the bare names are used here for readability. A
> bare name in a request returns `Unknown tool.`
>
> The connector is multi-instance: one connection reaches exactly one Fortnox
> company. Each additional company (an agreement, **aftale**, in the portal) is
> served on its own endpoint, e.g. `https://mcp.consile.ai/fortnox-2/mcp`, with
> tools named `fortnox-2__<tool>`. Agreements are added in the portal by an
> administrator.
>
> Besides the connector tools, `tools/list` on every Fortnox endpoint includes the
> unprefixed system tool `connect_account` (no arguments). It returns
> `{ connect_url, instructions }`: a link, valid for 10 minutes, that the user
> opens in the browser to connect (or reconnect) that endpoint's company.

For an account with access to Fortnox, `tools/list` on this endpoint returns the
60 `fortnox__*` tools plus `connect_account`. Without access only `connect_account`
is listed. A user without a seat still sees the tools, but every call is refused.
Read tools are annotated `readOnlyHint: true`, `destructiveHint: false`,
`openWorldHint: false`. Write tools carry `readOnlyHint: false`,
`destructiveHint: true` and `openWorldHint: false`; `idempotentHint` is `true` on
the `update_*` tools and `set_article_price` and `false` on the rest.

> [!WARNING]
>
> Fortnox data sits behind Fortnox licences. The company needs Fortnox's
> Integration licence and the module behind each area: Bokföring for suppliers and
> supplier invoices, Fakturering (or Order) for customers, articles, invoices and
> prices, Offert & Order for offers and orders, Lager (or Lager Plus) for the
> warehouse tools, and Tidredovisning for time registrations. A missing licence
> comes back as an explanatory error, never as a dead connection, and reconnecting
> does not fix it (see [Errors](#errors-and-timeouts)).

## Shared conventions

### One company per connection

A Fortnox connection reaches exactly one company, chosen when the connection was
made (an accounting firm picks the client at that point). No tool takes a company
argument. Call `get_company` first to confirm whose books you are reading.

### financialYearId

Fortnox keeps accounts, balances, voucher series and vouchers per financial year
(räkenskapsår).

**financialYearId** `integer`

The id from `list_financial_years`. It is Fortnox's own running number (`1`, `2`,
`3`, ...), **not** the calendar year, and a financial year need not follow the
calendar year. Omit it to read the current financial year. Accepted by
`list_accounts`, `get_account`, `list_voucher_series`, `list_vouchers`,
`get_voucher` and `create_voucher`.

Voucher numbers restart every financial year, so a voucher is identified by
`voucherSeries`, `voucherNumber` **and** `financialYearId`. Without the year,
Fortnox reads the current one, and the same series and number can return another
voucher than the one meant.

### Pagination

The `list_*` tools on Fortnox's main API are paged:

**page** `integer` (default: 1)

Page number, starting at 1 (max `100000`).

**limit** `integer` (default: 50)

Rows per page, `1` to `500`.

```json theme={null}
{ "meta": { "page": 1, "totalPages": 4, "totalResources": 173 }, "count": 50, "hasMore": true, "nextPage": 2, "items": [ ... ] }
```

`hasMore` comes from `totalPages` when Fortnox sends it, and otherwise from whether
the page came back full. `nextPage` is `null` on the last page.

### Unpaged lists: time and warehouse

`list_time_registrations`, `list_stock_balance`, `list_stock_points`,
`list_purchase_orders` and `list_incoming_goods` read Fortnox services that do not
page. They take no `page` / `limit` and return **at most 500 rows**:

**total** `integer`

How many rows Fortnox sent (for time registrations: the work registrations in the period).

**returned** `integer`

How many rows are in this result.

**truncated** `boolean`

`true` when rows were left out. Narrow the filters (or split the period) rather than reading the rows as complete.

### Searches and filters

* **One search per request.** The register and document lists accept several
  search arguments (e.g. `name`, `customerNumber`, `organisationNumber`), but
  Fortnox allows only one per request, and a second is refused. Searches are a
  case-insensitive *contains* match, so `customerNumber: "1"` also finds `10` and
  `21`. Narrow further on the returned rows.
* **Dates** are `YYYY-MM-DD`. Fortnox does not document whether `toDate` is
  inclusive, nor (on invoices, offers and orders) which date field it filters on.
  When an edge day matters, pass the day after and drop rows dated later.
* **`lastModified`** is `YYYY-MM-DD HH:MM` (or `YYYY-MM-DD` for midnight) and
  returns only records changed at or after that moment. Fortnox states no time
  zone; treat it as Swedish local time.
* **Identifiers** in a path (customer, supplier, article, project numbers, codes)
  may not contain `/`, `\`, `?`, `#` or `%`. Document, given and warehouse ids are
  digits only.

### Amounts and currency

Amounts are in major units (kronor with öre as decimals). Bookkeeping figures
(accounts, vouchers, booking rows) are in the company's accounting currency, SEK.
Invoices, offers and orders are in their own currency. Fortnox does not document
the basis of a document's `currencyRate`; the usual reading is
amount × `currencyRate` / `currencyUnit` = SEK, so treat a converted figure as
unverified. Supplier invoice booking rows and purchase orders (`orderValueInSek`)
already carry SEK amounts.

### Data minimisation

* The organisation number of a private person or a sole trader (enskild firma) is
  their personal identity number (personnummer). It is withheld, also where it
  sits inside a VAT number: the value is `null` and `organisationNumberWithheld` or
  `vatNumberWithheld` is `true`. This also applies to write previews and results.
* A supplier's IBAN and bank account number are returned with only the last four
  characters. Bankgiro and plusgiro are returned in full.
* `list_time_registrations` returns **work** registrations only. Absence (vacation,
  sick leave, parental leave and the like) is never returned; `absenceWithheld`
  counts it. The internal note and the employee's hourly cost are never returned.
* Offers, orders and purchase orders leave out the customer's or supplier's
  address and contact details; read master data with `get_customer` or
  `get_supplier`.

Reading never prints, e-mails or sends a document. Nothing is stored at Consile;
every call is a live request to Fortnox.

***

## Company & bookkeeping

| Tool | Description | Key arguments |
| - | - | - |
| `get_company` | Company name, organisation number, postal and visiting address, country code and `databaseNumber` (Fortnox's id for the company). | (none) |
| `list_financial_years` | Financial years with id, start and end date, accounting method (`ACCRUAL` or `CASH`) and chart-of-accounts type. An empty result for `date` usually means the new year has not been created in Fortnox yet. | `date?`, `page`, `limit` |
| `list_accounts` | The chart of accounts (BAS) for one year: number, description, active flag, VAT code, SRU code, `balanceBroughtForward` (opening) and `balanceCarriedForward` (carried forward). Sorted by account number. | `financialYearId?`, `lastModified?`, `page`, `limit` |
| `get_account` | One account: description, VAT and SRU code, default cost centre and project with their posting rules, and the yearly balances. | `accountNumber` (required), `financialYearId?` |
| `list_voucher_series` | Voucher series: code, description, manual flag and next voucher number. | `financialYearId?`, `page`, `limit` |
| `list_vouchers` | Vouchers in one year: series, number, transaction date, description and what created them (`referenceType`: `INVOICE`, `SUPPLIERINVOICE`, `INVOICEPAYMENT`, `SUPPLIERPAYMENT`, `MANUAL`, `CASHINVOICE` or `ACCRUAL`, with `referenceNumber`). No rows. | `financialYearId?`, `fromDate?`, `toDate?`, `voucherSeries?`, `page`, `limit` |
| `get_voucher` | One voucher with all rows: account, debit, credit, description, transaction information, cost centre, project, quantity and `removed` (a struck-out correction kept for the audit trail). Totals sum only rows that are not removed. | `voucherSeries`, `voucherNumber` (both required), `financialYearId?` |

> [!NOTE]
>
> Fortnox has no trial-balance or period-balance endpoint. `list_accounts` doubles
> as the year's balance list; figures for a month or quarter must be summed from
> voucher rows. Balances are signed as Fortnox reports them (debit positive, credit
> negative). For the current, still-open year Fortnox does not document whether
> `balanceCarriedForward` is the running balance to date, so do not present it as
> a year-end figure.

## Registers

| Tool | Description | Key arguments |
| - | - | - |
| `list_customers` | Customers with number, name, organisation number, e-mail, city, active flag and type (`COMPANY` or `PRIVATE`). Sorted by customer number. | one of `name`, `customerNumber`, `organisationNumber`, `email`, `city`; `lastModified?`, `page`, `limit` |
| `get_customer` | One customer's master data: type, organisation and VAT number, addresses, contact details, references, currency, terms of payment and delivery, way of delivery, price list, VAT type, default sales account, fees, default cost centre and project, comments. | `customerNumber` (required, string) |
| `list_suppliers` | Suppliers with number, name, organisation number, e-mail, city and active flag. | one of `name`, `supplierNumber`, `organisationNumber`; `page`, `limit` |
| `get_supplier` | One supplier's master data and payment details (bankgiro, plusgiro, bank name, BIC; IBAN and account number masked to the last four). | `supplierNumber` (required, string) |
| `list_articles` | Articles with number, description, `salesPrice` (default price list), `purchasePrice`, `quantityInStock`, unit, EAN and active flag. Sorted by article number. | one of `articleNumber`, `description`, `ean`, `supplierNumber`; `active?`, `page`, `limit` |
| `list_projects` | Projects with number, description, status (`NOTSTARTED`, `ONGOING`, `COMPLETED`), start and end date and project leader. | `page`, `limit` |
| `list_cost_centers` | Cost centres (kostnadsställen) with code, description, active flag and note. | `page`, `limit` |

Customer, supplier and article numbers are strings and may contain letters.

## Invoices

| Tool | Description | Key arguments |
| - | - | - |
| `list_invoices` | Sales invoices with document number, customer, invoice and due date, total (incl. VAT), `balance` (unpaid), currency and the booked, cancelled, sent and credit-note flags. | `filter?` (`cancelled`, `fullypaid`, `unpaid`, `unpaidoverdue`, `unbooked`), `fromDate?`, `toDate?`, one of `customerNumber` / `customerName`, `lastModified?`, `page`, `limit` |
| `get_invoice` | One sales invoice with header and rows: dates, currency, `currencyRate`, `currencyUnit`, net, VAT, rounding, total, balance, flags, OCR, references, terms, project, cost centre, booking voucher, reminders and any ROT/RUT reduction; each row with article, description, delivered quantity, unit, price, discount, VAT %, total and sales account. | `documentNumber` (required, digits) |
| `list_supplier_invoices` | Supplier invoices with `givenNumber` (Fortnox's running number), supplier, the supplier's own invoice number, dates, total, balance, currency, booked and cancelled flags and the approver's name. | `filter?` (`cancelled`, `fullypaid`, `unpaid`, `unpaidoverdue`, `unbooked`, `pendingpayment`, `authorizepending`), `fromDate?`, `toDate?`, `page`, `limit` |
| `get_supplier_invoice` | One supplier invoice with header, booking rows (account, row code such as `TOT`, `VAT`, `PRD`, debit and credit in SEK), linked vouchers (series, number, `financialYearId`, `referenceType`) and the comment log. | `givenNumber` (required, digits) |

## Offers, orders & prices

| Tool | Description | Key arguments |
| - | - | - |
| `list_offers` | Offers with document number, customer, offer date, total, currency, project and the cancelled and sent flags. Requires Offert & Order. | `filter?` (`cancelled`, `expired`, `completed`, `notcompleted`, `ordercreated`, `ordernotcreated`), `fromDate?`, `toDate?`, one of `customerNumber` / `customerName` / `documentNumber`, `lastModified?`, `page`, `limit` |
| `get_offer` | One offer with header and rows, including `expireDate`, totals, any ROT/RUT reduction and `orderReference` / `invoiceReference` (the order and invoice created from it, `null` while there is none). | `documentNumber` (required, digits) |
| `list_orders` | Sales orders with document number, customer, order and delivery date, total, currency, project, cancelled flag and the two external invoice reference fields. Requires Offert & Order. | `filter?` (`cancelled`, `expired`, `invoicecreated`, `invoicenotcreated`), `fromDate?`, `toDate?`, one of `customerNumber` / `customerName` / `documentNumber`, `lastModified?`, `page`, `limit` |
| `get_order` | One order with header and rows: order type (`Order` or `Backorder`), `yourOrderNumber`, dates, totals, `offerReference`, `invoiceReference`, delivery state (`deliveryState`, `warehouseReady`, `stockPointCode`); each row with ordered, delivered and reserved quantity and stock point. | `documentNumber` (required, digits) |
| `list_price_lists` | Price lists with code, description, comments and the pre-selected flag. | `page`, `limit` |
| `list_article_prices` | One article's prices in one price list: one row per quantity break with `fromQuantity`, `price`, `percent` and `modifiedAt`. Prices are in SEK; Fortnox does not document whether they include VAT (expected: excluding). | `articleNumber`, `priceList` (both required), `page`, `limit` |
| `list_currencies` | Currencies with code, description, `buyRate`, `sellRate`, `unit`, `rateDate` and `automaticRates`. Manually entered rates may be old; check `rateDate`, and convert a document with its own rate. | `page`, `limit` |

## Time

### list\_time\_registrations

Work time registrations in a period: id, employee name (`userName`), `workedDate`,
`workedHours`, `startTime`, `stopTime`, `chargeHours` (hours to invoice),
`nonInvoiceable`, registration code, customer, project, service, cost centre,
`invoiceText`, `unitPrice` and what the hours were transferred to (`invoiceBasisId`,
`documentType` order or invoice, `documentId`). Unpaged, oldest `workedDate` first.
Requires Tidredovisning.

**fromDate** `string` *required*

First day, `YYYY-MM-DD`.

**toDate** `string` *required*

End of the period, at most 365 days after `fromDate`. Split a longer period.

**invoiced** `boolean`

`true` for only invoiced registrations, `false` for only not invoiced; omit for both.

**total / returned / truncated** `integer / integer / boolean`

See [Unpaged lists](#unpaged-lists-time-and-warehouse).

**totals** `object`

`workedHours` and `chargeHours` summed over **all** work registrations in the period, also those not returned.

**absenceWithheld** `integer`

How many absence registrations were left out.

**unclassifiedWithheld** `integer`

Registrations whose type could not be read, also left out. When not `0`, the list may be incomplete.

## Warehouse

All warehouse tools require Fortnox's warehouse module (Lager or Lager Plus),
activated for the company by a Fortnox administrator. The list tools are unpaged
(at most 500 rows, see [Unpaged lists](#unpaged-lists-time-and-warehouse)).
Quantities are in each article's own unit.

| Tool | Description | Key arguments |
| - | - | - |
| `list_stock_balance` | One row per article and stock point: `inStock`, `availableStock` and `reserved` (in stock minus available). | `articleNumber?`, `stockPointCode?` (one value each; a comma is refused) |
| `list_stock_points` | Stock points (lagerställen) with id, code, name and active flag. | `state?` (`ACTIVE` default, `INACTIVE`, `ALL`), `search?` |
| `list_purchase_orders` | Purchase orders with id, supplier, order and delivery date, state, `responseState`, purchase type (`WAREHOUSE` or `DROPSHIP`), `orderValue`, `orderValueInSek`, `totalReceivedQuantity`, internal reference and stock point. | `state?` (`NOT_SENT`, `SENT`, `SENT_NOT_REJECTED`, `DELAYED`, `RECEIVED`, `VOIDED`, `CURRENT`, `ALL`; pass `ALL` to see every order), `supplierNumber?`, `articleNumber?`, `search?` |
| `get_purchase_order` | One purchase order with header and rows: row number, article, ordered and received quantity, `remainingOrderedQuantity`, back-ordered quantity, price, stock point and location. | `id` (required, digits) |
| `list_incoming_goods` | Goods receipts (inleveranser) with id, date, supplier, `deliveryNoteId`, the released, completed and voided flags, `stockPointId` and `unmatchedValue`. | `released?`, `completed?`, `voided?`, `supplierNumber?`, `articleNumber?`, `search?` |
| `get_incoming_goods` | One goods receipt with rows: ordered, received, back-ordered and invoiced quantity, `purchaseOrderId`, stock point and location. | `id` (required, digits) |

A released receipt is locked and booked, and its goods count in the available
stock. A completed one has its bookkeeping finalised. A voided one is cancelled.

***

## Write safety: guardrail model

The 28 write tools share one confirmation model.

1. **Every write is preview-first.** A call without `confirm: true` never changes
   anything. Updates and actions on an existing record read it first, so a
   dry-run can already fail with a read error (e.g. a `404` for a wrong number).
   Otherwise you get a [preview](#preview-shape) of the exact request and nothing
   is written.
2. **`confirm: true` is required to apply,** with no exceptions. Re-run the
   identical call with `confirm: true`. See
   [The `confirm` argument](https://docs.consile.ai/developers/write-tools-and-guardrails#the-confirm-argument).
3. **Permanent and replacing writes are bound to the preview.** The tools in the
   table below also require `expectedState` from the preview on the confirming
   call. The binding is recomputed from a fresh read; if the record changed in
   Fortnox, or the arguments differ from the previewed call, the write is refused
   and nothing is written.
4. **Nothing is sent, paid or deleted.** There is no tool that sends, prints or
   e-mails a document, registers or approves a payment, or cancels, credits, voids
   or deletes anything. Sales invoices are created as drafts and booked only with
   `bookkeep_invoice`.
5. **Supplier payment details cannot be written.** `create_supplier` and
   `update_supplier` refuse bankgiro, plusgiro, IBAN, BIC, bank name, bank account
   or clearing number, branch code and payment-file settings.
6. **Updates change only the fields you pass.** An empty string clears an optional
   text field. A `rows` array on `update_offer`, `update_order`, `update_invoice`
   and `update_supplier_invoice` is the **complete** new set and replaces every
   current row.
7. **Unknown outcomes are reported.** A write that gets no answer says the outcome
   is unknown; a write Fortnox accepted whose answer could not be read says so.
   Both ask you to check with a list or get tool before repeating.

| Tool | `expectedState` on the confirming call |
| - | - |
| `create_voucher` | Always |
| `bookkeep_invoice` | Always |
| `bookkeep_supplier_invoice` | Always |
| `create_order_from_offer` | Always |
| `create_invoice_from_order` | Always |
| `update_purchase_order` | Always |
| `release_incoming_goods` | Always |
| `update_offer`, `update_order`, `update_invoice`, `update_supplier_invoice` | Only when `rows` is given |
| All other write tools | Not used |

**confirm** `boolean`

Set `true` to apply the change in Fortnox. Omit (or `false`) to get a dry-run
preview. Accepted by every write tool.

**expectedState** `string`

The 16-character hex value from `preview.state.expectedState`. Treat it as
opaque. Required with `confirm: true` on the tools in the table above.

These are safety defaults built into the Fortnox tools. See
[Actions & guardrails](https://docs.consile.ai/en/essentials/actions-and-guardrails.md) for the policy across
connectors. An [approval rule](https://docs.consile.ai/en/portal/approvals.md) on a Fortnox write tool applies
per call, so both the preview and the confirming call need approval.

### Preview shape

When a write is not confirmed, the tool returns this as a normal (non-error) tool
result instead of writing to Fortnox:

```json theme={null}
{
  "preview": {
    "action": "create_voucher",
    "summary": "<human-readable summary of the change>",
    "request": { "method": "POST", "path": "<Fortnox path>", "body": { "...": "..." } },
    "current": { "...": "..." },
    "state": { "expectedState": "3f9c2a7b1e0d4c58" },
    "confirmHint": "Re-run the same call with confirm: true AND expectedState set to preview.state.expectedState. The write is refused if anything in this preview has changed by then."
  }
}
```

**preview\.request** `object`

The exact write: `method` (`POST` or `PUT`), `path` and, where there is one, `body`.

**preview\.current** `object`

Only on updates and actions: the record as it is in Fortnox now (personal identity numbers withheld).

**preview\.state** `object`

Only on the bound writes above: `{ expectedState }`.

**preview\.confirmHint** `string`

How to apply the change.

***

## Write tools: master data

### create\_customer / update\_customer

Create one customer, or change fields of one existing customer. Codes must already
exist in the company (`currency` from `list_currencies`, `priceList` from
`list_price_lists`, `costCenter` from `list_cost_centers`, `project` from
`list_projects`; `termsOfPayment`, `termsOfDelivery` and `wayOfDelivery` from the
company's own Fortnox registers, as `get_customer` shows them).

**name** `string`

Required on `create_customer`. Company name, or the full name of a private customer.

**customerNumber** `string`

Required on `update_customer` (cannot be changed). Optional on create; Fortnox assigns the next free number if omitted.

**type** `string`

`COMPANY` or `PRIVATE`.

**vatType** `string`

`SEVAT`, `SEREVERSEDVAT`, `EUREVERSEDVAT`, `EUVAT` or `EXPORT`.

Other optional fields: `organisationNumber`, `vatNumber`, `email`, `emailInvoice`,
`phone1`, `phone2`, `www`, `address1`, `address2`, `zipCode`, `city`, `countryCode`
(ISO 3166, capitals), `currency` (ISO 4217, capitals), `termsOfPayment`,
`termsOfDelivery`, `wayOfDelivery`, `priceList`, `ourReference`, `yourReference`,
`costCenter`, `project`, `comments`, `active` (`false` deactivates; nothing is
deleted), `confirm`. `update_customer` needs at least one field to change.
`create_customer` is not idempotent: repeating a confirmed call creates a second
customer.

### create\_supplier / update\_supplier

Create one supplier, or change fields of one existing supplier. Payment details are
not accepted (see the guardrail model).

**name** `string`

Required on `create_supplier`.

**supplierNumber** `string`

Required on `update_supplier` (cannot be changed). Optional on create.

Other optional fields: `organisationNumber`, `vatNumber`, `email`, `phone1`,
`phone2`, `www`, `address1`, `address2`, `zipCode`, `city`, `countryCode`,
`currency`, `termsOfPayment`, `ourReference`, `yourReference`, `comments`, `active`,
`confirm`.

### create\_article / update\_article

Create one article (product or service), or change fields of one existing article.
The sales price is set per price list with `set_article_price`, and stock
quantities are never set here.

**description** `string`

Required on `create_article`. Article name, 1 to 200 characters.

**articleNumber** `string`

Required on `update_article` (cannot be changed). Optional on create.

**type** `string`

`STOCK` or `SERVICE`.

**vat** `number`

VAT rate in percent (in Sweden 25, 12, 6 or 0).

Other optional fields: `unit`, `stockGoods`, `salesAccount`, `purchaseAccount`
(four-digit accounts), `purchasePrice` (SEK), `ean`, `manufacturer`,
`manufacturerArticleNumber`, `supplierNumber`, `note`, `active`, `confirm`.

### set\_article\_price

Set one sales price row: one article's price in one price list from one quantity
upwards. The row is read first; it is updated when it exists and created when it
does not, and the preview says which. Never deletes a row.

**articleNumber** `string` *required*

From `list_articles`.

**priceList** `string` *required*

From `list_price_lists`.

**price** `number` *required*

Price per unit in SEK, major units.

**fromQuantity** `number` (default: 0)

Quantity from which the price applies, at most four decimals. `0` is the base price in the list.

**confirm** `boolean`

### create\_project / update\_project

**description** `string`

Required on `create_project`. Project name, 1 to 50 characters.

**projectNumber** `string`

Required on `update_project` (cannot be changed). Optional on create.

**status** `string`

`NOTSTARTED`, `ONGOING` or `COMPLETED`.

Other optional fields: `startDate`, `endDate` (not before the start date),
`projectLeader`, `contactPerson`, `comments`, `confirm`. Previews show the contact
person and comments only as whether they are set.

### create\_cost\_center / update\_cost\_center

**code** `string` *required*

1 to 6 characters. On create, Fortnox refuses a code that already exists; on update it names the cost centre and cannot be changed.

**description** `string`

Required on `create_cost_center`.

Other optional fields: `note`, `active`, `confirm`.

***

## Write tools: sales

Offers, orders and invoices share one set of document fields. Nothing is ever
sent to the customer, and none of these tools books anything. Offers and orders
need the Offert & Order licence.

### Document header fields

**customerNumber** `string`

Required on `create_offer`, `create_order` and `create_invoice`. Cannot be changed by the update tools.

**documentNumber** `string`

Required on the update and conversion tools: the document's number, digits only.

Optional on create and update: `yourReference`, `ourReference` (each at most 50
characters), `currency` (no exchange rate is sent; Fortnox applies its own),
`priceList`, `termsOfPayment`, `remarks` (at most 1024 characters, visible to the
customer), `costCenter`, `project`, `confirm`, plus per document type:

| Tool | Extra header fields |
| - | - |
| `create_offer`, `update_offer` | `offerDate`, `expireDate` (not before the offer date), `deliveryDate` |
| `create_order`, `update_order` | `orderDate`, `deliveryDate`, `yourOrderNumber` |
| `create_invoice`, `update_invoice` | `invoiceDate`, `dueDate` (not before the invoice date; omit to derive from the terms), `yourOrderNumber` |

### Document rows

**rows** `array`

1 to 100 rows. Required on create. On update, optional: when given, it is the
complete new set and replaces every current row (Fortnox maps rows by position,
so give every field that matters on every row), and the confirming call needs
`expectedState`.

Each row: `articleNumber` (omit for a free-text row), `description` (required on a
free-text row), `quantity` (at most four decimals: the offered, ordered or invoiced
quantity), `unit`, `price` (per unit in the document's currency; omit to use the
price list), `discount` with `discountType` (`AMOUNT` or `PERCENT`), `vatPercent`,
`accountNumber` (a sales account, 1000 to 9999), `costCenter`, `project`. What is
left out, Fortnox fills in from the article, the customer and the company's
settings.

### Tools

| Tool | What it does | Refused when |
| - | - | - |
| `create_offer` | Creates an offer with 1 to 100 rows. | |
| `update_offer` | Changes header fields and optionally replaces the rows. | The offer is cancelled or already turned into an order or invoice. |
| `create_order_from_offer` | Turns an offer into a sales order; the offer then carries `orderReference`. Takes `documentNumber`, `expectedState`, `confirm`. | The offer is cancelled or already converted. |
| `create_order` | Creates a sales order with 1 to 100 rows. Stock handling follows the company's Fortnox settings. | |
| `update_order` | Changes header fields and optionally replaces the rows. | The order is cancelled or already invoiced. |
| `create_invoice_from_order` | Turns an order into a **draft** invoice; the order then carries `invoiceReference`. Takes `documentNumber`, `expectedState`, `confirm`. | The order is cancelled or already invoiced. |
| `create_invoice` | Creates a **draft** sales invoice with 1 to 100 rows. | |
| `update_invoice` | Changes a draft invoice and optionally replaces the rows. If it was already sent, the customer's copy does not change. | The invoice is booked, cancelled or a credit note. |

***

## Write tools: bookkeeping

Booking rows on vouchers and supplier invoices share one shape: each row books
**one** amount on **one** account.

**rows\[].account** `integer` *required*

Four-digit account from `list_accounts`, existing and active in the financial year.

**rows\[].debit** `number`

Above zero, at most two decimals, SEK. Give `debit` or `credit`, never both.

**rows\[].credit** `number`

Above zero, at most two decimals, SEK.

Optional per row: `transactionInformation` (up to 100 characters), `costCenter`,
`project`.

### create\_voucher

Create one voucher (verifikation). **Permanent:** a voucher cannot be deleted in
Fortnox, only reversed with a new voucher. Checked before anything is sent: one
amount per row, at least one debit and one credit row, and total debit equal to
total credit to the öre. The voucher lands in the financial year that contains
`transactionDate`; the preview shows it.

**voucherSeries** `string` *required*

From `list_voucher_series`.

**transactionDate** `string` *required*

`YYYY-MM-DD`. Decides the financial year and period.

**description** `string` *required*

Voucher text, 1 to 200 characters.

**rows** `array` *required*

2 to 100 booking rows.

**financialYearId** `integer`

Optional; if given, it must be the year that contains `transactionDate`.

**expectedState** `string`

Required with `confirm: true`.

**confirm** `boolean`

### bookkeep\_invoice

Bookkeep one draft sales invoice. Afterwards it can only be corrected by a credit
invoice made in Fortnox. Refused when the invoice is already booked, cancelled or
has no rows. Does not send the invoice or register a payment.

**documentNumber** `string` *required*

From `list_invoices` (filter `unbooked`).

**expectedState** `string`

Required with `confirm: true`.

**confirm** `boolean`

### create\_supplier\_invoice

Register a supplier invoice **without** bookkeeping it. No payment, approval or bank
field is offered. Fortnox does not document how it combines given rows with the
total and VAT, so check the stored rows with `get_supplier_invoice` before
bookkeeping.

**supplierNumber** `string` *required*

From `list_suppliers`.

**invoiceDate** `string` *required*

`YYYY-MM-DD`.

**total** `number` *required*

Total including VAT, in the invoice currency, above zero.

**vat** `number` *required*

VAT amount, zero or more and less than `total`.

Optional: `invoiceNumber` (the supplier's own), `dueDate`, `currency`, `ocr`,
`ourReference`, `yourReference`, `costCenter`, `project`, `rows` (1 to 100 booking
rows; without them Fortnox decides the rows), `confirm`.

### update\_supplier\_invoice

Change an unbooked supplier invoice. Only the fields given are sent. `rows`, when
given, replaces all booking rows, and the confirming call then needs
`expectedState`. Refused for a booked or cancelled invoice, a due date before the
invoice date, or VAT not less than the total.

**givenNumber** `string` *required*

Fortnox's running number from `list_supplier_invoices`, not the supplier's invoice number.

Optional: `invoiceNumber`, `invoiceDate`, `dueDate`, `total`, `vat`, `currency`,
`ocr`, `ourReference`, `yourReference`, `costCenter`, `project`, `rows`,
`expectedState`, `confirm`.

### bookkeep\_supplier\_invoice

Bookkeep one supplier invoice with its stored booking rows. Refused when it is
already booked or cancelled, has no rows, or its rows do not balance. It neither
approves (attesterar) nor pays the invoice, and it cannot be undone.

**givenNumber** `string` *required*

From `list_supplier_invoices` (filter `unbooked`).

**expectedState** `string`

Required with `confirm: true`.

**confirm** `boolean`

***

## Write tools: warehouse

All require the Lager module. Nothing is ever sent to the supplier, and dropship
orders are out of scope.

### create\_purchase\_order

Create a purchase order to one supplier for delivery to the company itself.

**supplierNumber** `string` *required*

From `list_suppliers`.

**orderDate** `string` *required*

`YYYY-MM-DD`.

**currency** `string` *required*

Three capital letters. Every row is sent in it.

**termsOfPayment** `string` *required*

Fortnox's terms of payment code, e.g. `30`.

**deliveryName** `string` *required*

**deliveryAddress** `string` *required*

**deliveryZipCode** `string` *required*

**deliveryCity** `string` *required*

**rows** `array` *required*

1 to 100 rows: `articleNumber` (required), `orderedQuantity` (required, above 0), `price` (optional).

**currencyRate** `number`

SEK per `currencyUnit` units. Required for any currency other than SEK.

Other optional fields: `currencyUnit`, `deliveryAddress2`, `deliveryCountryCode`,
`deliveryDate` (not before `orderDate`), `stockPointCode`, `project`, `costCenter`,
`internalReference`, `ourReference`, `yourReference`, `messageToSupplier`, `note`,
`confirm`.

### update\_purchase\_order

Change an existing purchase order. Fortnox only replaces a whole purchase order,
so the tool reads it, applies your changes and writes the merged order back; this
is why `expectedState` is always required. The currency and supplier cannot be
changed. Refused for an empty change, a delivery date before the order date, and
an order that is voided, fully received, manually completed or dropship.

**id** `string` *required*

Digits only, from `list_purchase_orders`.

**changeRows** `array`

Existing rows to change: `rowNumber` (required, from `get_purchase_order`), new `orderedQuantity` (not below what has been received) and/or `price`.

**addRows** `array`

New rows: `articleNumber`, `orderedQuantity`, optional `price`.

**removeRowNumbers** `array`

Row numbers to remove; only rows nothing has been received on, and at least one row must remain.

**expectedState** `string`

Required with `confirm: true`.

Optional header fields (an empty string clears an optional text field):
`deliveryDate`, `termsOfPayment`, `internalReference`, `ourReference`,
`yourReference`, `messageToSupplier`, `note`, `project`, `costCenter`,
`deliveryName`, `deliveryAddress`, `deliveryAddress2`, `deliveryZipCode`,
`deliveryCity`, `deliveryCountryCode`, `confirm`.

### create\_incoming\_goods

Register a goods receipt as a **draft**. Stock does not change until it is released
with `release_incoming_goods`.

**deliveryNoteId** `string` *required*

The supplier's delivery note number.

**date** `string` *required*

The day the goods arrived, `YYYY-MM-DD`.

**stockPointCode** `string` *required*

From `list_stock_points`. A row may name its own.

**rows** `array` *required*

1 to 100 rows: `receivedQuantity` (required, above 0) and either `purchaseOrderRowNumber` (with `purchaseOrderId`) or `articleNumber`; optional `backOrderQuantity` (purchase order rows only), `stockPointCode`, `stockLocationCode`.

**purchaseOrderId** `string`

Receive against a purchase order. Article, supplier and ordered quantity are then taken from the order.

**supplierNumber** `string`

Required without a purchase order; with one, it must match.

Optional: `note`, `confirm`. Refused when the purchase order is voided, fully
received, manually completed or dropship, a row number is not on it, or a supplier
or article differs from the order.

### release\_incoming\_goods

Release a draft goods receipt. **Permanent:** Fortnox locks and bookkeeps it, and
the goods count in the available stock. Refused when the receipt is already
released, completed or voided, or has no rows.

**id** `string` *required*

Digits only, from `list_incoming_goods` (`released: false` lists the drafts).

**expectedState** `string`

Required with `confirm: true`.

**confirm** `boolean`

***

## Access levels (per user)

An account administrator chooses one of two access levels for Fortnox per user, on
the portal's Team page, or picks the exact tools under **Custom**. All levels cost
the same. e-conomic and Uniconta have the same levels (see the
[e-conomic reference](https://docs.consile.ai/developers/tools/economic.md#access-levels-per-user)).

| Level | `tools/list` contains |
| - | - |
| Read only | the 32 tools with `readOnlyHint: true` |
| Full access (default) | all 60 tools |
| Custom | the tools the administrator picked |

Under Read only, `tools/list` on every Fortnox endpoint omits the 28 write tools
(`connect_account` is still listed), and a direct `tools/call` to a write tool
returns a tool result with `isError: true` explaining that the tool is not enabled
for the user. Nothing is sent to Fortnox. The level applies to all of the user's
Fortnox agreements; colleagues on Full access keep their write tools. Clients that
cache `tools/list` should start a new session after a level change.

Every level is also limited to the tools the organization has switched on under
[Tools](https://docs.consile.ai/en/portal/tools.md). For an organization whose membership or free edition
predates 2026-11-08, Fortnox's tools start switched off.

***

## Errors and timeouts

Tool failures come back as a normal tool result with `isError: true` and one text
block. Fortnox's own error text is never quoted.

| Situation | What the tool returns |
| - | - |
| Credential rejected or revoked (401, or a 403 meaning not authenticated) | `Fortnox rejected the connection's credential (HTTP 401); reconnect required from the Consile portal.` |
| Missing licence or module, or the connected user lacks a right (other 403) | `Fortnox refused this request (HTTP 403): the company lacks the Fortnox licence this data needs (...), or the connected Fortnox user lacks the right to read it. Reconnecting will not fix it; a Fortnox administrator must add the licence or the user right.` When Fortnox reports that the connecting **user** lacks the right, the text instead says an administrator can give the user the right, or the integration can be connected again by a user who has it. |
| Rate limit still hit after one automatic retry (429) | `Fortnox rate limit hit (Fortnox allows 25 requests per 5 seconds per company and integration); retried once and still limited. Wait a few seconds before trying again, and ask for fewer pages.` The limit is shared by every user of the company. |
| Fortnox rejects a value or an unknown record (400) | A fixed message asking you to check the identifiers with the matching list tool. |
| Record not found (404) | A fixed message; for accounts and vouchers it also points to `financialYearId`. |
| Confirm without `expectedState` on a bound write | `This write needs expectedState: run the tool WITHOUT confirm first, review the preview, then re-run the same call with confirm:true and expectedState set to preview.state.expectedState. Nothing was written.` |
| Record or arguments changed since the preview | `What would be written no longer matches the preview: ... Nothing was written.` |
| A write got no answer | `Fortnox did not answer this write in time, so it is NOT known whether it was applied. ...` Check before repeating. |
| A write was accepted but its answer could not be read | `Fortnox accepted this write, but its answer could not be read, ... Do not repeat it: ...` |
| The tool's own check fails (e.g. an unbalanced voucher, two searches in one call, a period over 365 days) | A message naming what is wrong. Nothing is written. |
| Arguments that break the input schema | `Tool invocation failed.` |
| Other upstream failure (5xx) | `Tool invocation failed.` |
| Fortnox not connected yet | `fortnox is not connected yet. Connect it here: <link>` (link valid 10 minutes) |
| The user has no seat on Fortnox | A seat message; an administrator assigns access under Team. |
| Tool not enabled for the user (switched off for the organization, or excluded by the access level or custom list) | `This tool is not enabled for your user on fortnox, so it cannot be used in this session. Nothing was changed. ...` |

Each request to Fortnox times out after 30 seconds. Access tokens are refreshed
automatically. See [Errors & limits](https://docs.consile.ai/developers/errors-and-limits.md) for the
protocol-level errors and rate limits shared by all connectors.

***

## Code examples

```json Request: list_financial_years theme={null}
{
  "name": "fortnox__list_financial_years",
  "arguments": { "date": "2026-03-31" }
}
```

```json Request: get_voucher theme={null}
{
  "name": "fortnox__get_voucher",
  "arguments": { "voucherSeries": "A", "voucherNumber": 214, "financialYearId": 3 }
}
```

```json Request: list_invoices (overdue) theme={null}
{
  "name": "fortnox__list_invoices",
  "arguments": { "filter": "unpaidoverdue", "limit": 100 }
}
```

```json Request: create_voucher (dry-run preview) theme={null}
{
  "name": "fortnox__create_voucher",
  "arguments": {
    "voucherSeries": "A",
    "transactionDate": "2026-11-08",
    "description": "Reclassification",
    "rows": [
      { "account": 6250, "debit": 5000 },
      { "account": 6110, "credit": 5000 }
    ]
  }
}
```

```json Request: create_voucher (apply with confirm) theme={null}
{
  "name": "fortnox__create_voucher",
  "arguments": {
    "voucherSeries": "A",
    "transactionDate": "2026-11-08",
    "description": "Reclassification",
    "rows": [
      { "account": 6250, "debit": 5000 },
      { "account": 6110, "credit": 5000 }
    ],
    "expectedState": "<preview.state.expectedState>",
    "confirm": true
  }
}
```


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