# Linking offers to products Linking a sales channel offer to a product in the Ritevo warehouse: how to do it in an order, when it works for later orders and what it is for. Every order line comes from an offer in a sales channel, for example a listing on eBay or a product in a shop. For Ritevo to know which product from your warehouse it is, you link the offer to a product. You do it once - then it works for every later order with that offer. > **Required integration:** You need an integration from the **Warehouses and wholesalers** category with products - for example the [Own warehouse](https://ritevo.com/en/docs/integrations/own-warehouse) - and orders from a sales channel. ## What the link is for - **Packing assistant** - recognises the scanned code by the EAN of the linked product. A line without a link is marked **No warehouse link**. - **Stock deduction** - with the button or an automatic action you deduct the stock of the linked product. A line without a link gets the **Not linked** status and changes nothing. More: [Deducting stock after a sale](https://ritevo.com/en/docs/products/stock-deduction). ## How to link an offer to a product 1. Open an order with that offer. 2. Next to the order line, click the chain icon - on hover it shows **Link offer to product**. 3. In the window, search for the product (the filters work like on the **Products** list) and click it. 4. Check the product preview and click **Link**. If it is the wrong product, click **Pick another**. ## How the link works - **Once per offer** - the link is saved for the offer, not for one order. Every later order with that offer from the same integration is linked to that product right away. - **Separately for each integration** - the same offer on two accounts (for example two eBay accounts) is two offers. You link each one separately. - **One product per offer** - an offer is linked to one product. One product can have many offers though, for example from different sales channels. - **Changing the product** - click the chain icon next to the line. You will see the current product - click **Pick another**, choose the new product and **Link**, and answer the overwrite question with **Overwrite** (or **Keep** if you change your mind). The new product applies to this offer from now on; earlier stock deductions do not change. - **A line without the chain icon** - the icon does not appear when the line has no offer id. This happens for a line added by hand - fill in the **Offer id** field when adding it. - **On the Allegro offer list** - you can also link Allegro offers on the offer list: in the Allegro integration, on the **Offer management** tab, click the chain icon on the offer card. An offer listed from the warehouse is linked right away. ## What is not there yet - It does not link offers to products automatically, for example by SKU or EAN. - You remove a link in the app only for Allegro offers - with the **Remove link** button on the offer card in **Offer management**. For other channels removing is available through the API. - It does not link one offer to several products (bundles). ## Links through the API The offer id (`externalOfferId`) identifies the offer in the sales channel: take it from the marketplace or shop, or from `lineItems[].externalOfferId` of an order with that offer. The link key is the pair `externalOfferId` + `integrationId` of the sales integration (`GET /integrations/marketplaces`, `GET /integrations/shops`); one pair points to one product, and one product can have many offers. Create: `POST /integrations/warehouses/external-offer-assignments` with the body `{integrationId, externalOfferId, warehouseProductId}` (product id from `GET /integrations/warehouses/products`). `externalOfferId` and `integrationId` are not verified: an unknown value is saved without an error and simply matches no order. Shortcut for an order line: `POST /orders/{orderId}/line-items/{lineItemId}/warehouse-link` with the body `{warehouseProductId}` - the offer and integration are taken from the line and the order. Responses: 201 with the link (`id`, `integrationId`, `externalOfferId`, `warehouseProductId`, `createdBy`, `createdAt`), 404 - no such product (with the shortcut also order or line), 409 (`EXTERNAL_OFFER_ALREADY_ASSIGNED`) - the offer is already linked (to change the product, remove the link first), 422 (`EXTERNAL_OFFER_ID_REQUIRED`) - the line has no `externalOfferId` (shortcut only). Checking many offers at once: `POST /integrations/warehouses/external-offer-assignments/resolve` with the body `{integrationId, externalOfferIds}` (up to 1000 ids) returns `integrationId`, `externalOfferId` and the full `product` for linked ones; an offer missing from the response is not linked. Linked products of one order: `GET /orders/{orderId}/warehouse-products`. The company's links: `GET /integrations/warehouses/external-offer-assignments` (filters `externalOfferId`, `integrationId`, `warehouseIntegrationId`, combined with AND, pages of up to 5000). Remove: `DELETE /integrations/warehouses/external-offer-assignments/{id}` or `DELETE /integrations/warehouses/external-offer-assignments?externalOfferId=...&integrationId=...` - a missing link is not an error (204). --- All help in one file: https://ritevo.com/llms-full.txt. Help map with links to every page: https://ritevo.com/llms.txt.