Spring til hovedindhold
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). Your organization needs access to Fortnox (a subscription, or a plan that covers it, see What decides access), and your user must hold a seat or plan licence (assigned under Team in the portal, see Team).
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.
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).

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).
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:
integer
standard:"1"
Page number, starting at 1 (max 100000).
integer
standard:"50"
Rows per page, 1 to 500.
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:
integer
How many rows Fortnox sent (for time registrations: the work registrations in the period).
integer
How many rows are in this result.
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

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

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

Invoices

Offers, orders & prices

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.
string
påkrævet
First day, YYYY-MM-DD.
string
påkrævet
End of the period, at most 365 days after fromDate. Split a longer period.
boolean
true for only invoiced registrations, false for only not invoiced; omit for both.
integer / integer / boolean
object
workedHours and chargeHours summed over all work registrations in the period, also those not returned.
integer
How many absence registrations were left out.
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). Quantities are in each article’s own unit. 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 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.
  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.
boolean
Set true to apply the change in Fortnox. Omit (or false) to get a dry-run preview. Accepted by every write tool.
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 for the policy across connectors. An approval rule 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:
object
The exact write: method (POST or PUT), path and, where there is one, body.
object
Only on updates and actions: the record as it is in Fortnox now (personal identity numbers withheld).
object
Only on the bound writes above: { expectedState }.
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).
string
Required on create_customer. Company name, or the full name of a private customer.
string
Required on update_customer (cannot be changed). Optional on create; Fortnox assigns the next free number if omitted.
string
COMPANY or PRIVATE.
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).
string
Required on create_supplier.
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.
string
Required on create_article. Article name, 1 to 200 characters.
string
Required on update_article (cannot be changed). Optional on create.
string
STOCK or SERVICE.
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.
string
påkrævet
From list_articles.
string
påkrævet
From list_price_lists.
number
påkrævet
Price per unit in SEK, major units.
number
standard:"0"
Quantity from which the price applies, at most four decimals. 0 is the base price in the list.
boolean

create_project / update_project

string
Required on create_project. Project name, 1 to 50 characters.
string
Required on update_project (cannot be changed). Optional on create.
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

string
påkrævet
1 to 6 characters. On create, Fortnox refuses a code that already exists; on update it names the cost centre and cannot be changed.
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

string
Required on create_offer, create_order and create_invoice. Cannot be changed by the update tools.
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:

Document 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


Write tools: bookkeeping

Booking rows on vouchers and supplier invoices share one shape: each row books one amount on one account.
integer
påkrævet
Four-digit account from list_accounts, existing and active in the financial year.
number
Above zero, at most two decimals, SEK. Give debit or credit, never both.
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.
string
påkrævet
From list_voucher_series.
string
påkrævet
YYYY-MM-DD. Decides the financial year and period.
string
påkrævet
Voucher text, 1 to 200 characters.
array
påkrævet
2 to 100 booking rows.
integer
Optional; if given, it must be the year that contains transactionDate.
string
Required with confirm: true.
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.
string
påkrævet
From list_invoices (filter unbooked).
string
Required with confirm: true.
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.
string
påkrævet
From list_suppliers.
string
påkrævet
YYYY-MM-DD.
number
påkrævet
Total including VAT, in the invoice currency, above zero.
number
påkrævet
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.
string
påkrævet
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.
string
påkrævet
From list_supplier_invoices (filter unbooked).
string
Required with confirm: true.
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.
string
påkrævet
From list_suppliers.
string
påkrævet
YYYY-MM-DD.
string
påkrævet
Three capital letters. Every row is sent in it.
string
påkrævet
Fortnox’s terms of payment code, e.g. 30.
string
påkrævet
string
påkrævet
string
påkrævet
string
påkrævet
array
påkrævet
1 to 100 rows: articleNumber (required), orderedQuantity (required, above 0), price (optional).
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.
string
påkrævet
Digits only, from list_purchase_orders.
array
Existing rows to change: rowNumber (required, from get_purchase_order), new orderedQuantity (not below what has been received) and/or price.
array
New rows: articleNumber, orderedQuantity, optional price.
array
Row numbers to remove; only rows nothing has been received on, and at least one row must remain.
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.
string
påkrævet
The supplier’s delivery note number.
string
påkrævet
The day the goods arrived, YYYY-MM-DD.
string
påkrævet
From list_stock_points. A row may name its own.
array
påkrævet
1 to 100 rows: receivedQuantity (required, above 0) and either purchaseOrderRowNumber (with purchaseOrderId) or articleNumber; optional backOrderQuantity (purchase order rows only), stockPointCode, stockLocationCode.
string
Receive against a purchase order. Article, supplier and ordered quantity are then taken from the order.
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.
string
påkrævet
Digits only, from list_incoming_goods (released: false lists the drafts).
string
Required with confirm: true.
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). 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. 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. Each request to Fortnox times out after 30 seconds. Access tokens are refreshed automatically. See Errors & limits for the protocol-level errors and rate limits shared by all connectors.

Code examples