In the following, errors that occur when calling ValidateDocument and their causes are described.
Code 422
Error: Unprocessable Entity
{
"StatusCode":422,
"Message":"Value cannot be null. (Parameter 'document')"
}
Possible causes:
Field types (e.g. enumeration fields) were filled incorrectly:
Example:
wrong:
"AutomaticVatCalculation": "true",
"DocumentType": "[0] = Receipt",
correct:
"AutomaticVatCalculation": 0,
"DocumentType": 0,
or:
"AutomaticVatCalculation": true,
"DocumentType": 0,
Comments
5 comments
Hi, I'm confused by the example in the article. As shown in the text, the value of the enumeration type field can only use the int type instead of the string type. However, when I tested using the endpoint provided by swagger, I found that when using the string type, the enumeration field can be used normally. Will enum fields drop support for string values in the future?
In addition, is the validity period of Transactions created after createDocument permanent? This is very helpful for me to solve the error message about "Tse connection error".
Hello Wu Cheng,
in some cases the enumeration field can be used "normally" and we will not stop supporting it in this way. The article should only point out, that in some cases (like "AutomaticVatCalculation": "true") will lead to validation errors.
Regarding createDocument, please note the following article: https://support.retailforce.cloud/hc/en-gb/articles/13963743474449-GET-api-v1-management-germany-clientId-tse-listTransactions
Especially in Germany, closing transactions, previously started with createDocument is very important, as open (not stored transactions) will be (permanently) kept open and this will show up in the DSFinV-K and TAR data of the TSE.
Hi, Harald. Thanks for your answer, it was very helpful for me.
I also have a question about the German Daily Closing. I use the cashpointClose operation for the daily closing, and then use lastClosing to query the time of the last operation. However, when testing multiple daily closing in one day, sometimes the returned status code is 204, and sometimes the returned body is the operation time of the earlier. I'm wondering if this is the reason I'm testing the daily closing multiple times in one day, and secondly can I use closingNecessary to tell if a daily closing is necessary?
Looking forward to your answer!
Hi Wu Cheng,
basically, a closing operation (daily- or shift closing) should be done only once per day / shift (= Z-report).
If you would like to do intermediarry closings (cash register balances or -checks) please create a X-report (cashpointCheck).
Regarding closingNexessayr, please refer to the Object Model Documentation (e.g. of the current Release 1.7.1: https://www.retailforce.cloud/downloads/Version%201.7.1/Object%20model%20documentation/Object%20model%20documentation.pdf). Please search for "closingNecessary".
Thanks for your time!
Please sign in to leave a comment.