Skip to content

Xero OAuth 2.0

Overview
The purpose of this document is to outline the detailed approach to setting up the new Xero OAuth2.0 integration with Sentral.
The integration has two components:
1. API integration which allows Sentral and Xero to securely communicate via API calls between the two systems.
2. Xero webhook, which allows for Xero to notify Sentral of changes to a customer or invoice that has been made in Xero. Sentral then queries via API the Xero file to determine the change.
Both components need to be set up for the integration to operate as expected.

What you will need
- Access level to the school’s Xero file as either Standard or Advisor
- Permission to the integrations page in Sentral
- Access to create a new app for the Xero ‘file’ for the school via the URL: https://developer.xero.com/myapps/

Setting up the Integration
API set-up
1. Open two sessions of a web-browser, one logged in to Sentral and the other into the Xero Developer MyApps page (https://developer.xero.com/myapps/)
2. In the Sentral page, access the Xero integrations page by selecting the setup menu at the top right-hand corner.
- Select the integrations tab
- Select configure on the Xero
- Integration tab
  This opens the Xero configurations page. 
3. In the Xero MyApps page, select new App, the Add a new App pop-up will display. 
4. Populate the information from the Sentral Page into the Xero page  
Once you have agreed to the Xero Terms and Conditions the Xero App details will display.

Create and apply the Xero API keys
Scroll to the bottom of the newly created app and select Generate Secret button. Hit Save
Click proceed in the Xero configuration page in Sentral to enable the below fields to be populated 
1. Copy the Client ID from the Xero App page to the Client ID field in the Sentral page
2. Copy the Client Secret from the Xero App page to Shared Secret field in the Sentral page
NOTE: We recommend using the copy button and not highlighting the code and manually clicking copy

Validating the integration
1. On the Sentral page, click allow access in Xero. This will open a Xero page asking which Xero file you wish to connect to.
2. Select your Xero file and then select allow access. The Xero file with display in the Xero Tenant of the Sentral page.
The Xero API Integration has been set up.   

Setting up the Webhook
On the Xero page, select webhook key from the top left-hand options. The Webhook set up will display.
1. From the Sentral page copy the highlighted URL
2. In the Xero page select Yes for both contacts and invoices and paste the URL from the integration page into the send notifications to page.
3. Select save on the Xero page.
4. From the Xero page, copy the webhook key and paste it into the webhook key field in Sentral
5. On the Sentral page, select Save.
The web-hook is now set up.

Validating the Webhook
1. On the Xero page click the “send intent to receive button”
2. Wait 15 – 30 Seconds and refresh the page
3. A successful webhook connection will look like this 
You successfully validated the Webhook.
Your app can be viewed at any time by following the https://developer.xero.com/myapps/ link to the Xero Developer page or by selecting my apps from your Xero login. 

Feedback and Knowledge Base