To set up the connection between your WooCommerce store and Xero account, there are two steps:
Go to the Xero Developer portal My Apps ( you may need to log in using your xero.com credentials ) section and click on the “New app” button:
Upon logging and clicking the “New app” button you will be presented with the following screen:
Fill in the form:
When everything is ready create your app ( Create App button ). You will be taken to the next screen:
Your Xero application is now created. Don’t close this page yet you will need it for the next step.
You should now see that the “Sign in with Xero” button is now Active:
Once you click the button you will be taken to the login.xero.com site where you will be asked to grant access for your application:
On the next screen, you will be informed about the scope of required permissions and asked to accept. If you have more than one organization defined in Xero portal you will be able to choose which one you want to connect to:
After clicking connect you will be taken back to the WooCommerce Xero page that will confirm the status of the connection.
You are now connected and may continue with the rest of the setup.
Invoices and payments sent to Xero need to be associated with account codes in your company’s Chart of Accounts. This is a required part of setup. Find the Chart of Accounts via Accounting > Chart of Accounts or Accounting > Advanced in your Xero dashboard:
Xero provides a standard set of account codes that you can modify as necessary (default codes will vary by country):
Note: The Tax Rate associated with the Xero account needs to match the tax rate setup in WooCommerce.
Account codes must be entered at WooCommerce > Xero within your site (below are sample codes for each account which may differ from the codes on your Xero account):
Important: All Account Code fields must be entered in order to send invoices to Xero. Read more about setting up account codes at: Settings: Chart of Accounts.
This controls when the invoice is created or updated in Xero.
Recommended: Payment Completion.
Xero will mark the associated invoice as PAID based on this setting.
You may need to send payments manually if you synchronise payments in another way, such as the PayPal to Xero integration.
Important: once a payment is sent for an invoice and the invoice is marked PAID in Xero, it can no longer be modified via the API. This means that WooCommerce cannot make any changes to the invoice. Once the invoice is marked PAID in Xero, all changes must be made manually in Xero.
This allows you to explicitly match up a WooCommerce tax-exempt (0%) tax rate with a Xero tax-exempt (0%) tax rate. This helps avoid issues like tax-exempt line items showing up as Zero Rated EC Services.
The costs associated with shipping line items in your WooCommerce orders can be treated either as Revenue or Expenses. You may need to toggle this setting based on your Xero Chart of Accounts settings to avoid errors.
Tick the box for Orders with zero total to enable the export of invoices for orders that have a grand total of zero.
/wc-logs/
Orders placed in your WooCommerce store are copied to your Xero account as an approved invoice. When payment is completed (normally immediately), then a payment is added to the invoice making the invoice paid in full. A note is added to each order in WooCommerce for the invoice including the Xero invoice reference number (Invoice ID). Here is a sample Xero invoice with payment.
These are the WooCommerce Order fields that are sent to the Xero invoice. Note: If the Billing Company field is used, it will be the main name on the invoice. Otherwise, Billing First Name and Billing Last Name are used.
Invoice Status is always AUTHORIZED. Tax Type depends on the WooCommerce setting.
Invoices are created within Xero based on the Send Invoices setting found at WooCommerce >Xero.
Payments are sent to Xero based on the Send Payments setting found at WooCommerce >Xero. Note: when a payment is applied to a Xero invoice the order is marked PAID in Xero and cannot be modified any longer through the API.
Yes, you can, but it’s a manual process. To achieve this, go to WooCommerce > Orders and select the order you want to sync. Select Actions and choose Send Invoice to Xero. Then select the “>” button on the right.
Entries are added to the Order Notes area of the order page. There is one message for the invoice and one for payment.
In order for your tax rates in your Xero invoices to be as accurate as possible, it is essential that your tax rates and names in WooCommerce match the tax rates and labels in Xero. If these two tax rates differ you may receive errors when trying to generate invoices/payments.
The default behaviour of WooCommerce is to completely omit taxes from sending per line-item if the tax is either 0% or the item is not taxable. If you want the Xero line items to show a zero tax rate(0.000%) you can do the following:
If creating the Xero invoice fails for any reason there will be a note added to the Order Notes section with the error message. Typical causes of failure:
Yes, if you have a Xero account with multi-currency capability(this usually requires an upgrade). If you receive an error in the Order Notes related to the currency not being supported, add additional currencies in Xero by going to Organization Settings, click on Currencies and add the currencies available in the store.
Stripe fees do not sync to Xero with this extension at this time. However, it’s possible to sync Stripe fees with the Stripe + Xero integration provided by Xero.
The extension sends a line-item wise coupon discount amount from WooCommerce to Xero and Xero shows it on each line item in the discount column of the invoice. Only discount amount information is sent to Xero, not coupon code information. So, while you’ll see the discount amount on each product in Xero, coupon code info won’t be visible there.
A few scenarios for coupons are mentioned below to give an idea of how coupon discounts get applied to the items and how they display in Xero.
For the given scenario, the coupon 20OFF is applied for a 20% discount.
WooCommerce Order:
Xero Invoice:
For the given scenario, the coupon 50OFF is applied for a fixed $50 discount on the cart.
WooCommerce order:
Xero Invoice:
For the given scenario, the coupon POLOOFF is applied for a fixed $10 discount on a “Polo” product only, which is reflected on the Xero invoice for a specific product only.
WooCommerce Order:
Xero Invoice:
Multiple coupons are used in conjunction here. 2 coupons are applied.
Xero Invoice will show to the total discount applied on each product separately.
WooCommerce Order:
Xero Invoice:
By default, the Xero integration will attempt to void the invoice once the order is totally refunded(when the order status changes to Refunded). Invoices that are marked PAID cannot be modified via the API and thus would have to be voided/modified manually at Xero.com.
If you wish to disable the automatic voiding of invoices when the associated WooCommerce order is refunded, add the following one-line code snippet to your child theme’s functions.php file or use a code snippets plugin:
add_filter( 'woocommerce_xero_disable_auto_void_invoices', '__return_true' );
By default, a new tax rate label will be created on Xero during invoice creation. However, in some countries, this may or may not be the desired outcome. If you need to match the tax rate label from what you have entered in WooCommerce to what Xero already has in the system, you can use the following filter. Add the filter to your child theme’s functions.php file or using a code snippets plugin:
add_filter( 'woocommerce_xero_create_unique_tax_label', '__return_false' );
Once you have done this, whatever you have set in as your tax rate label in WooCommerce will match what is already existing in your Xero account.
This is not yet an option in the Xero plugin, however, it is theoretically possible by creating a custom function that hooks into the woocommerce_xero_line_item_account_code
filter. Your custom function would need to check the category ID or product ID and return an integer representing the Xero sales account code(must be a Revenue/Sales account type).
To view debug information make sure the Debug checkbox option is checked in the Xero settings page. You can find Xero logs at WooCommerce > Status > Logs.
If invoices are being created, but payments are not being created, make sure that the Xero account that is used for “Payment Account” has “Enable payments to this account” checked in the Edit Account Details popup.
If you get the following error in the order notes related to “Item Code”:
ERROR creating Xero invoice: ErrorNumber: 10 ErrorType: ValidationException Message: A validation exception occurred Detail: Item code ‘XXXX′ is not valid
Please check your Xero configuration and make sure the inventory item is setup correctly. Here’s a doc on how to set up inventory items in Xero.
You may see the following error in the order notes:
ERROR creating Xero invoice: ErrorNumber: 10 ErrorType: ValidationException Message: A validation exception occurred Detail: The TaxType code ‘xxx’ cannot be used with account code ‘yyy’.
See the section named Xero simply omits the tax rate in my invoices if items are tax-exempt for information on how you can force the Xero integration to match up with a specific tax rate for zero-rated line items.
ERROR creating Xero payment. ErrorNumber:10| Error Message:Account type is invalid for making a payment to/from
Make sure that the account you specified for “Payment Account” in the Xero settings has “Enable Payments To This Account” checked in Xero. This will need to be either a Bank account type or a Revenue/Sales account type.
This error happens when the API application was created with the wrong organization. Go to https://developer.xero.com/myapps?privateAppCreation=true and click on the application you created to connect to your WooCommerce site. If the Selected Organization is “Demo Company” you’ll need to delete this application and recreate another one.
When you recreate the application, on the option “Please select which organization your application can access:” be sure to select the correct organization.
This is typically because there is already an invoice on Xero end which is marked as Paid (might be due to test orders sent from your staging environment to Xero during site development, or invoices created within Xero itself). You can add invoice prefix to Xero settings and test again to confirm that.