How may I load data from Xero to SQL Data Warehouse for further analysis? This post is an overview on how to access and extract your data from Xero through its API and how to load it into SQL Data Warehouse. This process requires from you to write the code to get the data and make sure that this process will run every time new data are generated. Alternatively, you can use products like Blendo that can handle this kind of problems automatically for you.
About Microsoft Azure SQL Data Warehouse
SQL Data Warehouse is the data warehousing solution that you can use if you are a user of Microsoft Azure. It’s an elastic data warehousing as a service solution, emphasising it’s enterprise focus. It also speaks SQL like the previous two solutions and it supports querying both relational and non-relational data. It offers a number of enterprise-class features like support for hybrid cloud installations and strong security. It’s probably the less mature solution compared to the two others though, it’s still in “Preview” mode although accessible to existing Azure subscribers.
Xero provides online accounting software and services for small and medium businesses. It includes a full accrual accounting system with a cashbook, automated daily bank feeds, invoicing, debtors, creditors, sales tax and reporting. Xero’s Software as a Service business model where software is hosted on the Internet as an innovative means of supplying solutions to large fragmented markets such as small businesses. Xero releases new features approximately every month. Additions and extensions to functionality are developed in response to the needs of new customers and new industries. Xero is a Microsoft Gold Certified Partner. The Xero software is developed using Microsoft’s .NET development environment, over a multi-tenanted SQL Server 2008 database, on a Windows 2008 production server infrastructure. Their production servers are hosted by Rackspace, a tier-one NASDAQ listed hosting provider, which monitors their servers and firewalls 24/7/365 at guarded facilities. Xero has also implemented a global Content Delivery Network with Akamai for faster application delivery to customers around the world.
Extract your data from Xero
Xero has an excellent API, or to be more precise a number of APIs, and encourages developers to build applications that can be sold on their add-on marketplace. The APIs that they expose are the following:
- Xero Core (Accounting) API – exposes accounting and related functions of the main Xero application and can be used for a variety of purposes such as creating transactions like invoices and credit notes, right through to extracting accounting data via our reports endpoint.
- Xero Payroll API – exposes payroll related functions of Payroll in Xero and can be used for a variety of purposes such as syncing employee details, importing timesheets etc.
- Files API – provides access to the files, folders, and the association of files within a Xero organization.
- Fixed Assets API – which is under review, this feature is not yet available but users can vote for it to become publicly available.
- Xero Practice Manager API – a recently released product built on the WorkflowMax product. Which is an API for managing workflows.
In this post we’ll focus on the Xero Core (Accounting) API. Which exposes the core accounting functionalities of the Xero product. The Xero API is a RESTful web service and uses the OAuth (v1.0a) protocol to authenticate 3rd party applications. As a RESTful API, interacting with it an be achieved by using tools like CURL or Postman or Apirise or by using http clients for your favourite language or framework. A few suggestions:
- Apache HttpClient for Java
- Spray-client for Scala
- Hyper for Rust
- Ruby rest-client
- Python http-client
As an a product and consequently an API that has to deal with sensitive data, Xero API takes really good care of security. For this reason there are a number of different applications that can be developed and integrate with it, where the main difference is how the application authenticates, how often the tokens expire and in general security-related aspects. For more about the different applications types, you can consult the application types guides on their documentation.