Closed ESPSolutions closed 7 months ago
Actually, is there a reason the success response in general is different between types? Why is "success" not true for an actual success with "Messages" not populated with "Invoice created successfully."?
Thanks for your work.
I see the point regarding the casing, and have logged that as a bug. Thanks.
But there is only ever one success message (string), and multiple error messages (array) - to truly make it consistent we would need to return the single success as an array that only ever contained one element.
We will look at standardising this in a future version of the APIs.
Thank you for your prompt response.
If a post into TASS is successful the JSON returned will be something like {"success":"Invoice created successfully.","vouch_code":"11111","__invalid":null} whilst the failure will be {"Response":{"Success":false},"Messages":[{"Text":"The invoice amount exceeds the credit amount available. Balance remaining is $5000."}]}. As you can see, the success key is "success" for one version and "Success" for another. For most applications that we use, "success" != "Success" so we have to check for both keys to consolidated the JSON response from the TASS server.
Since all of the keys that I can think of from the top of my head are capitalised I am assuming that the lowercase variety is a simple oversight.
Thanks.