> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnilinker.pl/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an ERP connection

> Create the connection in Omnilinker and generate the agent API key the ERP Sync agent signs in with.

A connection represents one ERP database in Omnilinker. You create it in the web app, then generate an agent API key
for it. The IT person installing the ERP Sync agent needs that key.

Before you start, check that you have the permissions listed in [Requirements](/erp/requirements#permissions-for-the-tenant-admin).

## Create the connection

<Steps>
  <Step title="Check that the ERP integration is enabled">
    Look for **ERP Integration** in the main menu. If it is missing, the ERP integration is not enabled for your
    organization yet. Ask Omnilinker to enable it; see [Modules and feature availability](/administration/features).
  </Step>

  <Step title="Open the connections list">
    Open **ERP Integration** > **Connections**.
  </Step>

  <Step title="Start a new connection">
    Click **New Connection**.
  </Step>

  <Step title="Fill in the form">
    * **Name**: a name you will recognize, such as the company or warehouse the ERP database belongs to. Required,
      up to 128 characters, and different from your other connections.
    * **Provider**: choose **Wapro**. The other providers in the list are not available yet.
    * **Description**: optional notes, up to 500 characters.

    The form does not ask for your ERP database details. You enter those later in the agent, and they never leave
    your network.
  </Step>

  <Step title="Save">
    Click **Save**. The connection appears in the list with the status **Active** and **Last Sync** set to **Never**.
  </Step>
</Steps>

New connections use **Hash scan** change detection. You can switch to WFM\_INT change tracking and change other agent
settings later with **Edit**. See [Sync configuration](/erp/sync-configuration).

## Generate the agent API key

The agent signs in to Omnilinker with an agent API key that belongs to this connection.

<Steps>
  <Step title="Find the connection">
    In **ERP Integration** > **Connections**, find the connection's row.
  </Step>

  <Step title="Generate the key">
    Open the row's **Actions** menu and click **Generate Agent Key**. Confirm the message that asks whether to
    generate an agent API key for the connection.
  </Step>

  <Step title="Copy the key">
    The **ERP Agent API Key** dialog shows the key under **Agent API key**. Click **Copy** and store the key
    somewhere safe, such as your password manager, until the agent is set up.
  </Step>

  <Step title="Close the dialog">
    Select **I have copied the key**, then click **Close**. You can only close the dialog after you copy the key and
    select the checkbox.
  </Step>
</Steps>

<Warning>
  The key is shown only once. Omnilinker cannot show it again after you close the dialog. If you lose it, generate a
  new key.
</Warning>

When you generate a key, Omnilinker does the following for you:

* It creates a service account for the connection, named `erp-agent-` followed by the connection ID. The dialog shows
  this name under **Service account**. The account has no password and cannot sign in to the web app.
* It adds the account to the **ERP Sync Agent** role, which has only the permissions the sync needs. Omnilinker creates
  that role the first time you generate a key.
* It revokes any earlier agent key for the same connection.

The service account appears in your users list. Do not delete it while the agent is in use.

<Warning>
  Do not create the agent's key on the **API keys** page. A key created there acts as the admin who created it, with
  all of that admin's permissions. Use **Generate Agent Key** instead. See [API keys](/administration/api-keys).
</Warning>

### Generate a new key

To replace the key, for example because it was lost or exposed, click **Generate Agent Key** on the same connection
again. The dialog tells you that the previous agent key was revoked.

The old key stops working at once, so the running agent can no longer send changes. Enter the new key in the agent
straight away. See [Setup wizard](/erp/setup-wizard) or [Tray app](/erp/tray-app).

## Find the connection ID

You do not need to enter the connection ID anywhere: the agent's setup wizard lists the connection that belongs to
your key. It is useful when you talk to support about a specific connection.

To find it, open the row's **Actions** menu and click **Details**. The connection ID is the last part of the address
in your browser:

```text theme={null}
https://omnilinker.pl/erp-integration/connections/<connection-id>
```

## Get the agent installer

Pass the agent API key to the IT person who installs the agent. Send it through a secure channel, never by plain
email or chat.

<CardGroup cols={1}>
  <Card title="Install the agent" icon="download" href="/erp/install-agent">
    Install the ERP Sync agent on a computer in your network.
  </Card>
</CardGroup>
