Skip to main content

Xero Connector

Xero Xero is a cloud-based accounting software platform for small and medium-sized businesses. This component allows you to manage invoices, payments, items, and contacts through the Xero REST API.

API Documentation

This component was built using the Xero Accounting API.

Connections

OAuth 2.0

Authenticate requests to Xero using OAuth 2.0.

Xero uses OAuth 2.0 to authorize requests made to the API. This connection uses the OAuth 2.0 Authorization Code grant type so that the integration can authenticate with a customer's Xero account.

Prerequisites

Setup Steps

  1. Log on to Xero's developer portal.
  2. Click New app.
    • Give the app a name.
    • Select Web app for Integration type.
    • Enter the company's URL for Company or application URL.
    • Enter https://oauth2.integrations.acme.com/callback for the Redirect URI.
  3. Open the Configuration page.
    • Click Generate Secret and take note of the Client id and Client secret.

Configure the Connection

When a Xero step is added to an integration, a Xero OAuth 2.0 connection config variable is created automatically.

  • For Scopes, enter the scopes from this list that are relevant to the integration. Always include the offline_access scope so that authentication tokens refresh automatically.
  • For Client ID and Client Secret, enter the values noted above.
  • A single customer might be logged in to multiple tenants, and Tenant Name is unique for each customer. Leave that input blank, and click the gear icon next to Tenant Name. Adjust Input Visibility and select Customer to make that input visible to customers. That way, customers are prompted for their tenant name when they enable this integration.

For additional information regarding authentication, refer to the Xero docs.

This connection uses OAuth 2.0, a common authentication mechanism for integrations. Read about how OAuth 2.0 works here.

InputCommentsDefault
ScopesA space-delimited set of one or more scopes to get the user's permission to access. You must specify 'offline_access' to enable automatic token refresh.offline_access accounting.settings accounting.contacts accounting.attachments
Client IDProvide the Client Id you received from the Xero Developer Console.
Client SecretProvide the Client Secret you generated from the Xero Developer Console.
Tenant NameThe name of the tenant you are requesting access to.

OAuth 2.0 Client Credentials

Authenticate requests to Xero using OAuth 2.0 client credentials.

Xero uses OAuth 2.0 to authorize requests made to the API. This connection uses the client credentials grant type to access data from a single Xero organization using Custom Connections.

Custom Connections are a premium integration option that utilize the client credentials grant type to access data from a single Xero organization.

Setup Steps

  1. Create the Custom Connection.

    • Log in to My Apps and click New App.
    • Give the integration a name and select Custom connection as the integration type.
  2. Select scopes and the authorizing user.

    • Select the API scopes the integration will need and who will authorize the connection.
    • That user is then emailed a link that takes them to the authorization step.
    • Once authorization is complete, an email confirms the connection has been authorized.
  3. Authorize the connection.

    • After clicking the Connect button in the email, the authorizing user is taken to a consent screen where they can see which scopes are being requested and select the organization to connect.
    • Note that an organization needs to have purchased a subscription with sufficient Custom Connections to be authorized and connected.
    • The only exception is the Xero Demo Company, which can be used for free for development purposes.
  4. Retrieve the client id and client secret.

    • Once the custom connection has been authorized, the client id is available on the app details page and the client secret can be generated.

Configure the Connection

  • For Scopes, enter the scopes relevant to the integration, separated by spaces. Do not include offline_access, as this is a client credentials flow.
  • For Client ID and Client Secret, enter the values retrieved from the app details page.

For more information, refer to the Custom Connections documentation.

This connection uses OAuth 2.0, a common authentication mechanism for integrations. Read about how OAuth 2.0 works here.

InputCommentsDefault
ScopesA space-delimited set of one or more scopes to get the user's permission to access. Don't specify 'offline_access' as this is a client credentials flow.accounting.settings accounting.contacts accounting.attachments
Client IDProvide the Client Id you received from the Xero Developer Console.
Client SecretProvide the Client Secret you generated from the Xero Developer Console.

Triggers

New and Updated Records

Checks for new and updated records in Xero on a configured schedule.

InputCommentsDefault
ConnectionThe Xero connection to use.
Resource TypeThe type of Xero resource to poll for new and updated records.
Show New RecordsInclude newly created records in trigger results.true
Show Updated RecordsInclude updated records in trigger results.true

Webhook

Receive and validate webhook requests from Xero for manually configured webhook subscriptions.

InputCommentsDefault
Webhook KeyThe webhook signing key created when the subscription was set up.

Actions

Add Note to Invoice

Add additional notes to an invoice by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Invoice IDThe unique identifier for the invoice.
NotesThe note text to add to the object's history.

Add Note to Item

Add a note to an item's history by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Item IDThe unique identifier for the item.
NotesThe note text to add to the object's history.

Archive Account

Archive an account by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Account IDThe unique identifier for the account.

Archive Contact

Archive a contact by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Contact IDThe unique identifier for the contact.

Create Account

Create a new account.

InputCommentsDefault
ConnectionThe Xero connection to use.
Account CodeA customer-defined alphanumeric code that identifies the account.
Account NameThe display name shown for the account.
Account TypeThe category of the account. Choose a value from the Xero account types.
Bank Account NumberThe bank account number. Required when the account type is BANK.
Show In Expense ClaimsWhen true, the account appears in expense claims. Required for certain account types.false
Optional ValuesFor each item, provide a key and value to be used in the request body.

Create Attachment

Add an attachment to an existing object. Existing attachments with that file name will be overridden.

InputCommentsDefault
ConnectionThe Xero connection to use.
Object TypeThe type of object to attach the file to.
Object IDThe unique identifier for the object to attach the file to.
File NameThe name of the file to attach. This becomes the unique identifier of the file for update operations.
File DataThe binary contents of the file to upload.
Content TypeThe MIME type of the file to upload.

Create Contact

Create a new contact.

InputCommentsDefault
ConnectionThe Xero connection to use.
Contact NameThe full name or business name of the contact.
First NameThe given name of the contact.
Last NameThe family name of the contact.
Email AddressThe email address used to reach the contact.
Address TypeThe kind of address being provided.
AddressThe street address of the contact.
CityThe city portion of the contact's address.
Postal CodeThe postal or ZIP code of the contact's address.
CountryThe country portion of the contact's address.
RegionThe state or region portion of the contact's address.
Bank Account DetailsThe bank account number for the contact. Depending on the account type, providing a value here could cause the request to fail. See the Xero accounts documentation for the expected shape.
Contact StatusThe status to assign to the contact.
Tax NumberThe tax number of the contact. See the Xero tax types for accepted values.
Accounts Receivable Tax TypeThe default tax type applied to sales invoices for the contact. See the Xero tax types for accepted values.
Accounts Payable Tax TypeThe default tax type applied to bills for the contact. See the Xero tax types for accepted values.
Default CurrencyThe default currency code used for the contact.
Additional FieldsAdditional fields that might not be covered by the standard inputs. See Xero API documentation for additional fields.

Create Invoice

Create a new invoice.

InputCommentsDefault
ConnectionThe Xero connection to use.
Invoice TypeThe type of invoice to create.
Contact IDThe unique identifier for the contact.
Line Amount TypeWhether line amounts are tax exclusive, inclusive, or have no tax.
Invoice StatusThe status of the invoice. Required to make payments on an invoice. Defaults to DRAFT.
Line ItemsA JSON array where each object describes a line item. The 'ItemCode', 'Tracking', and 'DiscountRate' properties are optional. Use an empty array for no line items.
DateThe date the invoice was issued. Defaults to the current date based on the organization's timezone setting if not specified. Format: YYYY-MM-DD.
Due DateThe date the invoice is due. Format: YYYY-MM-DD.
Date StringThe date the record was created. Format: YYYY-MM-DDTHH:MM:SS.
Due Date StringThe due date of the invoice as a string. Format: YYYY-MM-DDTHH:MM:SS.
Invoice NumberA unique number that identifies the invoice.
ReferenceAn additional reference number for the invoice (Accounts Receivable invoices only).
URLThe URL of a source document, shown as "Go to [appName]" in the Xero app.
Currency CodeThe currency the invoice has been raised in.
Sent To ContactWhen true, marks the invoice in the Xero app as "sent". This can only be set on invoices that have been approved.false
Additional FieldsAdditional fields that might not be covered by the standard inputs. See Xero API documentation for additional fields.

Create Item

Create a new item.

InputCommentsDefault
ConnectionThe Xero connection to use.
Item CodeA user-defined code that identifies the item.
DescriptionA summary that describes the item.
Purchase DescriptionA summary shown on purchase transactions for the item.
Purchase Unit PriceThe unit price applied when the item is purchased.
Purchase Account CodeThe account code used for purchases of the item.
Purchase Tax TypeThe tax type applied to purchases. Choose a value from the Xero tax types.
Sales Unit PriceThe unit price applied when the item is sold.
Sales Account CodeThe account code used for sales of the item.
Item NameThe display name of the item.
Sales Tax TypeThe tax type applied to sales of the item. Choose a value from the Xero tax types.
Inventory Asset Account CodeThe account code used to track the inventory asset.
Is SoldWhen true, the item is available to sell.false
Is PurchasedWhen true, the item is available to purchase.false

Delete Account

Delete an account by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Account IDThe unique identifier for the account.

Delete Invoice

Delete an invoice by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Invoice IDThe unique identifier for the invoice.

Delete Item

Delete an item by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Item IDThe unique identifier for the item.

Get Account

Retrieve the information and metadata of an account by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Account IDThe unique identifier for the account.

Get Attachment

Retrieve an attachment by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Object TypeThe type of object to attach the file to.
Object IDThe unique identifier for the object to attach the file to.
File NameThe name of the file to attach. This becomes the unique identifier of the file for update operations.

Get Contact

Retrieve the information and metadata of a contact by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Contact IDThe unique identifier for the contact.

Get Contact History

Retrieve the information and metadata of a contact's history by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Contact IDThe unique identifier for the contact.

Get Invoice

Retrieve the information and metadata of an invoice by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Invoice IDThe unique identifier for the invoice.

Get Item

Retrieve the information and metadata of an item by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Item IDThe unique identifier for the item.

Get Item History

Retrieve the information and metadata of an item's history by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Item IDThe unique identifier for the item.

Get Payment

Retrieve the information and metadata of a payment by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Payment IDThe unique identifier for the payment.

Get Payment History

Retrieve the information and metadata of a payment's history by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Payment IDThe unique identifier for the payment.

List Accounts

List all accounts.

InputCommentsDefault
ConnectionThe Xero connection to use.
Modified AfterOnly records created or modified since this timestamp will be returned. Format: YYYY-MM-DDTHH:MM:SS.
WhereA filter expression applied to endpoints and elements that don't have explicit parameters.

List Connections

List all connections.

InputCommentsDefault
ConnectionThe Xero connection to use.

List Contacts

List all contacts.

InputCommentsDefault
ConnectionThe Xero connection to use.
Fetch AllWhen true, automatically fetches all pages of results. This ignores the page number input.false
Page NumberThe page of results to return (1-based). Pagination is only enabled when more than 100 elements are returned by the request. The page size cannot be specified.
Modified AfterOnly records created or modified since this timestamp will be returned. Format: YYYY-MM-DDTHH:MM:SS.
WhereA filter expression applied to endpoints and elements that don't have explicit parameters.

List Invoices

List all invoices.

InputCommentsDefault
ConnectionThe Xero connection to use.
Fetch AllWhen true, automatically fetches all pages of results. This ignores the page number input.false
Page NumberThe page of results to return (1-based). Pagination is only enabled when more than 100 elements are returned by the request. The page size cannot be specified.
Modified AfterOnly records created or modified since this timestamp will be returned. Format: YYYY-MM-DDTHH:MM:SS.
WhereA filter expression applied to endpoints and elements that don't have explicit parameters.

List Items

List all items.

InputCommentsDefault
ConnectionThe Xero connection to use.
Modified AfterOnly records created or modified since this timestamp will be returned. Format: YYYY-MM-DDTHH:MM:SS.
WhereA filter expression applied to endpoints and elements that don't have explicit parameters.

List Payments

List all payments.

InputCommentsDefault
ConnectionThe Xero connection to use.
Fetch AllWhen true, automatically fetches all pages of results. This ignores the page number input.false
Page NumberThe page of results to return (1-based). Pagination is only enabled when more than 100 elements are returned by the request. The page size cannot be specified.
Modified AfterOnly records created or modified since this timestamp will be returned. Format: YYYY-MM-DDTHH:MM:SS.
WhereA filter expression applied to endpoints and elements that don't have explicit parameters.

Pay Invoice

Create a new payment on an existing AP/AR invoice.

InputCommentsDefault
ConnectionThe Xero connection to use.
Invoice IDThe unique identifier for the invoice.
Account IDThe unique identifier for the account.
Payment AmountThe amount of the payment. Must be less than or equal to the outstanding amount owed on the invoice.
Date StringThe date the record was created. Format: YYYY-MM-DDTHH:MM:SS.

Raw Request

Send a raw HTTP request to Xero.

InputCommentsDefault
ConnectionThe Xero connection to use.
URLInput the path only (/Accounts), The base URL is already included (https://api.xero.com/api.xro/2.0). For example, to connect to https://api.xero.com/api.xro/2.0/Accounts, only /Accounts is entered in this field.
MethodThe HTTP method to use.
DataThe HTTP body payload to send to the URL.
Form DataThe Form Data to be sent as a multipart form upload.
File DataFile Data to be sent as a multipart form upload.
File Data File NamesFile names to apply to the file data inputs. Keys must match the file data keys above.
Query ParameterA list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2.
HeaderA list of headers to send with the request.
Response TypeThe type of data you expect in the response. You can request json, text, or binary data.json
TimeoutThe maximum time that a client will await a response to its request
Retry Delay (ms)The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.0
Retry On All ErrorsIf true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.false
Max Retry CountThe maximum number of retries to attempt. Specify 0 for no retries.0
Use Exponential BackoffSpecifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.false

Reverse Payment

Reverse a payment by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Payment IDThe unique identifier for the payment.

Send Invoice

Send an existing accounts receivable invoice through email.

InputCommentsDefault
ConnectionThe Xero connection to use.
Invoice IDThe unique identifier for the invoice.

Update Account

Update the information and metadata of an existing account by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Account IDThe unique identifier for the account.
Account CodeA customer-defined alphanumeric code that identifies the account.
Account NameThe display name shown for the account.
Account TypeThe category of the account. Choose a value from the Xero account types.
Purchase Tax TypeThe tax type applied to purchases. Choose a value from the Xero tax types.
DescriptionA summary that describes the item.
Enable Payments To AccountWhen true, allows payments to be made to the account.false
Optional ValuesFor each item, provide a key and value to be used in the request body.
Show In Expense ClaimsWhen true, the account appears in expense claims. Required for certain account types.false

Update Contact

Update the information and metadata of a contact by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Contact IDThe unique identifier for the contact.
Contact NumberA unique number that identifies the contact.
Contact NameThe full name or business name of the contact.
First NameThe given name of the contact.
Last NameThe family name of the contact.
Email AddressThe email address used to reach the contact.
Accounts Payable Tax TypeThe default tax type applied to bills for the contact. See the Xero tax types for accepted values.
Accounts Receivable Tax TypeThe default tax type applied to sales invoices for the contact. See the Xero tax types for accepted values.
Bank Account DetailsThe bank account number for the contact. Depending on the account type, providing a value here could cause the request to fail. See the Xero accounts documentation for the expected shape.
Default CurrencyThe default currency code used for the contact.
Tax NumberThe tax number of the contact. See the Xero tax types for accepted values.
Contact StatusThe status to assign to the contact.
CityThe city portion of the contact's address.
Address TypeThe kind of address being provided.
AddressThe street address of the contact.
Postal CodeThe postal or ZIP code of the contact's address.
CountryThe country portion of the contact's address.
RegionThe state or region portion of the contact's address.
Additional FieldsAdditional fields that might not be covered by the standard inputs. See Xero API documentation for additional fields.

Update Item

Update the information and metadata of an item by ID.

InputCommentsDefault
ConnectionThe Xero connection to use.
Item IDThe unique identifier for the item.
Item CodeA user-defined code that identifies the item.
Item NameThe display name of the item.
DescriptionA summary that describes the item.
Is SoldWhen true, the item is available to sell.false
Is PurchasedWhen true, the item is available to purchase.false
Purchase DescriptionA summary shown on purchase transactions for the item.
Purchase Unit PriceThe unit price applied when the item is purchased.
Purchase Tax TypeThe tax type applied to purchases. Choose a value from the Xero tax types.
Purchase Account CodeThe account code used for purchases of the item.
Sales Account CodeThe account code used for sales of the item.
Sales Unit PriceThe unit price applied when the item is sold.
Sales Tax TypeThe tax type applied to sales of the item. Choose a value from the Xero tax types.
Inventory Asset Account CodeThe account code used to track the inventory asset.
Optional ValuesFor each item, provide a key and value to be used in the request body.

Void Invoice

Void an existing approved invoice that has no payments applied to it.

InputCommentsDefault
ConnectionThe Xero connection to use.
Invoice IDThe unique identifier for the invoice.