tripletex-api2
tripletex-api2 copied to clipboard
POST /ledger/voucher requires posting account name
Posting a voucher fails if account name is not specified, which is excessive. Supplying an empty string works but seems hacky.
You should only need to specify the account on the Posting by giving the ID, account name is not needed. For instance like this:
"account" : { "id": "195547511" }
Not specifying the name fails. Swagger clearly states the name is required
Well, it works for us (just testet it now), and this is the recommended way of doing it.
Name and number is required if you want to Post or Put the account object itself, but not when you are just referring to an account on a Posting.
The HTTP status code of the response was not expected (422). Status: 422 Response: { "status" : 422, "code" : 18000, "message" : "Validering feilet.", "link" : "https://tripletex.no/v2-docs/", "developerMessage" : null, "validationMessages" : [ { "field" : "postings.account.name", "message" : "Kan ikke være null.", "path" : "postings[0].account.name", "rootId" : null } ], "requestId" : "309af8e5-61d1-424d-b4a2-d34993e7611d" } Kan ikke være null. The HTTP status code of the response was not expected (422). Status: 422 Response: { "status" : 422, "code" : 18000, "message" : "Validering feilet.", "link" : "https://tripletex.no/v2-docs/", "developerMessage" : null, "validationMessages" : [ { "field" : "postings.account.name", "message" : "Kan ikke være null.", "path" : "postings[0].account.name", "rootId" : null } ], "requestId" : "309af8e5-61d1-424d-b4a2-d34993e7611d" } Kan ikke være null.
this is the erro i got couple of days ago. worked around it with setting blank value on accountname.
also we got suddenly issuews with currency factor. even though i am supplying all the amounts
The HTTP status code of the response was not expected (422). Status: 422 Response: { "status" : 422, "code" : 18000, "message" : "Validering feilet.", "link" : "https://tripletex.no/v2-docs/", "developerMessage" : "VALIDATION_ERROR", "validationMessages" : [ { "field" : "", "message" : "Ugyldig valuta", "path" : null, "rootId" : null } ], "requestId" : "3e2a59d5-c1f6-4696-bd6d-a0f5cd3625d8" } Ugyldig valuta The HTTP status code of the response was not expected (422). Status: 422 Response: { "status" : 422, "code" : 18000, "message" : "Validering feilet.", "link" : "https://tripletex.no/v2-docs/", "developerMessage" : "VALIDATION_ERROR", "validationMessages" : [ { "field" : "", "message" : "Ugyldig valuta", "path" : null, "rootId" : null } ], "requestId" : "3e2a59d5-c1f6-4696-bd6d-a0f5cd3625d8" } Ugyldig valuta
maybe somone did a bleep and reverted it fast. but this was indeed my message a 2 days ago
There has been no changes deployed or reverted here.
Have you tried to specify the account the way I showed above?
The second error message indicates that you are specifiying a currency ID that is not actually a legal currency ID.
These are not errors that we can reproduce, but if you can post the JSON that you are posting, then we can look more into it
what happens if the client generated adds the name field but with null values ?
Yep that was it. the new client didnt strip all null values, and your backend didnt like that :)
and the currency error message was the wrong one i pasted. but i asume the one i got about factor also is related to bunch of null fields being sent