Skip to content
Docs

Registering an Exact Online OAuth 2.0 app

This guide is part of the Publicus connection catalog. Once you have the credentials, connect the service and Publicus stores them for you.

Distilled from Exact Online’s own developer documentation: Using OAuth 2.0 to access Exact Online API, Step 1. Get Client ID and Client Secret, Register your app, Step 2. Set up authorization requests, Step 3. Get and use access tokens, Step 4. Obtain new access tokens, Exact Online sites. Retrieved 2026-07-03.

Exact Online supports only the implicit and authorization code grant types — the resource-owner-password and client-credentials grants are not supported. Use the authorization code grant for server-side apps that can keep a client secret; the implicit grant is only for public clients (SPAs, native/mobile) that cannot. This guide covers the authorization code grant.

Exact Online is deployed per country on a separate site, so first note your country host: https://start.exactonline.nl (NL), .be, .de, .co.uk, .com (US), .es, or .fr (FR — start.exactonline.fr serves the live Exact Online authorization endpoint). Every endpoint below is written by Exact as ../…; the .. resolves to your country host. This is the region connection-config value.

There are two registration flows, both of which yield a Client ID and Client Secret used in the same OAuth 2.0 flow:

Internal app (API key — your own subscription only):

  1. In Exact Online, go to Company name > Import/Export.
  2. In the Other section, click App registrations and accept the App Store terms & conditions.
  3. Click New, then enter an Application name and a Redirect URI. The redirect URI must be a public HTTPS URL — localhost and plain HTTP are rejected with a 401. You need the Manage apps role.
  4. Click Save + Edit. The generated Client ID and Client Secret are shown on the registration.

External app (App Store — usable by other customers):

  1. Log in to the App Store and click Manage my apps. You need an Exact Online Developer subscription.
  2. Click Register a production app (usable by external clients) or Register for a testing app (not visible in the App Store).
  3. Set the Redirect URI to a public HTTPS URL. Note: there is no sandbox/test environment.
  4. Open the app’s Develop your app tab to read the auto-generated ClientID and Client secret.
  5. To let other customers connect, submit the app for review (Submit for review tab) and, in Request Permission, click Request.

Keep a maximum of four registrations per app (development, test, acceptance, production); store the Client Secret encrypted.

Authorize a user (get an authorization code)

Section titled “Authorize a user (get an authorization code)”
  1. Redirect the user to the authorization endpoint on their country host:

    GET https://start.exactonline.{region}/api/oauth2/auth
    ?client_id={client_id}
    &redirect_uri={redirect_uri}
    &response_type=code
    &force_login=0

    force_login=1 forces a fresh login and ignores any active Exact Online session. The user logs in (two-step verification is integrated), sees a consent screen where they also choose which divisions the app may access (division-level scoping), and is redirected back. There is no scope parameter — access is governed by division scoping and the user’s entity rights, not OAuth scopes.

  2. Read the code from the redirect. It is valid for 3 minutes and can be used once. Before exchanging it, URL-decode it (e.g. %21 → !).

  1. POST to the token endpoint with an application/x-www-form-urlencoded body (client credentials go in the body — HTTP Basic is not used):

    POST https://start.exactonline.{region}/api/oauth2/token
    Content-Type: application/x-www-form-urlencoded
    code={code}
    &redirect_uri={redirect_uri}
    &grant_type=authorization_code
    &client_id={client_id}
    &client_secret={client_secret}

    The response contains access_token, token_type: Bearer, expires_in: 600, and refresh_token.

  2. Call the API with Authorization: Bearer {access_token}. The first call must be GET https://start.exactonline.{region}/api/v1/current/Me?$select=CurrentDivision to learn the current division; all other resources are addressed as /api/v1/{division}/{package}/{entity}.

Refresh tokens (strict single-use rotation)

Section titled “Refresh tokens (strict single-use rotation)”
  1. The access token expires after 600 seconds (10 minutes). Refresh it before it expires by POSTing to the same token endpoint:

    POST https://start.exactonline.{region}/api/oauth2/token
    Content-Type: application/x-www-form-urlencoded
    refresh_token={refresh_token}
    &grant_type=refresh_token
    &client_id={client_id}
    &client_secret={client_secret}
  2. Mind the tight timing window:

    • Not too early: a new token can only be requested 570 seconds (9m30s) after the previous one was issued; refreshing sooner returns 401 Access Token not expired. Refresh no earlier than ~30 seconds before expiry.
    • Not too late: calling the API with an expired access token returns 401 Authentication Required.
  3. Every refresh returns a new refresh_token and immediately invalidates the old one — persist the newest one atomically and discard the previous. Refresh tokens also expire after 30 days of non-use; once expired (or after a user revokes and re-grants permission), you must run the authorization-code flow again from step 6.

Open Connections under Credentials, choose Exact Online, and pick Exact Online OAuth 2.0 (authorization code). Publicus asks for exactly the fields listed above and keeps them in your workspace’s secret storage.

See also: Exact Online in the catalog.

This guide is maintained by Publicus and published under CC BY 4.0.