TLS 1.0 will be deprecated on 30 June 2018 for the Xero API. After that date, TLS 1.1 or above must be used. Please read this page for more info. How-to Guides
Integration Best Practices Certification Checkpoints
Overview
Branding Your Integration
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 Deep link to Xero 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 Create a public/private key 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. Tax in Xero Rounding in Xero
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.
Accounting for Inventory
Getting setup
Xero Tracked Inventory 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. Processing Payments 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 Conversions Guide user to map data between the POS and Xero. CRM and Xero
Xero Chart of Accounts
Farming and Xero
Every Xero organization has a Chart of Accounts which can be customized for their business. These accounts are how the business and their accountant Inventory and Xerocategorize revenue, assets, liabilities, expenses, etc. Your Integration will leverage these accounts to sync information from the POS system into Xero. Accounts GET example Payment services and Xero https://api.xero.com/api.xro/2.0/Accounts
Payroll and Xero
You can save on API calls by getting all Accounts, then filter them server-side based on different properties.
Point of Sale and Xero You have the option to create new accounts via the API. Accounts PUT example 400001Food SalesSALES
This is how you would create a new Account in Xero.
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.
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 Location
Tracking Categories Options POST example https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}/Options
This is how Tracking Categories look in Xero.
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.
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 POS System
Then use the ContactID returned for all future Invoices you create in Xero. Invoices POST example 204a98c2-601b-4d29-8d01-2abdde1e89d92015-11-05T00:00:002015-11-05T00:00:00AUTHORISEDExclusiveTotal Food Sales500.00OUTPUT400001Location43bb59...5f5e6063ddaa7-c440...ee0061.0000 ... additional line items ... ACCRECAMEX-20151105
This is how a Summary Invoice looks in Xero.
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 cd1cda0b-9e79-4902-a6ef-1bfa33e077585a5f78f1-17b6-4747-a6f0-d26ec709c61d2015-11-05T00:00:001069.37AMEX-20151105
This is how a Payment looks in Xero.
Reports in Xero On the Income Statement, you’ll see the revenue accounts including discounts.
On the Balance Sheet, you’ll see the money collected in the AMEX asset account
Along with your Tips, Gift cards and Sales Tax show up under Liabilities and Equity on the Balance Sheet.
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.
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.
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).
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.
On the Balance Sheet we can see $5.25 is still in the AMEX asset account.
Recording Fees & Adjustments through a Purchase Invoice in Xero You’ll need to create a Contact for your Invoice. Contacts POST example AMEX POS Sales
Then use the ContactID returned for all future Invoices you create in Xero. Invoices POST example 404a48c2-601b-4d29-8d01-2abdde1e89d32015-11-05T00:00:002015-11-05T00:00:00AUTHORISEDExclusiveFees & Adjustments5.25.00OUTPUT6000601.0000ACCPAYAMEX-20151105 - POS Payout Fees
Then you’ll apply a payment to this invoice using the AMEX asset account. Payments POST example dc1cda0b-9e79-4902-a6ef-1bfa33e0904425a5f78f1-17b6-4747-a6f0-d26ec709c61d2015-11-05T00:00:005.25AMEX-20151105
This is how the Purchase Invoice looks in Xero.
On the Journal Report we can see $5.25 debit the POS Payout fees account and a credit to the AMEX asset account.
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.
Point of Sale and Xero - How-to Guides | Xero Developer
Docs
TLS 1.0 will be deprecated on 30 June 2018 for the Xero API. After that date, TLS 1.1 or above must be used. Please read this page for more info...