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

# Orders to your ERP

> Send confirmed orders to Wapro as customer orders with a reservation, choose who imports orders today, and see what happens when an order is sent, changed, cancelled or fails.

Omnilinker can send an order to your ERP as a customer order, with a reservation for its products, so the stock your
ERP shows is already spoken for. The ERP Sync agent places the order in your Wapro database; Omnilinker never connects
to it. Each order is sent once: if a send is repeated, the ERP finds the order it already has and creates nothing
twice.

On the order card and in the **Orders** list, the ERP's name is your connection's name, for example **Wapro**. This page
writes **‹ERP›** for it. With more than one connection, the texts say "the ERP" until the order's source decides which
connection it goes to.

<Note>
  Update the agent first. An agent older than the one that can place orders makes the connection's **Orders** tab say
  **ERP Sync needs an update**, and nothing is sent. See [Install the agent](/erp/install-agent#update-the-agent).
</Note>

## Before you start

Open **ERP Integration** > **Connections**, click **Details** on the connection and open its **Orders** tab. You can change
the order settings with **Edit ERP Connection**, and the question and each source's choice with **Manage sources**
(**Ordering**); without them you see the tab read-only.

The **Orders to ‹connection›** card opens with **What orders need**, a checklist. Each line that is not ready has a
button that takes you to the fix:

| Line | What it means | If it is not ready |
| - | - | - |
| The connection is switched on | The connection is **Active**. | **Switch it on** |
| ERP Sync serves this connection | An agent is paired and sending heartbeats. | **Connect a PC**, **See the agent** |
| ERP Sync can place orders and find customers in ‹connection› | The agent's connector reports that it can. | **Update ERP Sync** |
| An ERP user for writes is set | Orders are saved in Wapro in the name of this user. | **Set the ERP user** |
| A warehouse is mapped | At least one ERP warehouse is mapped to an Omnilinker warehouse. | **Map a warehouse** |
| Products are linked | At least one product is linked to an ERP product. | **Link products** |
| The settings below are complete | The settings further down the tab are filled in. | **Complete the settings** |

The card's heading says where you stand: **Ready for orders**, **Connection switched off**, **No ERP Sync connected**,
**ERP Sync needs an update**, **No ERP user for writes**, **No warehouse mapped**, **No products linked** or
**Settings incomplete**.

The **ERP user for writes** is the Wapro user Omnilinker acts as when it writes. Set it on the connection's page; see
[Monitoring](/erp/monitoring#connection-details). The SQL login needs a few more rights for orders than for reading:
see [Requirements](/erp/requirements#sql-server-login) and [Wapro](/erp/providers/wapro#what-it-writes-to-your-database).

## Order settings

Below the checklist, **Order settings** holds what an ERP order carries.

| Setting | What it does |
| - | - |
| **Use one retail customer for consumer orders without an invoice** and **Retail customer's code** | Off by default: every buyer becomes a customer of their own. Turn it on to send consumer orders without an invoice request to one shared Wapro customer, and enter its code. An order with an invoice request, or a cross-border sale, always gets a named customer. See [Customers in your ERP](/erp/customers-in-erp). |
| **Field for Omnilinker's customer key** | Required before any order is sent, even to the retail customer: choose one of Wapro's free fields (**Field 1** to **Field 10**) to hold the key that finds the same customer again and keeps a lost answer from creating a second one. Fields 6 and 7 are never offered, and a field already used in Wapro is marked. |
| **Field for the channel order id** | A free field of the order that holds the shop's or Allegro's order number and the buyer's login. **None** puts them in the order's remarks only. |
| **Delivery service article code** | The Wapro article that carries the shipping cost. Empty means the order has no shipping line. |
| **Payment form** | The payment form of the order, as Wapro names it. Empty means Wapro's default. |
| **Book a reservation in ‹connection›** | On by default: every order sent books a reservation. Off: orders go without one, and Omnilinker keeps holding their stock. |
| **Download NBP exchange rates in ‹connection› before a foreign-currency order** | On by default. See [Currencies](#currencies). |

Click **Save**. If someone saved the settings meanwhile, Omnilinker reloads them and asks you to make your change
again.

## Choose who imports orders today

Many Wapro installations already import shop and Allegro orders through Wapro's own tools. If both Wapro and Omnilinker
brought in the same order, you would have it twice. So Omnilinker asks first, once per connection:

**Who imports orders into ‹connection› today?**

* **Nobody, we type them in**: Omnilinker sends the orders.
* **Another system already imports them**: you then choose **Which sources does the other system import?** and click
  **Leave them to the other system**. Omnilinker never sends those sources' orders; they show **Managed by another
  system**.

The card shows who answered and when. If the connection's database holds shop or Allegro orders that another system
imported during the last 30 days, the card warns you and tells you to leave those sources to the other system.

## Choose how each source sends

After the question, the card lists your order sources in a table with **Source**, **Warehouse** and **Into the ERP**.
Every source starts as **Not sent**: nothing leaves Omnilinker until someone chooses how a source sends. For each
source pick one of:

| Choice | What happens |
| - | - |
| **Send to ‹ERP› on confirmation** | The order is sent when it is confirmed. |
| **Send to ‹ERP› later: when the order reaches a status** | Pick the **Status**; the order is sent when it gets it. |
| **Send to ‹ERP› later: by an automation rule or by hand** | Nothing is sent until the [automation step](/automations/create-and-edit#steps) **Send to the ERP** or a person sends it. |
| **Do not send** | The source's orders are not sent. |
| **Managed by another system** | Another system enters this source's orders into the ERP. Omnilinker never sends them. |

Each source sends to one connection. If it already sends to another, the row says **Sends to …** and asks you to confirm
the move. To take a source back from another system, click **Take over from the other system** and confirm: switch the
other system's order import off first, because only orders confirmed from now on are sent automatically. Send older ones
by hand or in bulk.

The same line, **Into the ERP**, is on each source's card under **Sales** > **Order sources**; see
[Order statuses, sources and extra fields](/sales/order-settings#order-sources). The **Warehouse** column shows the
source's warehouse, whether it is mapped to an ERP warehouse and who manages its stock. All the product lines of an order
come from this one warehouse.

Above the table, **‹n› orders not in ‹ERP› yet** and **‹n› orders failed to reach ‹ERP›** open the **Orders** list
filtered to them.

## Send an order

An order can be sent when it is confirmed, not cancelled, not archived, not anonymized, and its source sends to an ERP.

* **Automatically**, as the source's choice above says.
* **By hand**: open the order, find the **ERP** section (**ERP** in the menu on the left) and click **Send to ‹ERP› now**.
  You need **Send orders to the ERP**.
* **In bulk**: tick orders on the **Orders** list and click **Send to ‹ERP›**. Each order goes to the connection its source
  sends to, and one that cannot be sent is counted as failed. Up to 50 orders are sent at once; with more, the send runs in
  the background and a bar shows the progress. See [Bulk actions](/sales/orders#bulk-actions).
* **From an automation rule**: the step **Send to the ERP**. See [Create and edit rules](/automations/create-and-edit).

Sending does not wait for the ERP. The order shows **Sending to ‹ERP›** while the agent picks it up, and then **In ‹ERP›**
or **In ‹ERP› as …** with Wapro's order number.

## What an ERP order contains

* **Products and prices.** Each product line goes to the Wapro article it is linked to, at the gross price from
  Omnilinker. The VAT rate comes from the Wapro article, not from Omnilinker, and Wapro works out the net.
* **Delivery.** The shipping cost is one line on the **Delivery service article code** from the settings. Without that
  code the line is left out and the shipping amount does not reach Wapro, with no warning anywhere, so set the code
  before you send orders that have a shipping cost.
* **Numbers.** Omnilinker's order number goes into the ERP's customer order number, cut to 30 characters (with a
  warning in the receipt). The shop's or Allegro's order number and the buyer's login go into the free field you chose, and into a line
  of the order's remarks.
* **A reference that makes a retry safe.** Each send carries a reference starting with `OMNI-` in the order's internet
  order id. Before writing, the agent looks for it, so a repeated send finds the order and creates nothing again.
* **The delivery address.** It becomes a delivery place of its own on the order's customer, with the parcel locker's point
  code for a pickup point. A matching place is reused, and the customer's default delivery place never changes. If Wapro
  does not know the delivery country, the address goes into the remarks, with a warning in the receipt.
* **The reservation.** With **Book a reservation** on, the products are reserved in the order's warehouse. If Wapro can
  reserve only part of it, the card says **Partly reserved in ‹ERP›: x of y** and you get a notification; the rest is not
  reserved until the stock arrives.
* **The customer.** A real named customer, found, created or chosen once. See [Customers in your ERP](/erp/customers-in-erp).
* **Warnings.** An order that went through with a caveat (a number cut short, an address moved to the
  remarks, an exchange-rate download that failed) is not marked on the order. The warnings are in the receipt of the
  command that placed it: **ERP Integration > Commands**, open the command, section **Receipt** (you need the ERP
  commands permission).

## Currencies

An order in euros, dollars or another currency is sent in its own currency, at the rate the ERP holds. Omnilinker does
not convert it.

* **The rate.** Wapro uses the National Bank of Poland (NBP) table it holds for the order's date.
* **Download first.** With **Download NBP exchange rates in ‹connection› before a foreign-currency order** on (the
  default), the agent asks Wapro to fetch the NBP tables just before it places the order. If the download fails, the
  order is still sent, with a warning in the receipt. The download needs rights on the SQL Server, and it needs the server
  to run Wapro's download component and to reach the NBP site; see
  [Wapro](/erp/providers/wapro#what-it-writes-to-your-database).
* **A table older than 7 days is never used.** If the newest table is 1 to 7 days older than the order date, the order is
  sent with a warning in the receipt naming both dates. If it is older, or there is none, the order waits: the card says **Not in ‹ERP› yet** and gives the reason, for example **No EUR rate in Wapro for 2026-10-19**. You get a notification; add the rate
  in Wapro (or let the next download bring it), and the order is sent again by itself.

## Cross-border VAT (OSS)

A consumer order delivered to another EU country is sent with that country's VAT rate, taken from your ERP, so the sale
is booked in your OSS (One Stop Shop) register.

* Your ERP must be set up for it. If it is not, the order waits and the card gives the reason **Cross-border VAT is not set up in ‹ERP›**, and you
  get a notification. Set it up in Wapro (the cross-border transactions switch and the destination country's rates), and
  the order is sent again by itself.
* For now only goods at Poland's standard 23% rate go this way; an order with other lines, for example reduced-rate
  goods, is declined by Wapro and waits.
* Such an order always goes to a named customer in the destination country, never to the shared retail customer. If the
  customer Omnilinker created for the buyer is in another country, the order waits until you choose the customer (the card offers **Choose the ‹ERP› customer**). Omnilinker does not add
  a second customer for the same buyer: change the customer's country in the ERP, then choose that customer again. A customer that
  was only found by the Allegro buyer id is not kept this way: it is replaced by a new customer in the destination country.

## What is not sent yet

An order with any of these is held, and its card names the reason:

* **Lines the ERP cannot take**: a line that is not a catalog product (a custom line), a discount line, or an order without
  any product line.
* **Lines from more than one warehouse**. An ERP order comes from one warehouse. Move the lines to one warehouse, or
  enter the order in the ERP by hand.
* **Too many lines**: more than 150.
* **Not supported yet: intra-EU / export sale**: a buyer with an EU VAT number, a buyer with a tax ID (a NIP included) whose order is delivered outside Poland, or any delivery outside the EU.
  Enter it in the ERP by hand and mark it (see below).
* **Warehouse not mapped**, **Products not linked to the ERP**, **ERP connection not ready**, **Order export settings
  incomplete**: fix what the checklist above shows.

An order held for a reason that something outside it can lift, like a missing link or an agent that is offline, is checked
again every 15 minutes. After **7 days** of waiting it stops waiting and shows **Not sent to ‹ERP›**; it is then never
sent automatically again, and you send it with **Send again**. An order that waits for a person, such as choosing the customer, a source that sends later, a source you handed over to another system, or a sale Omnilinker does not send yet,
waits for as long as it takes. So does an order you sent again after **No confirmation from ‹ERP›**: the first attempt may be in the ERP, so it keeps waiting instead of showing **Not sent to ‹ERP›**.

## While the order is in the ERP

Once the order is on its way to the ERP or in it, Omnilinker refuses to add, change or remove its products (a product's
warehouse included), and to delete, merge or split it. The message says "Order … is in the ERP; change it there, or
cancel it." The card's **ERP** section says the same. Buyer details, addresses, notes, payments and the status can still
be edited in Omnilinker, but the ERP is not told: change buyer details and addresses in Wapro as well.

* **Cancel.** Cancelling the order in Omnilinker cancels it in Wapro and releases its reservation. While the cancel waits
  for the agent the order shows **Cancelling in ‹ERP›**, then **Cancelled in ‹ERP›**.
* **Not cancelled.** If Wapro or the agent refuses the cancel, the card says **Not cancelled in ‹ERP›: cancel order …
  there by hand**, you get a notification, and **Try the cancel again** repeats it (you need **Change status**).
* **Cancel and send again.** On an order that is in the ERP, this cancels the ERP order and sends the order again as a
  new one. Use it, for example, to book a reservation for an order that went without one.
* **Earlier ERP orders.** When an order has been sent more than once, the card lists **Earlier ‹ERP› orders** with their
  numbers and whether each is **current**, **cancelled**, **removed** or **replaced**.

## When something goes wrong

The state in the card's heading tells you where the order stands:

| State | What it means and what to do |
| - | - |
| **Not in ‹ERP› yet** | Nothing has been sent. When the card lists reasons under it, such as **Products not linked to the ERP** or **More than one ‹ERP› customer could be this buyer, or those found are blocked or inactive**, something holds the order back: fix each reason. Without reasons, the card says when it will be sent, for example "Sent to ‹ERP› when the order is confirmed". |
| **Waiting to be sent to ‹ERP›** | The order is queued and nothing holds it back, so it goes out on its own. **Send to ‹ERP› now** sends it right away. |
| **Waiting to be sent by hand: the source does not send to ‹ERP›** | Nothing will send the order while its source sends nowhere. Switch the source to send (see [Choose how each source sends](#choose-how-each-source-sends)), then click **Send to ‹ERP› now**. If you entered the order in the ERP yourself, click **Entered in ‹ERP› by hand**. |
| **Not sent to ‹ERP›** | Wapro declined it, the agent did not pick it up in time, or it waited 7 days. The card says why. Fix the reason and click **Send again**. |
| **No confirmation from ‹ERP›** | The agent did not answer in time, so it is not known whether Wapro created the order. Check Wapro. **Send again** is safe: if the order is there, nothing is created twice. If you sent it again and then archived, anonymised or unconfirmed the order, the card keeps this heading and adds **The order can no longer be sent**: nothing will send it on its own. Once the order can be sent again (for example it is taken out of the archive or confirmed again), click **Send to ‹ERP› now**; if the order is already in the ERP, click **Entered in ‹ERP› by hand**. |
| **Withdrawn before reaching ‹ERP›** | The order changed or was cancelled before the agent picked it up. |

For an order that waits or whose send failed, you can click **Entered in ‹ERP› by hand** when you entered the order in
the ERP yourself. Omnilinker then stops sending it, shows **Entered in ‹ERP› by hand**, and does not carry the order's
later changes or its cancelling to the ERP. You need **Mark orders as entered in the ERP by hand**; the permission is
separate because it tells Omnilinker an order exists in the ERP when it may not.

## Notifications

Omnilinker tells you when an order needs a person: it was not sent, there is no confirmation, it is partly reserved, an
exchange rate or the cross-border VAT is missing, a customer must be chosen, the buyer's data or tax ID is wrong, its
lines come from more than one warehouse, or a cancel did not go through. The notification goes to the person who asked
for the send, otherwise the order's creator, otherwise the administrators, and it clears itself when the order is in. See
[Inbox](/notifications/inbox) and, to react automatically, the automation trigger **Sending to the ERP fails** in
[Create and edit rules](/automations/create-and-edit#triggers).

## Invoices

The invoice for a sale is issued in the ERP. Pick **one** place per order source to issue the sale document: an Omnilinker
receipt, or the ERP's invoice, not both. The ERP's status and the invoice and KSeF numbers will show on the order card in
the next release; until then the card shows only where the order stands.

## Permissions

| To … | You need |
| - | - |
| Send an order, send in bulk, cancel and send again, choose a customer | **Send orders to the ERP** (**Ordering**) |
| Mark an order as entered by hand | **Mark orders as entered in the ERP by hand** (**Ordering**) |
| Try a failed cancel again | **Change status** (**Ordering**) |
| Change the order settings | **Edit ERP Connection** (**ERP Integration**) |
| Answer the question and change each source's choice | **Manage sources** (**Ordering**) |
| Set the ERP user for writes | **Change the ERP user for writes** (**ERP Integration**) |

See [Permissions reference](/administration/permissions).

<CardGroup cols={2}>
  <Card title="Customers in your ERP" icon="user-round" href="/erp/customers-in-erp">
    How the buyer becomes a customer in Wapro.
  </Card>

  <Card title="Orders" icon="shopping-cart" href="/sales/orders">
    The order card, filters and bulk actions.
  </Card>

  <Card title="Wapro" icon="plug" href="/erp/providers/wapro">
    What the connector writes, and the SQL rights it needs.
  </Card>

  <Card title="Troubleshooting" icon="life-buoy" href="/erp/troubleshooting">
    Fix an order that does not reach Wapro.
  </Card>
</CardGroup>


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