Closed ehannes closed 2 years ago
There's a branch with a test for this: https://github.com/accodeing/fortnox-api/tree/fix-214-sales-account
Fortnox... really?
If I create a Customer
with the JSON payload below, with SalesAccount
as a string just like the documentation tells me to
{"Customer":{"Name":"Customer with Sales Account","SalesAccount":"3001"}}
You return this:
{"Customer":{"@url":"https:\/\/api.fortnox.se\/3\/customers\/242",..., SalesAccount":3001}}
Why have you converted the string to an integer? You just told me through the documentation that this value, strangely enough, is a string! But then, when I fetch the same Customer I just created:
{"Customer": "@url":"https:\/\/api.fortnox.se\/3\/customers\/242", ..., "SalesAccount":"3001"}}
you give me SalesAccount
as a ... string :tired_face:
Apparently,
SalesAccount
attribute onCustomer
is a string, not an integer as theNumber
attribute inAccount
is.According to the Fortnox documentation, in [ 1000 .. 9999 ]". So Fortnox has different data types for "the same thing" on different endpoints :weary:
Customer
aSales Account
is a "string 4 characters", but inAccount
theNumer
attribute is an "integerWe are currently using the same implementation for validating both these attributes, but that's not a correct implementation. We get this error:
This is how the attribute is defined now, which is obviously wrong: