Xero is an accounting software. This help document details the steps to integrate Xero with FSM. It broadly consists of the following:
- Register your application in Xero
- Create a connection for Xero
- Create a custom function in FSM
Register your application in Xero
- Log in to Xero Developer.
- Under My Apps, click New App.

- Enter the following details and click Create App:
a. App name: FSM
b. Integration type: Web app
c. Company or application URL: https://fsm.zoho.com/home
d. Redirect URI: https://deluge.zoho.com/delugeauth/callback
e. Accept the Terms & Conditions.

The Client id, Client secret can be found under the Configuration tab. Click Generate a secret to obtain the client secret.
Create a connection for Xero
- Navigate to Setup > Automation > Connections.
- Select Custom Services and click Create Service.

- Enter the following details and click Create Service.
a. Service Name: Xero
The Service Link Name will be automatically populated.
b. Authentication Type: OAuth2
c. Parameter Type: Header
d. Grant Type: Authorization Code
e. Client ID, Client Secret
The steps to obtain the Client ID, and Client Secret are mentioned here.
f. Authorize URL: https://login.xero.com/identity/connect/authorize
g. Access Token URL: https://identity.xero.com/connect/token
h. Refresh Token URL: https://identity.xero.com/connect/token
i. Scopes (refer to the table below). Choose Space for Scope Delimiter.
Scope | Scope Display Name |
accounting.transactions | accounting.transactions |
email | email |
openid | openid |
profile | profile |

- Click Create Connection.

- In the Create Connection page, do the following and click Create And Connect:
a. Enter a Connection Name
b. Disable Use Credentials of Login User
c. Choose all the scopes

- Click Connect.

- Log in to your Xero account.

- To authenticate your login, either use the notification sent to your phone or the backup method.

- In case you are using the backup method, choose a method.

- In case you have chosen Backup email address, click Send Code.

- Enter the code and click Log in.

- Click Allow access for 30 minutes.

The connection for Xero is created successfully.
Create a custom function
Here is a sample custom function. This will check the tenants you're authorized to access. Similarly, you can write custom functions as per your business requirements.
- Navigate to Setup > Automation > Functions and click Create Function.
- Enter the following details:
a. Function Name: XeroTest
b. Select a Module, say, Contacts
c. Copy the script below:
response = invokeurl
[
url :"https://api.xero.com/connections"
type :GET
connection:"xero"
];
info response;
|
In the script, the value to be given for connection is the Connection Link Name (refer to the screenshot below).
To test the function, do the following:
- In the Deluge Script Editor, click Save & Execute.

- In the Execute Function pop-up, enter a Record ID or click Click here to get the list to obtain the list of available records.

- Select a record and click Execute.

- Click Execute.

The result of the function will be displayed.