Point of Sale and Xero


Overview

The Xero APIs provide an easy way for developers to integrate a point of sale (POS) system with Xero. In this example we are going to focus on how you can record your POS sales in Xero.

We’ve gone for an approach that focuses on getting your sales information into Xero by summarizing sales for each payment type so, if anyone needs to revisit their daily sales figures later they are clearly labelled in Xero for easy cross checking with your POS system.  This approach aligns well with Xero bank reconciliation too.

We’ll go through the setup process for a basic scenario first and then show how to record the sales in Xero. After that we’ll go through the bank reconciliation in Xero and give some tips to make this as automated as possible.


Getting setup

There are numerous ways to work with different payment types. In this example we’ll setup some current asset and current liability accounts to assist with making our bank reconciliation process as simple as possible.

It is best practice to collect user preferences for how financial data synced to Xero will be categorized through the Chart of Accounts.  This is done by asking the user to map data between the POS and Xero.


Xero Chart of Accounts

Every Xero organization has a Chart of Accounts which can be customized for their business. These accounts are how the business and their accountant categorize revenue, assets, liabilities, expenses, etc.  Your Integration will leverage these accounts to sync information from the POS system into Xero.

Accounts GET example

https://api.xero.com/api.xro/2.0/Accounts

You can save on API calls by getting all Accounts, then filter them server-side based on different properties.

You have the option to create new accounts via the API.

Accounts PUT example

<Account>
    <Code>400001</Code>
    <Name>Food Sales</Name>
    <Type>SALES</Type>    
</Account>

This is how you would create a new Account in Xero.

POS-Guide-01


Invoice Line Item Types

Depending on how the POS system manages revenue types, you’ll want to offer 1 or more mappings between these revenue types and the Chart of Accounts in Xero.

Sample of Invoice Line Item Types

POS Type Account Code Account Name Account Type
Food 400001 Food Sales SALES
Beverage 400002 Beverage Sales SALES
Merchandise 400 Sales SALES
Discounts 401001 Discounts OTHERINCOME
Tips 200001 Tips for Employees CURRLIAB
Gift Cards 205001 Gift Cards Sales CURRLIAB


A word on Gift Card & Vouchers

Gift cards and vouchers should be tracked as a current liability.  Once purchased the gift card becomes a payment type and the items purchased with the gift card will be tracked as revenue.

A gift card  liability increases when sold and decreases when used to make a purchase. Filter from  existing accounts and/or create a gift card current liability account with the EnablePaymentToAccount attribute set to true. The same gift card account should be used for both revenue and payment scenarios.

This is how you would create a new Gift Card liability Account in Xero.

POS-Guide-02

If this Gift Card account is required for your integration to function then it should be added via the API or mapped during the setup process.

Tax on Gift Cards

The sale of a Gift Card is typically tax exempt.  Tax is applied as normal to a sale that is paid for by Gift Card.  For the Australian market, Gift Cards should use the BAS Excluded tax rate in Xero.

Expiring Gift Cards

If the Gift Card Expires then the Gift Card liability account should decrease and the value of the sales account increased.

Voiding Gift Cards

If a Gift Card is voided (For example if a customer has lost the gift card and you’re cancelling it and re-issuing it) this should be handled with no change to the Gift Card liability account.


Tracking Categories

Xero support up to 2 tracking categories to be assigned to invoice line items.  Many businesses like to track the source of revenue.  For example, store location could be a tracking category and allows the business to push sales from multiple POS locations into Xero and run reports to see how each location is performing.

Tracking Categories  GET example

https://api.xero.com/api.xro/2.0/TrackingCategories

You have the option to create new Tracking Categories or Options via the API.

Tracking Categories  POST example

<TrackingCategories>
    <TrackingCategory>
      <Name>Location</Name>
    </TrackingCategory>
</TrackingCategories>

Tracking Categories Options  POST example

https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}/Options
<Options>
  <Option>
     <Name>San Francisco</Name>
  </Option>
  <Option>
     <Name>Palo Alto</Name>
  </Option>
</Options>

This is how Tracking Categories look in Xero.

POS-Guide-03

Sample of Tracking Categories Types

POS Type Account Name Location Tracking Category 2
Food Food Palo Alto
Beverage Beverage Palo Alto
Merchandise Sales Palo Alto
Discounts Discounts Palo Alto
Tips Tips for Employees Palo Alto
Gift Cards Gift Cards Sales Palo Alto

 

Payment Types

Have users map payment types in the POS system to their Chart of Accounts in Xero.

To ensure users only pick accounts that are valid for the Payments endpoint you should filter Accounts so the Type is BANK OR  EnablePaymentToAccount is true.

Sample of Payment Types

Account Code Account Name Account Type
120001 Cash CURRENT
120002 Check CURRENT
120003 Debit Card or Eftpos CURRENT
120004 Visa CURRENT
120005 AMEX CURRENT
205001 Gift Card CURRLIAB

This is how you create a new Payment Account in Xero.

POS-Guide-05


Recording Summary Sales Invoice in Xero

Our goals are to record sales in Xero and make the reconciliation of the money received in our bank account easy.

Using the Xero API, create a sales invoice for each payment type (i.e.  Cash, Debit, AMEX, M/C & Visa, etc) and record a line item for each revenue or liability amount grouped by chart of account and by tax rate.

In this example we had $1000 total once you add up all revenues, discounts, tips, gift cards paid using AMEX (Credit Card) and 69.37 in Sales Tax.  We are also tracking this to the Palo Alto location using Tracking Categories.  We’ve populated the reference field to know which payment type and date “AMEX-20151105”.  Feel free to use a naming convention that works for your integration.

You’ll need to create a Contact for your Invoice.

Contacts  POST example

<Contacts>
  <Contact>
    <Name>POS System</Name>
  </Contact>
</Contacts>

Then use the ContactID returned for all future Invoices you create in Xero.

Invoices  POST example

<Invoices>
  <Invoice>
    <Contact>
      <ContactID>204a98c2-601b-4d29-8d01-2abdde1e89d9</ContactID>
    </Contact>
    <Date>2015-11-05T00:00:00</Date>
    <DueDate>2015-11-05T00:00:00</DueDate>
    <Status>AUTHORISED</Status>
    <LineAmountTypes>Exclusive</LineAmountTypes>
    <LineItems>
      <LineItem>
        <Description>Total Food Sales</Description>
        <UnitAmount>500.00</UnitAmount>
        <TaxType>OUTPUT</TaxType>
        <AccountCode>400001</AccountCode>
        <Tracking>
          <TrackingCategory>
            <Name>Location</Name>
            <option>Palo Alto</option>
            <TrackingCategoryID>43bb59...5f5e6</TrackingCategoryID>
            <TrackingOptionID>063ddaa7-c440...ee006</TrackingOptionID>
          </TrackingCategory>
        </Tracking>
        <Quantity>1.0000</Quantity>
      </LineItem>
        ... additional line items ...
    </LineItems>
    <Type>ACCREC</Type>
    <Reference>AMEX-20151105</Reference>
  </Invoice>
</Invoices>

This is how a Summary Invoice looks in Xero.

POS-Guide-04


Recording Payment in Xero

We’ll go through an example of recording your payment for the summary invoice in Xero.

In this example, this summary invoice is for all AMEX sales.  We’ll use the chart of account mapped by the user for AMEX payments.

Payments  POST example

<Payments>
  <Payment>
    <Invoice>
      <InvoiceID>cd1cda0b-9e79-4902-a6ef-1bfa33e07758</InvoiceID>
    </Invoice>
     <Account>
        <AccountID>5a5f78f1-17b6-4747-a6f0-d26ec709c61d</AccountID>
     </Account>
     <Date>2015-11-05T00:00:00</Date>
     <Amount>1069.37</Amount>
     <Reference>AMEX-20151105</Reference>
    </Payment>
</Payments>

This is how a Payment looks in Xero.

POS-Guide-06


Reports in Xero

On the Income Statement, you’ll see the revenue accounts including discounts.

POS-Guide-07

On the Balance Sheet, you’ll see the money collected in the AMEX asset account

POS-Guide-08
Along with your Tips, Gift cards and Sales Tax show up under Liabilities and Equity on the Balance Sheet.

POS-Guide-09


Bank Reconciliation of Summary Invoices

Once you have received your automated overnight bank feed (or imported your bank statement manually) then you’ll have at least one bank statement lines similar to the line below for the $1069.37 from your AMEX credit card processor.

POS-Guide-10

We can code this transaction to our AMEX asset account as we’ve already recorded the sales revenue when we applied a payment to our summary invoice.

POS-Guide-11

If we revisit our Balance sheet we will see now that our bank account balance which was  $16,214.31has increased by $1069.37 to 17,283.68 and our AMEX account now has a value of zero (so isn’t shown on the balance sheet).

POS-Guide-12

 

Fees and Adjustments

Some Payment types, like credit cards, may charge fees and/or make adjustments that affect the amount deposited in the user’s bank account  This will result in our AMEX asset account not being zero after completing reconciliation.

If your POS System can summarize the fees and adjustments on a daily, weekly or monthly basis, you can write them to Xero through a purchase invoice, spend money bank transaction or a manual journal to reduce the appropriate asset account.

This is how  fees and adjustments would surface in Xero.  

The business owner  reconciles a batch deposit from a credit card processor.

POS-Guide-14

On the Balance Sheet we can see $5.25 is still in the AMEX asset account.

POS-Guide-15

 

 

Recording Fees & Adjustments through a Purchase Invoice in Xero

You’ll need to create a Contact for your Invoice.

Contacts  POST example

<Contacts>
  <Contact>
    <Name>AMEX POS Sales</Name>
  </Contact>
</Contacts>

 

Then use the ContactID returned for all future Invoices you create in Xero.

Invoices  POST example

<Invoices>
  <Invoice>
    <Contact>
      <ContactID>404a48c2-601b-4d29-8d01-2abdde1e89d3</ContactID>
    </Contact>
    <Date>2015-11-05T00:00:00</Date>
    <DueDate>2015-11-05T00:00:00</DueDate>
    <Status>AUTHORISED</Status>
    <LineAmountTypes>Exclusive</LineAmountTypes>
    <LineItems>
      <LineItem>
        <Description>Fees & Adjustments</Description>
        <UnitAmount>5.25.00</UnitAmount>
        <TaxType>OUTPUT</TaxType>
        <AccountCode>600060</AccountCode>
        <Quantity>1.0000</Quantity>
      </LineItem>
    </LineItems>
    <Type>ACCPAY</Type>
    <Reference>AMEX-20151105 - POS Payout Fees</Reference>
  </Invoice>
</Invoices>

Then you’ll apply a payment to this invoice using the AMEX asset account.

Payments  POST example

<Payments>
  <Payment>
    <Invoice>
      <InvoiceID>dc1cda0b-9e79-4902-a6ef-1bfa33e090442</InvoiceID>
    </Invoice>
     <Account>
        <AccountID>5a5f78f1-17b6-4747-a6f0-d26ec709c61d</AccountID>
     </Account>
     <Date>2015-11-05T00:00:00</Date>
     <Amount>5.25</Amount>
     <Reference>AMEX-20151105</Reference>
    </Payment>
</Payments>

This is how the Purchase Invoice looks in Xero.

POS-Guide-17

On the Journal Report we can see $5.25 debit the POS Payout fees account and a credit to the AMEX asset account.

POS-Guide-18

The AMEX asset account would now be zero and not appear on the Balance Sheet.

Read our guide on How to integrate my inventory system for step by step details on how to record inventory purchases, keep your stock on hand asset value up to date and update your Cost of Goods sold (COGS) expense.