# Configuring Acumatica

Acumatica does not offer a single, centrally shared OAuth app the way most connectors do. Every
Acumatica instance, your own test instance and each of your consumers' production instances,
registers its own **Connected Application**. There is no Apideck-provided sandbox credential for
this connector: [Apideck Credentials are not available](https://platform.apideck.com/configuration/accounting/acumatica),
because the OAuth app lives inside each instance rather than centrally.

## Before you start

You'll need an Acumatica ERP instance (cloud or hosted) with the **Web Services API enabled**, and
an administrator role (or a custom role with API permissions) so you can register a Connected
Application. To develop against your own instance first, get one of:

- **Free local developer instance**: download from [builds.acumatica.com](https://builds.acumatica.com/)
  (Windows required: IIS and SQL Server; runs in 2-user demo mode).
- **Cloud trial instance**: available through the [Acumatica Developer Network (ADN)](https://adn.acumatica.com/),
  which also includes Acumatica University training.

## Register your Connected Application

Register the app inside the instance you want to connect (repeat this for each instance:
credentials never carry over between them).

1. In your Acumatica instance, open **System > Integration > Connected Applications** (form
   **SM303010**).
2. Create a new Connected Application and choose the **Authorization Code** OAuth 2.0 flow.
3. Add Apideck's redirect (callback) URI:

   ```
   https://unify.apideck.com/vault/callback
   ```

4. Generate a **Client Secret** and note the **Client ID**. The secret is shown when you generate
   it. Copy it before leaving the page.
5. Confirm the **Web Services API** is enabled on the instance so the connection can call the REST
   endpoints.

### Refresh token expiration

On Acumatica ERP **2023 R2 and later**, the Connected Application form lets you choose how refresh
tokens expire. Set **Sliding Expiration** so Apideck can keep the connection alive without a
manual re-authorization: each successful refresh extends the refresh token by the **Sliding
Lifetime** you configure, up to the **Absolute Lifetime**, or indefinitely if you set the
absolute lifetime to **Infinite**.

Per Acumatica's documentation, on instances **earlier than 2023 R2** the refresh token has a
fixed, non-configurable 30-day lifetime; after 30 days a refresh returns `invalid_grant` and the
consumer must re-authorize the connection.

## Connect your test instance

Once the app is registered, enter the **Client ID**, **Client Secret**, and your **instance URL**
(the full versioned endpoint, e.g. `https://yourinstance.acumatica.com/entity/DEFAULT/24.200.001`)
in [Apideck Vault](https://vault.apideck.com) to connect,
exactly as a consumer connects their own instance. IP whitelisting is not required.

## Rolling out to consumers

Because each instance needs its own Connected Application, every consumer repeats this registration
inside their own Acumatica instance before connecting: there is no app you register once on their
behalf. They generate their own Client ID and Client Secret and supply those plus their instance
URL in Apideck's Vault connection form.

## Going to market (optional)

Publishing on the Acumatica Marketplace is not required to build or ship this integration, but a
Marketplace listing needs **ADN Level 2 (Certified)** status, which involves a technical audit of
your solution and certified-developer training. Apply via the
[Acumatica Partner Program](https://www.acumatica.com/partners/become-a-partner/).

## Rate limits

Acumatica enforces API limits per the consumer's own instance license tier, not per Apideck app.
See the At a Glance tab for the headline numbers. If a consumer hits their limit, point them to the
License Monitoring Console inside their own instance; only Acumatica can raise it.

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