I'm using the Xero API to post multiple invoices to Xero.
This works fine if all the invoices are valid. I get a HTTP 200 response with the GUIDs of the newly created invoices.
However, if one of the invoices has an error I get a BadRequest response with a ValidationException.
I would expect the xero system to work transactionally, and if any of the invoices have a validation error, then none of them would be created. However, what I'm observing is that the valid invoices from my request are still created in the system, even when there is an invalid one present in the request.
The problem is that the response from the Xero API just has the details of the validation error. Nowhere in the response do I get the details of the newly created valid invoices. So I have no way of knowing what the GUIDs of those new invoices are.
Has anyone else experienced a problem like this, and how did they overcome it?
I am reluctant to send the invoices individually as their own guidance recommends posting multiple entities at once to avoid exceeding the rate limits of the API.