API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

How to get "FI-adviserings"-ID from Girokort-Invoices?

Hi E-conomic

There is no security mechanism in the function in E-conomic that imports from the Netbank (FI-adviseringer), so bookkeepers can by misstake imported the same Girokort-payments double (or more). The import could easily stop bookkeepers from doing this by making some checks before importing.

So we would like to create our own registration of girokort-payments. Our bank will soon give us a kind of API to our Netbank, so now I can extract the girokort-payments direkctly from our bankaccount. The system that will do this will automatically run the girokort-payment registration rutine.

Now I just need to know how to get the "FI-adviserings"-ID from the Girokort-Invoice so I can match the value from the netbank (something like: 000000000123406") with the value from the girokort-invoice.

I am missing a API function like: "Invoice_GetFIAdviseringsID($InvoiceNumber)"

Can you help?
created Dec 17, 2014 by Jens Kirk
14% Accept Rate

edited Dec 17, 2014 by Jens Kirk
Q 15 A 9 C 7

1 Answer

Best answer
Hi Jens

In case you use our system to generate the invoice, then the FI ID will be the same as the invoice number except that we add an identifier and a checksum as the last two digits for the FI ID.
You can read more about it on the e-copedia (in danish): http://wiki.e-conomic.dk/design-og-layout/ocr-linje

Please note that it differs from country to country how many digits are added. Sweden gets 3, DK gets 2.
answered Dec 17, 2014 by olej
selected Jan 7, 2015 by Jens Kirk
But how to I get the 2 last digits from an existing girokort-invoice?
That functionality isn't exposed via API. But I think we'd love to do it at some point.
Until then you'll have to calculate it yourself.

Danish OCR
The second to last digit is an indicator of whether this is an invoice (0) or a reminder/debtor (3).

The last digit (Checkciffer / control digit) is calculated as described at point 3.3.3 in this PDF which describes the official way to calculate it for DK:

Invoice #23

x 2,1,2 (weighting)
(If result is 10 or greater we do (1 + (X % 10)))
= 4,3,0
4+3+0= 7
Mod 10 of 7 = 7
10 - 7 = 3

Control digit for invoice 23 = 3
OCR for invoice 23 = 000000000002303

For the Swedish OCR line we add an extra control digit to the mix:
Invoicenumber + Identifier digit + e-conomic control digit + control digit
The e-conomic control digit is the length of the resulting OCR number excluding leading zeroes.
The swedish control digit is calculated in the same way as the danish.
Visma e-conomic A/S