1

In my Laravel/VueJS system I have a routine that i called to create invoices from our system into Xero.

I've a two fold issue, one is that when I have 300+ invoices, I get a 504 timeout error BUT all the invoices seem to transfer and are created.

The second is that I sometimes get a Xero API timeout as I've called it too many times in a 60 second period.

What I do at the moment is:-

Read my invoices
Create a new invoice
Call Xero and find the contacts ContactID from Xero
Pause a second
Add all the data to the new invoice
Save the new invoice to Xero
Wait a second
Repeat until the end

But, is there a way I can do the following:-

Read my invoices
Create a new invoice
Call Xero and find the contacts ContactID from Xero
Pause a second
Add all the data to the new invoice
Wait a second
Repeat until the end
Save all the invoices to Xero

Therefore, is it possible to create a variable called $batchInvoices, store each invoice in that variable, then push $batchInvoices to Xero?

Any help would be gratefully appreciated.

Carl.

Carl Ogden
  • 45
  • 6
  • You can send multiple invoices to Xero in a single go, yes. I seem to recall that there was a suggested limit of maybe 100 at a time, but this page doesn't seem to mention it: https://developer.xero.com/documentation/api/accounting/requests-and-responses#http-post-and-put – droopsnoot Feb 03 '22 at 18:09
  • Actually, it's somewhere else : "For example, you can create more than one Invoice in a single PUT or POST Invoices API call. While there is no upper limit in the number of nodes that can be sent at one time, a ceiling of about 50 nodes per request is practical - this will ensure a request does not exceed the maximum size of 3.5MB." That's from https://developer.xero.com/documentation/guides/oauth2/limits/#api-rate-limits – droopsnoot Feb 03 '22 at 18:11

0 Answers0