What your automation will do…
Refer to Xero – Connection

Xero Methods List and Settings Copy Link
UPSERT RECORDS Copy Link
⚠️ Reminder: The Method employs matching criteria to search for existing records. If a match is found, the record is updated; otherwise, a new record is created using the supplied information.
Configuration Table:
Input Options (Field Mapping):
- Input: Allows dynamic inputs, e.g., from a Trigger or from Step responses. Input tab>uncheck “Show recommended” to see all fields).
- Default Value: Select value from a defined list or specify a fixed attribute.
- Manual input: Set a custom value by using the Lightning Bold feature.
Name* | Upsert Record |
Connection* | Select your connection or create one. |
Entity* (Set of data that contain records) | Select the available Entities to create records: Invoice, Contact, Item, Purchase Order, Contact Groups, Tracking Category. |
(*) required field
Configuration tables for each Entity:
Upsert Invoice Copy Link
When Upsert Invoices:
▪️ Providing an existing Line Item with its Line Item ID will update that line item.
▪️ Not providing an existing Line Item with it’s Line Item ID will result in that line item being deleted.
Tip: Get ID and Code value (for example Contact ID) from Method “Get Records“, “Find Record” or from Trigger “Get all Records of an Entity“.
See Xero Invoice API Reference.
Invoice status changes:
The following state changes are valid when updating invoices.
Existing status | New status |
---|---|
DRAFT | DRAFT |
DRAFT | SUBMITTED |
DRAFT | AUTHORISED |
DRAFT | DELETED |
SUBMITTED | SUBMITTED |
SUBMITTED | AUTHORISED |
SUBMITTED | DRAFT |
SUBMITTED | DELETED |
AUTHORISED | AUTHORISED |
AUTHORISED | VOIDED |
Updating Invoices:
You can only update an invoice depending on the type of invoice, and its payment status.
Payment Status | ACCREC | ACCPAY |
---|---|---|
Unpaid | Yes | Yes |
Paid (in part, or in full) | Yes – with exceptions below | No |
In a locked period | No | No |
If an invoice is paid in part or in full, you can only update the following fields:
Reference
DueDate
InvoiceNumber
BrandingThemeID
Contact
, unless the payment is made with a Credit NoteURL
LineItems
Description
AccountCode
, except for Construction Industry Scheme (CIS) account codesTracking
Configuration table:
MAP FIELDS [+ Add Field] Select fields from a list, to configure the invoice upsert. Additional fields: Tenant, Type, Contact, Line Items, Invoice Number, Reference, Date String, Date, Due Date String, Due Date, Status, Line Amount Types, Line Items, Url, Currency Code, Expected Payment Date, Planned Payment Date | |
Invoice ID* | Unique Identifier of the Invoice (that has been generated by Xero). |
ADDITIONAL FIELDS | |
Type | Select the Invoice Type: Account receivable: A sales invoice – commonly known as an Accounts Receivable or customer invoice. Account Payable : A bill – commonly known as an Accounts Payable or supplier invoice. |
Contact | Name: Full name of contact/organization. [+ Add Field] add more fields in Contact: Contact ID: Enter the Unique Identifier or Look up the value by select Input > Lookup tab > Select Search button to display a list. Email Address: Email address of contact person. Bank Account Details: Bank account number. Addresses [⊕ Element][⊕ Map] Add a repeating group of fields or Map it from an array. See Field Mapping. Additional Address can be added as elements. Element 1: Represents the first address. _Address Type: If you do not specify an AddressType , Xero will treat the address as a STREET address by default. Possible values :POBOX : For PO Box addresses.STREET : For street addresses (default if no type is specified).DELIVERY : For delivery addresses._Address Line 1 [+ Add Field] add more Address Line. _City _Region _Postal Code _Country Phone [⊕ Element][⊕ Map] Add a repeating group of fields or Map it from an array. See Field Mapping. Additional Phone can be added as elements. Element 1: Represents the first Phone. _Phone Type: If you do not specify a PhoneType , Xero will treat the phone number as a DEFAULT phone number. Possible values :DEFAULT : The primary phone number (default if no type is specified).MOBILE : For mobile phone numbers.FAX : For fax numbers.DDI : For direct dial-in numbers._Phone Number _Phone Area Code _Phone Country Code |
Line Items | [⊕ Element][⊕ Map] Add a repeating group of fields or Map it from an array. See Field Mapping. Additional Line can be added as elements. Element 1: Represents the first Line. Line Item ID: Unique Identifier of the Line Item. Description: Description of the line item (max length = 4000). Unit Amount: By default, unit amount will be rounded to two decimal places. Quantity: Line item Quantity. [+ Add Field] add more fields in Line Items: Tax Type: Used as an override if the default Tax Code for the selected Account Code is not correct – see TaxTypes. Tax Amount: The tax amount is auto calculated as a percentage of the line amount based on the tax rate. You can change this value if the tax calculation is incorrect. Line Amount: The line amount reflects the discounted price if a DiscountRate has been used i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100) (can’t exceed 9,999,999,999.99 ). Account Code: Customer defined alpha numeric account code e.g 200 or SALES. specifies which revenue or expense account the credit note applies to. Tip: Find the Account Code with the Method “Get Records” or “Find Records”, Entity “Account”. Item Code: User defined item code. Discount Amount Discount Rate Percentage discount or discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts. |
Tenant | Optionally select a specific Organization (for Xero Account with multiple Organisations). Select Input > Lookup tab > Select Search button to display a list. |
Invoice Number (max length = 255) | If your Invoice Type is ACCREC – Enter a Unique alpha numeric code identifying invoice ( when missing will auto-generate from your Organisation Invoice Settings). If your Invoice Type is ACCPAY – Enter a non-unique alpha numeric code identifying invoice. This value will also display as Reference in the UI. |
Reference | ACCREC only – additional reference number (max length = 255) |
Date String | Use these fields if you are working with date strings that are not in the standard YYYY-MM-DD format.The DateString and DueDateString fields accept dates in a human-readable string format (e.g., "1 January 2023" or "01/01/2023" ).Xero will attempt to parse the string into a valid date. If both Date and DateString (or DueDate and DueDateString ) are provided, Xero will prioritize the Date and DueDate fields. |
Date | Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation. |
Due Date String | Use these fields if you are working with date strings that are not in the standard YYYY-MM-DD format.The Date String and Due Date String fields accept dates in a human-readable string format (e.g., "1 January 2023" or "01/01/2023" ).Xero will attempt to parse the string into a valid date. If both Date and Date String (or Due Date and Due Date String ) are provided, Xero will prioritize the Date and DueDate fields. |
Due Date | Date invoice is due – YYYY-MM-DD |
Status | Possible values : Draft – Submitted – Authorized For more details, refer to Invoice Status. |
Line Amount Types | Line amounts are exclusive of tax by default if you don’t specify this element. Possible values: Exclusive: Line items are exclusive of tax Inclusive: Line items are inclusive tax NoTax: Line have no tax |
Url | URL link to a source document – shown as “Go to [appName] ” in the Xero app. |
Currency code | The currency that invoice has been raised in (see List of Currencies). |
Expected Payment Date | Shown on sales invoices (Accounts Receivable) when this has been set. |
Planned Payment Date | Shown on bills (Accounts Payable) when this has been set. |
(*) required field
Example of Invoice (ACCREC)
Invoice with every single element being specified:
{
"Invoices": [
{
"Type": "ACCREC",
"Contact": {
"ContactID": "eaa28f49-6028-4b6e-bb12-d8f6278073fc"
},
"DateString": "20025-09-08T00:00:00",
"DueDateString": "20025-10-20T00:00:00",
"ExpectedPaymentDate": "2009-10-20T00:00:00",
"InvoiceNumber": "OIT:01065",
"Reference": "Ref:SMITHK",
"BrandingThemeID": "3b148ee0-adfa-442c-a98b-9059a73e8ef5",
"Url": "http://www.accounting20.com",
"CurrencyCode": "NZD",
"Status": "SUBMITTED",
"LineAmountTypes": "Inclusive",
"SubTotal": "87.11",
"TotalTax": "10.89",
"Total": "98.00",
"LineItems": [
{
"ItemCode": "Test 01",
"Description": "3 copies of OS X 10.6 Snow Leopard",
"Quantity": "3.0000",
"UnitAmount": "59.00",
"TaxType": "OUTPUT",
"TaxAmount": "19.67",
"LineAmount": "177.00",
"AccountCode": "200",
"Tracking": [
{
"TrackingCategoryID": "e2f2f732-e92a-4f3a-9c4d-ee4da0182a13",
"Name": "Region",
"Option": "North"
}
]
},
{
"ItemCode": "Test 02",
"Description": "Returned Apple Keyboard with Numeric Keypad (faulty)",
"Quantity": "1.0000",
"UnitAmount": "-79.00",
"TaxType": "OUTPUT",
"TaxAmount": "-8.78",
"LineAmount": "-79.00",
"AccountCode": "200"
}
]
}
]
}
Upsert Contact Copy Link
⚠️ When you are updating a contact you don’t need to specify every element. If you exclude an element then the existing value will be preserved.
▪️ The business rules around contacts in Xero may be changing in the future and ‘Contact Name’ may no longer be a unique field.
▪️ We recommend all developers use ContactID to uniquely reference contacts in Xero and do not rely on ContactName as a way to reference contact data uniquely in Xero.
Tip: Get ID and Code value (for example Contact ID) from Method “Get Records“, “Find Record” or from Trigger “Get all Records of an Entity“.
See Xero Contact API Reference.
MAP FIELDS [+ Add Field] Select fields from a list, to configure the Contact upsert. Additional fields: Tenant, FirstName, LastName, Contact Number, Email Address, Company Number, Addresses, Phones, Contact Persons, Bank Account Details, Tax Number, Accounts Receivable Tax Type, Accounts Payable Tax Type, IsSupplier, IsCustomer, Default Currency. | |
Name* | Full name of contact/organisation (max length = 255) |
ADDITIONAL FIELDS | |
Tenant | Optionally select a specific Organization (for Xero Account with multiple Organisations). Select Input > Lookup tab > Select Search button to display a list. |
FirstName | First name of contact person (max length = 255) |
LastName | Last name of contact person (max length = 255) |
Contact Number | This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. |
Email Address | Email address of contact person (umlauts (ä, ö, ü) not supported) (max length = 255) |
Company Number | Company registration number. Max 50 char. |
Addresses | [⊕ Element][⊕ Map] Add a repeating group of fields or Map it from an array. See Field Mapping. Additional Address can be added as elements. Element 1: Represents the first address. _Address Type: If you do not specify an AddressType , Xero will treat the address as a STREET address by default. Possible values :POBOX : For PO Box addresses.STREET : For street addresses (default if no type is specified).DELIVERY : For delivery addresses._Address Line 1 [+ Add Field] add more Address Line. _City _Region _Postal Code _Country |
Phones | [⊕ Element][⊕ Map] Add a repeating group of fields or Map it from an array. See Field Mapping. Additional Phone can be added as elements. Element 1: Represents the first Phone. _Phone Type: If you do not specify a PhoneType , Xero will treat the phone number as a DEFAULT phone number. Possible values :DEFAULT : The primary phone number (default if no type is specified).MOBILE : For mobile phone numbers.FAX : For fax numbers.DDI : For direct dial-in numbers._Phone Number _Phone Area Code _Phone Country Code |
Contact Persons A contact can have a maximum of 5 Contact Persons. | [⊕ Element][⊕ Map] Add a repeating group of fields or Map it from an array. See Field Mapping. Additional Phone can be added as elements. Element 1: Represents the first Contact person. First Name Last Name Email Address Include in Emails: True – False To indicate whether contact should be included on emails with invoices etc. |
Bank Account Details | Bank account number of contact. |
Tax Number | Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50). |
Accounts Receivable Tax Type | Default tax type used for contact on AR invoices. This field is optional. If not provided, Xero will use the default tax type set in the organization’s settings. The available tax types depend on your organization’s tax settings. You can view and manage tax types in the Xero UI under Settings > Tax Rates. |
Accounts Payable Tax Type | Default tax type used for contact on AP invoices. This field is optional. If not provided, Xero will use the default tax type set in the organization’s settings. The available tax types depend on your organization’s tax settings. You can view and manage tax types in the Xero UI under Settings > Tax Rates. |
Default Currency | Represents the three-letter currency code (e.g., USD , EUR , GBP . See List of Currencies) that will be used as the default currency for the contact.If not provided, Xero will use the organization’s default currency (as set in the Xero organization settings). |
(*) required field
Upsert Item Copy Link
⚠️ Only the fields you include in your update request will be modified; any fields you omit will retain their existing values in Xero.
⚠️ Tracked items in Xero have their inventory quantity and value monitored, and sales are restricted based on stock levels. Untracked items are simply listed on transactions without inventory tracking. Consult Xero’s help center for more information.
Tip: Get ID and Code value (for example Contact ID) from Method “Get Records“, “Find Record” or from Trigger “Get all Records of an Entity“.
See Xero Items API Reference.
Adjusting the quantity and value of tracked items:
The Quantity and TotalCostPool elements are read-only and cannot be directly modified through the Items endpoint. To update the quantity or value of tracked items, you must create accounting transactions.
To raise the value and quantity of a tracked item, generate purchase transactions such as ACCPAY Invoices or SPEND Bank Transactions. Conversely, to reduce the value and quantity of tracked items, create sales transactions like ACCREC Invoices or RECEIVE Bank Transactions. For further details on inventory adjustments, refer to the Tracked Inventory in Xero guide.
Configuration table:
MAP FIELDS [+ Add Field] Select fields from a list, to configure the Item update. Additional fields: Tenant, Description, Inventory Asset Account Code, IsSold, IsPurchased, Purchase Description, Purchase Details, Sales Details. | |
Code* | Enter a user defined item code. |
Name | The name of the item. |
ADDITIONAL FIELDS | |
Tenant | Optionally select a specific Organization (for Xero Account with multiple Organisations). Select Input > Lookup tab > Select Search button to display a list. |
Description | Description of the item. |
Inventory Asset Account Code | The inventory asset account for the item. The account must be of type INVENTORY . The COGSAccountCode in PurchaseDetails is also required to create a tracked item. |
IsSold | True – False If True the item will be available on sales transactions in the Xero UI. |
IsPurchased | True- False If True the item is available for purchase transactions in the Xero UI. |
Purchase Description | The purchase description of the item (max length = 4000) |
Purchase Details | [+ Add Field] add more fields: Unit Price: By default UnitPrice is rounded to two decimal places. Account Code: Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items. Cost of good sold Account Code(COGSAccountCode): Cost of goods sold account. Only applicable to the purchase details of tracked items. Tax Type: Used as an override if the default Tax Code for the selected Account Code is not correct – see TaxTypes. |
Sales Details | [+ Add Field] add more fields: Unit Price: By default UnitPrice is rounded to two decimal places. Account Code: Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items. Tax Type: Used as an override if the default Tax Code for the selected Account Code is not correct – see TaxTypes. |
(*) required field
Upsert Purchase Order Copy Link
⚠️ When creating a purchase order you can set the Status field to DRAFT, SUBMITTED, or AUTHORISED. However, once a purchase order is set to SUBMITTED or AUTHORISED, it cannot be reverted to DRAFT through the Update Method. Additionally, the statuses BILLED and DELETED are system-generated and cannot be assigned manually during creation or updates.
Tip: Get ID and Code value (for example Contact ID) from Method “Get Records“, “Find Record” or from Trigger “Get all Records of an Entity“.
See Xero Purchase Order API Reference.
Updating line items when updating purchase orders:
In an update request:
- Providing an existing Line Item with its Line Item ID will update that line item.
- Providing a Line Item with no Line Item ID will create a new line item.
- Not providing an existing Line Item with it’s Line Item ID will result in that line item being deleted.
Configuration table:
MAP FIELDS [+ Add Field] Select fields from a list, to configure the Purchase Order upsert. Additional fields: Tenant, Date, Status, Line Amount Types, Currency Code, Purchase Order Number, Reference, Branding Theme ID, Send To Contact, Delivery Address, Attention To, Telephone, Delivery Instructions, Expected Arrival Date. | |
Purchase Order ID* | Unique Identifier of the Purchase Order. |
ADDITIONAL FIELDS | |
Contact provide information of an existing contact. | Contact ID: Enter the Unique Identifier or Look up the value by select Input > Lookup tab > Select Search button to display a list. [+ Add Field] add more fields in Contact: Name: Full name of contact/organization. |
Line Items | [⊕ Element][⊕ Map] Add a repeating group of fields or Map it from an array. See Field Mapping. Additional Line can be added as elements. Element 1: Represents the first Line. Line Item ID: Unique Identifier of the Line Item. Unit Amount: By default, unit amount will be rounded to two decimal places. Quantity: Line item Quantity. [+ Add Field] add more fields in Line Items: Description: Description of the line item (max length = 4000). Account Code: specifies which revenue or expense account the credit note applies to. Tip: Find the Account Code with the Method “Get Records” or “Find Records”, Entity “Account”. Discount Rate: Percentage discount being applied to a line item Tax Type: Used as an override if the default Tax Code for the selected Account Code is not correct – see TaxTypes. |
Tenant | Optionally select a specific Organization (for Xero Account with multiple Organisations). Select Input > Lookup tab > Select Search button to display a list. |
Date | Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation |
Delivery Date | Date the goods are to be delivered – YYYY-MM-DD (From supplier location). |
Status | Once a purchase order is set to SUBMITTED or AUTHORISED , it cannot be reverted to DRAFT through the API. Additionally, the statuses BILLED and DELETED are system-generated and cannot be assigned manually during creation or updates.Possible values: SUBMITTED AUTHORISED |
Line Amount Types | Line amounts are exclusive of tax by default if you don’t specify this element. Possible values: Exclusive: Line items are exclusive of tax Inclusive: Line items are inclusive tax NoTax: Line have no tax |
Currency Code | The currency that purchase order has been raised in (see List of Currencies). |
Purchase Order Number | Enter the Unique alpha numeric code identifying purchase order ( when missing will auto-generate from your Organisation Invoice Settings). |
Reference | Additional reference number. |
Branding Theme ID | Unique Identifier of the Branding Theme that apply to this Purchase Order. |
Send To Contact | True – False To set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed. |
Delivery Address | The address the goods are to be delivered to. |
Attention To | The person that the delivery is going to. |
Telephone | The phone number for the person accepting the delivery. |
Delivery Instructions | A free text field for instructions (500 characters max). |
Expected Arrival Date | The date the goods are expected to arrive. |
(*) required field
Example request to update a purchase order to mark it as sent
{
"PurchaseOrderID": "8694c9c5-7097-4449-a708-b8c1982921a4",
"SentToContact": true
}
Upsert Contact Groups Copy Link
Tip: Get ID and Code value (for example Contact ID) from Method “Get Records“, “Find Record” or from Trigger “Get all Records of an Entity“.
See Xero Contact Groups API Reference.
MAP FIELDS [+ Add Field] Select fields from a list, to configure the Contact Group upsert. Additional fields: Tenant. | |
Contact Group ID* | Unique Identifier of the contact group. |
ADDITIONAL FIELDS | |
Tenant | Optionally select a specific Organization (for Xero Account with multiple Organisations). Select Input > Lookup tab > Select Search button to display a list. |
Contact Group Name | Name of the Contact Group. |
Status | Status of the Contact Group. Possible values: ACTIVE: The contact group is active and fully functional. ARCHIVED: The contact group is archived and no longer active. |
(*) required field
Example request to rename a Contact Group
{
"ContactGroupID": "679382fd-7a71-4281-b013-0ff811ca87ab",
"Name": "New Name Here"
}
{
"ContactGroupID": "679382fd-7a71-4281-b013-0ff811ca87ab",
"Name": "New Name Here"
}
Upsert Tracking Category Copy Link
See Xero Tracking Categories Reference.
MAP FIELDS [+ Add Field] Select fields from a list, to configure the Tracking Category upsert. Additional fields: Tenant. | |
ID* | Unique Identifier of the Tracking Category. |
ADDITIONAL FIELDS | |
Name | The name of the Tracking Category. |
Tenant | Optionally select a specific Organization (for Xero Account with multiple Organisations). Select Input > Lookup tab > Select Search button to display a list. |
Status | Possible values: ACTIVE – ARCHIVED |
(*) required field
Example of request for updating a Tracking Category status
POST https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}
{
"Status": "ARCHIVED"
}
Test run or automate your Flow Copy Link
After setting up your Flow, you can choose to:
- “Run once”, your Flow will run only a single time. You can use this function to test your Flow.
- “Run Scheduler” will automate your Flows with the recurrence rule you previously defined.
For more details, refer to How to run a Flow tutorial in our Help Center.
If you are using a Webhook Trigger, the Flow will initiate automatically when a webhook is received from your connected apps. This means that the Flow is automated without a scheduler and will run until you deactivate the Flow manually. Refer to Webhook documentation in our Help Center.
If you need an integration that you cannot find in Wiresk, you can make a request to our team, and we will try our best to satisfy your needs.