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

# Customers in your ERP

> How Omnilinker finds, creates or asks you to choose the customer in Wapro for an order, what it never changes there, and what happens to personal data.

An order in Wapro belongs to a customer, so before Omnilinker sends an order it settles which Wapro customer the buyer
is. It finds one, creates one, or asks you to choose, and it remembers the answer so the same buyer is the same customer
next time. You do not have to do anything for most orders. See [Orders to your ERP](/erp/orders-to-erp) for the rest of the
send.

## How a customer is found

Omnilinker looks in this order and stops at the first answer:

1. **A customer it already knows.** If Omnilinker created or chose a customer for this buyer before, it uses that one.
2. **A company, by its tax ID (NIP).** A buyer who is a company with a valid NIP is looked up in Wapro by that number.
   One match is used. If several customers have the NIP, Omnilinker narrows them by the invoice **postcode and city**; if
   exactly one is left, it is used. Otherwise (several are still left, or none matches the address), the order waits for you to choose (see
   [Choose the customer yourself](#choose-the-customer-yourself)). If the only customers with the NIP are blocked or
   inactive in Wapro, the order waits for you as well: a block is usually a credit hold, and Omnilinker never creates a
   second customer with the same NIP to get round it. An anonymised customer does not count.
3. **A buyer from Allegro, by the buyer's Allegro ID.** Wapro Aukcje (Wapro's Allegro module) records the Allegro buyer
   on the customers it creates. When exactly one usable Wapro customer carries this buyer's Allegro ID, Omnilinker uses
   it as it is. If several do, or the only ones are blocked or inactive, you choose.
4. **Otherwise, a new customer is created** in Wapro (see below).

Omnilinker never looks a customer up by e-mail address, phone number or name, and never by the Allegro login: those are not
reliable enough to put two people together. A customer that is anonymised, blocked or inactive in Wapro is never used
automatically. How Omnilinker matches buyers to its own contacts is described in [Contacts](/sales/contacts#contacts-created-from-orders).

## How a customer is created

If nobody matches, Omnilinker creates a customer in Wapro from the buyer's invoice details: the name, the address and, for a
company, the NIP. Wapro numbers the customer's code itself.

* **Choose the field for the key first.** On the connection's **Orders** tab, set **Field for Omnilinker's customer key**
  to one of Wapro's free fields. Omnilinker writes a key for the buyer there, so if an answer is lost on the way it finds
  the customer it just created instead of creating it a second time. Until you choose a field, no order is sent
  and a send waits with **Order export settings incomplete**. Once Omnilinker has matched or created a customer,
  the field can no longer be changed: the keys already written there would no longer be found and duplicates would follow.
* **Fields 6 and 7 are never offered.** Wapro does not save them correctly, so Omnilinker keeps away from them. The fields
  you can choose come from your Wapro database; a field that is already used there is marked **used in ‹connection›**.

## The retail customer

By default every buyer becomes a customer of their own. If you prefer one shared Wapro customer for the consumers who
buy without an invoice (for example **Sprzedaż detaliczna**), turn on **Use one retail customer for consumer orders
without an invoice** on the **Orders** tab and enter the customer's code.

The retail customer is used only for a consumer order with no invoice request. An order where the buyer asked for an
invoice, a company order and a cross-border (OSS) sale always get a named customer.

## Choose the customer yourself

When several Wapro customers could be the buyer, or the only ones found are blocked or inactive, the order does not guess. It waits, you get a notification, and the order
card says **Not in ‹ERP› yet** with the reason **More than one ‹ERP› customer could be this buyer, or those found are blocked or inactive** and the button **Choose the ‹ERP› customer**. The dialog lists the candidates with their
**Code**, **Name**, **Tax id** and **Postcode and city**. A customer that is anonymised, blocked or inactive in Wapro is
listed but cannot be picked. Click **Use this customer**, or **Create a new customer in ‹ERP›** if none is the buyer or the
customer is blocked for a reason that should not stop this order. You need **Send orders to the ERP**.

Omnilinker remembers your choice: the buyer's next order goes to the same customer without asking. An order waiting for a
choice waits as long as it takes; it is not given up after 7 days.

## What Omnilinker never changes

Omnilinker only adds customers; it never edits one. An existing Wapro customer keeps its name, NIP, address and every other
detail, even when the order's invoice details differ. When they do, the order card says so: "The order's invoice name
differs from the ‹ERP› customer's. Omnilinker never changes customers in ‹ERP›." The order's own delivery address does not
touch the customer either: it is saved as a delivery place of the order.

The order card's **ERP** section shows the customer, for example **Customer in Wapro: …**, and how it was found: **matched
by tax id**, **matched by the Allegro buyer id**, **matched by Omnilinker's key**, **created in Wapro by Omnilinker** or
**chosen by a person**.

## Personal data

An order sent to Wapro carries only what the customer and the delivery need. Once the data is in Wapro it belongs to
Wapro, and Polish law has you keep invoice data for the tax period. So when you [anonymize an order or a
contact](/sales/orders#anonymize-an-order) in Omnilinker, the anonymisation does **not** reach the customer and orders
already in Wapro. Anonymise those in Wapro, according to your own retention rules.

Omnilinker also keeps its own record of what it asked Wapro to do (the command log). Anonymising a contact erases the
buyer's name, address, e-mail, phone and tax id from the customer searches and creations recorded for it. Anonymising an
order erases the delivery name, company, address, phone and pickup point, and the buyer's Allegro login, from the order
sends recorded for it; a send still waiting for the agent is withdrawn first, so the erased order never reaches Wapro.
The records themselves stay, with their outcome, for the audit.

<CardGroup cols={2}>
  <Card title="Orders to your ERP" icon="send" href="/erp/orders-to-erp">
    Choose how sources send, and what an ERP order contains.
  </Card>

  <Card title="Contacts" icon="address-book" href="/sales/contacts">
    How Omnilinker matches buyers to its own contacts.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.