Prerequisites

  • Xero account (personal or business)
  • Access to Xero Developer Portal

Step 1: Create Xero Developer Account

  1. Visit https://developer.xero.com/
  2. Click “Get started for free” or “Login” if you already have an account
  3. Sign in with your Xero account or create a new developer account
Xero Developer Login

Step 2: Create a New App

  1. Once logged in, go to your developer dashboard
  2. Click “New app” or “Create an app”
  3. Choose “Web App” as the integration type
  4. Fill in the app details:
    • App name: Your application name (e.g., your brand name)
    • Company or application URL: Your company website
    • Privacy policy URL: Your privacy policy URL
    • Terms of service URL: Your terms of service URL
Xero App Creation Form
Normally, the redirect URI should be set to: https://api.klavis.ai/oauth/xero/callback

Step 3: Configure OAuth Settings

Klavis Xero MCP Server uses the following OAuth scopes: accounting.transactions.read accounting.transactions offline_access
  1. Redirect URIs: Add your callback URL:
    • https://api.klavis.ai/oauth/xero/callback
  2. Scopes: Select the scopes your application needs:
    • offline_access (required for refresh tokens)
    • accounting.transactions.read (for reading transaction data)
    • accounting.transactions (for transaction operations)
    • Add any additional scopes based on your needs
OAuth Settings and Connection Configuration
You can connect up to 25 organisations to uncertified apps. Read more about uncertified app limits.

Step 4: Get Your Credentials

After creating the app, you’ll see:
  • Client ID: Copy this value
  • Client Secret: Generate and copy this value (keep it secure!)
You have successfully created a Xero OAuth application! You now have your Client ID and Client Secret ready for integration with Klavis AI.

Xero Token Expiration

  • Access Tokens: Expire after 30 minutes
  • Refresh Tokens: Expire after 60 days (rolling expiration - resets when used)
Klavis handles all token management automatically - we refresh your tokens before they expire so you maintain seamless access to your Xero data without any interruption.

(Optional) Step 5: White Labeling

White labeling allows you to customize the OAuth experience with your own branding instead of Klavis AI’s.
If you want to use your own Xero OAuth application with custom branding:
  1. Configure White Labeling: Go to https://www.klavis.ai/home/white-label
  2. Add Your Credentials: Enter your Xero Client ID and Client Secret from Step 4
  3. Set Redirect URI: Use https://api.klavis.ai/oauth/xero/callback or your custom callback URL
  4. Initiate OAuth: Use your client ID when starting the OAuth flow:
    const authUrl = `https://api.klavis.ai/oauth/xero/authorize?instance_id=${instanceId}&client_id=${yourClientId}`;
    
For detailed white labeling implementation and code examples, see our OAuth & White Labeling guide.

Resources