canonical: https://jentic.com/apis/xero.com/xero-accounting

# Xero Accounting API

Record and reconcile financial transactions, generate invoices, track payments, and produce financial reports for small and medium businesses. The API exposes 237 endpoints covering accounts, contacts, invoices, bank transactions, journals, and reporting - enabling full double-entry bookkeeping through programmatic access. Supports multi-currency transactions, tax calculations, and attachment management on all document types.

## For AI agents

Create invoices, record payments, reconcile bank transactions, and generate financial reports for small businesses through Xero's double-entry accounting system.

## Scope

Does not process card payments, manage payroll, or handle inventory tracking - use for double-entry accounting, invoicing, and financial reporting only.

## Capabilities

- Generate and send invoices with line items, tax rates, and payment terms to contacts
- Reconcile bank transactions against outstanding invoices and bills automatically
- Record payments, credit notes, and overpayments against specific invoices
- Pull profit-and-loss, balance sheet, and aged receivables reports on demand
- Sync contacts with full address, tax registration, and payment history details
- Track multi-currency transactions with automatic exchange rate conversion
- Attach source documents (receipts, contracts) to any transaction or contact record

## Use cases

### AI Agent Invoice Automation

AI agents use the Xero Accounting API through Jentic to create invoices, apply payments, and check outstanding balances without building custom OAuth flows or handling token refresh. The agent searches for the operation (e.g., 'create an invoice'), Jentic returns the schema for the /Invoices endpoint with required fields, and the agent executes. Jentic manages OAuth2 tokens and tenant ID headers, so the agent never handles raw credentials.

Example prompt: Create a new sales invoice for contact 'Acme Corp' with two line items totalling $1,250 NZD, set payment due in 30 days, then confirm the invoice status is AUTHORISED

### Bank Reconciliation

Reconcile bank statement lines against outstanding invoices and bills in Xero. The API supports creating bank transactions, matching them to existing records, and flagging discrepancies. Batch endpoints allow processing multiple transactions in a single call, with support for bank feeds that push statement data directly into Xero for matching.

Example prompt: Retrieve all unreconciled bank transactions from the last 7 days, match each against outstanding invoices by amount, and create bank transaction records for confirmed matches

### Financial Reporting

Generate profit-and-loss statements, balance sheets, aged receivables, and aged payables reports via API. Reports accept date range parameters and can be filtered by tracking category. The trial balance endpoint provides account-level debit and credit totals for any period, enabling custom reporting and data warehousing workflows.

Example prompt: Pull the profit-and-loss report for Q1 2026 and return total revenue, total expenses, and net profit figures

### Contact and Supplier Management

Store and query contact records including customers, suppliers, and employees. Each contact holds billing address, tax number, payment terms, and full transaction history. The API supports batch creation of contacts and filtering by name, email, or account number, enabling CRM synchronisation workflows.

Example prompt: Search for all contacts with outstanding invoices over 60 days overdue and return their names, email addresses, and total amounts owed

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /Invoices | List all invoices with optional status and date filters |
| POST | /Invoices | Create one or more new invoices |
| GET | /Contacts | List all contacts (customers and suppliers) |
| POST | /Payments | Record a payment against an invoice or bill |
| GET | /BankTransactions | List bank transactions for reconciliation |
| GET | /Accounts | Retrieve the chart of accounts |
| GET | /Reports/ProfitAndLoss | Generate a profit and loss report |
| GET | /Reports/BalanceSheet | Generate a balance sheet report |

## Key resources

- **Invoices** — Sales and purchase invoices with line items, tax, and payment tracking
- **Contacts** — Customer and supplier records with addresses and payment terms
- **BankTransactions** — Bank statement lines for reconciliation against invoices
- **Payments** — Payment records linking bank accounts to invoices and bills
- **Accounts** — Chart of accounts defining ledger structure and account types
- **Reports** — Financial reports including P&L, balance sheet, and aged receivables

## Why Jentic

- **Setup:** Wiring the Xero Accounting API by hand means implementing its OAuth2 flow, sending the correct tenant header on every request, and mapping 237 operations across invoices, contacts, and reports yourself. Through Jentic you install once, import the Xero Accounting API from the API Directory, store the OAuth2 credential once, and your agent calls it.
- **Permission scoping:** The Xero Accounting API identifies its collections through the operation and request body rather than a resource id in these URL paths, so scope by operation: limit the agent to the operations it needs, such as reading invoices or a profit-and-loss report. You choose that set, so writes like posting invoices or payments are not included unless you add them.
- **Credential handling:** Your Xero Accounting OAuth2 credential and tenant id are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create an invoice' or 'get the balance sheet report', and Jentic returns the matching Xero Accounting API operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **The Plaid API** — Plaid pulls live bank data that feeds into Xero for reconciliation
- **Stripe API** — Stripe processes payments that become invoice payments in Xero
- **Sage API** — Sage offers similar accounting features with stronger enterprise and payroll integration

## FAQ

### What authentication does the Xero Accounting API use?

Xero uses OAuth 2.0 with PKCE for all API access. Applications must obtain an access token through the authorization code flow and include a xero-tenant-id header identifying the target organisation. Through Jentic, OAuth tokens are stored in your Jentic One instance with automatic refresh - agents never handle client secrets or manual token rotation.

### Can I create and send invoices with the Xero Accounting API?

Yes. POST to /Invoices with a contact reference, line items, and tax rates to create an invoice. Set the Status field to AUTHORISED to approve it, then use the email endpoint to deliver it. The API supports batch creation of up to 50 invoices in a single request.

### What are the rate limits for the Xero Accounting API?

Xero enforces a limit of 60 calls per minute per tenant (organisation) and 5,000 calls per day per tenant. Batch endpoints that accept multiple records in one call count as a single request. The API returns a 429 status with a Retry-After header when limits are exceeded.

### How do I generate financial reports through the Xero API via Jentic?

Search Jentic for 'generate profit and loss report', then load the /Reports/ProfitAndLoss operation schema. Provide fromDate and toDate parameters, and the agent receives a structured report with income, expense, and net profit figures. Install with pip install jentic or run it through Jentic One, the self-hosted execution layer.

### Does the Xero Accounting API support multi-currency transactions?

Yes. Invoices, payments, and bank transactions can be recorded in any currency enabled in the organisation's settings. The API applies the exchange rate from Xero's daily feed or accepts a custom rate on each transaction. The /Currencies endpoint lists all enabled currencies and their current rates.

### Can I reconcile bank transactions programmatically with Xero?

Yes. The /BankTransactions endpoint allows creating spend and receive money transactions. Bank feed integrations push statement lines into Xero, and the /BankTransfers endpoint records transfers between accounts. For automated matching, pull unreconciled lines and compare against outstanding invoices by amount and date.

### Can I limit what my agent is allowed to do with the Xero Accounting API?

Yes. Because you run Jentic One yourself, your own rules decide which Xero Accounting operations the agent may call, so you can scope it to read-only work like listing invoices on /Invoices or pulling a /Reports/ProfitAndLoss report. Write operations such as posting to /Invoices or recording /Payments stay out of reach unless you explicitly add them to the allowed set. Your OAuth2 credential and tenant id are held only by your own instance and injected at execution time, so the agent can act only within the operations you have granted.
