How to Integrate Zoho FSM with Xero
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.
3. 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
You need to create a custom connection for Xero.
- Navigate to Setup > Automation > Connections.
- Select Custom Services and click Create Service.
3. 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
openid
profile
accounting.transactions
openid
profile
4. Click Create Connection.
5. 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
6. Click Connect.
7. Log in to your Xero account.
8. To authenticate your login, either use the notification sent to your phone or the backup method.
9. In case you are using the backup method, choose a method.
10. In case you have chosen Backup email address, click Send Code.
11. Enter the code and click Log in.
12. 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.
2. 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.
3. Select a record and click Execute.
4. Click Execute.
The result of the function will be displayed.