> ## 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.

<Steps>
  <Step title="Create the integration">
    In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *Xero*.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Call the Xero API">
    Let's make your first request to the Xero API. Replace the placeholders below with your [secret key](https://app.nango.dev/dev/environment-settings), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

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

      <Tab title="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({ secretKey: '<NANGO-SECRET-KEY>' });

        const res = await nango.get({
            endpoint: '/api.xro/2.0/Contacts',
            providerConfigKey: '<INTEGRATION-ID>',
            connectionId: '<CONNECTION-ID>'
        });

        console.log(res.data);
        ```
      </Tab>
    </Tabs>

    Or fetch credentials with the [Node SDK](/reference/sdks/node#get-a-connection-with-credentials) or [API](/reference/api/connection/get).

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

  <Step title="Implement Nango in your app">
    Follow our [Auth implementation guide](/guides/primitives/auth) to integrate Nango in your app.

    To obtain your own production credentials, follow the setup guide linked below.
  </Step>
</Steps>

## 📚 Xero Integration Guides

Nango maintained guides for common use cases.

* [How to register your own Xero OAuth app](/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](/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 & actions for Xero

Enable them in your dashboard. Extend and customize to fit your needs.

### Accounts

| Function name    | Description                                      | Type                                         | Source code                                                                                                         |
| ---------------- | ------------------------------------------------ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `create-account` | Create an account in the Xero chart of accounts. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/create-account.ts) |
| `get-account`    | Retrieve an account by AccountID.                | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/get-account.ts)    |
| `list-accounts`  | List accounts in the Xero chart of accounts.     | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/list-accounts.ts)  |
| `update-account` | Update an existing account.                      | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/update-account.ts) |

### Bank Transactions

| Function name             | Description                                         | Type                                         | Source code                                                                                                                  |
| ------------------------- | --------------------------------------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `create-bank-transaction` | Create a spend or receive money bank transaction    | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/create-bank-transaction.ts) |
| `get-bank-transaction`    | Retrieve a bank transaction by BankTransactionID.   | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/get-bank-transaction.ts)    |
| `list-bank-transactions`  | List bank transactions with filters and pagination. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/list-bank-transactions.ts)  |
| `update-bank-transaction` | Update an existing bank transaction.                | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/update-bank-transaction.ts) |

### Contacts

| Function name    | Description                                | Type                                         | Source code                                                                                                         |
| ---------------- | ------------------------------------------ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `create-contact` | Create a contact in Xero.                  | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/create-contact.ts) |
| `get-contact`    | Retrieve a contact by ContactID            | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/get-contact.ts)    |
| `list-contacts`  | List contacts with filters and pagination. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/list-contacts.ts)  |
| `update-contact` | Update an existing contact.                | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/update-contact.ts) |

### Credit Notes

| Function name        | Description                                    | Type                                         | Source code                                                                                                             |
| -------------------- | ---------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `create-credit-note` | Create a credit note for a contact             | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/create-credit-note.ts) |
| `get-credit-note`    | Retrieve a credit note by CreditNoteID.        | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/get-credit-note.ts)    |
| `list-credit-notes`  | List credit notes with filters and pagination. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/list-credit-notes.ts)  |
| `update-credit-note` | Update an existing credit note.                | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/update-credit-note.ts) |

### General Ledger

| Function name    | Description                                                                                    | Type                                           | Source code                                                                                                       |
| ---------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `general-ledger` | Sync Xero general ledger journals, each containing journal lines with account and tax details. | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/syncs/general-ledger.ts) |

### Invoices

| Function name    | Description                         | Type                                         | Source code                                                                                                         |
| ---------------- | ----------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `create-invoice` | Create a sales or purchase invoice. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/create-invoice.ts) |
| `get-invoice`    | Retrieve an invoice by InvoiceID.   | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/get-invoice.ts)    |
| `update-invoice` | Update an existing invoice.         | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/update-invoice.ts) |

### Items

| Function name | Description                          | Type                                         | Source code                                                                                                      |
| ------------- | ------------------------------------ | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `create-item` | Create an inventory or catalog item. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/create-item.ts) |
| `get-item`    | Retrieve an item by ItemID.          | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/get-item.ts)    |
| `list-items`  | List items with optional filtering.  | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/list-items.ts)  |
| `update-item` | Update an existing item.             | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/update-item.ts) |

### Payments

| Function name    | Description                                         | Type                                         | Source code                                                                                                         |
| ---------------- | --------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `create-payment` | Create a payment against an invoice or credit note. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/create-payment.ts) |
| `get-payment`    | Retrieve a payment by PaymentID.                    | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/get-payment.ts)    |

### Purchase Orders

| Function name           | Description                                      | Type                                         | Source code                                                                                                                |
| ----------------------- | ------------------------------------------------ | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `create-purchase-order` | Create a purchase order for a contact.           | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/create-purchase-order.ts) |
| `get-purchase-order`    | Retrieve a purchase order by PurchaseOrderID.    | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/get-purchase-order.ts)    |
| `list-purchase-orders`  | List purchase orders with filters and pagination | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/list-purchase-orders.ts)  |
| `update-purchase-order` | Update an existing purchase order.               | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/update-purchase-order.ts) |

### Tenants

| Function name  | Description                                                                                                        | Type                                         | Source code                                                                                                       |
| -------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `get-tenants`  | Fetches all the tenants the connection has access to. This can be used to set the metadata to the selected tenant. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/get-tenants.ts)  |
| `list-tenants` | List Xero tenants connected to the current OAuth token.                                                            | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/list-tenants.ts) |

### Others

| Function name       | Description                                           | Type                                           | Source code                                                                                                          |
| ------------------- | ----------------------------------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `list-invoices`     | List invoices with filters and pagination.            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/list-invoices.ts)   |
| `list-payments`     | List payments with filters and pagination             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/actions/list-payments.ts)   |
| `accounts`          | Sync accounts from the Xero chart of accounts.        | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/syncs/accounts.ts)          |
| `bank-transactions` | Sync bank transactions from Xero.                     | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/syncs/bank-transactions.ts) |
| `contacts`          | Sync contacts from Xero.                              | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/syncs/contacts.ts)          |
| `credit-notes`      | Sync credit notes from Xero.                          | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/syncs/credit-notes.ts)      |
| `invoices`          | Sync invoices from Xero.                              | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/syncs/invoices.ts)          |
| `items`             | Sync inventory and catalog items from Xero.           | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/syncs/items.ts)             |
| `organisations`     | Sync Xero organisation records for connected tenants. | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/syncs/organisations.ts)     |
| `payments`          | Sync payments from Xero.                              | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/syncs/payments.ts)          |
| `purchase-orders`   | Sync purchase orders from Xero.                       | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/xero/syncs/purchase-orders.ts)   |

***
