Xero OAuth Integration
Connect Xero to your application without building and maintaining the OAuth flow.
Each user connects their own Xero organisation through your OAuth app. Pathfix manages the authorization flow, stores and refreshes their tokens, and authenticates the requests your application makes to the Xero Accounting API. Which accounting data you read or write is defined by your code.
What can you build?
Examples of what the Xero API supports. Your application implements the logic; Pathfix authenticates the requests.
Create invoices and credit notes
Raise invoices and credit notes in a user's Xero organisation from transactions in your app.
Keep contacts in sync
Retrieve, add and update contacts so customer details match between your app and Xero.
Record payments
Apply payments against invoices when they are collected in your product.
Pull financial reports
Use Xero's report endpoints to show summaries in your app without totalling individual transactions yourself.
How Pathfix helps
- 01
OAuth authorization
Pathfix runs the authorization flow with your Xero OAuth app, so users approve access on Xero’s own consent screen.
- 02
Token management
Each user’s access and refresh tokens are stored by Pathfix rather than in your application.
- 03
Token refresh
Where Xero issues refresh tokens, Pathfix refreshes them as they expire, so connections keep working after the first authorization.
- 04
Authenticated API passthrough
Your application sends Xero API requests through Pathfix, which adds the connected user’s credentials before passing them on to Xero.
You own the Xero OAuth application and its credentials, and your code implements the API logic.
POST https://labs.pathfix.com/oauth/method/xero/callHow to get started
- 1
Create an app in the Xero developer portal
The app gives your application its own OAuth credentials.
- 2
Copy your Client ID and Client Secret
These belong to your Xero app. Pathfix uses them to run the OAuth flow as your application.
- 3
Choose your scopes
Request the Accounting API scopes that match the data your integration reads or writes.
- 4
Add the credentials in Pathfix
In your Pathfix account, add an application, select Xero from the providers and enter the Client ID and Client Secret.
- 5
Let your users authorize
Add the connect step to your app. Each user signs in to Xero and approves the scopes you requested.
- 6
Call the Xero API
Send requests through the Pathfix passthrough API using the provider reference
xero.
The Pathfix setup guide for Xero covers the app settings Xero requires.