Last updated: 2025-10-20

Exporting invoices to Duett (API)

Applies to Opter 2025.06.228 and later.

Opter can be connected to (integrated with) the Duett accounting system. Invoices can then be exported from Opter to Duett via API. For more information about Duett, see duett.no.

When an invoice is exported from Opter to Duett, the following happens:

  • The account coding is exported.

    For each invoice that is exported, a voucher is created in Duett. This voucher contains the account coding that is transferred, account coding row by account coding row. A copy of the Opter invoice in PDF format is attached to this voucher if the Include PDF-copy checkbox is selected, (for more information, see Step 1 below).

  • Customer information is exported and updated in Duett, unless you actively choose to switch it off using settings in the Start text field. (For more information, see Step 1 below.)

Conditions

User account at Duett

In order to connect (integrate) Opter with Duett, a user account is required at Duett. Contact Duett if you need more information.

Account number

The account numbers used in Opter must be available in Duett.

Invoice number and invoice number series

Duett accepts invoice numbers from Opter. We recommend ensuring that the numbers on invoices that are generated in Opter do not clash with the numbers on any invoices generated directly in Duett. This can be solved by using different invoice number series in Opter and Duett.

For each invoice exported from Opter, a "voucher" is created in Duett. The number on this voucher is always added to the invoice number.

This voucher contains the account coding being transferred, line by line. For each coding line, Opter sends information about which invoice period the coding line belongs to. The default text is "Invoice journal Opter period: {0} <invoice period number>", but can be changed in the IES_DuettAPIVoucherDescription terminology tag. If you want to change the text, you can do so in Opter under Settings > Terminology.

If you want to see in Duett the information about which invoice period the coding rows belong to, export from Duett to Excel.

Postcode

Postcodes of Norwegian customers invoiced in Opter must have postcodes that are in the Duett postcode registry.

Duett does not allow you to add postcodes, either in the client or via API calls. If you receive the error message The postcode {0} is not in Duett when exporting, you can do one or both of the following:

  • Change the postcode in Opter to match the postcode in Duett. Then export the invoice again.

  • Disable customer update by setting createCustomers=false and updateCustomers=false (in Step 1 below), and keep the customer records in Opter and in Duett updated manually.

    Then export the invoice again.

Currency and currency codes

Duett is for the Norwegian market and uses Norwegian kroner. Duett and Opter use the same currency codes.

Economic units

In Opter, all the economic units are available under Settings > Offices, on the Economy tab. If the economic units used in Opter do not exist in Duett, Opter tries to create them in Duett.

In Opter, you can see the codes (values) of the different departments under an economic unit by clicking on Economy > Economic units and selecting the economic unit. If the codes (values) used in Opter for an economic unit do not exist in Duett, Opter tries to create them in Duett.

Consider the following

Duett does not allow you to add postcodes, either in the client or via API calls. For more information, see Postcode above.

Step 1: Create an invoice export for Duett in Opter

  1. Click on Economy > Invoices > Invoice export and create a new invoice export by clicking on . The following fields must be filled in on the General tab:

    • Name: For example “Duett (API)”.

    • Report: None.

    • Type: Duett API.

    • Encoding: UTF-8.

    • Password: Password (API client key) from Duett. Optionally, you can create an API client key yourself in Duett. If that is not possible, contact Duett support.

    • Start text: In this field you can enter additional settings if you want to customise the export.

      If you do not enter anything in the Start text field, the default settings will be followed, i.e:

      • If the customer on the invoice being exported does not exist in Duett, the customer is automatically created in Duett.

      • If the customer information on the invoice being exported has changed in Opter since the customer was last included in an export, Opter will update the customer information in Duett.

      • Duett handles VAT accounting automatically. This means that Duett creates accounting line(s) for VAT based on the amount and VAT code.

      Use the format "parameter=value" and write one parameter per line, as in the example below.

      Exempel, fältet Starttext
      createCustomers=false
      updateCustomers=false
      voucherAutomatedVatHandling=false
      voucherTypeDebet="100"
      voucherTypeCredit="101"
      voucherTypeSalesVat="102"

      If you do not enter a specific parameter in the Start text field, the default setting is used (see table below).

  2. If you want the Opter invoice to be attached in PDF format, select the Include PDF-copy checkbox.

    In Duett 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 Duett as a PDF file.

  3. 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.

  4. Click on to save all changes.

Step 2 (optional): Translate Opter’s VAT codes

VAT can be added to account numbers in Duett, but the VAT code for each account coding line in Opter is always included in the invoice export to Duett. By default, the VAT rate in whole percent is sent as the VAT code, for example "25".

If you need to use other VAT codes, enter the VAT codes in the translation table; see instructions below. If the VAT for the account coding row has a translation in the Invoice export window on the Codes tab, that VAT code is sent instead of the default setting that the VAT rate is sent as a whole percent as the VAT code.

To control which VAT code(s) are sent to Duett, proceed as follows:

  1. In Opter, in the Invoice export window, click on the Codes tab and select Tax rates from the drop-down list.

  2. Enter the VAT code in the Code column for the VAT rate(s) you want to influence.

  3. Click on to save all changes.

Step 3: Add the invoice export to an invoice export group

To create a new invoice export setting (i.e. group of exports) or to check if there is already an invoice export setting (group) where you want to add the invoice export to Duett, proceed as follows:

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

  2. Look in the list on the left to see if there is already an invoice export setting (group) where you want to add the invoice export to Duett. Click on that invoice export setting and select the checkbox for "Duett (API)" (or the name you gave the invoice export) under Exports.

    If there is no invoice export setting (group) where you want to add the invoice export to Duett, create a new one. Click on and give the invoice export setting a name, for example “Duett (API)”. Select the checkbox for "Duett (API)" (or the name you gave the invoice export) under Exports.

  3. Click on to save all changes.

  4. Choose which invoice export setting should be the default. To choose Duett (API) as the default, select “Duett (API)” from the list on the left and click on .

  5. To ensure that all invoices are recorded in Duett, select the “Duett (API)” export for all export settings (groups).

  6. Click on to save all changes.

  7. To set which invoice export setting (group) applies to a particular customer, click on Register > Customers and search for the customer for which the setting is to be made. Click on the Invoice information tab and select invoice export setting (group) in the Invoice export setting drop-down list. Click on to save all changes.

Step 4: Export invoices to Duett

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.

  1. In Opter, 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 to export the invoice or invoice period to Duett.

    The number of invoices to be exported and the number of invoices exported are displayed, as well as a progress bar (at the bottom of the window), are shown in the Invoice export window in Opter. When the invoice export has been completed, the entire progress bar is green.

    If the invoice export fails, the progress bar turns grey and there is a statement indicating that the export failed. If the export fails, an error message is displayed, see Error messages below.

  4. In Duett, to check that the account coding was transferred correctly, proceed as follows:

    1. As no actual invoices can be created via API calls, you have to go via the customer and see which sales ledger entries exist, and from there it is possible to review the vouchers that have been created and ensure that the account coding in Duett matches that in Opter.

      In Duett, click on (”Meny” > ”Salg” > ”Kunder” ("Menu" > "Sales" > "Customers"). On the customer for which the transactions are to be checked, right-click and select ”Transaksjonsoversikt” (Transaction overview). The “Reskontrooversikt” ("Sales Ledger Overview") window opens.

    2. Find the invoice and click on the attachment number in the “Bilagsnr” ("Attachment number") column. The “”Bilagsjournal” (“Attachment Journal") window opens.

    3. The interface is a bit limited, so we recommend doing an export from Duett to Excel, to get all the data.

    4. Check that the account coding in Duett matches that in Opter.

Troubleshooting

If the export to Duett does not work as it should, an error message is displayed. The following applies to the error messages:

  • They only appear if something goes wrong during export.

  • They are displayed in a popup window at the time of export.

  • For more detailed information, see the Windows Event Log. (In other words, look in the client's event log, as the calls are made from the client).

The error messages and suggested remedial actions are listed in the table below. Once you have rectified the problem/error, you can export the invoices again.

Could not retrieve...

Regarding all error messages starting with "Could not retrieve..." in the table below:

  • If the invoice already exists in Duett, Opter does not export that invoice to Duett (again), but instead moves on to the next invoice in the export. No duplicates are created in Duet. There is a control function for this.

  • If something goes wrong when Opter uses this check function, it displays error messages starting with "Could not retrieve...". The error messages and suggested remedial actions are listed in the table below.

Error messages

Error message

Description

Error during API call

This error message is connected to an error message from Duett. Contact the Opter support team.

It was not possible to log into Duett

Check that the correct password has been entered in the Password field (in Step 1 above).

A module is missing in Duett. Log into Duett and rectify the problem.

Add the missing module. If desired, it is possible to add the missing module to Duett yourself. If that is not possible, contact Duett support.

Incorrectly stated account number: {0}

Check the account number in Opter.

No {0} account in Duett. Check the available accounts in Duett.

The account numbers used in Opter must be available in Duett.

Could not retrieve accounts

Opter was unable to retrieve information about the accounts when Opter used the check function. For more information, see Could not retrieve... above.

Contact the Opter support team.

It was not possible to create the customer in Duett

The customer could not be created automatically in Duet. (You have the default setting createCustomers=true, see Step 1 above.)

The customer can be created manually in Duett and then the invoice can be exported again.

If you wish, you can also disable customer updates by setting createCustomers=false and updateCustomers=false (in Step 1 above), and keep the customer records in Opter and in Duett updated manually.

Could not retrieve customers

Opter was unable to retrieve information about the customer when Opter used the check function. For more information, see Could not retrieve... above.

Contact the Opter support team.

The customer {0} is not in Duett and export of customers has been disabled

You have put createCustomers=false in the Start text field (in Step 1 above).

You can do one of the following:

  • Create the customer manually in Duett and then export the invoice again.

  • Put createCustomers=true in the field Start text (or remove the line createCustomers=false from the field Start text), see Step 1 above, and then export the invoice again.

Could not retrieve customer details for {0}

Opter was unable to retrieve customer information for the stated customer when Opter used the check function. For more information, see Could not retrieve... above.

Contact the Opter support team.

Error updating customer {0}

This error message is connected to an error message from Duett. Contact the Opter support team.

The postcode {0} is not in Duett See the Postcode section above.

It was not possible to create the economic unit {0} in Duett

If the economic units used in Opter do not exist in Duett, Opter tries to create them in Duett. If you receive this error message, Opter has failed to create the economic unit in Duett.

For more information, see the Economic units section above.

Contact the Opter support team.

It was not possible create value {0} for the economic unit in Duett

Check that all the departments have a code (a value) in the Code field (in the windows Economic Units 1-Economic Units 5) in Opter.

For more information, see the Economic units section above.

Could not retrieve economic units

Opter was unable to retrieve information about the economic units when Opter used the check function. For more information, see Could not retrieve... above.

Contact the Opter support team.

It was not possible to export invoice {0} to Duett

The specified invoice could not be exported to Duett.

Contact the Opter support team.

Could not retrieve invoices

Something went wrong when Opter used the check function in terms of Opter asking Duett if the invoice with number x in period y already exists in Duett. For more information, see Could not retrieve... above.

Contact the Opter support team.

Too many calls

Contact the Opter support team.

See also