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 payment reference id for the invoice


I can see payment reference id in exported PDF invoice for one of the customer using my export service.

I tried to find payment reference id in "InvoiceData" class but i can not find.

Is there any way i can get payment reference id for the invoice?
created Apr 16, 2016 by dapa
13% Accept Rate
Q 25 A 0 C 8

1 Answer


That would be DebtorEntry_FindByInvoiceNumber.
Which gives you the handle for the DebtorEntry. You need to feed that to DebtorEntry_GetData (or DebtorEntry_GetDataArray if you need to get more than one).

answered Apr 18, 2016 by olej
But i could not get that payment reference no in this object that is available in PDF

See image for what i am getting..

See pdf image, i am looking for this payment reference no(36 24108) from invoice no (36241)
Ahh. Now it makes sense; viitenumero is the OCR number.

"36 24108" = "36241" (invoice number) + "0" (e-conomic OCR uses 0 to define it as an invoice) +  "8" (modulus 10 checksum digit)

is there any way to get this "36 24108" entire string from API?
Or how i can manually make this string. what is the logic for finding  "8" (modulus 10 checksum digit)
Modulus: https://en.wikipedia.org/wiki/Luhn_algorithm

Mod 10(3624108):
3 + 3 (example info: 2x6=12=1+2=3) + 2 + 8 + 1 + 0 = 17 = 1+7 = 8

OCR strings are not exposed via API.
You could for instance view the source code on http://www.viitenumero.fi to learn how they do the checksum calculation.

I've written a how-to for DK and SE OCR here:
Visma e-conomic A/S