> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.monite.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.monite.com/_mcp/server.

# Set up accounting integration

## Prerequisites \[#prerequisites]

You must have a [partner account](../../get-started/credentials) in Monite.

## 1. Set up partner accounts on accounting platforms \[#partner-accounts]

Partners must set up accounts in [QuickBooks Online](https://developer.intuit.com/app/developer/homepage) and [Xero](https://developer.xero.com/) to successfully support integrations with these accounting systems.

## 2. Provide accounting credentials to Monite \[#accounting-credentials]

After creating a partner account in QuickBooks or Xero, partners must provide their secure application keys (API Key and Secret) for whichever platform they intend to integrate with Monite.

To do this, please send the credentials to [dev-accounting@monite.com](mailto:dev-accounting@monite.com) via a secure password manager or file sharing tool, such as [BitWarden](https://bitwarden.com/).

> **Warning**
>
> Partners must provide their **production** keys. Development and sandbox keys are not supported for these integrations.

## 3. Generate a Monite partner access token \[#partner-token]

To authenticate your API calls with Monite, you need to generate a [partner-level token](../../get-started/credentials#generate-partner-token). To do this, call [`POST /auth/token`](/v2024-01-31/api/access-tokens/post-auth-token) with the following parameters:

```sh
curl -X POST 'https://api.sandbox.monite.com/v1/auth/token' \
     -H 'X-Monite-Version: 2024-01-31' \
     -H 'Content-Type: application/json' \
     -d '{
        "grant_type": "client_credentials",
        "client_id": "YOUR_PARTNER_CLIENT_ID",
        "client_secret": "YOUR_PARTNER_CLIENT_SECRET"
     }'
```

The successful response contains the token and its validity time (in seconds):

```json
{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhb...",
  "token_type": "Bearer",
  "expires_in": 1800
}
```

## 4. Set up entities in Monite \[#entities]

If you have not already, create [entities](../../entities/index) in Monite that represent your customers. Since the connection to an accounting system is configured on the entity level, Monite partners must have entities in Monite before proceeding further.

Entities that use [accounts receivable](../../accounts-receivable/index) must also create their [product catalog](../../accounts-receivable/products) in Monite before setting up an accounting connection.

## 5. Establish entity connection to an accounting system \[#connection]

To establish a new accounting connection that allows an entity to synchronize all its accounting data with a third-party accounting system, call [`POST /accounting_connections`](/v2024-01-31/api/accounting-connections/post-accounting-connections). In this request, you must pass the entity ID in the `X-Monite-Entity-Id` header:

```sh
curl -X POST 'https://api.sandbox.monite.com/v1/accounting_connections' \
     -H 'X-Monite-Version: 2024-01-31' \
     -H 'X-Monite-Entity-Id: ENTITY_ID' \
     -H 'Authorization: Bearer YOUR_PARTNER_TOKEN' \
```

The successful `201 Created` response contains the information about the newly created connection:

```json
{
  "id": "cd16c05b-bd05-45c8-822c-a5aa4a6b1e78",
  "created_at": "2024-06-08T19:52:22.557280+00:00",
  "updated_at": "2024-06-08T19:52:22.557291+00:00",
  "connection_url": "https://sites.railz.ai/ste-bac47d52-c7f3-452c-83d3-de55d6193924",
  "errors": null,
  "last_pull": "2024-06-08T19:52:22.557307+00:00",
  "platform": null,
  "status": "pending_auth"
}
```

Note down the `connection_url` value as you will need it on the next step.

> **Info**
>
> Each entity can connect to **only one** accounting system at a time. The entity must be disconnected from any previous system before they can successfully establish a new connection. To disconnect an entity from an accounting system, call [`POST /accounting_connections/{connection_id}/disconnect`](/v2024-01-31/api/accounting-connections/post-accounting-connections-id-disconnect) endpoint. For more information, see [Disconnect an accounting system](manage#disconnect).

## 6. Entity user authorizes their connection \[#user-authorizes-connection]

Send the `connection_url` value obtained on the previous step to the entity representative. This URL looks like this:

```
https://sites.railz.ai/ste-bac47d52-c7f3-83d3-452c-de55d6193924
```

The entity user must navigate to this URL in their browser. This opens an authorization page, where the entity user must select their preferred accounting system.

![Authorization page](/_fern-img/3f593619fed0ee81c31382185dcd445bc9c8d5c9c8c80fbe708a8d189782edc9.webp)

After selecting the accounting platform, the entity user must log in and authorize the partner's developer account to access their data.

> **Info**
>
> Partners can customize specific attributes on the authorization page. To do this, please contact your Monite Customer Success Manager.

Upon successful authorization, the `platform` field will contain the entity's chosen accounting platform and the value of the `status` field in the accounting connection object will be `connected`. You can confirm this by calling [`GET /accounting_connections/{connection_id}`](/v2024-01-31/api/accounting-connections/get-accounting-connections-id). This endpoint returns information about the entity's connection to an accounting system including the status of the connection and the last synchronization.

## What's next \[#next]

* Assign [ledger accounts](./ledger-accounts) to products, line items, and payment records so that they can be successfully pushed.
* Learn how [invoices are pushed](./push-invoice).

## Troubleshooting

If you experience any issues and need further assistance with the integration, please feel free to [contact our Support Team](../../intro/support) at any time.