Skip to main content

Xero Component

Manage invoices, items, accounts, payments and more objects from your Xero account.

Component key: xero

Description#

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

Xero Connections#

Xero OAuth 2.0#

Xero uses OAuth 2.0 to authorize requests made to the API. In order for your integration to authenticate with your customers' Xero accounts, you will need to create a Xero OAuth 2.0 app:

  • Log on to Xero's developer portal
  • Click New app
    • Give your app a name
    • Select Web app for Integration type
    • Enter your company's URL for Company or application URL
    • Enter https://oauth2.prismatic.io/callback for the Redirect URI
  • Next, open the Configuration page
    • Click Generate Secret and take note of the Client id and Client secret - you'll enter those in Prismatic in a moment

When you add a Xero step to an integration, a Xero OAuth 2.0 connection config variable will be created automatically for you:

  • For Scopes, enter the scopes from this list that are relevant to your integration. Always include the offline_access scope in order for authentication tokens to refresh automatically.
  • For Client ID and Client Secret, enter the values you 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 visibility icon next to Tenant Name. Adjust Input Visibility and make the value Visible to Customer Deployer and Visible to Organization Deployer. That way, your customers will be prompted for their tenant name when they enable this integration.

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

InputDefaultNotesExample
Input
Authorize URL
string
/ Required
Hidden Field
Default
https://login.xero.com/identity/connect/authorize
Notes
The OAuth 2.0 Authorization URL for Xero
Example
 
Input
Client ID
string
/ Required
Default
 
Notes
Provide the Client Id you received from the Xero Developer Console.
Example
 
Input
Client Secret
password
/ Required
Default
 
Notes
Provide the Client Secret you generated from the Xero Developer Console.
Example
 
Input
Scopes
string
/ Required
Default
offline_access accounting.settings
Notes
A 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.
Example
accounting.contacts
Input
Tenant Name
string
/ Required
Default
 
Notes
Provide a string value for the name of the tenant you are requesting access to.
Example
Acme Inc.
Input
Token URL
string
/ Required
Hidden Field
Default
https://identity.xero.com/connect/token
Notes
The OAuth 2.0 Token URL for Xero
Example
 

Triggers#

Webhook#

Trigger for handling webhook requests from your Xero tenant | key: webhook

InputNotesExample
Input
Webhook Key
string
Notes
Provide the webhook key that was created upon subscription.
Example
up/tz7l0Q9FM6Wyq3Rli0bqJrfqmtl4idswda/LQ==

Output Example Payload#

{  "response": {    "contentType": "application/json; charset=UTF-8",    "statusCode": 200  },  "payload": {    "headers": {      "Content-Type": "application/json; charset=UTF-8",      "Host": "hooks.example.prismatic.io",      "x-xero-signature": "ubUJMsDNGuunnCBc/n1g0wc2SpjplAb"    },    "body": {      "data": {        "events": None,        "firstEventSequence": 0,        "lastEventSequence": 0,        "entropy": "FMLHZNKCVK"      },      "contentType": "application/json; charset=UTF-8"    },    "rawBody": {      "data": { "type": "Buffer", "data": [69, 120, 97, 109, 112, 108, 101] }    },    "queryParameters": {},    "webhookUrls": {      "Flow 1": "https://hooks.example.prismatic.io/trigger/EXAMPLEGbG93Q29uZmlnOmRlNmNmNDMyLTliNWMtN0005NDMxLTRmYzA4ZjViODgxOA=="    },    "webhookApiKeys": { "Flow 1": ["abc-123"] },    "customer": {      "externalId": "customer-example-external-id",      "name": "John Doe"    }  }}

Actions#

Add Note To Item#

Add a note to an item's history by Id | key: addNoteToItem

InputNotesExample
Input
Item ID
string
/ Required
Notes
Provide a string value for the Item ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Notes
string
Notes
Provide a string value for notes to add to an object.
Example
These are example notes.
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "HistoryRecords": [      {        "Changes": "Edited",        "DateUTCString": "2021-11-23T18:38:24",        "DateUTC": "/Date(1637692704697+0000)/",        "User": "System Generated",        "Details": "These are some example details"      }    ]  }}

Add Notes To Invoice#

Add additional notes to an invoice by Id | key: addNoteToInvoice

InputNotesExample
Input
Invoice ID
string
/ Required
Notes
Provide a string value for the Invoice ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Notes
string
Notes
Provide a string value for notes to add to an object.
Example
These are example notes.
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "HistoryRecords": [      {        "Changes": "Edited",        "DateUTCString": "2021-11-23T18:38:24",        "DateUTC": "/Date(1637692704697+0000)/",        "User": "System Generated",        "Details": "These are some example details"      }    ]  }}

Archive Account#

Archive the information and metadata of an account by Id | key: archiveAccount

InputNotesExample
Input
Account ID
string
/ Required
Notes
Provide a string value for the Account ID
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "accounts": [      {        "AccountID": "example-7b92-4e10-84e8-efef27090697",        "Code": "200",        "Name": "Example Account",        "Status": "ARCHIVED",        "Type": "REVENUE",        "TaxType": "OUTPUT"      }    ]  }}

Archive Contact#

Archive the information and metadata of a contact by Id | key: archiveContact

InputNotesExample
Input
Contact ID
string
/ Required
Notes
Provide a string value for the Contact ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "contacts": [      {        "ContactID": "example-7b92-4e10-84e8-efef27090697",        "ContactStatus": "ARCHIVED",        "Name": "Example Contact",        "EmailAddress": "someone@example.com",        "IsSupplier": "false",        "IsCustomer": "false",        "updatedDateUTC": "/Date(1637614988203+0000)/"      }    ]  }}

Create Account#

Create a new account | key: createAccount

InputNotesExample
Input
Account Code
string
/ Required
Notes
Provide a string value for the account code. This value is a customer defined alpha numeric account code.
Example
200
Input
Account Name
string
/ Required
Notes
Provide a string value for the name of the account.
Example
Example Account
Input
Account Type
string
/ Required
Notes
Provide a string value for the type of the given account. You can choose from the list of provided values here: https://developer.xero.com/documentation/api/accounting/types#accounts
Example
BANK
Input
Bank Account Number
string
Notes
This value is required if you are creating an account of type 'BANK'.
Example
121-121-1234567
Input
Optional Values
string
Key Value List
Notes
For each item, provide a key and value to be used in the request body.
Example
exampleValue
Input
Show In Expense Claims
boolean
Notes
This value will determine if your account will show in expense claims. This field is required for certain accounts.
Example
 
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Xero has support for many different types of accounts. When creating certain accounts they may require you to provide additional fields. You can provide these fields with the 'Optional Values' input. For a list of the required values for each type of account, refer to the documentation provided by Xero.

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "accounts": [      {        "AccountID": "example-7b92-4e10-84e8-efef27090697",        "Code": "200",        "Name": "Example Account",        "Status": "ARCHIVED",        "Type": "REVENUE",        "TaxType": "OUTPUT"      }    ]  }}

Create Attachment#

Create a new attachment on an existing object | key: createAttachment

InputNotesExample
Input
File Data
data
/ Required
Notes
Provide a value that represents the data of the file you want to upload
Example
 
Input
File Name
string
/ Required
Notes
Provide a string value for the name of the file you want to attach to the object. The File Name will become the unique identifier of the file for update operations.
Example
My Example File
Input
Object ID
string
/ Required
Notes
Provide a string value for the Id of the object.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Object Type
string
/ Required
Notes
Provide a string value for the type of object you would like to access.
Example
 
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Create Contact#

Create a new contact | key: createContact

InputNotesExample
Input
Accounts Payable Tax Type
string
Notes
Provide a string value for the tax type of accounts payable for the account. For more information on what value to provide, refer to the Xero docs: https://developer.xero.com/documentation/api/accounting/types#tax-types
Example
OUTPUT
Input
Accounts Receivable Tax Type
string
Notes
Provide a string value for the tax type of accounts receivable for the account. For more information on what value to provide, refer to the Xero docs: https://developer.xero.com/documentation/api/accounting/types#tax-types
Example
OUTPUT
Input
Address
string
Notes
Provide a string value that represents a valid address.
Example
4 Privet Drive
Input
Address Type
string
Notes
Provide a string value for the address type.
Example
POBOX
Input
Bank Account Details
string
Notes
Provide a string value for the details of the contacts bank account. Depending on the type of account, providing a value for this field could cause your request to fail. For more information on the expected shape of the Account object, refer to the Xero docs: https://developer.xero.com/documentation/api/accounting/accounts/#get-accounts
Example
01-0123-example-00
Input
City
string
Notes
Provide a string value for the city of the address.
Example
San Francisco
Input
Contact Name
string
/ Required
Notes
Provide a string value for the name of the contact.
Example
Acme Inc.
Input
Contact Status
string
Notes
Provide a string value for the status of the contact.
Example
 
Input
Default Currency
string
Notes
Provide a valid type of currency.
Example
USD
Input
Email Address
string
Notes
Provide a valid email address for the contact.
Example
someone@example.com
Input
First Name
string
Notes
Provide a string value for the first name of the contact.
Example
John
Input
Last Name
string
Notes
Provide a string value for the last name of the contact.
Example
Doe
Input
Postal Code
string
Notes
Provide a valid postal code.
Example
48423
Input
Tax Number
string
Notes
Provide a string value for the Tax number. For more information on what value to provide, refer to the Xero docs: https://developer.xero.com/documentation/api/accounting/types#tax-types
Example
12-345-678
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "contacts": [      {        "ContactID": "example-7b92-4e10-84e8-efef27090697",        "ContactStatus": "Active",        "Name": "Example Contact",        "EmailAddress": "someone@example.com",        "IsSupplier": "false",        "IsCustomer": "false",        "updatedDateUTC": "/Date(1637614988203+0000)/"      }    ]  }}

Create Invoice#

Create a new invoice | key: createInvoice

InputDefaultNotesExample
Input
Contact ID
string
/ Required
Default
 
Notes
Provide a string value for the Contact ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Date
string
Default
 
Notes
Provide a valid date for when the invoice was created.
Example
/Date(1518685950940+0000)/
Input
Date String
string
Default
 
Notes
Provide a string value for the date in which the invoice was created.
Example
2021-05-27T00:00:00
Input
Due Date
string
Default
 
Notes
Provide a valid date for the due date of the invoice.
Example
/Date(1518685950940+0000)/
Input
Due Date String
string
Default
 
Notes
Provide a string value for the due date of the invoice.
Example
2021-05-27T00:00:00
Input
Invoice Status
string
Default
 
Notes
This value is required if you want to make payments on an invoice. Will default to 'DRAFT'
Example
 
Input
Invoice Type
string
/ Required
Default
 
Notes
Provide a string value for the type of the given invoice.
Example
 
Input
Line Amount Type
string
/ Required
Default
 
Notes
Provide a string value for the line Amount Types.
Example
 
Input
Line Items
code
Default
[  {    "Description": "example description",    "Quantity": "10",    "ItemCode": "Use this value to reference an existing item.",    "UnitAmount": "100.00",    "AccountCode": "200",    "DiscountRate": "20",    "Tracking": [      {        "Name": "Activity/Workstream",        "Option": "On site consultancy"      }    ]  }]
Notes
Provide a JSON array, For each item, provide an object describing a valid line item. The 'ItemCode', 'Tracking', and 'DiscountRate' properties are optional. If you want to provide no line items, simply enter an empty Array.
Example
 
Input
Connection
connection
/ Required
Default
 
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "Invoices": [      {        "InvoiceID": "example-7b92-4e10-84e8-efef27090697",        "InvoiceNumber": "example01",        "AmountDue": 800,        "AmountPaid": 0,        "SentToContact": false,        "TotalDiscount": 200,        "contact": {}      }    ]  }}

Create Item#

Create a new Item | key: createItem

InputNotesExample
Input
Description
string
Notes
Provide a string value for the description.
Example
This is an example description
Input
Inventory Asset Account Code
string
Notes
Provide the account code for the inventory asset
Example
200
Input
Is Purchased
boolean
Notes
Provide a boolean value to determine if the item has been purchased yet.
Example
 
Input
Is Sold
boolean
Notes
Provide a boolean value to determine if the item has been sold yet.
Example
 
Input
Item Code
string
/ Required
Notes
Provide a user-defined valid item code.
Example
Untracked Item
Input
Item Name
string
Notes
Provide a string value for the name of the item.
Example
Example Name
Input
Purchase Account Code
string
Notes
Provide the account code of the purchase.
Example
200
Input
Purchase Description
string
Notes
Provide a string value for the description.
Example
This is an example description
Input
Purchase Tax Type
string
Notes
Provide the tax type of the purchaser. Pick a value from the items listed here: https://developer.xero.com/documentation/api/accounting/types#tax-types
Example
NONE
Input
Purchase Unit Price
string
Notes
Provide the unit price of the purchase.
Example
800
Input
Sales Account Code
string
Notes
Provide the account code of the sale.
Example
200
Input
Sales Tax Type
string
Notes
Provide the tax type of the Seller. Provide a value from the items listed here: https://developer.xero.com/documentation/api/accounting/types#tax-types
Example
NONE
Input
Sales Unit Price
string
Notes
Provide the unit price of the sale, if the item has been sold.
Example
50.69
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "Items": [      {        "ItemID": "19b79d12-0ae1-496e-9649-cbd04b15c7c5",        "Code": "ExampleThing",        "Description": "I sell this untracked thing",        "PurchaseDescription": "I buy this untracked thing",        "UpdatedDateUTC": "/Date(1488338552390+0000)/",        "PurchaseDetails": {          "UnitPrice": 20,          "AccountCode": "400",          "TaxType": "NONE"        },        "SalesDetails": {          "UnitPrice": 40,          "AccountCode": "200",          "TaxType": "OUTPUT2"        },        "Name": "An Example Untracked Item",        "IsTrackedAsInventory": false,        "IsSold": true,        "IsPurchased": true      }    ]  }}

Delete Account#

Delete the information and metadata of an account by Id | key: deleteAccount

InputNotesExample
Input
Account ID
string
/ Required
Notes
Provide a string value for the Account ID
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "accounts": [      {        "AccountID": "example-7b92-4e10-84e8-efef27090697",        "Code": "200",        "Name": "Example Account",        "Status": "ARCHIVED",        "Type": "REVENUE",        "TaxType": "OUTPUT"      }    ]  }}

Delete Invoice#

Delete the information and metadata of an invoice by Id | key: deleteInvoice

InputNotesExample
Input
Invoice ID
string
/ Required
Notes
Provide a string value for the Invoice ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "Invoices": [      {        "InvoiceID": "example-7b92-4e10-84e8-efef27090697",        "InvoiceNumber": "example01",        "AmountDue": 800,        "AmountPaid": 0,        "SentToContact": false,        "TotalDiscount": 200,        "contact": {},        "status": "Deleted"      }    ]  }}

Delete Item#

Delete the information and metadata of an item by Id | key: deleteItem

InputNotesExample
Input
Item ID
string
/ Required
Notes
Provide a string value for the Item ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Get Account#

Get the information and metadata of an account by Id | key: getAccount

InputNotesExample
Input
Account ID
string
/ Required
Notes
Provide a string value for the Account ID
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "accounts": [      {        "AccountID": "example-7b92-4e10-84e8-efef27090697",        "Code": "200",        "Name": "Example Account",        "Status": "ARCHIVED",        "Type": "REVENUE",        "TaxType": "OUTPUT"      }    ]  }}

Get Contact#

Get the information and metadata of a contact by Id | key: getContact

InputNotesExample
Input
Contact ID
string
/ Required
Notes
Provide a string value for the Contact ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "contacts": [      {        "ContactID": "example-7b92-4e10-84e8-efef27090697",        "ContactStatus": "Active",        "Name": "Example Contact",        "EmailAddress": "someone@example.com",        "IsSupplier": "false",        "IsCustomer": "false",        "updatedDateUTC": "/Date(1637614988203+0000)/"      }    ]  }}

Get Contact History#

Get the information and metadata of a contact's history by Id | key: getContactHistory

InputNotesExample
Input
Contact ID
string
/ Required
Notes
Provide a string value for the Contact ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "HistoryRecords": [      {        "Changes": "Edited",        "DateUTCString": "2021-11-23T18:38:24",        "DateUTC": "/Date(1637692704697+0000)/",        "User": "System Generated",        "Details": "These are some example details"      }    ]  }}

Get Invoice#

Get the information and metadata of an invoice by Id | key: getInvoice

InputNotesExample
Input
Invoice ID
string
/ Required
Notes
Provide a string value for the Invoice ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "Invoices": [      {        "InvoiceID": "example-7b92-4e10-84e8-efef27090697",        "InvoiceNumber": "example01",        "AmountDue": 800,        "AmountPaid": 0,        "SentToContact": false,        "TotalDiscount": 200,        "contact": {}      }    ]  }}

Get Item#

Get the information and metadata of an item by Id | key: getItem

InputNotesExample
Input
Item ID
string
/ Required
Notes
Provide a string value for the Item ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "Items": [      {        "ItemID": "example-7b92-4e10-84e8-efef27090697",        "Code": "ExampleThing",        "Description": "I sell this untracked thing",        "PurchaseDescription": "I buy this untracked thing",        "UpdatedDateUTC": "/Date(1488338552390+0000)/",        "PurchaseDetails": {          "UnitPrice": 20,          "AccountCode": "400",          "TaxType": "NONE"        },        "SalesDetails": {          "UnitPrice": 40,          "AccountCode": "200",          "TaxType": "OUTPUT2"        },        "Name": "An Example Untracked Item",        "IsTrackedAsInventory": false,        "IsSold": true,        "IsPurchased": true      }    ]  }}

Get Item History#

Get the information and metadata of an items's history by Id | key: getItemHistory

InputNotesExample
Input
Item ID
string
/ Required
Notes
Provide a string value for the Item ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "HistoryRecords": [      {        "Changes": "Updated",        "DateUTCString": "2018-02-28T21:02:11",        "DateUTC": "/Date(1519851731990+0000)/",        "User": "Example",        "Details": "Example Received through the Xero API from ABC Org"      },      {        "Changes": "Created",        "DateUTCString": "2018-02-28T21:01:29",        "DateUTC": "/Date(1519851689297+0000)/",        "User": "Example",        "Details": "Example INV-0041 to ABC Furniture for 100.00."      }    ]  }}

Get Payment#

Get the information and metadata of a payment by id | key: getPayment

InputNotes
Input
Payment ID
string
/ Required
Notes
Provide a string value for the Id of the payment.
Input
Connection
connection
/ Required
Notes
The connection to use.

Output Example Payload#

{  "data": {    "Id": "example-d457-425f-8395-b3bdad78e517",    "status": "OK",    "ProviderName": "example-provider",    "Payments": [      {        "PaymentID": "19b79d12-0ae1-496e-9649-cbd04b15c7c5",        "Date": "/Date(1638144000000+0000)/",        "BankAmount": 80,        "CurrencyRate": 1,        "PaymentType": "ACCRECPAYMENT",        "Status": "AUTHORISED",        "HasAccount": false      }    ]  }}

Get Payment History#

Get the information and metadata of a payment's history by Id | key: getPaymentHistory

InputNotes
Input
Payment ID
string
/ Required
Notes
Provide a string value for the Id of the payment.
Input
Connection
connection
/ Required
Notes
The connection to use.

List Accounts#

List all accounts | key: listAccounts

InputNotesExample
Input
Modified After
string
Notes
Only contacts created or modified since this timestamp will be returned.
Example
yyyy-mm-ddThhss
Input
Page Number
string
Notes
Provide the page of the results you would like to return. Pagination will only be enabled if over 100 elements are returned by your request. It is not possible to specify the page size.
Example
3
Input
Where
string
Notes
The where parameter allows you to filter on endpoints and elements that don't have explicit parameters.
Example
Name.Contains("Peter")
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "accounts": [      {        "AccountID": "example-7b92-4e10-84e8-efef27090697",        "Code": "200",        "Name": "Example Account",        "Status": "ARCHIVED",        "Type": "REVENUE",        "TaxType": "OUTPUT"      },      {        "AccountID": "example-7b92-4e10-84e8-efef27090697",        "Code": "200",        "Name": "Example Account",        "Status": "ARCHIVED",        "Type": "REVENUE",        "TaxType": "OUTPUT"      }    ]  }}

List Connections#

List all connections | key: listConnections

InputNotes
Input
Connection
connection
/ Required
Notes
The connection to use.

Output Example Payload#

{  "data": [    {      "id": "example-e40f-414a-8f95-ce6a63196e1a",      "authEventId": "example-e40f-414a-8f95-ce6a63196e1a",      "tenantId": "example-e40f-414a-8f95-ce6a63196e1a",      "tenantType": "ORGANIZATION",      "tenantName": "Example"    }  ]}

List Contacts#

List all contacts | key: listContacts

InputNotesExample
Input
Modified After
string
Notes
Only contacts created or modified since this timestamp will be returned.
Example
yyyy-mm-ddThhss
Input
Page Number
string
Notes
Provide the page of the results you would like to return. Pagination will only be enabled if over 100 elements are returned by your request. It is not possible to specify the page size.
Example
3
Input
Where
string
Notes
The where parameter allows you to filter on endpoints and elements that don't have explicit parameters.
Example
Name.Contains("Peter")
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "contacts": [      {        "ContactID": "example-7b92-4e10-84e8-efef27090697",        "ContactStatus": "Active",        "Name": "Example Contact",        "EmailAddress": "someone@example.com",        "IsSupplier": "false",        "IsCustomer": "false",        "updatedDateUTC": "/Date(1637614988203+0000)/"      }    ]  }}

List Invoices#

List all invoices | key: listInvoices

InputNotesExample
Input
Modified After
string
Notes
Only contacts created or modified since this timestamp will be returned.
Example
yyyy-mm-ddThhss
Input
Page Number
string
Notes
Provide the page of the results you would like to return. Pagination will only be enabled if over 100 elements are returned by your request. It is not possible to specify the page size.
Example
3
Input
Where
string
Notes
The where parameter allows you to filter on endpoints and elements that don't have explicit parameters.
Example
Name.Contains("Peter")
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "Invoices": [      {        "InvoiceID": "example-7b92-4e10-84e8-efef27090697",        "InvoiceNumber": "example01",        "AmountDue": 800,        "AmountPaid": 0,        "SentToContact": false,        "TotalDiscount": 200,        "contact": {}      }    ]  }}

List Items#

List all items | key: listItems

InputNotesExample
Input
Modified After
string
Notes
Only contacts created or modified since this timestamp will be returned.
Example
yyyy-mm-ddThhss
Input
Page Number
string
Notes
Provide the page of the results you would like to return. Pagination will only be enabled if over 100 elements are returned by your request. It is not possible to specify the page size.
Example
3
Input
Where
string
Notes
The where parameter allows you to filter on endpoints and elements that don't have explicit parameters.
Example
Name.Contains("Peter")
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "Items": [      {        "ItemID": "19b79d12-0ae1-496e-9649-cbd04b15c7c5",        "Code": "ExampleThing",        "Description": "I sell this untracked thing",        "PurchaseDescription": "I buy this untracked thing",        "UpdatedDateUTC": "/Date(1488338552390+0000)/",        "PurchaseDetails": {          "UnitPrice": 20,          "AccountCode": "400",          "TaxType": "NONE"        },        "SalesDetails": {          "UnitPrice": 40,          "AccountCode": "200",          "TaxType": "OUTPUT2"        },        "Name": "An Example Untracked Item",        "IsTrackedAsInventory": false,        "IsSold": true,        "IsPurchased": true      }    ]  }}

List Payments#

List all payments | key: listPayments

InputNotesExample
Input
Modified After
string
Notes
Only contacts created or modified since this timestamp will be returned.
Example
yyyy-mm-ddThhss
Input
Page Number
string
Notes
Provide the page of the results you would like to return. Pagination will only be enabled if over 100 elements are returned by your request. It is not possible to specify the page size.
Example
3
Input
Where
string
Notes
The where parameter allows you to filter on endpoints and elements that don't have explicit parameters.
Example
Name.Contains("Peter")
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "Id": "example-d457-425f-8395-b3bdad78e517",    "status": "OK",    "ProviderName": "example-provider",    "Payments": [      {        "PaymentID": "19b79d12-0ae1-496e-9649-cbd04b15c7c5",        "Date": "/Date(1638144000000+0000)/",        "BankAmount": 80,        "CurrencyRate": 1,        "PaymentType": "ACCRECPAYMENT",        "Status": "AUTHORISED",        "HasAccount": false      }    ]  }}

Pay Invoice#

Create a new payment on an existing AP/AR invoice | key: payInvoice

InputNotesExample
Input
Account ID
string
/ Required
Notes
Provide a string value for the Account ID
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Date String
string
Notes
Provide a string value for the date in which the invoice was created.
Example
2021-05-27T00:00:00
Input
Invoice ID
string
/ Required
Notes
Provide a string value for the Invoice ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Payment Amount
string
/ Required
Notes
Provide a string value for the amount of the payment. This value must be less than or equal to the outstanding amount owed on the invoice.
Example
 
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Reverse Payment#

Reverse a payment by Id | key: reversePayment

InputNotes
Input
Payment ID
string
/ Required
Notes
Provide a string value for the Id of the payment.
Input
Connection
connection
/ Required
Notes
The connection to use.

Output Example Payload#

{  "data": {    "Id": "example-d457-425f-8395-b3bdad78e517",    "status": "OK",    "ProviderName": "example-provider",    "Payments": [      {        "PaymentID": "19b79d12-0ae1-496e-9649-cbd04b15c7c5",        "Date": "/Date(1638144000000+0000)/",        "BankAmount": 80,        "CurrencyRate": 1,        "PaymentType": "ACCRECPAYMENT",        "Status": "DELETED",        "HasAccount": false      }    ]  }}

Send Invoice#

Send an existing accounts receivable invoice through email | key: sendInvoice

InputNotesExample
Input
Invoice ID
string
/ Required
Notes
Provide a string value for the Invoice ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

You can use the Send Invoice action to trigger the email of a sales invoice out of Xero. The invoice must be of Type ACCREC and a valid Status for sending (SUBMITTED, AUTHORISED or PAID). The email will be sent to the primary email address of the contact on the invoice and any additional contact persons that have IncludeInEmails flag set to true. The sender will be the user who authorized the app connection.


Update Account#

Update the information and metadata of an existing account by Id | key: updateAccount

InputNotesExample
Input
Account Code
string
Notes
Provide a string value for the account code. This value is a customer defined alpha numeric account code.
Example
200
Input
Account ID
string
/ Required
Notes
Provide a string value for the Account ID
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Account Name
string
Notes
Provide a string value for the name of the account.
Example
Example Account
Input
Account Type
string
Notes
Provide a string value for the type of the given account. You can choose from the list of provided values here: https://developer.xero.com/documentation/api/accounting/types#accounts
Example
BANK
Input
Description
string
Notes
Provide a string value for the description.
Example
This is an example description
Input
Enable Payments To Account
boolean
Notes
This flag will enable payments to be made to the given account.
Example
 
Input
Optional Values
string
Key Value List
Notes
For each item, provide a key and value to be used in the request body.
Example
exampleValue
Input
Purchase Tax Type
string
Notes
Provide the tax type of the purchaser. Pick a value from the items listed here: https://developer.xero.com/documentation/api/accounting/types#tax-types
Example
NONE
Input
Show In Expense Claims
boolean
Notes
This value will determine if your account will show in expense claims. This field is required for certain accounts.
Example
 
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "accounts": [      {        "AccountID": "example-7b92-4e10-84e8-efef27090697",        "Code": "200",        "Name": "Example Account",        "Status": "ARCHIVED",        "Type": "REVENUE",        "TaxType": "OUTPUT"      }    ]  }}

Update Attachment#

Update the information and metadata of an existing attachment by Id | key: updateAttachment

InputNotesExample
Input
File Data
data
/ Required
Notes
Provide a value that represents the data of the file you want to upload
Example
 
Input
File Name
string
/ Required
Notes
Provide a string value for the name of the file you want to attach to the object. The File Name will become the unique identifier of the file for update operations.
Example
My Example File
Input
Object ID
string
/ Required
Notes
Provide a string value for the Id of the object.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Object Type
string
/ Required
Notes
Provide a string value for the type of object you would like to access.
Example
 
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Update Contact#

Update the information and metadata of a contact by Id | key: updateContact

InputNotesExample
Input
Accounts Payable Tax Type
string
Notes
Provide a string value for the tax type of accounts payable for the account. For more information on what value to provide, refer to the Xero docs: https://developer.xero.com/documentation/api/accounting/types#tax-types
Example
OUTPUT
Input
Accounts Receivable Tax Type
string
Notes
Provide a string value for the tax type of accounts receivable for the account. For more information on what value to provide, refer to the Xero docs: https://developer.xero.com/documentation/api/accounting/types#tax-types
Example
OUTPUT
Input
Address
string
Notes
Provide a string value that represents a valid address.
Example
4 Privet Drive
Input
Address Type
string
Notes
Provide a string value for the address type.
Example
POBOX
Input
Bank Account Details
string
Notes
Provide a string value for the details of the contacts bank account. Depending on the type of account, providing a value for this field could cause your request to fail. For more information on the expected shape of the Account object, refer to the Xero docs: https://developer.xero.com/documentation/api/accounting/accounts/#get-accounts
Example
01-0123-example-00
Input
City
string
Notes
Provide a string value for the city of the address.
Example
San Francisco
Input
Contact ID
string
/ Required
Notes
Provide a string value for the Contact ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Contact Name
string
Notes
Provide a string value for the name of the contact.
Example
Acme Inc.
Input
Contact Number
string
Notes
Provide a string value for the unique number identifier of the contact.
Example
IDexample01
Input
Contact Status
string
Notes
Provide a string value for the status of the contact.
Example
 
Input
Default Currency
string
Notes
Provide a valid type of currency.
Example
USD
Input
Email Address
string
Notes
Provide a valid email address for the contact.
Example
someone@example.com
Input
First Name
string
Notes
Provide a string value for the first name of the contact.
Example
John
Input
Last Name
string
Notes
Provide a string value for the last name of the contact.
Example
Doe
Input
Postal Code
string
Notes
Provide a valid postal code.
Example
48423
Input
Tax Number
string
Notes
Provide a string value for the Tax number. For more information on what value to provide, refer to the Xero docs: https://developer.xero.com/documentation/api/accounting/types#tax-types
Example
12-345-678
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "contacts": [      {        "ContactID": "example-7b92-4e10-84e8-efef27090697",        "ContactStatus": "Active",        "Name": "Example Contact",        "EmailAddress": "someone@example.com",        "IsSupplier": "false",        "IsCustomer": "false",        "updatedDateUTC": "/Date(1637614988203+0000)/"      }    ]  }}

Update Item#

Update the information and metadata of an item by Id | key: updateItem

InputNotesExample
Input
Description
string
Notes
Provide a string value for the description.
Example
This is an example description
Input
Optional Values
string
Key Value List
Notes
For each item, provide a key and value to be used in the request body.
Example
exampleValue
Input
Inventory Asset Account Code
string
Notes
Provide the account code for the inventory asset
Example
200
Input
Is Purchased
boolean
Notes
Provide a boolean value to determine if the item has been purchased yet.
Example
 
Input
Is Sold
boolean
Notes
Provide a boolean value to determine if the item has been sold yet.
Example
 
Input
Item Code
string
/ Required
Notes
Provide a user-defined valid item code.
Example
Untracked Item
Input
Item ID
string
/ Required
Notes
Provide a string value for the Item ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Item Name
string
Notes
Provide a string value for the name of the item.
Example
Example Name
Input
Purchase Account Code
string
Notes
Provide the account code of the purchase.
Example
200
Input
Purchase Description
string
Notes
Provide a string value for the description.
Example
This is an example description
Input
Purchase Tax Type
string
Notes
Provide the tax type of the purchaser. Pick a value from the items listed here: https://developer.xero.com/documentation/api/accounting/types#tax-types
Example
NONE
Input
Purchase Unit Price
string
Notes
Provide the unit price of the purchase.
Example
800
Input
Sales Account Code
string
Notes
Provide the account code of the sale.
Example
200
Input
Sales Tax Type
string
Notes
Provide the tax type of the Seller. Provide a value from the items listed here: https://developer.xero.com/documentation/api/accounting/types#tax-types
Example
NONE
Input
Sales Unit Price
string
Notes
Provide the unit price of the sale, if the item has been sold.
Example
50.69
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "Items": [      {        "ItemID": "example-7b92-4e10-84e8-efef27090697",        "Code": "ExampleThing",        "Description": "I sell this untracked thing",        "PurchaseDescription": "I buy this untracked thing",        "UpdatedDateUTC": "/Date(1488338552390+0000)/",        "PurchaseDetails": {          "UnitPrice": 20,          "AccountCode": "400",          "TaxType": "NONE"        },        "SalesDetails": {          "UnitPrice": 40,          "AccountCode": "200",          "TaxType": "OUTPUT2"        },        "Name": "An Example Untracked Item",        "IsTrackedAsInventory": false,        "IsSold": true,        "IsPurchased": true      }    ]  }}

Void Invoice#

Void an existing approved invoice that has no payments applied to it. | key: voidInvoice

InputNotesExample
Input
Invoice ID
string
/ Required
Notes
Provide a string value for the Invoice ID.
Example
example-e40f-414a-8f95-ce6a63196e1a
Input
Connection
connection
/ Required
Notes
The connection to use.
Example
 

Output Example Payload#

{  "data": {    "ID": "example-7b92-4e10-84e8-efef27090697",    "status": "OK",    "ProviderName": "MyExampleProvider",    "DateTimeUTC": "/Date(1637616068092)/",    "Invoices": [      {        "InvoiceID": "example-7b92-4e10-84e8-efef27090697",        "InvoiceNumber": "example01",        "AmountDue": 800,        "AmountPaid": 0,        "SentToContact": false,        "TotalDiscount": 200,        "contact": {},        "Status": "VOIDED"      }    ]  }}