Add a Connection to Xero in Engini
Prerequisites
- A Xero account with access to the organization you want to connect.
- A Xero developer app of your own, with its Client Id and Client Secret (see Create your Xero app below).
- The Tenant Id of that organization (see Find your Xero Tenant Id below).
Create your Xero app
Engini connects through an app that you own in the Xero developer portal. Create it before you add the connection in Engini.- Open the Xero developer portal at developer.xero.com and sign in with your Xero account.
- Go to My Apps and click New app.
- Enter an app name, choose Web app as the integration type and fill in the remaining details Xero asks for.
- In Redirect URI, paste Engini’s Redirect URI:
https://workflowapi.engini.io/api/auth/OAuthRedirectUrl. You can also copy it from the Redirect URI field of the Xero connection form in Engini (see Connecting Engini to Xero below). Then click Create app. - Open the app’s Configuration page, click Generate a secret and copy the Client Id and the Client Secret. Xero shows the secret only once, so store it safely.
offline_access, accounting.invoices, accounting.payments, accounting.banktransactions, accounting.manualjournals, accounting.contacts, accounting.settings, accounting.reports.trialbalance.read and accounting.budgets.read.
Note: Xero’s free Starter plan allows up to 5 connections, that is, up to 5 Xero organizations connected to your app. For other plans, see Xero’s developer pricing.
Find your Xero Tenant Id
Xero identifies each connected organization by a Tenant Id, and every request Engini sends to Xero includes it. You enter it once, when you create the connection. Xero returns the Tenant Id (thetenantId value) in the response of its Connections API, https://api.xero.com/connections, once you have authorized access. Copy the tenantId of the organization you want to use and paste it into the Tenant Id field below. For details, see the Xero developer documentation.
Note: If you have access to more than one Xero organization, create a separate Engini connection for each one, each with its own Tenant Id.
Connecting Engini to Xero
- Enter your Engini account at https://app.engini.io.
-
Navigate to the Connections page by clicking on Connections in the left sidebar or by clicking here.

-
Click on the “New Integration” option located at the top bar.

-
Choose the Xero option from the available applications.

-
Enter the following details in the “New Integration” form and press Save:

- Connection Name - Enter a name that helps identify the Xero connection, for example the name of your organization.
- Client Id - Paste the Client Id of your Xero app, as described in Create your Xero app above.
- Client Secret - Paste the Client Secret you generated for your Xero app. It is hidden as you type.
- Redirect URI - Engini fills this in and you can’t edit it. Click the copy icon and add this address as a Redirect URI in your Xero app, as described in Create your Xero app above.
- Tenant Id - Paste the Tenant Id of your Xero organization, as described in Find your Xero Tenant Id above.
- Signin - Click Signin and sign in to your Xero account. Xero asks you to choose the organization to connect and to allow your app access. Click the button that allows access to complete the sign-in.
- Save - Click Save to create the connection.
Triggers
Check for New Invoices
Starts the workflow when Xero returns invoices that are new or have changed since the last check.
- Starting (UTC) - Select the start date and time for the scheduled trigger.
- Recur every - Choose the time interval for triggering and checking invoices. The minimum time interval is 15 minutes.
- Add time frame - You can specify a time frame during which the trigger will operate.
- Add Conditions - Click Add Conditions to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, click here.
Check for New Payments
Starts the workflow when Xero returns payments that are new or have changed since the last check.
- Starting (UTC) - Select the start date and time for the scheduled trigger.
- Recur every - Choose the time interval for triggering and checking payments. The minimum time interval is 15 minutes.
- Add time frame - You can specify a time frame during which the trigger will operate.
- Add Conditions - Click Add Conditions to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, click here.
Actions
Create Invoice
Creates a sales invoice or a bill in Xero.
- Contact Id - The customer or supplier the invoice belongs to. You have 3 ways to fill it:
- Dynamic List - Choose through a live, auto-generated list of your Xero contacts.
- Dynamic Mapping - Map a Contact Id variable from a previous step in your workflow so it changes automatically based on real-time data.
- Static Text - Provide the Id as text, such as
3fa85f64-5717-4562-b3fc-2c963f66afa6.
- Type - Select Sales invoice (ACCREC) for an invoice you send to a customer, or Bill (ACCPAY) for a bill you receive from a supplier.
- Line Items - The lines on the invoice. Build the list with the Initialize Object Array and Append to Object Array actions, choosing “Invoice line (Create Invoice)” as the Object Element Type. Each line has a Description (required), Quantity, Unit Amount, Account Code, Item Code, Tax Type and Discount Rate.
- Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Create Manual Journal
Creates a manual journal in Xero.
- Narration - A description of the journal, for example “Month-end accrual”.
- Journal Lines - The lines of the journal. Build the list with the Initialize Object Array and Append to Object Array actions, choosing “Journal line (Create Manual Journal)” as the Object Element Type. Each line has a Line Amount (required, debits positive and credits negative), an Account Code (required), a Description and a Tax Type.
- Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Create Payment
Records a payment against an invoice.
- Invoice Id - The invoice being paid. You have 3 ways to fill it:
- Dynamic List - Choose through a live, auto-generated list of your Xero invoices.
- Dynamic Mapping - Map an Invoice Id variable from a previous step in your workflow so it changes automatically based on real-time data.
- Static Text - Provide the Id as text, such as
3fa85f64-5717-4562-b3fc-2c963f66afa6.
- Account Id - The bank account the payment is made from or into. You have 3 ways to fill it:
- Dynamic List - Choose through a live, auto-generated list of your Xero bank accounts.
- Dynamic Mapping - Map an Account Id variable from a previous step in your workflow so it changes automatically based on real-time data.
- Static Text - Provide the Id as text, such as
3fa85f64-5717-4562-b3fc-2c963f66afa6.
- Amount - The payment amount, for example
100.00. - Date - The date of the payment.
- Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Email Invoice
Emails an invoice from Xero to the contact on the invoice.
- Invoice Id - The invoice to email. You have 3 ways to fill it:
- Dynamic List - Choose through a live, auto-generated list of your Xero invoices.
- Dynamic Mapping - Map an Invoice Id variable from a previous step in your workflow so it changes automatically based on real-time data.
- Static Text - Provide the Id as text, such as
3fa85f64-5717-4562-b3fc-2c963f66afa6.
Get Accounts
Retrieves the accounts in your Xero chart of accounts.
- Add Filter - Click Add Filter to define conditions that narrow down the data list and return only the relevant items. The fields you can filter on are Where and Modified Since. To learn more about using filters, click here.
- Add Sort - Click Add Sort to organize the data list by a selected field in ascending or descending order. To learn more about sorting data, click here.
Get Bank Transactions
Retrieves bank transactions from Xero.
- Add Filter - Click Add Filter to define conditions that narrow down the data list and return only the relevant items. The fields you can filter on are References, Where and Modified Since. To learn more about using filters, click here.
- Top N - You can set the maximum number of records Engini will return for the object you chose (default = all records).
- Add Sort - Click Add Sort to organize the data list by a selected field in ascending or descending order. To learn more about sorting data, click here.
Get Budgets
Retrieves budgets from Xero.
- Add Filter - Click Add Filter to define conditions that narrow down the data list and return only the relevant items. The fields you can filter on are Budget Ids, Date From and Date To. To learn more about using filters, click here.
Get Contacts
Retrieves customers and suppliers from Xero.
- Add Filter - Click Add Filter to define conditions that narrow down the data list and return only the relevant items. The fields you can filter on are Contact Ids, Search Term, Include Archived, Where and Modified Since. To learn more about using filters, click here.
- Top N - You can set the maximum number of records Engini will return for the object you chose (default = all records).
- Add Sort - Click Add Sort to organize the data list by a selected field in ascending or descending order. To learn more about sorting data, click here.
Get Currencies
Retrieves the currencies that are set up in your Xero organization.
- Add Filter - Click Add Filter to define conditions that narrow down the data list and return only the relevant items. The fields you can filter on are Where. To learn more about using filters, click here.
Get Invoice
Retrieves a single invoice from Xero.
- Invoice Id - The invoice to retrieve. You have 3 ways to fill it:
- Dynamic List - Choose through a live, auto-generated list of your Xero invoices.
- Dynamic Mapping - Map an Invoice Id variable from a previous step in your workflow so it changes automatically based on real-time data.
- Static Text - Provide the Id as text, such as
3fa85f64-5717-4562-b3fc-2c963f66afa6.
Get Invoices
Retrieves invoices and bills from Xero.
- Add Filter - Click Add Filter to define conditions that narrow down the data list and return only the relevant items. The fields you can filter on are Statuses, Invoice Numbers, Invoice Ids, Contact Ids, Search Term, Include Archived, Created By This App, Where and Modified Since. To learn more about using filters, click here.
- Top N - You can set the maximum number of records Engini will return for the object you chose (default = all records).
- Add Sort - Click Add Sort to organize the data list by a selected field in ascending or descending order. To learn more about sorting data, click here.
Get Manual Journals
Retrieves manual journals from Xero.
- Add Filter - Click Add Filter to define conditions that narrow down the data list and return only the relevant items. The fields you can filter on are Where and Modified Since. To learn more about using filters, click here.
- Top N - You can set the maximum number of records Engini will return for the object you chose (default = all records).
- Add Sort - Click Add Sort to organize the data list by a selected field in ascending or descending order. To learn more about sorting data, click here.
Get Payments
Retrieves payments from Xero.
- Add Filter - Click Add Filter to define conditions that narrow down the data list and return only the relevant items. The fields you can filter on are Where and Modified Since. To learn more about using filters, click here.
- Top N - You can set the maximum number of records Engini will return for the object you chose (default = all records).
- Add Sort - Click Add Sort to organize the data list by a selected field in ascending or descending order. To learn more about sorting data, click here.
Get Tax Rates
Retrieves the tax rates that are set up in your Xero organization.
- Add Filter - Click Add Filter to define conditions that narrow down the data list and return only the relevant items. The fields you can filter on are Where. To learn more about using filters, click here.
Get Trial Balance
Retrieves the trial balance report from Xero.
- Add Filter - Click Add Filter to define conditions that narrow down the data list and return only the relevant items. The fields you can filter on are Report Date and Cash Basis. To learn more about using filters, click here.
Get Users
Retrieves the users of your Xero organization.
- Add Filter - Click Add Filter to define conditions that narrow down the data list and return only the relevant items. The fields you can filter on are Where and Modified Since. To learn more about using filters, click here.
Update Invoice
Updates an existing invoice in Xero.
- Invoice Id - The invoice to update. You have 3 ways to fill it:
- Dynamic List - Choose through a live, auto-generated list of your Xero invoices.
- Dynamic Mapping - Map an Invoice Id variable from a previous step in your workflow so it changes automatically based on real-time data.
- Static Text - Provide the Id as text, such as
3fa85f64-5717-4562-b3fc-2c963f66afa6.
- Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Initialize Object Array
Creates a new object array variable in your workflow to store structured Xero data for use in later steps. Use it to build the Line Items or Journal Lines of a create action.
- Variable name - Enter the name of the variable that will hold the object array. This name will be used throughout the workflow whenever you refer to this object array.
- Object Element Type - Select the type of object the array will store: “Invoice line (Create Invoice)”, “Invoice line (Update Invoice)” or “Journal line (Create Manual Journal)”. The selected type determines the structure of the array and opens its fields so you can fill in the values for the first entry.
Append to Object Array
Adds a new entry to an existing object array variable in your workflow.
- Variable - Select the object array variable you want to append to. This must be an already initialized object array.
- Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Map Object Array
Transforms a list of data into a structured object array that can be used later in the workflow. It iterates over each item in the selected data list and maps it into a structured entry.
- Data List - Select or map the array or list of data you want to iterate over and transform.
- Object name - Define the name of the temporary object that represents each item during the mapping. You will use this name when referencing fields from the current item.
- Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Send API Request
This activity allows you to send a custom API request directly to Xero’s API.
- Base Url - The root URL of the Xero API. It is filled in from your Xero connection and can’t be edited here.
- Relative url - You can specify additional path segments or parameters that need to be added to the end of the Base Url. This allows you to customize the specific request you want to perform.
- Method - Select the HTTP method (e.g., Get, Post, Put, Delete, Patch). The default is POST.
- Body Type - Defines the format of the data in the body of your request. The default, application/json, means the body contains a JSON-formatted payload.
- application/json – Sends the request body in JSON format. Commonly used by REST APIs.
- custom – Allows you to define a custom body format by manually setting the Content-Type header. Add a
Content-Typerow in Add Headers with the media type you need (for exampleapplication/xml). With any other Body Type, a Content-Type you type in Add Headers is not sent; Engini sets it from the Body Type, and the run history shows it underheadersnotsent. - application/x-www-form-urlencoded – Sends the body as URL-encoded key-value pairs, commonly used in form submissions.
- file – Sends a file as the request body.
- multipart/form-data – Sends form data that may include both text fields and files.
- text/html – Sends the request body as HTML content.
- text/plain – Sends the request body as plain text.
- text/xml – Sends the request body in XML format.
- Body - Contains any data that is being sent to the server.
- Add Headers - Additional metadata about the request, such as the type of data Engini can accept, the length of the request body, and authentication information.
- Add Queries - The query refers to the parameters or data that are included in the URL of an HTTP request to provide additional information or instructions to the server.