Only in Mage Pro.Try our fully managed solution to access this advanced feature.
Configuration
To set up the Xero source, provide the following configuration parameters:| Key | Description | Sample Value | Required |
|---|---|---|---|
access_token | OAuth access token used to authenticate API requests. | abcdefg | ✅ |
id_token | Token containing user identity details (if OpenID Connect scopes are requested). | abcdefg | ✅ |
start_date | The start date for syncing data. Format: YYYY-MM-DDTHH:MM:SSZ. | 2021-01-01T00:00:00Z | ✅ |
client_id | Client ID issued when you create your Xero app. | abcdefg | ✅ |
client_secret | Client secret generated when you create your Xero app. | abcdefg | ✅ |
tenant_id | Tenant ID associated with your Xero organization. | abcdefg | ✅ |
refresh_token | Refresh token used to renew the access token after expiration (requires offline_access scope). | abcdefg | ✅ |
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:| Scope | Required For |
|---|---|
accounting.settings.read | Organisation settings, currencies, etc. |
accounting.transactions.read | Invoices, bank transactions, payments |
accounting.contacts.read | Contacts |
accounting.reports.read | Reports |
accounting.journals.read | Journals |
accounting.attachments.read | Attachments |
offline_access | Long-lived access via refresh tokens |
- 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.