# How to connect Exact Online

Connecting Exact Online takes two actions, in this order: pick your **API domain**, the Exact
Online region you sign in on, and save it, then click **Authorize** and sign in with your Exact
Online account. There are no credentials to type or paste. Apideck runs the OAuth flow and keeps
the short-lived access token refreshed afterwards, so the connection keeps working without you
re-entering anything.

**Do the region first.** Exact Online runs every country as a separate instance with its own
hosts, and this connector sends the authorization to the domain you select. Vault asks for the API
domain before it offers **Authorize**: until the setting is saved, the connection shows a message
that the API domain must be set first and the button is not shown. When the domain is left unset
the connector falls back to the Dutch instance (`nl`), which sends anyone outside the Netherlands
to a host that holds none of their data. Choosing the domain and saving takes a few seconds.

## Prerequisites

- **An active Exact Online subscription** in your country edition.
- **A user account that can authorize third-party app connections.** If you are not sure whether
  yours can, check with your Exact Online administrator before you start.
- **The right administration selected in Exact Online before you authorize.** Exact Online calls a
  company an *administration* (a *division* in the API). A connection is anchored to one of them,
  and it is taken from whichever administration your account is currently in at the moment you
  authorize, so if your account has access to more than one, switch to the one this connection is
  for **first**. Step 3 explains the detection and how to correct it.

## 1. Select your API domain: then save

Open the Exact Online connection in Apideck Vault. Its settings include **Select your API domain**:

| Region | Exact Online sign-in domain |
|---|---|
| Belgium | `start.exactonline.be` |
| Germany | `start.exactonline.de` |
| Netherlands | `start.exactonline.nl` |
| Spain | `start.exactonline.es` |
| United Kingdom | `start.exactonline.co.uk` |
| United States | `start.exactonline.com` |

1. Pick the region whose domain matches the one you sign in to Exact Online on.
2. Click **Save**.

This choice decides which Exact Online instance the authorization, and every later request, is
sent to. An app registration also belongs to one country instance, so the region has to be the one
the integration you are setting up was registered for.

These six domains are the ones this connector's API domain setting offers. If you sign in on
another Exact Online instance, for example France (`start.exactonline.fr`), this setting cannot
reach it, so contact the provider of the integration: they own the relationship with Apideck and
can raise the request.

## 2. Authorize with Exact Online

1. If your Exact Online account has access to more than one administration, sign in to Exact
   Online and switch to the administration this connection should use. Whichever one is current
   when you authorize is the one the connection gets.
2. Back in Vault, with the API domain saved, click **Authorize**. Vault redirects you to the Exact
   Online sign-in page for that region.
3. Sign in with the Exact Online account this connection should use.
4. Review the access the app asks for and grant it.

You are never asked for a redirect URL, a client ID, or a client secret. Those belong to the Exact
Online app registration held by the provider of the integration.

## 3. Your administration is detected automatically

Right after authorization, Apideck reads the **current division** of the account you just signed in
with and stores it as the connection's default administration. You never type a division number,
and there is no dropdown to fill in.

Because it is your *current* division that gets captured, the administration you were in when you
authorized is the one now on the connection. If the wrong one was captured, switch administration
in Exact Online and run **Authorize** again.

An integration that works across several administrations can target a different one per request by
sending the division id in the `x-apideck-company-id` header. Requests without that header use the
administration stored on the connection.

## 4. Optional connection settings

None of these are required to save the connection, but two of them are needed in practice before
certain records can be created.

| Setting | Needed for | Notes |
|---|---|---|
| **Purchase Journal** | Creating bills (purchase invoices) | Dropdown, read live from the journals in your administration. |
| **Bank Journal** | Creating payments and bill payments | Must be an actual bank journal (Exact journal type 12), not a general or sales journal. |
| **Balance-Sheet / Profit-and-Loss titles** | Balance sheet and profit-and-loss reads on a non-Dutch classification scheme | See the [Balance Sheet and Profit and Loss configuration guide](https://developers.apideck.com/connectors/exact-online/docs/consumer+financial-reports-configuration). |

Without a **Bank Journal**, creating a payment or bill payment fails with `Invalid journal`.
Without a **Purchase Journal**, bills cannot be created. Both dropdowns list every journal in your
administration, so choose deliberately: entries are posted to the journal named here. The one
exception: an integration can override the journal on an individual write request, so a record
created with a different journal than the one configured here is expected behaviour rather than a
broken setting.

The Balance-Sheet and Profit-and-Loss title fields only matter when the built-in Dutch RGS headings
do not match your administration's classification scheme, which is the normal case outside the
Netherlands. The linked guide walks through reading your own headings and entering them.

## Notes

- **Token refresh is automatic.** Apideck refreshes the short-lived access token for you; there is
  nothing to re-enter while the connection is in regular use.
- **An unused connection stays connected.** Exact expires a refresh token after 30 days without
  use, and each refresh replaces the previous one: they are single-use. Apideck renews the token in
  the background before then, so a connection does not lapse merely from sitting idle. If a renewal
  fails, restore the connection by opening it in Vault and clicking **Authorize** again.
- **Payments are recorded, not reconciled.** Creating a payment or bill payment writes a bank entry
  in the bank journal you configured. It does not match that entry against the invoice, so the
  invoice status does not change to paid. Do the matching in Exact Online.
- **A `429` is a rate-limit answer, not a broken connection.** Exact counts calls against a
  per-minute and per-day budget per app per administration (the current figures are in this
  connector's overview). When the budget runs out Exact answers `429`, and Apideck passes Exact's
  rate-limit and retry-after headers through so the integration can back off and retry.
- **The connection's reach is the authorizing user's reach.** What it can read and write follows
  that Exact Online user's permissions and administration access. If their access is reduced or
  their account is disabled later, the connection is affected too.

## Troubleshooting

**The sign-in page is for the wrong country, or my Exact Online login is rejected.**
The API domain on the connection does not match your region. If no domain was saved, authorization
falls back to the Dutch instance; if the wrong domain was saved, authorization goes to that region
instead. Vault requires the domain to be saved before it shows **Authorize**, but a connection
created through the Vault API can still carry no domain. Set **Select your API domain** to your
region, click **Save**, then click **Authorize** again.

**Authorization completed but the connection returns another company's data.**
The division captured at authorization was not the one you wanted (step 3). Sign in to Exact
Online, switch to the right administration, and run **Authorize** again on the connection.

**Exact Online will not let me authorize the app at all.**
Two things to check, in order. First, that your user is allowed to authorize third-party app
connections; your Exact Online administrator can confirm. Second, that the app has been approved
by Exact for use outside the Exact instance it was registered in; until it is, only accounts on
that same instance can connect. The second one is not yours to change. Report it to the provider
of the integration, who owns the app registration and its review.

**Creating a payment or bill payment fails with `Invalid journal`.**
The **Bank Journal** setting is empty, or points at a journal that is not a bank journal. Open the
connection, pick a bank journal from the dropdown, and save.

**Bills cannot be created.**
Set the **Purchase Journal** on the connection (step 4).

**The balance sheet or profit-and-loss sections look wrong or empty.**
Your administration's first-level classification headings differ from the built-in Dutch RGS
defaults. The
[Balance Sheet and Profit and Loss configuration guide](https://developers.apideck.com/connectors/exact-online/docs/consumer+financial-reports-configuration)
shows how to read your own headings and which fields to enter them in.

**Requests start failing with `429`.**
The call budget for this administration is used up. The connection itself is fine: nothing needs
re-authorizing, and it recovers once the budget resets. If it keeps happening, report it to the
provider of the integration: how the integration paces its calls is theirs to manage, and this
connector's overview lists the current limits.

**The connection worked and later stopped.**
The usual causes, in order:

1. A background token renewal failed: re-authorize (see Notes).
2. The Exact Online user who authorized it lost access, or the subscription lapsed: re-authorize
   with an account that has the access.
3. The Exact Online app credentials behind the integration changed. That sits with the provider of
   the integration, not with you, and affects every connection using them. Report it to them.

Still stuck? Contact [Apideck Support](https://help.apideck.com/en/articles/7774658).
