Last updated: 26.08.2024

Valid from: Opter 2024.06.00

Exporting invoices to Dinero (API)

Opter can be connected to (integrated with) Dinero, www.dinero.dk. Invoices can then be exported from Opter to Dinero.

For each invoice that is exported, a manual voucher is created in Dinero. This manual 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 manual voucher.

The following is sent to Dinero in the voucher :

  • Your corporate ID number, as it appears in Dinero, ("organizationId").

  • The invoice date, ("voucherDate").

  • The account number on the account coding row, ("accountNumber").

  • The amount on the account coding row, ("amount").

  • The VAT code of the account on the account coding row, ("accountVatCode").

  • The balancing account number that your company uses in Dinero, ("balancingAccountNumber").

  • The VAT code for the balancing account that your company uses in Dinero, ("balancingAccountVatCode").

  • A link to the attached Opter invoice in PDF format.

  • The description on the coding row, ("description"). In the description, Opter sends the invoice number, order number and invoice date.

    There is no field for invoice number in the Dinero API. Instead, Opter sends the invoice number in the API's description field and externalReference field, so that it is at least possible to see the Opter invoice number in Dinero.

  • The text "Opter Invoice" and the invoice number that the invoice has in Opter, ("externalReference").

Limitations

The Dinero API has some limitations. The following cannot be sent from Opter to Dinero in the voucher:

  • Customer code, ledger number, invoice address.

    We recommend that you keep customer information up-to-date in both Opter and Dinero.

  • Economic unit.

    We recommend that you keep information on economic units up-to-date in both Opter and Dinero.

  • Currency code and exchange rate.

    Dinero does not support invoices in other currencies. If you use Dinero as your financial system, do not use the option to select the currency of the customer in Opter.

    For more information, see Currency and currency codes and Exchange rate below.

  • Invoice number. (There is no field for invoice number in the Dinero API. Instead, Opter sends the invoice number in the API's description field and externalReference field, so that it is at least possible to see the Opter invoice number in Dinero.)

  • Payment conditions.

  • And more.

Each time you export, a new manual voucher is created for each invoice in Dinero.

If you have accidentally exported the same invoice several times, you can remove the duplicates in Dinero, but there are rules that you have to take into consideration, especially if they have been registered in the accounts. More information is available here: https://dinero.dk/support/slet-bilag/

If you export an invoice period and it goes wrong somewhere in the middle of the export, you must check carefully which invoices have been exported to Dinero, and then make sure to export only the remaining invoices.

Conditions

Currency and currency codes

In Dinero, the currency is selected in the invoice settings. The currency chosen there will be used on the manual voucher sent to Dinero for each invoice in the invoice export.

Currency codes (for example "DKK", "SEK" and "EUR") are not sent in the manual voucher sent to Dinero.

Exchange rate

It is important to always have exactly the same exchange rates in Dinero 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.

Set exactly the same exchange rates in Dinero and Opter. When updating an exchange rate, change the exchange rate at the same time in both Dinero and Opter.

  • In Opter, exchange rates are set under Economy > Currencies, on the Currency rates tab.

  • In Dinero, it can be seen in the invoice settings which exchange rate is being used in Dinero.

Account number

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

OCR number

The OCR numbers in Opter are not sent in the manual voucher sent to Dinero.

Step 1: Create an API user account in Visma Connect

If you have any questions or need help getting started, contact to make an appointment with an installation expert.

In order to be able to export invoices to Dinero via API, the following information is required (which is then entered in Opter in Step 2: Create an invoice export in Opter below):

  • "Client_id" (user ID) for the API user account.

  • "Client_secret" (the API key) for the API user account.

  • "Redirect URI" (the "Redirect URI" is the location to which the user will be redirected after successfully logging into the Dinero API. So you need a web server to which you can send the data generated by authentication).

Follow the instructions at https://developer.dinero.dk/documentation/getting-started/. If you have any questions, please contact Visma Connect or Dinero for support.

To connect to the Dinero API, you have to go through Visma Connect and do an OAUTH2 authentication.

Step 2: Create an invoice export in Opter

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, "Dinero (API)".
  • Type: Dinero API.
  • Encoding: UTF-8.
  • User id: “Client_id” for the API user account created in Step 1: Create an API user account in Visma Connect above.
  • Password: “Client_secret” (the API key) for the API user account created in Step 1: Create an API user account in Visma Connect above.
  • Office code: Your corporate ID number ("organizationId") as stated in Dinero, so that it can be matched when exporting invoices.
  • Start text: In this field, enter the following:

    Enter each setting on a separate line, as shown in the example below.

    Example, "redirect URI" and balance account in the Start text field
    RedirectUri=http://localhost:44303
    BalancingAccountNumber=55000

Step 3: Translate Opter’s VAT codes

In the manual voucher sent to Dinero, each account coding row is sent with the account number and VAT code. The account numbers used in Opter must exist in Dinero and each account must have the same VAT code in both systems.

In Dinero, the VAT codes (VAT rates) are under “Indstillinger” -> ”Momssatser” ("Settings" -> "VAT rates").

The VAT codes (VAT rates) in Opter must therefore be translated into the VAT codes used in Dinero. 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 Dinero VAT codes in the Code column for each of the VAT rates available in Opter.

  3. 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 “Dinero API”). Select “Dinero API" (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 choose Dinero API as the default, select “Dinero API” from the list on the left and click on .

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

  6. Click on to save all changes.

Step 5: Export invoices to Dinero

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

    A browser opens. Log in with your Visma Connect account.

    The following is displayed:

  4. Click on "Accept" (to accept that the integration linked to Dinero in Visma Connect should be authorised to send data to Dinero. You must have this or it will not be possible to export to Dinero).

    After clicking on "Accept", the export to Dinero starts.

    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.

Each time you export, a new manual voucher is created for each invoice in Dinero.

If you have accidentally exported the same invoice several times, you can remove the duplicates in Dinero, but there are rules that you have to take into consideration, especially if they have been registered in the accounts. More information is available here: https://dinero.dk/support/slet-bilag/

If you export an invoice period and it goes wrong somewhere in the middle of the export, you must check carefully which invoices have been exported to Dinero, and then make sure to export only the remaining invoices.

The following happens when invoices are exported to Dinero:

  • Before Opter exports the invoices, it checks all the accounts on the account coding rows for all invoices. For details, see Detailed description of the invoice export below.

  • In Dinero 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. The graphic invoice is therefore created in Opter with all the details, and sent automatically to Dinero as a PDF file.

  • The invoices that have been exported to Dinero cam be found in Dinero by clicking on “Bogföring” ("Accounting") and then on “Bilagsarkiv” ("Invoice archive").

    The graphic invoice (which was sent as a PDF file) is shown on the left. The manual voucher created for the invoice is shown on the right.

  • If the export to Dinero does not work, an error message is displayed, see Error messages below.

Troubleshooting

Detailed description of the invoice export

The following happens (automatically) when invoices are exported to Dinero:

  1. Opter checks that there is a "BalancingAccountNumber" specified in the Start text field in the Invoice export window. (See Step 2: Create an invoice export in Opter above).

    If it is not there, the No balancing account entered. error message is displayed.

  2. Opter checks that the "BalancingAccountNumber" entered in the Start text field exists in Dinero.

    If it does not exist, the The stated balancing account ({0}) does not exist in Dinero. error message is displayed. The "BalancingAccountNumber" entered in the Start text field is displayed in the error message within the "{ }" brackets.

  3. Opter checks that the accounts on the account coding rows are entered correctly.

    If they are entered incorrectly, the Incorrectly entered account number. Check available accounts in Dinero. error message is displayed

    (For example, you may have mixed letters and numbers, "xx (2000)" or similar, in the account numbers in Opter).

  4. Opter checks that the accounts on the account coding rows exist in Dinero.

    If an account does not exist in Dinero, the No account in Dinero. Check available accounts in Dinero. error message is displayed

  5. Opter retrieves invoice data from the Opter database (for the invoices that are to be exported).

    If this does not work, the Error loading invoice data error message is displayed.

  6. Opter creates a PDF file of the graphic invoice with all the details in Opter.

    If the PDF file is larger than 6 MB, Opter will try to reduce the size of the file. (The PDF file is attached to the manual voucher that is created for the invoice. Attached files must not exceed 6 MB).

  7. Opter uploads the PDF file to Dinero.

    If that does not work, an error message from the API is displayed. Error messages from the API are available here: https://developer.dinero.dk/documentation/error-and-status/.

  8. Opter creates a manual voucher for each invoice being exported. This manual voucher contains the account coding that is transferred.

  9. Opter attaches the PDF file (with the graphic invoice) to this manual voucher.

  10. The manual voucher is booked in Dinero.

    It is only after Opter has booked a manual voucher in Dinero that this manual voucher has any impact on the accounting in Dinero.

Error messages

If the export to Dinero 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.

Error message Description

Failed to log into Dinero. Check the user details.

It was not possible to log into Dinero. Make sure you enter the correct email address and password.

Contact Visma Connect or Dinero for support.

The user could not be authorised by Visma Connect.

Make sure you enter the correct email address and password.

Contact Visma Connect or Dinero for support.

No balancing account entered.

There is no "BalancingAccountNumber" specified in the Start text field in the Invoice export window. (See Step 2: Create an invoice export in Opter above).

The stated balancing account ({0}) does not exist in Dinero.

The "BalancingAccountNumber" entered in the Start text field does not exist in Dinero. (See Step 2: Create an invoice export in Opter above).

The "BalancingAccountNumber" entered in the Start text field is displayed in the error message within the "{ }" brackets.

Incorrectly entered account number. Check available accounts in Dinero.

The account on the account coding row is not specified correctly in Opter. For example, letters and numbers may have been mixed, "xx (2000)" or similar.

 

No account in Dinero. Check available accounts in Dinero.

The accounts on the account coding rows do not exist in Dinero.

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

 

Error loading invoice data

Something goes wrong when Opter tries to retrieve invoice data from the Opter database (for the invoices that are to be exported).

Error during API call

Opter receives an error message from the Dinero API and displays it. The various error messages that can be received are listed here: https://developer.dinero.dk/documentation/error-and-status/.


Ask a deployment consultant for assistance

If you have any questions or need help getting started, contact to make an appointment with an installation expert.