Xero Server Response is Empty
This message comes from Xero itself and Xeroom feeds it back to the user and logs it on the Xeroom debug log page. Usually means a timeout has happened in Xero for data to be returned from the endpoint. This might happen with a Bulk Send of too many invoices. It can occur if your server execution time limit is set too low.
Xero will process data at a certain rate and at busy times implements a strict API call rate limit. Xeroom has a setting to throttle back the rate of sending to avoid this from happening - see below, which also explains why the Bulk Send is so slow.
Large order process limits - Xero has limits on the no of API calls that can be made in a rolling minute (60) and total per day (5000) see https://developer.xero.com/faq/limits. We have rewritten the order posting process to be far more efficient and tested it with a 120 item order. This posted in under 5 seconds with inventory adjustments and took 5 API calls so the Xero limit will be 12 order/min and if this rate is exceeded the server response is empty message will show. To avoid this reduce the no of orders sent in a batch to 12.
We also tested it by posting 20 orders of 120 items each in 4 minutes using the Bulk Send which should be more than sufficient for any WooCommerce store. This was released in version 2.6.7 in May 2023. Versions prior to that will have issues so please upgrade.
Too many orders in the Batch Send - Ensure that the no of orders on the batch size setting in Xeroom is set to a max of 12. Xeroom then breaks the batch up into chunks of 12 orders to send to Xero so that Xero doesn't hit the API rate limits as described above.
Max execution server time limits - You can try changing the execution time to 300 seconds as it is often set by hosts to default to 60 seconds which is way too low. ie php max_execution_time = 300 since 60 seconds is not long enough for Xero to process large orders either singularly or in batches of smaller orders. This setting will restrict any processes or cron jobs from running longer than 60 seconds which will cause the order send to fail leading to this error message.
Host shared server limitation - Some hosts like WP Engine will restrict this setting if you are on a shared server. This is more serious as we cannot do anything about it and the solution is to move from a cheaper shared host to a dedicated host server where you don't suffer from such limitations.
Missing critical data - Another cause is if some critical data is missing from the order eg an SKU is blank, that is causing the order to retry and timeout and fail. The Xeroom debug screen should provide details of this.
Server Memory - Also check that you have a decent amount of memory on the server ie at least 768 M as large orders will require more to prevent them freezing. Again shared servers will restrict the amount of memory by default which is an obvious cause - you can check it with a php info plugin or on your server or host settings.
Decouple the Sending from the Checkout - If you find that this error is only occurring during the checkout process but not when you send it from the WooCommerce order back-end then Xeroom Version 2.6.4 contains an option to decouple the order sending process from the checkout time.
You just need to tick this box and Xeroom will not send the invoice during checkout preventing delays for the user who is checking out but will send it within the next 5 minutes as a cron job (so make sure that WP Cron is not disabled for any reason). If it fails then it will try again after 5 minutes and repeatedly until 5 attempts are made after which it will stop trying. Run a few large test orders to ensure this is working correctly.
Contact Xero support - If no errors are showing for Xeroom in the WC debug log then ask Xero if they can check their logs giving them the failed order no(s) as they have more visibility to the causes of this error.
Still no joy? - Please open a ticket and send us the following info in order to help you:
1. An estimate of how many orders are failing as a % of the total being sent.
2. Order nos for 2 or 3 of the failed orders.
3. A copy of the Xeroom debug screen.
3. Logins to your system - We need an admin login to your website and a standard business user invite to your Xero account using our [email protected] email.
4. Details of the results of trying the above suggestions.