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

# Xero

> Integrate your application with the Xero API

## 🚀 Quickstart

Connect to Xero with Nango and see data flow in 2 minutes.

**1. Create the integration**

In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *Xero*. Nango doesn't have a Nango-managed OAuth app for Xero yet. You'll need to set up your own by following the setup guide linked below. After that, make sure to add the OAuth client ID, secret, and scopes in the integration settings in Nango.

**2. Authorize Xero**

Go to [Connections](https://app.nango.dev/dev/connections) -> *Add Test Connection* -> *Authorize*, then log in to Xero. Later, you'll let your users do the same directly from your app.

**3. Call the Xero API**

Let's make your first request to the Xero API. Replace the placeholders below with your [Environment API key](https://nango.dev/docs/reference/backend/http-api/api-keys.md), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

> [tab] cURL
>
> ```bash theme={null}
> curl "https://api.nango.dev/proxy/api.xro/2.0/Contacts" \
>   -H "Authorization: Bearer <NANGO-API-KEY>" \
>   -H "Provider-Config-Key: <INTEGRATION-ID>" \
>   -H "Connection-Id: <CONNECTION-ID>"
> ```

> [tab] Node
>
> Install Nango's backend SDK with `npm i @nangohq/node`. Then run:
>
> ```typescript theme={null}
> import { Nango } from '@nangohq/node';
>
> const nango = new Nango({ apiKey: '<NANGO-API-KEY>' });
>
> const res = await nango.get({
>     endpoint: '/api.xro/2.0/Contacts',
>     providerConfigKey: '<INTEGRATION-ID>',
>     connectionId: '<CONNECTION-ID>'
> });
>
> console.log(res.data);
> ```

Or fetch credentials with the [Node SDK](https://nango.dev/docs/reference/backend/backend-sdk/node.md#get-a-connection-with-credentials) or [API](https://nango.dev/docs/reference/backend/http-api/connections/get.md).

✅ You're connected! Check the [Logs](https://app.nango.dev/dev/logs) tab in Nango to inspect requests.

**4. Implement Nango in your app**

Follow our [Auth implementation guide](https://nango.dev/docs/guides/primitives/auth.md) to integrate Nango in your app.

To obtain your own credentials, follow the setup guide linked below.

## 📚 Xero Integration Guides

Nango maintained guides for common use cases.

* [How to register your own Xero OAuth app](https://nango.dev/docs/api-integrations/xero/how-to-register-your-own-xero-api-oauth-app)\
  Register an OAuth app with Xero and obtain credentials to connect it to Nango

* [How to configure Xero webhooks with Nango](https://nango.dev/docs/api-integrations/xero/webhooks)\
  Learn how to set up webhook notifications from Xero to Nango

Official docs: [Xero API documentation](https://developer.xero.com/documentation/getting-started-guide)

## 🧩 Pre-built syncs & tools for Xero

Explore Nango-provided tools in your dashboard. Extend and customize them to fit your needs.

### General Ledger

| Function name | Description | Type |
| - | - | - |
| `general-ledger` | Sync Xero general ledger journals, each containing journal lines with account and tax details. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |

### Others

| Function name | Description | Type |
| - | - | - |
| `create-account` | Create an account in the Xero chart of accounts. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-bank-transaction` | Create a spend or receive money bank transaction | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-contact` | Create a contact in Xero. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-credit-note` | Create a credit note for a contact | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-invoice` | Create a sales or purchase invoice. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-item` | Create an inventory or catalog item. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-payment` | Create a payment against an invoice or credit note. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `create-purchase-order` | Create a purchase order for a contact. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-account` | Retrieve an account by AccountID. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-bank-transaction` | Retrieve a bank transaction by BankTransactionID. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-contact` | Retrieve a contact by ContactID | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-credit-note` | Retrieve a credit note by CreditNoteID. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-invoice` | Retrieve an invoice by InvoiceID. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-item` | Retrieve an item by ItemID. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-payment` | Retrieve a payment by PaymentID. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-purchase-order` | Retrieve a purchase order by PurchaseOrderID. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `get-tenants` | Fetches all the tenants the connection has access to. This can be used to set the metadata to the selected tenant. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-accounts` | List accounts in the Xero chart of accounts. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-bank-transactions` | List bank transactions with filters and pagination. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-contacts` | List contacts with filters and pagination. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-credit-notes` | List credit notes with filters and pagination. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-invoices` | List invoices with filters and pagination. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-items` | List items with optional filtering. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-payments` | List payments with filters and pagination | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-purchase-orders` | List purchase orders with filters and pagination | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `list-tenants` | List Xero tenants connected to the current OAuth token. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-account` | Update an existing account. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-bank-transaction` | Update an existing bank transaction. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-contact` | Update an existing contact. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-credit-note` | Update an existing credit note. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-invoice` | Update an existing invoice. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-item` | Update an existing item. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `update-purchase-order` | Update an existing purchase order. | [Tool](https://nango.dev/docs/guides/functions/tools.md) |
| `accounts` | Sync accounts from the Xero chart of accounts. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `bank-transactions` | Sync bank transactions from Xero. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `contacts` | Sync contacts from Xero. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `credit-notes` | Sync credit notes from Xero. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `invoices` | Sync invoices from Xero. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `items` | Sync inventory and catalog items from Xero. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `organisations` | Sync Xero organisation records for connected tenants. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `payments` | Sync payments from Xero. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |
| `purchase-orders` | Sync purchase orders from Xero. | [Sync](https://nango.dev/docs/guides/functions/syncs/sync-functions.md) |

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.