Coupler.io Blog

A Simple Guide to Connect Xero to BigQuery

Connecting Xero to a destination like BigQuery offers several benefits. You can back up your Xero data and have quicker access to your consolidated records whenever you need them. However, this is not the only reason for connecting Xero to BigQuery. Let’s discuss how you can achieve this connection. 

Methods to send your Xero data to Google BigQuery 

How to connect Xero to Google BigQuery with Coupler.io?

With Coupler.io, you can export from two Xero source apps – Xero and Xero Reports. The Xero source provides access to every raw transaction in your account. 

To connect Xero to BigQuery, click Proceed in the preconfigured form below.

If you’re new, you’ll need to create a Coupler.io account for free (no credit card is needed). Then, you can log in and integrate your Xero financial data by following the steps below: 

Step 1. Collect Xero data

Add your account, select the Xero tenant, then pick a data entity and report type. 

Step 2. Preview and transform 

Check the data and make any required changes. You can:

You can also use Coupler.io to merge data from multiple Xero accounts or combine it with related information from other business apps such as CRMs, marketing platforms, etc. 

Step 3. Load and schedule 

Follow the instructions to load data into BigQuery. Go to IAM & Admin in your BigQuery, create a service account, and create a json key. Once the file has been saved to your device, you’ll return to the Coupler.io importer and upload it. Then, specify a new or existing dataset name and a table name to pull your data into. You may allow it to autodetect table schema or you can enter a preferred table schema to use.  

The Set up a schedule button allows you to create a custom schedule for automatic data imports. First, you need to turn on Automatic data refresh. Then choose the interval, days of the week, specific time, and the timezone. 

Make sure to hit Save and Run to send data from Xero to BigQuery. Congrats, your finance function automation is enabled.

What data can you export from Xero?

These are the data types you can export from the Xero source app:

Data entityDescription
AccountsOrganization
Bank TransactionsAll bank transactions such as debits, credits, and transfers
Bank transfersDetails of fund transfers between different bank accounts
Branding themesCustomized templates for email and document designs
Contact groupsGroups for categorizing different contacts
ContactsAll contacts and their details
Credit NotesDocuments issued to reduce any amounts owed by customers
CurrenciesList of all currencies used in financial transactions
EmployeesInformation about those employed by the organization
Expense ClaimsRecords of employee expense claims, and the specific details
InvoicesAll invoices issued to customers
ItemsList of products and services available
JournalsA summary of all entries and transactions
Linked TransactionsConnected transactions, e.g. bills and orders
Manual JournalsJournal entries created manually
OrganisationProfile and details about the company
PaymentsRecord of all payments made or received 
PrepaymentsPayments made in advance of receiving any goods and services
Purchase ordersOrders placed for goods bought
ReceiptsRecords of money gotten from customers
Repeating invoicesInvoices sent to customers on a scheduled basis
Tax ratesAll tax rates applied to various transactions
Tracking categoriesCategories used to track and analyze financial performance
UsersAll account users with their roles and permissions

Can you automate exports of reports from Xero to BigQuery using Coupler.io?

Xero reports contain aggregated data from your account e.g. account-level summaries and monthly or bi-weekly totals. Coupler.io enables you to export these separately. For this, click Proceed in the preset form below:

Then connect your Xero account, choose the report type, transform, and load into the destination. The setup is very similar to the one described in the previous section. 

Here are the report types to pick from:

Report typeDescription
Aged Payables by ContactA snapshot of your financial standing including, assets, liabilities, and equity at a specific date
Aged Receivables by ContactOverdue customer invoices and the time they have been pending 
Balance SheetA snapshot of your financial standing including, assets, liabilities and equity at a specific date
Bank StatementRecords of bank transactions and their matching Xero entries
Bank SummaryAn overview of bank balances and activity over a selected period
Budget SummaryDisplays all budgets in your Xero account
Executive SummaryAll key financial metrics, e.g. income, expenses, balance, profit, cash flow, etc. 
Profit and LossA comprehensive report of income, expenses, and profit
Trial BalanceSummary of account balances to ensure total debits equal total credits

Manually export Xero to BigQuery

You can download Xero data and reports from your account as CSV or Google Sheets files and then upload them to BigQuery. Check out the steps below:

Step 1: Export Xero data

It will save the CSV file to your device. 

How to export Xero Reports

Make sure to click Update to save and preview your report. 

To further load data to BigQuery, choose either Excel or Google Sheets.

Step 2: Upload data to BigQuery

When you’re done, click Create table. This will load your data into the dataset and table. 

What do you need to perform the custom integration with API?

If you have solid technical skills and access to the Xero API, you can make a Xero to Google BigQuery data integration. First, you’ll generate the endpoint and the access token. The next step is to use a custom script in Google Apps Script or another programming language to extract data from your Xero account. Here are the steps to do this:

The Xero API

You need to create a New app to proceed.

Make sure to Allow Access to the organization.

The Xero Accounting API has endpoints for all Xero data and one for Reports. If you choose a data entity, the next step is to select the operation, e.g. Get Purchase Orders. As for the Reports endpoint, you’ll pick the report type under Operation. E.g. Get Report Bank Summary. Your endpoint URL will be generated, and you can copy it immediately.

Access token

This shows the Redirect URL, Client id, and Client secret.

https://login.xero.com/identity/connect/authorize?response_type=code&client_id=YOURCLIENTID&redirect_uri=YOURREDIRECTURI&scope=openid profile email accounting.transactions&state=123

Replace the values for client id, redirect uri, scope, and state (optional). The Xero server will redirect back and add a temporary code to the redirect uri. 

POST https://identity.xero.com/connect/token

The header:

authorization: "Basic " + base64encode(client_id + ":" + client_secret)
Content-Type: application/x-www-form-urlencoded

Request body:

grant_type=authorization_code
&code=xxxxxx
&redirect_uri=https://myapp.com/redirect

Replace with values for client id, client secret, and code.

The response will contain an access token, expiry time, and a refresh token. You’ll add the access token to the authorization header when making the API request. The token expires after 30 minutes, but the refresh token will help you get a new one. Check out the Xero Authorization Code Flow for a detailed breakdown of the entire process. 

Once you have the access token, you can create a script to extract data from the Xero API and send it directly to BigQuery. 

Bonus step: Use dashboard templates for quick Xero analytics 

If you want to turn your Xero financial data into insights, you’ll need to create a report or dashboard in a spreadsheet app or a BI platform. Moreover, creating reports from scratch is unnecessary since there are ready-to-use report templates. Here are some examples of reports designed in Looker Studio and Google Sheets that can help analyze Xero data.

Financial dashboard for Xero

The Xero financial dashboard makes it easy to monitor your company’s financial health by tracking revenue, expenses, cash flow, and balance sheet insights in real-time. It helps small business owners, accountants, and finance teams analyze key financial trends without manually sorting through spreadsheets. With clear visual reports, you can assess profitability, manage liquidity, and make data-driven financial decisions easily.

Here are the insights to expect:

You can use the dashboard in Coupler.io, which offers the AI insights feature designed to help you quickly make sense of your data. It’s also available as a template for third-party tools. In this case, follow the instructions in the Readme tab to connect your Xero account and automatically import data into Looker Studio or Google Sheets. The Coupler.io importer keeps your dashboard updated with scheduled refreshes, ensuring real-time financial tracking.

Revenue dashboard for Xero

The revenue dashboard for Xero focuses on your business’s revenue, income, and expenses. With a detailed breakdown of financial health, you can analyze revenue patterns over the last 12 months and identify seasonal trends or unexpected fluctuations. It also highlights your top-performing customers and products, so that you can understand where the majority of your income is coming from.

Here are the insights to expect:

The dashboard is available in Coupler.io and as a template in Looker Studio and Google Sheets. Follow the instructions on the Readme tab to connect your Xero account using the built-in connector and populate the dashboard with your data.

Accounts receivable dashboard

This dashboard offers a detailed analysis of accounts receivable turnover and provides a clear view of invoices and unpaid client balances. It includes a breakdown of paid, unpaid, and overdue invoices to monitor patterns in payment behaviors. It helps you stay on top of your cash flow and make crucial decisions to improve business revenue.

Here are the insights to expect:

Follow the instructions in the Readme to copy the dashboard and connect your Xero account. The Coupler.io importer will automatically update the report with your data. The template is available in Google Sheets and Looker Studio.

Accounts payable dashboard

This dashboard ensures that you keep track of all the bills received from vendors and suppliers. It allows you to view the total amount due and provides details of unpaid bills and overdue bills. You can review paid bills and payment history over a period. It also shows a list of vendor bills so that you can categorize and determine the order of settlement.

Here are the insights to expect:

On the Readme, you’ll find instructions to copy and connect Xero to the Google Sheets or Looker Studio template. All you have to do is set up the importer and enable automatic data refresh.

What method is best for the Xero to BigQuery data integration?

One major purpose of a data warehouse like BigQuery is to store large datasets from various sources in one central location. It allows you to retrieve data anytime, run complex SQL queries, compare historical data, and connect to BI platforms for comprehensive analysis. 

The manual method is suitable for one-time imports and for sharing data with others. It’s not convenient for report building because you’d need to repeat the workflow every time. 

If you’re quite technical or you have access to IT staff, you may use the custom integration with API to connect Xero to BigQuery. 

The best option is to use a no-code tool like Coupler.io to pull data so you can create reports from scratch or use any of the report templates. In addition to Xero, there are several other connectors that can help build more data pipelines. Coupler.io is a platform that offers everything a small business needs for effective data analysis and reporting.

Automate Xero reporting with Coupler.io

Get started for free
Exit mobile version