Connecting to Xero
This guide walks you through creating a Xero App and connecting it to your Blesta installation.
Creating a Xero App
Step 1: Access the Developer Portal
- Go to developer.xero.com
- Sign in with your Xero credentials
- Click My Apps in the top menu
Step 2: Create a New App
- Click New app
- Fill in the app details:
- App name: Your company name or "Blesta Sync"
- Integration type: Select Web app
- Company or application URL: Your Blesta URL
- OAuth 2.0 redirect URI: Copy this from your Xero Sync settings page
Important: The redirect URI must match EXACTLY what is shown on your Xero Sync settings page, including the trailing slash if present.
- Accept the terms and click Create app
Step 3: Get Your Credentials
After creating the app:
- You will see your Client ID - copy this
- Click Generate a secret to create your Client Secret
- Copy the Client Secret immediately (it will only be shown once)
Configuring Blesta
Step 1: Enter Credentials
- Go to Tools → Xero Sync → Settings in Blesta admin
- Enter your Client ID
- Enter your Client Secret
- Click Save Settings
Step 2: Connect to Xero
- Click the Connect to Xero button
- You will be redirected to Xero to authorize the connection
- Select the organization you want to sync with
- Click Allow access
- You will be redirected back to Blesta
Step 3: Select Organization (Multi-Org)
If your Xero account has multiple organizations:
- After connecting, the Organization dropdown will appear
- Select the organization you want to sync
- Click Save Settings
Connection Status
On the Settings page, you will see:
- Connected (green) - Successfully connected to Xero
- Not Connected (red) - Connection required or expired
Token Refresh
The plugin automatically refreshes OAuth tokens before they expire. No manual intervention is required.
Disconnecting
To disconnect from Xero:
- Go to Settings
- Click Disconnect from Xero
- Confirm the action
Note: Disconnecting does not delete your sync mappings. You can reconnect and continue syncing.
Troubleshooting Connection Issues
Invalid Redirect URI
If you see a redirect URI error:
- Verify the URI in Xero matches EXACTLY what Blesta shows
- Check for http vs https differences
- Check for trailing slash differences
- Ensure no extra spaces were copied
Token Expired
If your connection stops working:
- Try clicking Connect to Xero again
- Reauthorize the connection
- Check that your Xero app has not been deleted
Access Denied
If Xero denies access:
- Ensure you are signing into the correct Xero account
- Verify you have admin permissions in Xero
- Check that the Xero app is still active