Integrate an inventory system


Overview

The Xero API provides an easy way for developers to integrate an inventory/stock system with Xero.


Getting setup

1. A current asset account to record stock on hand is necessary. To add this account go to Settings > Chart of Accounts > Add Account. Consider having more than one stock asset account if you want to distinguish between different stock lines on your balance sheet.

inventory_example2

2. We also need a Cost of Goods Sold account so we can show this expense on our profit and loss. We can add this the same way as above as an Expense account type.

3. If we are selling products then typically we want to show our Sales less Cost of Goods sold on our Profit and Loss report. Xero provides great flexibility with reporting layouts so we can easily adjust the default layout of our Profit and Loss report to move the cost of goods sold expense up to be included in the Gross Profit calculation.

To do this, go to Reports > All Reports > Profit and Loss. Scroll to the bottom of the report and choose “Layout Options” and then “Create new Layout”.

Tick the selection box to the left of your “Cost of Goods Sold” account and choose “Move selected accounts” at the top of the screen. Choose “Less Cost of Sales” in the drop down list shown in the popup window and choose “OK”. Type a name in the “Layout Name” such as “My Profit and Loss”. Choose “Save” at the bottom of the page. Your Profit and Loss report will now show the Cost of Goods Sold in the correct place.


Managing Purchases

When we make stock purchases we can code the purchases to the Stock on hand account or alternate asset account we have setup for this.


Cost of Goods Sold (COGS)

Every time we make a sale we can reduce the asset value of stock on hand and increase our cost of goods sold. You may choose to do this for every sale or in batch once a day, week or month. Since Xero receives daily information from your bank we recommend to update your COGS every day so that your reports are as accurate as possible whenever viewed.

We can enter a zero total accounts payable invoice (similar to posting a journal) to show the reduction of stock on hand and recording the cost of goods sold.

In the example below I sold a widget for $1000 which only cost me $600 so I need to reduce my stock on hand by $600 and increase my cost of goods sold by $600.

inventory_example4

Below is an example of a Profit and Loss that has a customised layout to show our cost of goods sold as part of our Gross Profit figure.

inventory_example5

After our stock adjustment our Balance sheet is updated to reflect the change to our stock on hand.

inventory_example6