Create Invoice
xero.create_invoice
ActionCRM & salesconnection required
Calls the Xero API with the connection's credentials.
Create one sales invoice or purchase bill from a Xero invoice object.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- OAuth 2.0
- Providers
- Xero
- Secret shape
- {"client_id": "…", "client_secret": "…", "refresh_token": "…"}
- Config it needs
- tenant_id
- Resolved by
- config.connection_id, else node.connection_id
Configuration
2 fields, 1 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
fields The Xero Invoice object to send, in Xero's PascalCase, e.g. {"Type": "ACCREC", "Contact": {"ContactID": "00000000-0000-0000-0000-000000000000"}, "LineItems": [{"Description": "Consulting", "Quantity": 1, "UnitAmount": 500, "AccountCode": "200"}]}. | object | Yes | — | ≥ 1 characters | {"Contact":{"ContactID":"00000000-0000-0000-0000-000000000000"},"LineItems":[{"AccountCode":"200","Description":"Consulting","Quantity":1,"UnitAmount":500}],"Type":"ACCREC"} |
tenant_id Xero organisation (tenant) id for this call; overrides the connection's. | string | No | — | — | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"fields": {
"Contact": {
"ContactID": "00000000-0000-0000-0000-000000000000"
},
"LineItems": [
{
"AccountCode": "200",
"Description": "Consulting",
"Quantity": 1,
"UnitAmount": 500
}
],
"Type": "ACCREC"
}
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
invoice The invoice as Xero returned it, in PascalCase. | object | — |
invoice_id The Xero identifier of the invoice. | string | — |
validation_errors Messages Xero attached to the record; empty when it was accepted. | array | — |
{
"invoice": {},
"invoice_id": "",
"validation_errors": []
}Notes
- Xero requires at least Type, Contact and LineItems; Status defaults to DRAFT.
- A rejected record fails the step with Xero's own ValidationErrors messages.
See Create Invoice run in a workflow.
In a technical demo we add the Xero connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.