Skip to main content

Xero

Prefer guided AI setup?

Instead of following these steps manually, you can use the AI Credential Assistant — describe what you want to connect and the AI will walk you through the setup step by step, tailored to your account.

Overview​

Connect your Xero account to Nirvai to automate accounting workflows, manage invoices, track expenses, and sync financial data.

Supported Authentication Methods​

  • OAuth2 - Secure authorization with Xero Developer account

Prerequisites​

Setup Instructions​

OAuth2 Authentication​

Step 1: Create a Xero App​

  1. Go to Xero Developer Portal
  2. Click New app
  3. Select Web app as the integration type

Step 2: Configure Your App​

  1. Enter your App name (cannot contain "n8n")
  2. For Company or application URL, enter your Nirvai server URL
  3. Add the Nirvai OAuth Redirect URL as an OAuth 2.0 redirect URI

Step 3: Get OAuth Credentials​

  1. Once created, copy the Client ID
  2. Generate and copy the Client Secret

Step 4: Set Scopes​

Add these scopes for full functionality:

  • offline_access - For token refresh
  • accounting.transactions - Invoices, bills, payments
  • accounting.contacts - Customers and suppliers
  • accounting.settings - Organization settings

Step 5: Configure in Nirvai​

  1. In Nirvai, select Xero OAuth2
  2. Enter your Client ID and Client Secret
  3. Click Connect to authorize

Available Operations​

With Xero credentials, you can:

  • Create and manage invoices
  • Track bills and payments
  • Manage contacts (customers/suppliers)
  • Access bank transactions
  • Generate financial reports
  • Manage chart of accounts

Scopes Reference​

ScopePurpose
offline_accessRefresh tokens for continuous access
accounting.transactionsRead/write invoices, bills, payments
accounting.contactsRead/write customers and suppliers
accounting.settingsRead organization settings

Troubleshooting​

Common Issues​

  • Invalid Redirect URI: Ensure the Nirvai callback URL is added to your app
  • Scope Errors: Verify you've added required scopes in your Xero app
  • App Name Restriction: Xero doesn't allow "n8n" in app names
  • Token Expired: Nirvai automatically handles token refresh

Multi-Organization Access​

Xero OAuth tokens can access multiple organizations:

  1. During authorization, select which orgs to connect
  2. Use the connections endpoint to list available orgs
  3. Specify tenant ID in API calls for multi-org setups

Adapted from n8n documentation for Nirvai platform


Next Steps​

Got your credential? Connect it to an agent

Use the AI Tool Creator to turn this credential into agent-callable tools. Describe what your agent should be able to do and the AI investigates the API, configures the endpoints, and gives you a reviewable toolkit before saving anything.