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

# Connect Xledger

> Provide an Xledger API token and, when needed, a custom GraphQL endpoint.

You need an API token generated by an Xledger domain administrator.

## Create the credential

1. Sign in to Xledger as a domain administrator.
2. Go to **Administration → System Access → GraphQL → API tokens**.
3. Create a token for Control and grant only the read rights required for the integration.
4. Generate and copy the API token or hash.
5. Confirm whether the company uses the live or demo GraphQL endpoint.

## Fill the fields in Control

| Field               | Value                                                                                                                                      |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Xledger API Token   | The generated API token/hash                                                                                                               |
| Xledger GraphQL URL | Optional; defaults to the live endpoint, `https://www.xledger.net/graphql`. Use `https://demo.xledger.net/graphql` for demo organizations. |

Save and verify the credentials. If your organization rotates tokens, update Control after every rotation.

## GraphQL access required

The token must be able to query these root fields:

| GraphQL field    | Data                                                     | Requirement                                |
| ---------------- | -------------------------------------------------------- | ------------------------------------------ |
| `entities`       | Xledger entities available to the token                  | Required                                   |
| `arTransactions` | Accounts-receivable transactions and outstanding amounts | Required                                   |
| `apTransactions` | Accounts-payable transactions and outstanding amounts    | Required                                   |
| `customers`      | Customers                                                | Optional; Control continues if unavailable |
| `suppliers`      | Suppliers                                                | Optional; Control continues if unavailable |
| `projects`       | Projects                                                 | Optional; Control continues if unavailable |
| `products`       | Products                                                 | Optional; Control continues if unavailable |
| `purchaseOrders` | Purchase orders                                          | Optional; Control continues if unavailable |

Grant query/read access only. Xledger applies the token owner's domain, entity, role, and data-access restrictions to
GraphQL results, so verify that the token can see every entity intended for Control.

## Data imported

* Xledger entities
* Accounts-receivable and accounts-payable transactions, including outstanding amounts
* Customers and suppliers
* Projects and products
* Purchase orders

Control does not currently import a standalone Xledger general ledger or chart of accounts.

Contact your Xledger domain administrator or regional Xledger support if token management is not available to your user.

## Provider documentation

* [Xledger: generate an API token](https://xledgerukinternal.zendesk.com/hc/en-us/articles/23682919258514-Generate-an-API-token)
* [Xledger: access the GraphQL schema](https://xledgerukinternal.zendesk.com/hc/en-us/articles/23684055307666-Access-GraphQL-Schema)
