Configuration
To set up the Xero source, provide the following configuration parameters:You must provide either
refresh_token or refresh_token_secret_name. Using refresh_token_secret_name is recommended because Xero uses rotating refresh tokens (each token can only be used once), and this option automatically persists the new token after each refresh.Option 1: Direct Refresh Token
Option 2: Mage Secret (Recommended)
- Open a pipeline edit page
- Expand the right side panel
- Click the “Secrets” tab
- Click “Add new secret”
- Enter your chosen secret name (e.g.,
XERO_REFRESH_TOKEN) and your initial refresh token as the value - Copy the secret name to your Xero config’s
refresh_token_secret_namefield
The tap will automatically update the secret with the new refresh token after each sync, ensuring reliable long-term operation.
Supported Streams
The Xero source supports the following streams:Incremental Streams
These streams support incremental syncing based on thestart_date configuration and bookmark state:
Full Table Streams
These streams are fully synced on each run (no incremental support):How to Generate Credentials
To use this source, you need to create a Xero OAuth app and complete the OAuth flow.1. Create a Xero App
Go to the Xero Developer Portal and create a new app. Note down your Client ID and Client Secret.2. Configure OAuth2 Scopes
When setting up your Xero app, grant the following OAuth2 scopes:- The minimum scope required for discovery is
accounting.settings.read. - You only need scopes for the streams you plan to sync.
- Missing scopes for a selected stream will result in
401or403errors.
3. Complete the OAuth2 Authorization Flow
Follow Xero’s OAuth2 Auth Flow Guide to obtain your initialaccess_token and refresh_token.
4. Get Your Tenant ID
Thetenant_id uniquely identifies your Xero organization. After completing OAuth authentication:
- Call the connections endpoint:
- Extract the
tenantIdfrom the response:
If your app is connected to multiple Xero organizations, the response will contain multiple entries. Choose the
tenantId for the organization you want to sync data from.Required Xero OAuth2 Scopes
To use this source, you must grant your Xero app the following OAuth2 scopes.Minimum Scope for Discovery
accounting.settings.readRequired for the/Currenciesendpoint, which is called during discovery to verify:- Your
access_tokenis valid - Your
tenant_idis authorised - The app has the correct scopes
- Your
Scopes for Syncing All Streams
To sync all available streams, grant the following scopes:
Note:
- You only need scopes for the streams you plan to sync.
- Missing scopes for a selected stream will result in
401or403errors.
Example Scope String
How to Generate Credentials
Follow Xero’s OAuth 2.0 Authentication Flow guide to generate the required credentials:- Register a new Xero app to get your
client_idandclient_secret. - Set up the OAuth scopes your app requires.
- Complete the OAuth 2.0 authorization flow to obtain your
access_token,refresh_token,id_token, andtenant_id. - Store these securely in your configuration.
Additional Notes
- The
start_datedetermines how far back data will be synced. - Ensure that the
offline_accessscope is enabled to receive arefresh_token. - Tokens expire after a set period; use the
refresh_tokento obtain newaccess_tokenandid_tokenvalues automatically. - During setup, the connector calls the
/Currenciesendpoint to validate platform access before syncing.