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

# Xero

> Sync invoices, bills, contacts, accounts, payments, journal entries, items, attachments, bank feeds, and the rest of the chart of accounts with Xero via OAuth 2.0 + PKCE.

<img src="https://icon.horse/icon/xero.com" alt="Xero" style={{ width: "48px", height: "48px", marginBottom: "16px" }} />

## Overview

| Property    | Value                             |
| ----------- | --------------------------------- |
| Slug        | `xero`                            |
| Auth        | OAuth 2.0 + PKCE                  |
| API version | v2.0                              |
| Sandbox     | Yes — via Xero's "Demo Company"   |
| Rate limit  | 60 req/min, 5,000 req/day per org |

## Supported resources

| Resource                   | List                                      | Get                                       | Create                                    | Update                                    | Delete                                    |
| -------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
| Invoice                    | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Contact                    | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Account                    | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Payment                    | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Tax Rate                   | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | —                                         | —                                         | —                                         |
| Journal Entry              | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Expense                    | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Purchase Order             | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Sales Order                | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Credit Note                | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Vendor Credit              | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Item                       | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Tracking Category          | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | —                                         | —                                         | —                                         |
| Company Info               | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | —                                         | —                                         | —                                         |
| Employee                   | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | —                                         | —                                         | —                                         |
| Transaction                | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Bank Feed Account          | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Bank Feed Transaction      | —                                         | —                                         | <span style={{color: "#16a34a"}}>✓</span> | —                                         | —                                         |
| Balance Sheet              | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | —                                         | —                                         | —                                         |
| Income Statement           | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | —                                         | —                                         | —                                         |
| Attachment                 | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> | <span style={{color: "#16a34a"}}>✓</span> |
| Address                    | —                                         | <span style={{color: "#16a34a"}}>✓</span> | —                                         | —                                         | —                                         |
| Phone Number               | —                                         | <span style={{color: "#16a34a"}}>✓</span> | —                                         | —                                         | —                                         |
| Accounting Period          | —                                         | —                                         | —                                         | —                                         | —                                         |
| Payment Method             | —                                         | —                                         | —                                         | —                                         | —                                         |
| Payment Term               | —                                         | —                                         | —                                         | —                                         | —                                         |
| Cash Flow Statement        | —                                         | —                                         | —                                         | —                                         | —                                         |
| General Ledger Transaction | —                                         | —                                         | —                                         | —                                         | —                                         |
| Expense Report             | —                                         | —                                         | —                                         | —                                         | —                                         |
| Item Fulfillment           | —                                         | —                                         | —                                         | —                                         | —                                         |
| Project                    | —                                         | —                                         | —                                         | —                                         | —                                         |

## Connect setup

Xero uses OAuth 2.0 with PKCE. You need an app registered in the **Xero Developer Portal**.

<Steps>
  <Step title="Create a Xero app">
    Go to [Xero Developer Portal](https://developer.xero.com/myapps) → **New app**. Choose **Web app** and integration type **Accounting**. Under **Configuration**, copy the **Client ID** and **Client Secret**.
  </Step>

  <Step title="Add the redirect URL">
    In your app's **OAuth 2.0 redirect URIs** list, add:

    ```
    https://api.routemcp.io/api/v1/auth/callback
    ```
  </Step>

  <Step title="Configure required scopes">
    Enable the following scopes on your app:

    * `openid`
    * `profile`
    * `email`
    * `offline_access`
    * `accounting.invoices`
    * `accounting.payments`
    * `accounting.banktransactions`
    * `accounting.manualjournals`
    * `accounting.contacts`
    * `accounting.settings`
    * `accounting.reports.balancesheet.read`
    * `accounting.reports.profitandloss.read`
    * `accounting.attachments`
    * `files`
  </Step>

  <Step title="Connect via the widget">
    When your end user opens the Connect widget, they will enter the Client ID and Client Secret, then be redirected to Xero to authorize the connection.
  </Step>
</Steps>

## Usage

```bash theme={null}
# List sales invoices (AR) from Xero
curl "https://api.routemcp.io/api/v1/accounting/invoice?provider=xero" \
  -H "Authorization: Bearer sk_live_your_key" \
  -H "X-End-User-Id: user-123"

# Create a bill (AP) — set type=ACCOUNTS_PAYABLE
curl -X POST "https://api.routemcp.io/api/v1/accounting/invoice?provider=xero" \
  -H "Authorization: Bearer sk_live_your_key" \
  -H "Content-Type: application/json" \
  -H "X-End-User-Id: user-123" \
  -d '{ "type": "ACCOUNTS_PAYABLE", "contact": "urn:xero:contact:abc", "total_amount": 850.00, "due_date": "2026-06-01" }'

# Update by URN
curl -X PATCH "https://api.routemcp.io/api/v1/accounting/invoice/urn:xero:invoice:abc-uuid?provider=xero" \
  -H "Authorization: Bearer sk_live_your_key" \
  -H "Content-Type: application/json" \
  -H "X-End-User-Id: user-123" \
  -d '{ "memo": "Approved by ops" }'
```

## Notes

* Pass `type: "ACCOUNTS_PAYABLE"` on `invoice` create to write a bill. The same pattern applies to `credit_note` / `vendor_credit`. For vendor contacts, set `is_supplier: true`.
* `address` and `phone_number` ids are discoverable inline on `contact.addresses[].id` and `contact.phone_numbers[].id`.
