Last updated: 2025-10-06

Invoice export to Fortnox

Opter can be connected to (integrated with) the Fortnox accounting system, www.fortnox.se. Then it is possible to:

Each time invoices are exported, Fortnox checks whether there is anything to update in the invoices or customers. Fortnox only updates invoices that have not yet been recorded in Fortnox.

Invoice information sent from Opter to Fortnox

When an invoice export is made to Fortnox, Opter sends a summary of each unique coding combination. This means that Opter sends one invoice row per combination of ledger account and economic unit.

Sending invoices to the customers from Fortnox or Opter

In Opter, invoices can be created that contain the details you want about the transport. In Fortnox there is no support for presenting all the details that should be included on a transport invoice, such as sender, receiver, distance, weight, freight bill number, etc. On the invoice created in Fortnox, Opter adds a "Title" (description) containing the invoice number, order number and order date. For more information, see Transport information on the invoice from Fortnox below.

Choose whether to send the invoices to the customers from Fortnox or Opter, in accordance with one of the following options:

  • Book the invoices in Fortnox, but send the invoices to the customers from Opter.

  • Book the invoices in Fortnox, and send the invoices to the customers from Fortnox, with the Opter invoice attached in PDF format. The disadvantage is that it may appear to the customer that you have sent two invoices.

  • Book the invoices in Fortnox, and send the invoices to the customers from Fortnox, (without the Opter invoice attached).

    The customer receives one invoice, from Fortnox. The disadvantage is that unfortunately that invoice does not contain any detailed information about the shipments, only the invoice number, order number and order date. See also the information on Interest invoices below.

Transport information on the invoice from Fortnox

On the invoice created in Fortnox, Opter adds a "Title" (description). Opter inserts the following information in the following sequence:

  • The text "Invoice" (in the language you had your Opter set to when you created the invoice in Opter).

  • Invoice number.

  • Order number.

  • Order date.

For example, the title could look like this: "Invoice 100353, 4555, 2024-09-04".

Conditions

Integration licence and invoicing licence

To be able to connect (integrate) Opter to Fortnox, you need an integration licence. You also need to have a software licence for invoicing in Fortnox. These licences (also called "programs" and "add-ons") can be ordered in the Fortnox program. Contact Fortnox if you need more information about your licences.

Payment imports require the software licences for invoicing and accounting in Fortnox.

Settlement export and invoice export require the software licence for invoicing in Fortnox.

Web browser

In order to export to Fortnox, it is important that you use a modern standard browser, such as Edge, Firefox or Chrome.

Standard currency

In order to export invoices and supplier bills to Fortnox and import payments from Fortnox to Opter, the default currency in Opter must be Swedish kronor (SEK).

Do not change the default currency as that would cause major problems in the system. If you have a standard currency other than Swedish kronor, it is not possible to export invoices and supplier bills to Fortnox and import payments from Fortnox.

Currency codes

Fortnox only accepts three-letter currency codes, such as “DKK”, “SEK”, “GBP” and “EUR”.

Exchange rates

It is important to always have exactly the same exchange rates in Fortnox and Opter to avoid problems such as exchange rate losses, and payments that do not match the invoice in Opter exactly and are therefore registered as advances.

To always have the same exchange rates in Fortnox and Opter, proceed as follows:

  • In Fortnox: Go to Invoicing > Currency, and set Automatic exchange rates to “NO”.

  • Set exactly the same exchange rates in Fortnox and Opter. When updating an exchange rate, change the exchange rate at the same time in both Fortnox and Opter. In Opter, exchange rates are set under Economy > Currencies> Currency rates tab.

Customer number and sales ledger number

Fortnox requires all customers to have a number. To ensure that Fortnox and Opter work well together, check that the Fortnox customer number is the same number as the one in the Sales ledger number field under Register > Customers in Opter.

If customers are to be exported from Opter to Fortnox, make sure that all the customers in Opter have a number in the Sales ledger number field in the customer registry before exporting the invoices. When the invoices are then exported, the customer associated with the invoice is automatically downloaded from Opter to Fortnox.

Cost centre and project

In order for cost centres and projects to be transferred from Opter to Fortnox, you must write the names of the economic units as below on the Economy tab in the office settings (even if you have Opter in a language other than Swedish):

  • If cost centres are used, an economic unit must be called a “COST CENTRE”.

  • If projects are used, an economic unit must be called a “PROJECT”.

Also check that Name and Code for the economic units in Opter match with Name and Code for the cost centres in Fortnox. In Opter, you can find the economic units under Economy > Economic units.

Correcting an invoice, invoice number and number series of correction invoice

When a debit invoice recorded in Fortnox is corrected in Opter, Fortnox will create a correction invoice with an automatically generated invoice number. This invoice number may be the same as the number another invoice has or will have in Opter. To avoid this problem, choose a number series in Fortnox that will not clash with the invoice numbers in Opter under Settings > Invoicing > Number series and OCR in the Customer invoice field, and click on Save.

When exporting normal credit invoices, Fortnox does not allow you to decide the correction invoice number in Opter. If manual correction invoices are used, Fortnox accepts that the correction invoice number is determined in Opter, but the correction invoice will not be marked as the correction of another invoice and will lose the link to the original invoice.

Also note that even if correction invoices have previously been exported to Fortnox as normal correction invoices and a switch is then made to always exporting correction invoices as manual correction invoices, the number series will probably be interrupted.

If all the correction invoices should be treated as manual correction invoices when exporting invoices to Fortnox, select the Always manually export correction invoices checkbox on exports.

Correcting an invoice, OCR number

In Fortnox, under Settings > Invoicing > Number series and OCR, you can set OCR on customer invoices to OFF or ON.

When a debit invoice recorded in Fortnox is corrected in Opter, Opter generates an OCR number for the correction invoice. If you have chosen to set OCR on customer invoices to ON, Fortnox will also generate an OCR number. This OCR number may be the same as the OCR number another invoice has or will have in Opter. To avoid this problem, you can choose to set OCR on customer invoices to OFF and click on Save.

Interest invoices

In order for Fortnox and Opter to work well together, interest invoices are exported to Fortnox as normal invoices. The information specific to interest invoices is displayed in a PDF copy that Opter attaches to the invoice export for Fortnox, if the Include PDF-copy checkbox has been selected under Economy > Invoices > Invoice export. For more information, seeStep 2: Create an invoice export for Fortnox in Opter below.

Selling invoices

If you sell your invoices, Fortnox wants you to sell the invoices that are in Fortnox. To include all the details (such as the sender, receiver, distance, weight, freight bill number, etc.), it is important to attach the Opter invoices as PDF files when exporting to Fortnox. This can be done by selecting Include PDF-copy in Step 2 below.

Step 1: Create a self-signed certificate

All computers that will be capable of exporting invoices and supplier bills to Fortnox must have a self-signed certificate to be authenticated.

  1. Open Windows PowerShell with administrator rights and run the following command.

    PowerShell
    New-SelfSignedCertificate -DnsName localhost44301 -CertStoreLocation cert:\LocalMachine\My
  2. Copy Thumbprint from the result of the above command and use as certhash in the following command.

    PowerShell
    netsh http add sslcert ipport=0.0.0.0:44301 appid='{ae7f1bed-891a-45a3-b0ac-37fe01e6b6cd}' certhash=Klistra in Thumbprint från ovanstående kommando
  3. Repeat steps 1 and 2 above on each computer that is to be capable of exporting invoices and supplier bills to Fortnox.

Instructions on how to set up supplier bill exports are available in Supplier bill export to Fortnox.

The certificate expires after one year without notice. If a certificate has expired, you will receive the error message The user details were not accepted by the external system.

Step 2 (optional): Adding a service account

The function to use service account is available in Opter version 2025.06.85 and later.

If you want to simplify the assignment of authorisations, you can allow ordinary users to have limited authorisations, and create a service account and only give the service account the authorisations required to export invoices and supplier bills to Fortnox and import payments to Opter (from Fortnox).

When the regular users then export invoices or supplier bills to Fortnox or import payments to Opter, it is the service account and its authorisations that are used in the background for the export/import between Opter and Fortnox. (That is, the integration uses the service account.)

You must be a system administrator to set up a service account in Fortnox.

If you, as a system administrator, want to set up a service account, do the following:

  1. In Opter, tick the checkbox Use service account in the window Invoice export. You can do this in connection with the Create an invoice export for Fortnox step in Opter below.

    For settlement export, tick the Use service account checkbox in the Supplier bill export window. See Supplier bill export to Fortnox.

    For payment imports, tick the Use service accountcheckbox in the Payment Import window. See Payment import from Fortnox.

  2. When it is time to export invoices, it is you as the system administrator who must do the first invoice export to create the service account. If you also export supplier bills and import payments, the system administrator must also perform the first supplier bill export and the first payment import.

    Proceed as follows:

    1. In Fortnox, if you are not already logged in, log in with your Fortnox user account.

    2. Follow the Export invoices to Fortnox step below. When you click on Export and send in Opter, a window opens in Fortnox. The window displays a list of the authorisations required for the service account. Click on the "Authorise" button. The service account is created.

      The web window with the text "Close this window" can be closed at any time, it does not interfere with the creation of the service account. It also does not interfere with the export of invoices.

      You may also get "This site can't be reached", this does not interfere with the creation of the service account or the export of invoices.

      To check that the service account has been created, click on "Account" and then "Manage integrations" in Fortnox. In the list of "Users" the service account is shown with the following icon:

      After the service account is created, ordinary users (with limited authorisations) can export invoices to Fortnox. The service account and its authorisations are then used in the background when exporting to Fortnox. (However, regular users need authorisation to manage invoices in Opter).

    3. For settlement exports, follow the step Supplier bill export to Fortnox. When you click on Export and send in Opter, a window opens in Fortnox. Click on the "Authorise" button. Now regular users can export supplier bills and the service account is used in the background.

    4. For payment import, follow the step Payment import from Fortnox. When you click on Ok in Opter to import the payments, a window opens in Fortnox. Click on the "Authorise" button. Regular users can now import payments and the service account is used in the background.

Step 3: Create an invoice export for Fortnox in Opter

  1. Click on Economy > Invoices > Invoice export. Click on and give the invoice export a name (for example “Fortnox”). The Type and Encoding fields must be filled in.

    • Type: Fortnox API

    • Encoding: UTF-8

    • Include PDF-copy If you want the Opter invoice to be attached in PDF format.

      In Fortnox there is no support for presenting all the details that should be included on a transport invoice, such as sender, receiver, distance, weight, freight bill number, etc. Therefore, the graphic invoice with all the details is created in Opter and sent to Fortnox as a PDF file. For more information, see Sending invoices to the customers from Fortnox or Opter above.

      In order for Fortnox and Opter to work well together, interest invoices are exported to Fortnox as normal invoices. The information specific to interest invoices is displayed in the PDF copy that Opter includes in the invoice export to Fortnox, if Include PDF-copy is selected.

    (Leave the Password and API Code fields blank. The Get access token button is not used. These two fields and the button are removed as of Opter version 2025.06.00).

  2. If you want to reduce the size of the PDF file, tick the checkbox Reduce PDF file size.

    The file size is reduced by removing all text formatting (bold, italic, underlined), and by changing the font to Trebuchet MS which uses less storage space. How much the file size is reduced depends, among other things, on how much formatting it contains.

  3. If all the correction invoices should be treated as manual correction invoices when exporting invoices to Fortnox, select the Always manually export correction invoices checkbox.

    When exporting normal credit invoices, Fortnox does not allow you to decide the correction invoice number in Opter. If manual correction invoices are used, Fortnox accepts that the correction invoice number is determined in Opter, but the correction invoice will not be marked as the correction of another invoice and will lose the link to the original invoice.

    Also note that even if correction invoices have previously been exported to Fortnox as normal correction invoices and a switch is then made to always exporting correction invoices as manual correction invoices, the number series will probably be interrupted.

  4. If you want to use a service account when exporting invoices, tick the checkbox Use service account. For more information, see step Add a service account above.

  5. Click on to save all changes.

Step 4: Add the invoice export in the invoice export settings

  1. Click on Economy > Invoices > Invoice export settings.

  2. Click on and give the export setting a name (for example “Fortnox”). Select “Fortnox" (or the name you gave the invoice export) under Exports.

  3. Click on to save all changes.

  4. Choose which invoice export should be the default. To select Fortnox as the default, select “Fortnox” from the list on the left and click on .

  5. To ensure that all invoices are recorded in Fortnox, select the “Fortnox” export for all export settings.

  6. Click on to save all changes.

Step 5: Exporting invoices to Fortnox

The invoice information can be exported from Opter when closing an invoice period, or subsequently when choosing whether to export entire invoice periods or individual invoices.An invoice is created in Fortnox with invoice rows corresponding to the account coding in Opter.

  1. Click on Economy > Invoices > Invoices.

  2. Select the invoice or invoice period you want to export, right-click and select Export.

  3. Click on Export and send.

    If you are not already logged in to Fortnox, a new window will open where you log in with your usual Fortnox username and password. If authentication is successful, the export will start.

    The web window with the text “Close this window” can be closed at any time, it will not interfere with the invoice export.

    At the bottom of the Invoice export window in Opter, there is a progress indicator that turns completely green when the invoice export is complete. If the invoice export fails, the progress bar turns grey and there is a statement indicating that the export failed.

If not all invoices are exported during the first attempt, click on Export and send again. There will be no more invoices if you export again. Each time an invoice is exported, Fortnox will update the invoice if it is not recorded in Fortnox.

Delete the service account

If you have a service account and want to delete it, follow these steps:

  1. In Opter, untick the checkbox Use service account in the window Invoice export.

    For settlement export, untick the Use service account checkbox in the Supplier bill export window.

    For payment imports, untick the Use service accountcheckbox in the Payment Import window.

    Save all changes.

  2. In Fortnox, click on "Office" and then "Manage integrations" in Fortnox. In the list of "Users" the service account is shown with the following icon:

    In the service account menu, select "Disconnect".

The service account is now cancelled.

Troubleshooting, service account

If you use a service account and receive the following three error messages in the following order

  1. The user details were not accepted by the external system. (Click on Ok.)

  2. The user could not be authorised by the external system, please check the assigned roles. (Click on Ok.)

  3. Error creating invoice. Contact your system administrator.. (Click on Ok.)

This is probably because Fortnox has removed the service account key (token). To solve this, the system administrator must add a new service account. Follow Step 2 (optional): Adding a service account above (again).

Troubleshooting

If the transfer to Fortnox does not work, an error message is displayed. Error messages only appear if something goes wrong during export. Error messages are displayed in a popup window, and are not saved anywhere.

If the export to Fortnox does not work, it may be due to one of the following reasons:

  • If exports are done from several different computers, and they work on some computers but not on all of them, it is probably because the computer does not have a self-signed certificate. All computers that will be capable of exporting invoices and supplier bills to Fortnox must have a self-signed certificate to be authenticated. (See Step 1: Create a self-signed certificate above.

    The certificate expires after one year without notice. If a certificate has expired, you will receive the error message The user details were not accepted by the external system.

  • Your browser is too old or Internet Explorer opens by default. In order to export to Fortnox, it is important that you use a modern standard browser, such as Edge, Firefox or Chrome.

  • The Fortnox web service is currently down.

  • You do not have a licence. For more information, see Integration licence and invoicing licence above.

See also