Open Navigation

Xero

Xero is an easy-to-use but powerful cloud based online accounting system.

Overview

Xero is an easy-to-use but powerful cloud based online accounting system. Xero provides business owners with real-time visibility of their financial position and performance in a way that is simple, smart and secure.

Authentication

In order to use the Xero connector in your workflows, an authentication for the service will need to be created. This allows Tray.io to access your Xero account (and the organisations associated with it) on your behalf. Authentication is a simple process and only needs to be performed once.

To authenticate to Xero, drop the Xero connector into your workflow and click on the step so that it is selected.

xero-add-step

The input panel for the step will be displayed on the right hand side of the workflow builder. Here, you will find the authentication section. Click on the the 'New Authentication' button located underneath the drop-down field.

xero-new-auth

The window that opens will give you an opportunity to give your authentication a name. This name is purely to help you identify the authentication when selecting it for other Xero connector steps and can be edited later if required.

Below the 'Authentication name' field you will see a number of checkboxes that allow you to specify what parts of your Xero account Tray.io is allowed to have access to. The permission sets listed are the ones required by Tray.io so that it can execute all of the operations in the connector. It is advised to enable them to ensure that all of the operations can execute as intended.

Once you have chosen a name for your authentication and have selected the permissions, click 'Add authentication'.

xero-add-auth

You will be then redirected to a Xero login page which will. After you have logged in with your Xero account, you will be asked to confirm the access you are granting to Tray.io. Once you have reviewed the permissions, click 'Allow Access'.

xero-auth

After being redirected back to the workflow, the authentication has been successfully created and the Xero connector can now be used.

You will now be able to select your Xero authentication from the drop down on the 'Input Panel' in all future Xero steps (including in other workflows).

Basic Operations List

Full list of operations can be found HERE

  • List tenancies
  • Create/update invoice
  • Email invoice
  • List payments

Note on Operations usage

Your Xero User Account can be associated with more than one Organisation. When you authenticate to Xero, Tray.io will be able to interact with all of the Organisations associated with your User Account (so long as your account has sufficient privalages to do so).

In order for Xero to know which Organisation you want to interact with, a 'Tenant ID' (which identifies an organisation) must be supplied when executing the operation. For information on how to obtain your 'Tenant ID', please refer to the example below.

Example Usage: Obtaining your 'Tenant ID'

Your 'Tenant ID' can be obtained using the 'List tenancies' operation. This operation does not require any additional input and will simply list the tenancies associated with your account. The following steps will guide you through the process.

The steps will be as follows:

  1. Create a new workflow with a manual trigger and Xero connector step.
  2. Use the debug panel to obtain your 'Tenant ID'.
  3. Verify 'Tenant ID'

1. Setup manual trigger & first Xero step

Create a new workflow in your Tray.io account, and make sure to use the 'Manual Trigger' as your starting point. Once you're in the workflow builder dashboard, drop a new Xero step onto the workflow by searching in the connector panel by name (displayed in the image below).

xero-example-01-01-create-wf

2. Configue the Xero step and run the workflow

In the workflow builder, click on the Xero step you created. Once highlighted, the input panel for this step will appear on the right hand side of the workflow builder.

In the input panel, select 'List tenancies' from the drop-down options in the 'Operations' menu. Once this has been configured, click on 'Run workflow' on the bottom-right of the workflow builder.

xero-example-01-02-config

3. Obtain 'Tenant ID'

Now that the workflow has executed, we can take a look at the output of the workflow to get hold of the 'Tenancy ID'.

Click on the 'Debug' tab; this will open the debug panel on the left of the workflow builder itself. Here, you can select the workflow run that was just executed. A further panel will appear that will show the output of each step. In this case, we want to see the output of the Xero step.

Once we click on the output of this step, we can see the output of the 'List tenancies' operation. The response we receive from Xero will include the 'Tenant ID' of the organisation tied to your User Account.

If we take a closer look at this output, we can see that it contains a parameter called 'tenantId'. This is the 'Tenant ID' that can be used to run your operations.

xero-example-01-03-debug

3. Verify 'Tenant ID'

We can now test to see if this 'Tenant ID' will allow us to run operations correctly. We will first copy the 'Tenant ID' from the output obtained in the previous step.

Next, we can then change the operation on our Xero connector step to be 'List invoices' (as this requires a 'Tenant ID' to execute). Once we have selected the operation, we can add the copied 'Tenant ID' to the required field in the input panel.

xero-example-01-04-verify-config

You can then click 'Run workflow' and check the output in the 'Debug' panel to check the output of the step. If the step executes correctly, then you can use this 'Tenant ID' on all operations that require it.

xero-example-01-04-verify-output

Was this article helpful?
Yes
No