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

Keys are of different types

I noticed something when making a data warehouse from the e-conomic data. This seems to be somewhat general. (Please note im using C# and the .NET API)

Take the Debtor table and the Number property is of the data type int, now go to the Invoice table and take the debtor foreign key (it points to the before mentioned Number property on the debtor entity) - this datatype is string.

Can i treat the foreign key as an integer (always the same type as the primary key) or is there a particular reason for keys not being of same data type?
created May 24, 2012 by brian0905
0% Accept Rate
Q 4 A 3 C 0

1 Answer

Hi Brian,

Debtor.Number is most certainly also a string.

You should treat it as a string, type-wise - the reason it's a string, even if we don't allow anything except positive integers, is to avoid introducing a breaking change in case we allow alphanumeric debtor numbers at some point in the future (for which there are no immediate plans, though).

In other words: Type-wise, it's a string - content-wise, we currently validate it to be a positive integer.

Best regards,
answered May 24, 2012 by Christian Estrup
Visma e-conomic A/S