Xero Integration setup

This article covers the Xero Integration Setup.

The Xero integration allows small to medium sized businesses to link all their inventory and order management activities on Stock&Buy with their accounting records on Xero. This tremendously helps streamline business operations by aligning your inventory records with your accounting journal in a simple and effective way. This automation is enabled by the Stock&Buy ability to link invoices, payments, stock and customer data automatically with your Xero account.


Stock&Buy automatically syncs your sale orders, purchase orders, inventory adjustments, stock on hand and cost of goods sold to Xero. In order to have a smooth experience, we recommend you ensure the following ledger accounts exist in Xero first.

AccountAccount typeNotes
Sales AccountSales

Ledger account where sale invoices are sent to. Sales data can be split to different sales accounts using sales sync rules.

Payments accountRevenue

Ledger account where payment information are synced to. Payment data can be dispatched to different ledger accounts using the payment sync rules.

Purchases AccountCurrent AssetLedger account where purchase orders are synced to
Stock Purchases AccountCurrent AssetLedger account used to received purchased goods.

Important: Do not use the default Xero Inventory ledger account. It is reserved to Xero only and cannot be used within Stock&Buy
Stock on hand Current Asset

Ledger account used to track your inventory value.

Important: Do not use the default Xero Inventory ledger account. It is reserved to Xero only and cannot be used within Stock&Buy
Cost of goods soldExpensesLedger account used to track your cost of goods sold

Important: Do not use the default Xero Inventory ledger account. It is reserved to Xero only and cannot be used within Stock&Buy
Adjustments  Expenses

Ledger account used to record irrecoverable stock such as loss, shrinkage and write offs.

Inventory adjustment data can be synced to different ledger accounts using the adjustment sync rules.

The account types used above might be different depending on your business and accounting practices. We highly recommend you review these settings with your accountant.   

Once your Xero accounts are all set, head over to Stock&Buy and install the Xero integration.

  1. Login to your Stock&Buy account
  2. Go to Integrations on the left hand side navigation menu
  3. Click Install on the Xero Integration tile
  4. Follow the on screen instructions


How does the integration work

Action in Stock&BuyResulting transaction in Xero
Approve a purchase orderA bill is created against your Purchases account account
Receive a purchase orderCreates a journal entry which moves the net amount (without tax) of the purchase order from the Stock Purchases account to your Stock On Hand account.
Void a purchase orderSets the corresponding bill back to Draft (see note below)
Authorize a supplier returnA credit note is created against your purchases account in Xero. At the end of the day, a journal entry is created to move the credit note value from the Stock On Hand account to the stock purchases account.
Invoice a sale orderAn invoice is created against your Sales account in Xero
Record a payment for a sale orderMarks the corresponding invoice as Paid in Xero and pushes a note to your payments account
Void a sale orderSets the corresponding bill back to Draft (see note below)
Create a sale refundA credit note is created against your sales account in Xero
Ship (fulfill) a sale orderA journal entry is created to move the order total cost of goods sold from the Stock On Hand account to the Cost of Goods Sold account. Any refunds attached to the closed order will result in a journal entry moving the total cost of the refund from the cost of goods sold to the Stock On Hand account (if the items are restocked) or the Adjustments account if the items is written off
Create an adjustmentA journal entry is created moving the total adjustment value from the Stock On Hand ledger account to the adjustments ledger account

Stock&Buy can set an invoice or purchase order to Draft state only and only if the document (invoice / bill) has no payments attached to it. Otherwise, the document has to be manually modified within Xero.

Synchronization timing

Stock&Buy performs synchronizes sale and purchase orders every 5 minutes. This also happens whenever a sale or a purchase order gets changed or updated. You can also force the synchronization of pre-selected sale and purchase orders via the Xero Sync Status report.

Stock On Hand (SOH) and Cost Of Goods Sold (COGS) transactions are synchronized as journal entries once a day at 8:00 PM GMT.

Sales and purchases tax handling

Sales and purchase tax are also synced from Stock&Buy to Xero. However there are important considerations you need to be aware of depending on which country you reside in.

Xero AU, Xero NZ and Xero UK

If you have you are running an Australian, New Zeland or United Kindom Xero version, then you must already have your tax rates defined in Xero (Xero creates them automatically for you). For these Xero versions, Stock&Buy pushes all data without tax definitions. The invoices and bills will automatically get assigned their respective tax rates depending on what ledger account they are sent to.

Other Xero versions

If your Xero version is none of the above, then Stock&Buy will automatically push your tax definitions within Stock&Buy to Xero. This applies to both sales and purchase tax rates (also applies to orders coming from online shops such as Shopify)

Reconciling Stock&Buy and Xero

To ensure your inventory valuation is always the same in Stock&Buy and Xero, we recommend you double check your Stock on Hand value within Stock&Buy and make sure it matches your Stock On Hand balance in Xero. Once this initial check is done, your total stock on hand across all inventory locations in Stock&Buy should always be equal to that reported in Xero. If the values in the Stock on Hand report in Stock&Buy differs from the Stock On Hand account balance in Xero, then simply follow each step outlined below in order:

  1. Ensure transactions from Stock&Buy are processed and approved in Xero. You can use the Xero Sync Status report to help you spot items which have not been processed.
  2. If it is not matching, then you should run a ‘Account Transactions’ report inside Xero for your Stock on Hand account. All transactions recorded against to this account should be from Stock&Buy so anything being posted from elsewhere will cause a discrepancy.
  3. Check your activity feed for any errors coming from the Xero Integration.
  4. If all the above did not help to spot the underlying issues then you may need to make an adjustment in Xero and monitor the balances going forward. 

How useful was this post?


We are sorry that this post was not useful for you!

Tell us how we can improve this post?