Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

Invoice resource not found when getting with comma list of IDs

Started by Wes DeBoer -   in API Endpoints

If I try to receive a list of all invoice by passing in their IDs as a comma separated list and one of those IDs is not found the whole endpoint returns a resource not found. Is there a way to get back the matching items?

GET https://.../Invoices?IDs=123,456,789

if 123 and 456 are found but 789 is not found, the entire endpoint is not found, I'd like to receive invoices 123 and 456.
Hi Wes

I could not replicate this issue.
I just tried this specifying 5 InvoiceIDs with a couple of dummy ones and the call still returned 3 invoices that do exist.

Would you be able to provide details of your application so we can check its logs to investigate?


Welli Abdullah (Xero Staff)  

I'm no longer getting the same results, I am receiving a Bad Request because it is a malformed ID, with well formed IDs it works as you describe. I'll investigate further.

Wes DeBoer  

I'm running into this problem. I have a webhook setup on Invoices. When I receive the webhook I iterate through the list of events and push the resourceID of any event type "UPDATE" into an array. I then call getInvoices as I need to inspect the payments associated with each invoice and take some action if they have been paid.

It generally works however occasionally (usually after doing a lot of reconciliation) it fails and my logs show it throwing this error where the body is just "The resource you're looking for cannot be found"

I also log all the resource IDs and I've used the api previewer to call get invoices for each resourceID individually and they are all valid and work correctly when called individually?

I had previously switched to calling them individually in my app to get around this problem but then occasionally hit a rate limit issue :-(

Tim Diacon