How do I connect Klipfolio and Xero?

You can set up a connection between Klipfolio and Xero to show your accounting data on a dashboard. Use the steps in this article to learn how set up that connection.

What is Klipfolio?

Klipfolio integrates with many cloud services and tools to create beautiful data visualizations.

How do I get started with Xero?

You have the following options for visualizing your data on a dashboard in Klipfolio:

Try the Klip Gallery Use the Connector Gallery
The Klip Gallery allows you to track your key metrics using pre-built Klips for some of the most popular services and data sources. The Connector Gallery helps you get your data fast with pre-built queries. Use this article as a guide to build your own Xero data source.

If you want to build a data source entirely from scratch, use the Advanced section below.

Authenticate with Xero

You can choose to connect with Xero using the Connector Gallery or the Klip Gallery in Klipfolio. Either way, the first thing you will be asked to do is authenticate and create a handshake connection between your Klipfolio and Xero accounts.

  • Click Connect to Xero.
  • Enter your Xero login credentials.
  • Click Next Step.
    Note: You now have an OAuth Token for your Connected Account. You can manage your tokens in the Account section under Connected Accounts.

Advanced: Build a data source yourself

Klipfolio connects to hundreds of services in the cloud that have a REST API. If you take the time to learn how to get data into Klipfolio using APIs, your possibilities are endless. Here's a quick and simple overview video on APIs and Klipfolio:

  Klipfolio API's 101

If APIs are a bit too tricky for you, enlist a data analyst or developer to help you.

If you want to edit a Xero data source that you already created, check out How to edit or reconfigure a data source, and get step-by-step instructions.

Xero quick reference table

API Documentation Xero API documentation

Authentication Method

OAuth Token Authentication
Response Format XML (default)/JSON (depending on the endpoint)

API Limits

Xero returns a maximum of 100 records per query. To retrieve a specific set of records, specify a date range in the query or, to retrieve more records, pagination (supported only for certain endpoints) is required.

Pagination Method

Xero returns a maximum of 100 records per query and only certain endpoints (such as invoices and contacts) support pagination. Use the page parameter to retrieve more than 100 records, for example page=2.

Note that Xero does not provide a count of the total number of records, so it is necessary to know in advance how many pages to request.

Refer to Data Sources with Multiple Pages for details on how to handle pagination.

Date Parameters

Date parameters (such as fromDate and toDate) in Xero API queries use yyyy-MM-dd format.

When filtering queries using the where parameter, the assigned value must be URL-encoded and dates must use the format (yyyy,MM,dd). For example, the URL-encoded form of 

   ?where=Date>=DateTime(2015,01,01)

?where=Status!="PAID"

is 

   ?where=Date%3E%3DDateTime(2015,01,01)

?where=Status%21%3D"PAID"

Sample Queries

In Klipfolio, Xero API queries use the base URL:

https://api.xero.com/

Examples

https://api.xero.com/api.xro/2.0/Reports/ProfitandLoss?fromDate={date.add(-30).format()}&toDate={date.add(-1).format()}

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

Advanced query examples

To write your Query URL, refer to Xero API documentation and our Guide to REST API data sources as well as the following examples (orange text indicates values to be replaced with your specific values).

Reports

https://api.xero.com/api.xro/2.0/Reports/ProfitandLoss?fromDate={date.add(-30).format()}&toDate={date.add(-1).format()}

https://api.xero.com/api.xro/2.0/Reports/BankSummary?fromDate={date.today}&toDate={date.today}

Invoices

https://api.xero.com/api.xro/2.0/Invoices?where=Date%3E%3DDateTime(2015,01,01)%26%26Date%3C%3DDateTime(2015,12,31)

https://api.xero.com/api.xro/2.0/Invoices?where=Contact.Name%3D%3D"Jo%20Klipfolio"

https://api.xero.com/api.xro/2.0/Invoices?where=Contact.ContactID%21%3DGuid("01234567-1234-5678-9abc-0123456789ab")

https://api.xero.com/api.xro/2.0/Invoices?where=Status%21%3D"PAID"

Files

For Files endpoint, set Query Parameters as follows:

  • Name = accept
  • Value = application/xml
  • Type = Header

https://api.xero.com/files.xro/1.0/Files

 

Click Get Resource, validate the data returned and click Continue to save your Xeo data source.

Related Links