> ## 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.

# Reference items

> Map your ERP's price levels and warehouses to Omnilinker so prices and stock can be applied.

Reference items are the lists your ERP keeps alongside its products, such as price levels and warehouses. The agent
reads them from the ERP and uploads them to Omnilinker. You then map each one to its Omnilinker counterpart: an ERP
price level to a catalog price level, and an ERP warehouse to an Omnilinker warehouse.

Omnilinker needs these mappings to know where a price or a stock quantity belongs. Until a price level or warehouse is
mapped, prices and stock for it are skipped.

## What the agent uploads

| Reference data   | Wapro source                                     | Used in Omnilinker             |
| ---------------- | ------------------------------------------------ | ------------------------------ |
| Price levels     | The `Api_V_Price` view, identified by `ID_CENY`  | Mapped on the **Mappings** tab |
| Warehouses       | The `MAGAZYN` table, identified by `ID_MAGAZYNU` | Mapped on the **Mappings** tab |
| Units of measure | The `JEDNOSTKA` table                            | Not used yet                   |
| Categories       | The `KATEGORIA_ARTYKULU` table                   | Not used yet                   |

On a Wapro database with several companies, price levels and warehouses are limited to the company set in the agent
(the **Company ID**). See [Wapro](/erp/providers/wapro#multi-company-databases).

### When reference data is refreshed

The agent uploads reference data:

* when the agent starts,
* once a day after that,
* right after you enable WFM\_INT change tracking, and
* when you click **Refresh Reference Data** in the tray app's settings.

Reference data is uploaded in both change tracking modes, so you can map price levels and warehouses before you turn
on WFM\_INT change tracking.

Each upload is a complete list. An item that is missing from the latest upload is not deleted in Omnilinker. It is
marked **Stale** instead.

## Map price levels and warehouses

You need the **Reference Data** and **Entity Mappings** permissions to see the tab, and **Manage Entity Mappings** to
change mappings.

<Steps>
  <Step title="Open the Mappings tab">
    Open **ERP Integration** > **Connections**, choose **Details** on the connection, and open the **Mappings** tab.
  </Step>

  <Step title="Map each price level">
    Under **Price Levels**, choose a catalog price level in the **Mapped to** list for each ERP price level. Choose
    **— Not mapped —** to remove a mapping.
  </Step>

  <Step title="Map each warehouse">
    Under **Warehouses**, choose an Omnilinker warehouse in the **Mapped to** list for each ERP warehouse.
  </Step>
</Steps>

Each choice is saved as soon as you make it. There is no **Save** button.

Each row shows the item's **ERP ID**, **Code**, **Name** and when it was **Discovered**, that is, last seen in an
upload. Tick **Show stale** to also list items that are no longer in the ERP.

If a section says **No reference data discovered yet. It is uploaded by the on-premise agent.**, the agent has not
uploaded anything yet. Check that it is running and connected. See [Monitoring](/erp/monitoring).

The **Mapped to** lists show the catalog price levels and Omnilinker warehouses that already exist. Create any you
are missing first. See [Price levels](/catalog/price-levels).

### Things to know about price levels

* **The ERP name wins.** When the ERP price level's name differs from the name of the catalog price level you mapped
  it to, Omnilinker renames the catalog price level to the ERP name at the next upload.
* **Derived price levels are never used.** In Wapro a price level can be calculated from another one. Omnilinker
  never creates or updates a catalog price level for a derived level, and records such changes as skipped.

### Things to know about warehouses

* Deleting a warehouse in the ERP does not delete the Omnilinker warehouse or its stock history.
* Stock only syncs with WFM\_INT change tracking. See
  [Change tracking mode](/erp/sync-configuration#change-tracking-mode).

## Automatic provisioning

Instead of mapping everything by hand, you can let Omnilinker create what is missing. Choose **Edit** on the
connection in **ERP Integration** > **Connections**, and under **Sync Settings** tick:

| Setting                         | What happens to an unmapped item                                                                                                                                                                  |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Auto-provision price levels** | Omnilinker creates a catalog price level with the ERP level's name and maps it. If a catalog price level with that name already exists, it maps to that one instead. Derived levels are left out. |
| **Auto-provision warehouses**   | Omnilinker maps the ERP warehouse to the Omnilinker warehouse with the same code, or creates one if there is none.                                                                                |

Warehouses are provisioned from WFM\_INT change tracking only. In hash scan mode, map warehouses by hand.

If your plan does not allow another warehouse, the warehouse is not created and stock for it stays skipped. See
[Modules and feature availability](/administration/features).

## What happens to unmapped items

Omnilinker does not fail a change whose price level, warehouse or product is not mapped yet. It records the change
as skipped on the **Sync Logs** tab. The log entry's error message holds one of these codes:

| Code                                      | Meaning                                                                                                               |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `ErpIntegration:Skip:PriceLevelNotMapped` | A price, or the price level itself, arrived for an ERP price level you have not mapped, and auto-provisioning is off. |
| `ErpIntegration:Skip:WarehouseNotMapped`  | Stock, or the warehouse itself, arrived for an ERP warehouse you have not mapped, and auto-provisioning is off.       |
| `ErpIntegration:Skip:ProductNotMapped`    | A price or stock quantity arrived before its product.                                                                 |
| `ErpIntegration:Skip:DerivedPriceLevel`   | Expected. Derived price levels are never used.                                                                        |

A skipped price or stock quantity is applied the next time it changes in the ERP after you add the mapping. It is not
replayed when you create the mapping.

<Tip>
  Map price levels and warehouses, or turn on automatic provisioning, **before** you enable WFM\_INT change tracking.
  Enabling it sends every price and stock quantity once. Anything that arrives unmapped then waits for its next
  change in the ERP.
</Tip>

## Dangling mappings

A section shows **mapping(s) need attention** when a mapping no longer fits:

* **— ERP item no longer present**: the ERP price level or warehouse is gone from the latest upload.
* **— target no longer available**: the catalog price level or Omnilinker warehouse it points to was deleted.

Click **Delete** next to the item to remove the mapping, then map the item again if it still exists.

## Product and brand mappings

Omnilinker also keeps a link between each ERP product or brand and the catalog product or brand it created. These
links are made automatically when data arrives, and are not shown or edited in the web app. For Wapro, a product is
identified by its `INDEKS_KATALOGOWY` and a brand by its manufacturer name. See
[Wapro](/erp/providers/wapro#how-products-are-identified).
