English
Xero
Records the received bill with its PDF, finds a contact or invoice, issues a sales invoice and has it sent.
The Xero node acts on the organisation of a Xero connection. Pick a Resource — Contact, Sales invoice, Bill — then an Operation.
| Resource | Operations |
|---|---|
| Contact | Create · Update · Get · Search |
| Sales invoice | Create · Get · Search · Attach a file · Get the PDF · Send via Xero |
| Bill | Create (with the email attachment) · Get · Search · Attach · Get the PDF |
At a glance
- Type:
xero.api· version 1 - Category: Data
- Kind: Step — one stage of a run
- Effect: Writes outside (
external_write) — writes outside Loop & Roll; described instead of performed during a test run - Needs a carrier email: No
- Connection: Xero
- Inputs:
main - Outputs:
main
Connection
This node needs a Xero connection.
Parameters
connection
Xero connection — The Xero connection to use. Create it once in Connections; its key never appears in the workflow.
- Type: Connection (
credential) - Required: Yes
- Default:
""(empty)
resource
Resource
- Type: One choice (
options) - Required: Yes
- Default:
bill - Options:
contact— Contactinvoice— Sales invoice: What you bill (ACCREC).bill— Bill: What you are billed (ACCPAY) — the invoice received by email.
operation
Operation
- Type: One choice (
options) - Required: Yes
- Default:
create - Options:
create— Createupdate— Update (contact)get— Getsearch— Searchattach— Attach a file: Uploads a file of the run to the invoice.pdf— Get the PDF: The invoice PDF, added to the run’s files for sending by email.email— Send via Xero (sales invoice): Xero emails the approved invoice to the contact’s address.
recordId
Xero ID — The ContactID or InvoiceID (a GUID), as an earlier step returns it.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 36 characters at most
- Example:
{{ data.api_1.id }} - Shown when: (
resourceis one ofcontactandoperationis one ofupdate,get) or (resourceis one ofinvoice,billandoperationis one ofget,attach,pdf,email) - Expressions:
{{ }}accepted
contactName
Contact name — Required on creation: the company or person name.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 255 characters at most
- Shown when:
resourceis one ofcontactandoperationis one ofcreate,update - Expressions:
{{ }}accepted
email
Email address
- Type: Text (
string) - Required: No
- Default:
""(empty) - 255 characters at most
- Shown when:
resourceis one ofcontactandoperationis one ofcreate,update - Expressions:
{{ }}accepted
firstName
First name
- Type: Text (
string) - Required: No
- Default:
""(empty) - 255 characters at most
- Shown when:
resourceis one ofcontactandoperationis one ofcreate,update - Expressions:
{{ }}accepted
lastName
Last name
- Type: Text (
string) - Required: No
- Default:
""(empty) - 255 characters at most
- Shown when:
resourceis one ofcontactandoperationis one ofcreate,update - Expressions:
{{ }}accepted
contactId
Contact (ContactID) — The customer (sales invoice) or supplier (bill).
- Type: Text (
string) - Required: No
- Default:
""(empty) - 36 characters at most
- Example:
{{ data.search_1.first.ContactID }} - Shown when:
resourceis one ofinvoice,billandoperationis one ofcreate - Expressions:
{{ }}accepted
reference
Reference — Bill: the number of the received invoice. Sales invoice: your reference.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 255 characters at most
- Shown when:
resourceis one ofinvoice,billandoperationis one ofcreate - Expressions:
{{ }}accepted
date
Date (YYYY-MM-DD)
- Type: Text (
string) - Required: No
- Default:
""(empty) - 10 characters at most
- Shown when:
resourceis one ofinvoice,billandoperationis one ofcreate - Expressions:
{{ }}accepted
dueDate
Due date (YYYY-MM-DD)
- Type: Text (
string) - Required: No
- Default:
""(empty) - 10 characters at most
- Shown when:
resourceis one ofinvoice,billandoperationis one ofcreate - Expressions:
{{ }}accepted
lineDescription
Line description
- Type: Text (
string) - Required: No
- Default:
""(empty) - 4000 characters at most
- Shown when:
resourceis one ofinvoice,billandoperationis one ofcreate - Expressions:
{{ }}accepted
unitAmount
Unit amount — A number, decimal point (1250.50). Tax exclusive or inclusive per the organisation’s setting.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 30 characters at most
- Shown when:
resourceis one ofinvoice,billandoperationis one ofcreate - Expressions:
{{ }}accepted
quantity
Quantity
- Type: Number (
number) - Required: No
- Default:
1 - At least 0
- Shown when:
resourceis one ofinvoice,billandoperationis one ofcreate
accountCode
Account code — The Xero chart-of-accounts code (200 sales, 400 purchases…).
- Type: Text (
string) - Required: No
- Default:
""(empty) - 10 characters at most
- Shown when:
resourceis one ofinvoice,billandoperationis one ofcreate - Expressions:
{{ }}accepted
linesJson
Lines as JSON (advanced) — An array of Xero line items (Description, Quantity, UnitAmount, AccountCode, TaxType). Replaces the line above.
- Type: Long text (
text) - Required: No
- Default:
""(empty) - 20000 characters at most
- Shown when:
resourceis one ofinvoice,billandoperationis one ofcreate - Expressions:
{{ }}accepted
status
Status
- Type: One choice (
options) - Required: No
- Default:
DRAFT - Options:
DRAFT— DraftSUBMITTED— Awaiting approvalAUTHORISED— Approved
- Shown when:
resourceis one ofinvoice,billandoperationis one ofcreate
attachmentPosition
Attachment (position) — When creating a bill, or for “Attach”: an email attachment (1 for the first one) or a file added by a step. 0 = none.
- Type: Number (
number) - Required: No
- Default:
0 - Whole number, from 0 to 2000000
- Shown when: (
resourceis one ofbillandoperationis one ofcreate) or (resourceis one ofinvoice,billandoperationis one ofattach)
searchTerm
Search for — Contact: name, first name, last name, number or email address. Invoice: number or reference.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 255 characters at most
- Example:
{{ email.from.email }} - Shown when:
resourceis one ofcontact,invoice,billandoperationis one ofsearch - Expressions:
{{ }}accepted
limit
Maximum count
- Type: Number (
number) - Required: No
- Default:
20 - Whole number, from 1 to 100
- Shown when:
resourceis one ofcontact,invoice,billandoperationis one ofsearch
Outputs
main— Taken once the Xero call has succeeded, whatever the operation. An error answer from Xero fails the step instead.
Data produced
What this node adds to the run data, and how to read it in an expression. <step> stands for the step key: the node name turned into an identifier (see Data and expressions).
{{ data.<step>.id }}—string. The Xero ID (ContactID or InvoiceID) created, read or targeted.{{ data.<step>.number }}—string. Create an invoice: its number.{{ data.<step>.invoice }}—object. Create, Get an invoice: the invoice as Xero returns it.{{ data.<step>.contact }}—object. Contact: the saved or read contact.{{ data.<step>.first }}—object. Search: the first item found, ornull.records,countandfoundcomplete it.{{ data.<step>.attachmentPosition }}—number. Get the PDF: the PDF’s position in the run’s files, to cite in a Compose node.
Example
A firm receives its suppliers’ invoices by email. After an Extract node reading supplier, number, date and amount:
resource bill
operation create
contactId {{ data.search_1.first.ContactID }}
reference {{ data.extract.number }}
date {{ data.extract.date }}
lineDescription {{ data.extract.subject }}
unitAmount {{ data.extract.amount }}
accountCode 400
attachmentPosition 1The bill is created as a draft in Xero, with the email’s PDF attached.
Tips
- Dates as YYYY-MM-DD; amounts with a decimal point or comma.
- Several lines: Lines as JSON replaces the single line.
- Status: Draft by default; “Send via Xero” needs an approved invoice.
- IDs: a ContactID or InvoiceID is a 36-character identifier; any other value is refused before any call.
- Test runs: reads are real, writes are described.