• Shopping Cart Shopping Cart
    0Shopping Cart
Databuzz
  • Home
  • Services
    • FileMaker Development
    • FileMaker Integration
    • FileMaker Web Publishing
    • FileMaker Go for the iPhone and iPad
    • FileMaker Xero Integration
    • FileMaker WooCommerce Integration Specialists
    • FileMaker Shopify Integration Specialists
    • FileMaker DocuSign Integration Specialists
    • FileMaker MYOB AccountRight Integration
    • FileMaker MYOB Essentials Integration Specialists
  • Products
    • fmSMS
    • fmMMS
    • fmAccounting Link (Xero Edition)
    • fmAccounting Link (QuickBooks Online Edition)
    • fmEcommerce Link (WooCommerce Edition)
    • fmEcommerce Link (Shopify Edition)
    • fmESignature Link (Docusign Edition)
    • fmAccounting Link (MYOB AccountRight Edition)
    • fmAccounting Link (MYOB Essentials Edition)
  • Shop
  • Contact
    • Contact Databuzz
    • Support
    • Submit Testimonial
  • About Us
    • About Databuzz
    • Our Clients
    • Testimonials
    • Support
    • Databuzz Newsletter Signup
    • Terms and Conditions
    • Privacy Policy
  • News
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu

fmAccounting Link (Xero Edition) v1 OAuth 2.0 Update Guide

This page is a guide to upgrading a copy of fmAccounting Link (Xero Edition) v1 from OAuth 1.0a to OAuth 2.0. The main changes can be summarised as:
  • Authentication: the process for authenticating with Xero changes from OAuth 1.0a to OAuth 2.0. You now need to do a one time approval via a Web Viewer that requires the Xero customer to approve the app. See our video for further details here.
  • API request Header: each request to the Xero API now requires new headers to be set for each request
  • Token Refresh: you need to check, once you have completed the one off initial authentication, that your Xero token hasn’t expired and to call the script to silently refresh this if it has

We’ll be using the fmAccounting Link (Xero Edition) Single Organisation.fmp12 file as the guide here, but the process is similar if you’re using the fmAccounting Link (Xero Edition) Multiple Organisations.fmp12 version.

If you use one of the Database Design Report analysis tools like BaseElements or FMPerception you can use these to run a comparison report between your current version/integration and the new OAuth 2.0 version to identify the changes. We’ve used BaseElements to generate a report showing the differences between the last OAuth 1.0a version (v1.969) and an OAuth 2.0 version (v1.975) which you can download here.

Authentication

The process for authenticating with the Xero API obviously changes quite significantly as part of the move from OAuth 1.0a to OAuth 2.0. You’ll need to create the following new fields in the Interface table (you can copy/paste these across using FileMaker Pro Advanced):

ClientID

ClientSecret

RedirectURI

AccessTokenExpires

TenantID

XeroAccessToken

XeroRefreshToken

We’ve created a new layout for the authentication process (you could also use a popup window for this etc)

Xero Authentication

which has the Web Viewer that is used for the OAuth 2.0 authentication process.

You can import the following scripts which are used to start and complete the OAuth 2.0 authentication:

Xero Authentication - OAuth 2.0 Start

Xero Authentication - OAuth 2.0 Complete

Xero Authentication - OAuth 2.0 Refresh Access Token

Get Organisation

The existing Xero Preferences layout has been updated with these new fields and buttons that call the new scripts – once again you can copy/paste these across. Once you have completed updating the fields, layouts and scripts you can test the OAuth 2.0 authentication process.

We have a video showing the OAuth 2.0 authentication flow in action on the fmAccounting Link (Xero Edition) Videos page.

OnFirstWindowOpen Script

You will need to update the OnFirstWindowOpen Script script to set the $$fmXeroAuthenticated global variable if you have previously authenticated with Xero so you don’t continue to be prompted to authenticate unnecessarily.

With OAuth 1.0a we set this global variable when the Xero Authentication script was performed, typically once per FileMaker session. With OAuth 2.0 you need to perform the initial authentication and then continually refresh the Xero access token as it expires. As you typically only need to perform the initial authentication once we can check to see if this has been performed in the OnFirstWindowOpen Script script which runs each time a user opens the file.

We have added a number of tests in this script for each FileMaker Client (Web Publishing Engine, Server and Pro) that you can copy/paste to set the global variable to prevent you from having to unnecessarily authenticate each time you open the file:

You can copy/paste these across from the OAuth 2.0 script at the appropriate places to ensure the $$fmXeroAuthenticated global variable is set accordingly each time the user opens the file.

HTTP Header Changes

As part of the change to authenticating using OAuth 2.0 each request to the Xero API needs to specify new HTTP Headers. Here’s a comparison of the old and new using the Get All Invoices – XML script as an example. With OAuth 1.0a we just set the Header once in the script here:

In the above example you can see it is only setting a single Header.

With OAuth 2.0 we need to set the Header for each iteration of the loop like this:

We also need to set multiple headers like these in this example:

BE_HTTP_SetCustomHeader ( "Accept" ; "text/xml" ) &

BE_HTTP_SetCustomHeader ( "Authorization" ; "Bearer " & InvoicesPreferences::XeroAccessToken ) &

BE_HTTP_SetCustomHeader ( "Xero-tenant-id" ; InvoicesPreferences::TenantID )

For each script that you’re currently using (e.g. if you’re just uploading Contacts, Invoices and Payments you just need to update those scripts for now) you’ll need to update the steps that set the HTTP Headers when making the requests. Once again you can copy/paste these across from the OAuth 2.0 script.

Token Management

As part of the OAuth 2.0 authentication fmAccounting Link will store the following:

At the successful completion of an OAuth flow you will be granted an access token to act on behalf of the user as well as a refresh token. Access tokens expire after 30 minutes and you can refresh an access token without user interaction by using a refresh token.

N.B. Unused refresh tokens expire after 60 days. If you don’t refresh your access token within 60 days the user will need to reauthorize your app.

As access tokens expire after 30 minutes you will need to check to see if they have expired before you make a request to the API and refresh them first. There are 2 occasions when you will need to perform this:

  1. before every request to the API (e.g. before attempting to download or upload to Xero)
  2. if performing a bulk action within a loop (e.g. downloading a batch of Invoices using pagination) you will need to check the token expiry within each iteration of the loop

Here are some screenshots showing this in the Get All Invoices – XML script at the beginning before making the first API request:

and then within the loop to check before making the next API request in the next iteration of the loop:

Once again you can copy/paste these across from the OAuth 2.0 script.

We recommend testing each change that you make as you go. First update the Authentication process and ensure you can successfully authenticate using the new OAuth 2.0 flow. Then update a script that you currently use and test that it works with the new OAuth 2.0 changes.

We have updated the fmAccounting Link (Xero Edition) FAQ with some OAuth 2.0 specific issues so please review that if you’re encountering issues with the OAuth 2.0 changes.

Latest News

  • Changes to Xero Accounting API ScopesJuly 1, 2026 - 9:20 am

    Earlier this year Xero introduced a change to the authentication scopes for new Xero OAuth Apps that were created on or after March 2, 2026. They are replacing the previous broad scopes with more  granular scopes to give you more control and security. Xero OAuth Apps created on or after March 2, 2026 have been […]

  • fmSMS Now Supports Notifyre SMS GatewayJune 29, 2026 - 4:33 pm

    fmSMS, our FileMaker solution for sending and receiving SMS messages from the Claris FileMaker Platform, has been updated to support the Notifyre SMS Gateway based in Australia. The Notifyre SMS Gateway is trusted by 20,000 Australian organisations and was named Australia’s Most Reliable SMS Provider for 2025. You can download a trial version of fmSMS to […]

  • Databuzz releases fmESignature Link (Docusign Edition) v2 – Integrate the Claris FileMaker Platform with DocusignJune 9, 2026 - 6:00 am

    Databuzz today announced fmESignature Link (Docusign Edition) v2, a major update to their FileMaker solution that integrates with the Docusign eSignature platform. fmESignature Link (Docusign Edition) is a FileMaker solution that integrates between the Claris FileMaker Platform and Docusign. Docusign is one of the most popular electronic signature platforms and helps organisations connect and automate […]

  • Changes to the Xero Developer PricingMarch 24, 2026 - 8:24 pm

    In December 2025 Xero announced that they were making changes to their pricing and policies for the  Xero Developer Platform, including moving to a new usage-based pricing effective March 2, 2026. New apps created in the Xero Developer portal will default to the free Starter tier and existing apps will be migrated starting mid March, […]

  • Tickets for Reconnect.Christchurch 2026 Now AvailableMarch 16, 2026 - 8:20 am

    The Reconnect Claris FileMaker Developer conference is back again in 2026 and this year we’re heading outside of Australia to Christchurch, New Zealand. The conference will be held in the Christchurch Town Hall, located on the banks of the Avon River in central Christchurch on 15-16 October, 2026. Tickets for the conference are on sale […]

Newsletter Signup

X Logo X Logo Followon X RSS Feed Logo RSS Feed Logo Subscribeto RSS Feed

Latest News

  • Changes to Xero Accounting API ScopesJuly 1, 2026 - 9:20 am

Newsletter Signup

© Copyright Splash IT Consulting Pty Ltd T/A Databuzz | ABN 31 116 889 028
  • Link to X
  • Link to Facebook
  • Link to Rss this site
  • Home
  • Services
  • Products
  • Shop
  • Contact
  • About Us
  • News
Scroll to top Scroll to top Scroll to top