Last updated: 2025-03-07

Expert: David Magnusson-Rosén

Invoice export to Procountor (API)

Applies to Opter 2024.12.20 and later.

You can connect (integrate) Opter with the Procountor financial system. After that, you can export invoices from Opter to Procountor via API. More information about Procountor is available at https://procountor.fi, in Swedish https://procountor.se/ and in English https://procountor.fi/en/.

When you export an invoice from Opter to Procountor, the following happens:

  • The invoices are exported as "account assignment products", i.e. it is the account assignment that is transferred.

    If you wish, the graphical Opter invoice with all the details can be attached as a PDF file. (You make the setting in Step 2 below.)

  • Customer information is exported and updated in Procountor.

Conditions

Performance units and dimensions

What is called a "profit centre" in Opter is called a "dimension" in Procountor. When exporting invoices (posting products), the name of the profit centre in Opter is matched with the name of the dimension in Procountor.

Check:

  • all profit centres you use in Opter are available as dimensions in Procountor. (It is not possible to create new dimensions in Procountor via API calls.)

  • that you use the same names for the profit centres in Opter as the dimensions in Procountor.

In Opter, you can see your profit centres and their names in the office settings on the Economy tab.

If you add a new department or group under a profit centre in Opter, the new department or group will be created automatically in Procountor during invoice export, (if the new department or group is included in any coding product).

Account number

The account numbers used in Opter must exist in Procountor.

Invoice number and invoice number series

Procountor accepts invoice numbers from Opter. We recommend that you make sure that the numbers of invoices created in Opter do not clash with the numbers of any invoices created directly in Procountor. You can solve this by using different invoice number series in Opter and Procountor.

Currency codes

Procountor uses the same currency codes as Opter.

Customer number

Please check that all Opter customers have a customer number in the Sales ledger number field on the General tab of the customer register.

When exporting invoices, the customer number is also sent to Procountor. If there is no number in the Sales ledger number field, you will receive an error message when exporting.

(Customer code is available in Opter, but not in Procountor.)

Customer’s bank

The code of the customer's bank must be entered in the EDI code field in the Opter customer register, on the Details tab. Please check that the EDI code field contains the correct information for all your customers. For more information, see the table below and https://support.procountor.fi/.

Product group "OpterGroup"

Customer number

Please check that all Opter customers have a customer number in the Sales ledger number field on the General tab of the customer register.

When exporting invoices, the customer number is also sent to Procountor. If there is no number in the Sales ledger number field, you will receive an error message when exporting.

(Customer code is available in Opter, but not in Procountor.)

Limitations

Procountor integration for different markets

The integration is only tested for the Finnish market. However, we at Opter can customise the integration for all Procountor markets. If you want to be able to use Procountor for a market other than Finland, please contact Opter support.

footbridge : Create a user and an API key in Procountor

In order to export invoices to Procountor, you first need to create a so-called m2m user ("machine to machine" user). The M2m user needs to have rights as shown in the table below, and an API key associated with it. You will not need any personal login details to export invoices to Procountor.

To be able to export invoices to Procountor, proceed as follows:

  1. In Procountor, create an m2m user. See "Create new user" (under "Users and users rights" > "Adding and removing a user"), https://support.procountor.fi/hc/en-us/articles/360000252297-Adding-and-removing-a-user#CREATENEWUSER.

    If you need help creating the m2m user, giving it rights and an API key, please contact Procountor support.

  2. In Procountor, make sure that the m2m user has all the rights according to the table below.

    To set up user rights in Procountor, see "Users and user rights", https://support.procountor.fi/hc/en-us/articles/10142366663580-Users-and-user-rights.

    Designation

    Level of rights

    basicAccountingInfo

    ALL_RIGHTS

    importData

    ALL_RIGHTS

    editPersonalInfo

    ALL_RIGHTS

    salesOrGroupInvoices

    ALL_RIGHTS

    salesInvoiceSearch

    ALL_RIGHTS

    customerRegister

    ALL_RIGHTS

    productRegister

    ALL_RIGHTS

    verification

    ALL_RIGHTS

    approval

    ALL_RIGHTS

    journalReceipts

    ALL_RIGHTS

    journalReceiptSearch

    ALL_RIGHTS

  3. In Procountor, create an API key ("API key"). See "Creating an API Key using Procountor UI", https://dev.procountor.com/m2m-authentication/#creating an api key using procountor ui.

    (You then copy and paste the API key into Opter in the step below.)

  4. Save all changes in Procountor.

footbridge : Create an invoice export

  1. 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 "Procountor (API)".

    • Report: None.

    • Type: Procountor API.

    • Encoding: UTF-8.

    • Password: Here you enter the API key you created in Procountor in the step above.

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

    Attach the Opter invoice if you want all the details of the transport to be included in Procountor, such as the order's sender, recipient, distance, weight and consignment note number.

    If the PDF file cannot be attached to the invoice during export, a warning will appear (see Error messages below). However, this does not stop the creation of the invoice in Procountor.

  3. To reduce the size of the PDF file, select Reduce PDF file size.

    The file size is reduced by deleting all text formatting (bold, italic, underlined) and by changing the font to one that 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.

footbridge : Translate Opter’s VAT codes

Invoices are exported from Opter to Procountor as "posting products". In Procountor, "VAT status" is set on each accounting product.

In order to create correct posting products, Opter needs to know which VAT status code to use for each VAT rate in Opter. For example, 'VAT status code' = 'vat_1' should be used for the VAT rate of 25,5 %.

Descriptions and the most common codes ("VAT status codes") can be found at https://support.procountor.fi/hc/en-us/articles/360000240818-VAT-defaults. If you want to see a complete list of all the codes, see the Procountor user interface, search in English "VAT defaults" or in Finnish "ALV-oletukset".

In order for Opter to know which "VAT status code" to use for each VAT rate in Opter, proceed as follows:

  1. In Opter, click on Economy > Invoices > Invoice export.

  2. In the Invoice export window, select "Procountor (API)" in the list on the left.

    Click on the Codes tab and select Tax rates from the drop-down menu.

  3. Enter the "VAT status code" in the column Code for the VAT rate(s) you use. See example in the image below.

  4. Click on to save all changes.

footbridge : 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 Procountor, do as follows:

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

  2. Look in the list on the left if there is already an invoice export setting (group) where you want to add the Procountor export. Click on that invoice export setting and tick the checkbox for "Procountor (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 Procountor export, create a new one. Click on and give the invoice export setting a name, for example "Procountor (API)". Select the checkbox for "Procountor (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 select Procountor (API) as default, select "Procountor (API)" in the list on the left and click on .

  5. To ensure that all invoices are posted in Procountor, tick the "Procountor (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.

footbridge : Exporting invoices to Procountor

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.

Procountor does not have invoicing periods, but the invoice date in Opter must fall within an open financial year in Procountor.

Proceed as follows:

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

    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 failed, an error message is displayed, see Troubleshooting below.

Troubleshooting

If the export to Procountor does not work properly, 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 pop-up window in Opter 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.

Error messages

Error message

Description

Error during API call

This error message is linked to an error message from Procountor. Contact the Opter support team.

The user credentials were not accepted by Procountor

Make sure you have entered the API key from Procountor in the Password field, (see Step 1 and Step 2 above).

Check that the m2m user you created has all the rights shown in the table in Step 1 above.

The product group {0} does not exist/could not be created in Procountor

For more information, see Product Group "OpterGroup" above.

Contact the Opter support team.

Incorrectly stated account number: {0}

Check the account number in Opter.

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

The account numbers used in Opter must exist in Procountor.

Could not retrieve accounts from Procountor

Contact the Opter support team.

The dimensions {0} do not exist in Procountor

What is called a "profit centre" in Opter is called a "dimension" in Procountor. For more information, see Result units and dimensions above.

Could not retrieve account coding for invoice {0} from Procountor

Opter could not retrieve the posting for the invoice that Opter exported.

Contact the Opter support team.

Could not update account coding for invoice {0} in Procountor

Contact the Opter support team.

The period for date {0} does not exist or is closed in Procountor

Procountor does not have invoicing periods, but the invoice date in Opter must fall within an open financial year in Procountor.

The customer {0} could not be created in Procountor (customer code: {1}, customer no.: {2})

You can try creating the customer manually in Procountor. It is important that the customer number matches the one already in Opter, see Customer number above.

You can then try to export the invoice again.

The customer {0} could not be updated in Procountor (customer code: {1}, customer no.: {2})

You can try updating customer information manually in Procountor. It is important that the customer number matches the one already in Opter, see Customer number above.

You can then try to export the invoice again.

Customer number missing in Opter for customer: {0} (customer code: {1}, customer no: {2})

See Customer number above.

You can then try to export the invoice again.

Error when uploading PDF file to Procountor

This error message is a warning, but it does not stop the creation of the invoice in Procountor.

The Opter invoice in PDF format could not be attached to the invoice in Procountor. This may be because the PDF file is too large, for example.

You can manually add the PDF file (Opter invoice) to the invoice in Procountor.

If you haven't already ticked the Reduce PDF file size checkbox, you can see if it helps next time it's time to export invoices. (See Step 2: Create an invoice export above).

If you do not want the Opter invoice attached to the export, untick the checkbox Include PDF-copy, (see Step 2: Create an invoice export above).

Too many calls

Contact the Opter support team.

See also