Xero accounting
Select the exact tenant, coordinate rotating tokens and reconcile guarded accounting actions.
Xero operations read tenant connections, contacts, invoices, payments and accounts; deliberate actions create/update contacts, create a draft invoice/bill and record an accounting payment. An applied payment is an accounting entry, not a bank transfer. Draft creation does not approve, send or pay an invoice.
Select the account and auth mode#
Complete the appropriate Xero OAuth consent flow outside the graph. In accessToken mode, a named secret such as XERO_ACCESS_TOKEN supplies a token maintained externally. In managedRefresh mode, named bootstrap/client secrets initialize the refresh lifecycle. A bootstrap token object contains access_token, refresh_token and ISO expires_at; its values remain protected and are never ordinary socket data. PKCE uses its documented configuration without a client-secret value.
Run Xero List Tenant Connections only after authorization, then select the exact organization tenantId. A connection ID or mutable organization name is not a tenant UUID. Accounting permissions and the tenant's roles must permit each operation.
Coordinate refresh state#
Every consumer of one rotating grant in a workspace must share the same tokenNamespace/tokenKey. Defaults are integration.xero.oauth / default. Separate namespaces, workspaces or independent refreshers can compete for one rotating grant and invalidate each other's tokens.
Managed refresh writes the new token pair immediately to encrypted versioned storage, using a 60-second compare-and-set lock. Busy/uncertain refresh fails before accounting work. The bootstrap is used only when the durable record is absent: changing a bootstrap secret does not replace an existing record. Do not clear locks or restore older token copies as a generic recovery step. Preserve the database and matching encryption key.
Page reads correctly#
Build a Xero Page Query, then call a list operation and inspect the matching page codec. Page starts at 1; pageSize defaults to 100 and permits 1–1,000. A full page conservatively reports hasMore:true and nextPage; a short or empty page establishes the end. Accounts is unpaged.
Keep filters/order stable while resuming. The provider's data can change between reads, so this is not a remote snapshot transaction. modifiedSince becomes the appropriate request header. Contact-only options cannot be passed to invoice/payment lists.
Guard writes#
Writes require allowWrites:true, runtime $retries:0, a stable idempotencyKey and the original firstAttemptAt. The implementation rejects an attempt older than five minutes. Reconciliation keeps method/path/body/key identical; creating a fresh key/timestamp to bypass the guard defeats its purpose.
The provider's finite idempotency window is not permanent domain deduplication. Persist the business event identity and receipt when later replay is possible. Lost, malformed or oversized responses can follow a committed write; inspect accounting state before another action. Tax/account/currency and outstanding balances require current tenant data.
Operations#
- Xero List Tenant Connections: Read connected tenants for the consenting access-token user. No tenant header is required. Uses GET /connections; optional authEventId filters the authorization event. No business write.
- Xero Select Tenant:
- Xero List Contacts: Read one bounded Contacts page with GET /Contacts. query contains page/pageSize, where/order, IDs and modifiedSince; invoices also supports statuses. Contact searchTerm/includeArchived/summaryOnly are explicit.
- Xero Get Contact: Read one contact by its immutable Xero UUID with GET /Contacts/{id}. A missing/nonunique result fails. No business write.
- Xero List Invoices: Read one bounded Invoices page with GET /Invoices. query contains page/pageSize, where/order, IDs and modifiedSince; invoices also supports statuses. Contact searchTerm/includeArchived/summaryOnly are explicit.
- Xero Get Invoice: Read one invoice by its immutable Xero UUID with GET /Invoices/{id}. A missing/nonunique result fails. No business write.
- Xero List Payments: Read one bounded Payments page with GET /Payments. query contains page/pageSize, where/order, IDs and modifiedSince; invoices also supports statuses. Contact searchTerm/includeArchived/summaryOnly are explicit.
- Xero Get Payment: Read one payment by its immutable Xero UUID with GET /Payments/{id}. A missing/nonunique result fails. No business write.
- Xero List Accounts: Read chart of accounts with GET /Accounts, optional where filter, scope accounting.settings.read. Accounts does not use the paged-resource contract. Use Type=BANK or EnablePaymentsToAccount to choose a payment account; live provider validation remains authoritative.
- Xero Create Contact: Create exactly one contact with PUT /Contacts. Only the typed fields are sent; excluded update fields stay unchanged. No name-based matching or guessed identity. Scope accounting.contacts.
- Xero Update Contact: Update one existing contact by ContactID with POST /Contacts. Only the typed fields are sent; excluded update fields stay unchanged. No name-based matching or guessed identity. Scope accounting.contacts.
- Xero Create Draft Invoice: Create one DRAFT ACCREC sales invoice or ACCPAY bill with PUT /Invoices. A contact UUID, typed invoice lines and account codes are required; regional tax and currency are explicit tenant choices. This node does not approve, authorize, send or pay the draft. Scope accounting.invoices.
- Xero Apply Invoice Payment: Apply one accounting payment to an approved invoice with PUT /Payments. The bank/payment-enabled account must belong to the selected tenant. This records an accounting payment; it does not transfer money through a bank. Amount is in invoice currency and cannot exceed the provider outstanding balance. Scope accounting.payments. Reconciliation and explicit human approval belong before this action.
Read retries, response bounds and grant behavior are documented per node. Synthetic tests and codec round trips are not proof of a connected real account or successful accounting action.
Source provenance
Reviewed against maintained source and topic documentation on 23 October 2026. This is a source snapshot; installed versions and provider access may differ.
../OpenNodeFlow-Library/work/xero/SETUP.md../OpenNodeFlow-Library/docs/INTEGRATIONS.mddocs/INTEGRATIONS-XERO.md