> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atako.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Xero

> Connect Xero to your Atako agents — 13 read and 5 write actions.

Let your agents read your Xero organisation, contacts, invoices, payments, bank transactions, credit notes and financial reports, and create contacts, invoices and payments. Every accounting action takes the tenant\_id returned by list\_connections.

## Connection

* **Authentication**: OAuth 2.0 — you authorize Atako via Xero's consent screen; no key to copy.
* **Scopes requested**:
  * `offline_access`
  * `accounting.settings.read`
  * `accounting.contacts`
  * `accounting.invoices`
  * `accounting.payments`
  * `accounting.banktransactions.read`
  * `accounting.reports.profitandloss.read`
  * `accounting.reports.balancesheet.read`
  * `accounting.reports.aged.read`

<Note>
  Nothing to paste: click Connect and approve Atako in your Xero account, choosing the organisation(s) to share. Prerequisite on the Atako side — an administrator creates a Xero app (Developer Portal [https://developer.xero.com/app/manage](https://developer.xero.com/app/manage) → New app → Web app), sets the redirect URI to \$\{API\_URL}/integrations/oauth/callback, generates a Client secret, and puts the Client ID and Client Secret in INTEGRATION\_OAUTH\_XERO\_CLIENT\_ID / \_CLIENT\_SECRET. An uncertified Xero app can connect at most 25 organisations — beyond that the app must be certified through the Xero App Partner program.

  See [Xero's documentation](https://developer.xero.com/documentation/guides/oauth2/auth-flow/).
</Note>

## Read actions (13)

| Action                    | Description                                                                                                                                                                                                                                                               |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `get_contact`             | Get one contact by its ContactID. Requires tenant\_id (the tenantId from list\_connections).                                                                                                                                                                              |
| `get_invoice`             | Get one invoice (with its line items, payments and amounts due) by its InvoiceID. Requires tenant\_id (the tenantId from list\_connections).                                                                                                                              |
| `get_organisation`        | Get the organisation's details (name, legal name, base currency, country, financial year end, tax settings). Requires tenant\_id (the tenantId from list\_connections).                                                                                                   |
| `list_accounts`           | List the chart of accounts (Code, Name, Type, TaxType, Status) — use a Code as AccountCode on invoice lines or as the paying account of a payment. Filters: where, order. Requires tenant\_id (the tenantId from list\_connections).                                      |
| `list_bank_transactions`  | List bank transactions (spend and receive money). Filters: where, order, page, pageSize. Requires tenant\_id (the tenantId from list\_connections).                                                                                                                       |
| `list_connections`        | List the Xero organisations this connection can access: each item has tenantId (pass it as tenant\_id to every other action), tenantName and tenantType. Call this first.                                                                                                 |
| `list_contacts`           | List contacts (customers and suppliers). Filters: searchTerm (text search across name and e-mail), where, order, page, pageSize, includeArchived, IDs (array of ContactIDs). Requires tenant\_id (the tenantId from list\_connections).                                   |
| `list_credit_notes`       | List credit notes. Filters: where, order, page, pageSize. Requires tenant\_id (the tenantId from list\_connections).                                                                                                                                                      |
| `list_invoices`           | List invoices (sales ACCREC and bills ACCPAY). Filters: where, order, page, pageSize, Statuses (array: DRAFT, SUBMITTED, AUTHORISED, PAID, VOIDED, DELETED), ContactIDs, IDs, InvoiceNumbers, includeArchived. Requires tenant\_id (the tenantId from list\_connections). |
| `list_payments`           | List payments applied to invoices and credit notes. Filters: where, order, page, pageSize. Requires tenant\_id (the tenantId from list\_connections).                                                                                                                     |
| `report_aged_receivables` | Get the Aged Receivables report for ONE contact (contactId required). Optional: date, fromDate, toDate (YYYY-MM-DD). Requires tenant\_id (the tenantId from list\_connections).                                                                                           |
| `report_balance_sheet`    | Get the Balance Sheet report at a date. Optional: date (YYYY-MM-DD, default today), periods (1–12) + timeframe (MONTH, QUARTER, YEAR), paymentsOnly (cash basis). Requires tenant\_id (the tenantId from list\_connections).                                              |
| `report_profit_and_loss`  | Get the Profit and Loss report. Optional: fromDate, toDate (YYYY-MM-DD), periods (1–12) + timeframe (MONTH, QUARTER, YEAR) to compare periods, paymentsOnly (cash basis). Requires tenant\_id (the tenantId from list\_connections).                                      |

## Write actions (5)

| Action           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `create_contact` | Create a contact. Arguments: Name (string, required, unique in Xero), FirstName, LastName, EmailAddress, CompanyNumber, TaxNumber, AccountNumber (strings, optional), Phones (array of \{ PhoneType: DEFAULT\|DDI\|MOBILE\|FAX\|OFFICE, PhoneNumber, PhoneAreaCode, PhoneCountryCode }), Addresses (array of \{ AddressType: POBOX\|STREET, AddressLine1…4, City, Region, PostalCode, Country, AttentionTo }). Requires tenant\_id (the tenantId from list\_connections).     |
| `create_invoice` | Create a sales invoice (Type ACCREC) or a bill (Type ACCPAY). Arguments: Type (required), Contact (\{ ContactID }, required), LineItems (array, required: Description, Quantity, UnitAmount, AccountCode, TaxType?, ItemCode?, DiscountRate?), Date, DueDate (YYYY-MM-DD), Reference, InvoiceNumber, CurrencyCode, LineAmountTypes (Exclusive\|Inclusive\|NoTax), Status (DRAFT default, SUBMITTED or AUTHORISED). Requires tenant\_id (the tenantId from list\_connections). |
| `create_payment` | Record a payment against an invoice. Arguments: Invoice (\{ InvoiceID }, required), Account (\{ Code } or \{ AccountID }, required — a bank account from list\_accounts, or one with payments enabled), Date (YYYY-MM-DD, required), Amount (number, required, ≤ amount due), Reference (optional). Requires tenant\_id (the tenantId from list\_connections).                                                                                                                |
| `email_invoice`  | E-mail a sales invoice (ACCREC, status SUBMITTED or AUTHORISED) to its contact's e-mail address, using Xero's default template. Requires tenant\_id (the tenantId from list\_connections).                                                                                                                                                                                                                                                                                    |
| `update_invoice` | Update an invoice by InvoiceID: Status (DRAFT → SUBMITTED → AUTHORISED, or VOIDED for an authorised invoice without payments), Reference, InvoiceNumber, Date, DueDate, ExpectedPaymentDate, LineItems (replaces all lines — DRAFT/SUBMITTED only). Requires tenant\_id (the tenantId from list\_connections).                                                                                                                                                                |

## Permissions

Every action above must be explicitly granted to an agent before it can be used. See [Permissions](/integrations/permissions) for the grant model and [Security](/integrations/security) for how credentials are protected.
