Skip to content

Reading the catalog from the PIM ​

Stock Sync keeps its own copy of the PIM's products, called the catalog. Everything else (matching, calculating, sending) works from that copy. This page explains how the copy is kept up to date.

What Stock Sync reads for each product ​

From the PIMUsed forExample
PIM product idMatching the product to marketplace offers101577
SKU and sizeShowing and searching onlyK50K510943-BAX, M
Barcodes (the EAN Code and Barcode fields)Showing and searching; on Secret Sales and Showroomprivé, also picking between two products with the same SKU and size; on Fashionette and Bol, linking the item; on Spartoo, only picking between two products that fit the same SKU5901234123457
Available stock (the PIM's quantity)The stock to publish7
On hand stock (the PIM's quantity on hand)Shown beside available, for information; never published9
Lead timeDeciding whether an offer is eligible1 day

It reads every PIM product. Nothing about category, brand or status in the PIM filters what is read. Whether a product is sold on an account is decided by the offers that exist on that account (see Matching offers to products).

Four ways the catalog is read ​

The PIM reading (every 15 minutes) ​

Four times an hour, at :07, :22, :37 and :52 (Romanian time), Stock Sync asks the PIM which products changed since its last successful reading. It also runs once when Stock Sync itself starts, for example after an update.

  • It reads back 2 minutes further than strictly needed, so nothing that changed at the very edge of the last reading is missed. Reading a product twice costs nothing: an unchanged product causes no work.
  • It looks at both product changes and stock changes in the PIM, because a change of stock alone does not always mark the product itself as changed.
  • It compares each product with its copy: SKU, size, barcodes, available, on hand and lead time. Only a product where one of these really changed goes on to be recalculated.
  • When the PIM is slow to answer, times out or briefly fails, Stock Sync waits a few seconds and asks again. By default it tries up to four times in all, waiting 5, 10, then 20 seconds in between.
  • It remembers where it got to only if the whole reading succeeded. If the PIM is still down after those attempts, the reading fails and the next one starts again from the same point, so nothing is lost.

In Activity → Sync runs each one appears as a PIM reading (hover over its start time for the period it read) with counts such as "214 seen · 37 changed". Most readings find nothing new; while Hide routine readings is on, consecutive ones like that fold into one line.

The full PIM check (every night at 02:17) ​

Once a night Stock Sync reads all products (about 99,000) from start to end. This catches anything a 15-minute reading might have missed, and it is the only way to notice that a product was removed from the PIM.

It reads them page by page. When the PIM is slow to answer one page, times out or briefly fails, Stock Sync waits a few seconds and asks for the same page again, up to four attempts in all, so one slow answer no longer fails the night's check. Only when every attempt fails does the check fail; its error then says how many attempts were made and at which page it stopped.

The 5 % safety limit protects you from a PIM accident. If the PIM suddenly returned half its products, Stock Sync would otherwise set thousands of offers to 0. Instead it refuses, removes nothing and marks the Full PIM check as Failed in Activity → Sync runs, where the technical team and the PIM team can see it.

Read PIM now (when you ask) ​

An operator can press Read PIM now at the top of the Overview or of Activity, on a late-PIM row of Needs your attention, or in Search or jump to (Ctrl K). You see "A PIM reading was requested. PIM data updates when it finishes, usually within a minute." It is the same reading as the regular one, run straight away instead of at the next quarter hour.

  • If a reading is already running, Stock Sync waits for it to finish and then reads the PIM once more, because that reading began before your request and may have missed your change (it waits up to a quarter of an hour; after that the next scheduled reading picks it up).
  • If several people press it at once, it costs at most two readings: the one running and one after it.

Use it after the PIM team tells you they fixed something, or when you want to see a change on the marketplace sooner. See Read the catalog again now.

Re-read from PIM (chosen offers) ​

Read PIM now reads only the products the PIM reports as changed. Re-read from PIM is for when you already know which offers are wrong: an operator picks 1 to 50 offers (on the Offer page, the side panel, the row's ⋯ menu or the bar of ticked offers on Offers), and Stock Sync:

  1. reads the PIM products of those offers again, by their PIM product id;
  2. updates its copy of each product;
  3. works out the stock to publish again for every offer of each product, on every account, even when the PIM changed nothing.

It is recorded in Activity → Sync runs as a Re-read from PIM run, with seen (products read) and changed (products whose PIM data differed). It never counts as a PIM reading for the PIM data tile. Each offer of a product it read gets Re-read from PIM in its history.

  • An offer that is not linked to a PIM product has nothing to read: it is reported as not linked.
  • A product the PIM does not return is reported as not in PIM and left as it is. Removing products stays with the full PIM check and its 5 % safety limit.
  • If the PIM does not answer, nothing changes and the message says so. Resync, by contrast, never reads the PIM: it only sends the number already worked out again.

How PIM values are turned into numbers ​

The PIM sometimes holds values that are not clean whole numbers. Stock Sync reads them like this:

The PIM holdsStock Sync uses
A whole number, such as 77
A negative number, such as −30
A decimal, such as 7.97 (rounded down)
Nothing, or text that is not a number0

Lead time comes from the first of these that is filled in:

  1. The product's Lead Time field in the PIM.
  2. Otherwise, the shortest delivery time among the product's suppliers in the PIM that still have stock. A supplier whose quantity is 0 is left out, because the PIM keeps its delivery time even when it has nothing left. If the suppliers with stock have no delivery time, the lead time is unknown. If no supplier has stock, the longest of their delivery times counts.
  3. Otherwise, the lead time is unknown. An unknown lead time always counts as eligible.

That one lead time is what the Lead time fact of an offer shows. For the stock itself Stock Sync goes one step further: it keeps each supplier's available pieces with that supplier's delivery time (or the product's Lead Time field when the supplier has none), so that only the pieces that can ship within an account's Lead-time limit are published. See Rule 5.

A PIM product with no SKU, or without a valid product id, is left out of the copy. An offer for it cannot be linked.

Examples ​

Example 1: a stock change ​

At 09:58 the PIM changes product 101577 from available 7 to available 5 (on hand stays 9).

  1. At 10:07 the PIM reading asks for products changed since about 09:50 (the previous reading, minus 2 minutes).
  2. The PIM returns 101577 among others. Stock Sync compares: available was 7, now 5. That is a real change.
  3. The copy is updated and every offer of 101577 is recalculated.
  4. Activity → Sync runs shows the reading with, say, "180 seen · 22 changed".

Example 2: a product's supplier changes ​

Product 88420 has no Lead Time field. Its only supplier, who delivers in 2 days, has 4 units. The purchasing team adds a second supplier who delivers in 6 days, with 10 units. The PIM now says 14 available.

  • On an account with a Lead-time limit of 3 days, only the first supplier's 4 units can ship in time: the offer is Eligible: Partly — 4 of 14 within 3 days and publishes 4.
  • The first supplier sells out (0 units). No supplier with stock can ship within 3 days: Eligible: No — 6 days > 3 days, stock 0.
  • On an account with No limit all of it counts: 14, then 10.

Example 3: a product is deleted from the PIM ​

Product 101577 is deleted from the PIM on Tuesday afternoon.

  • The 15-minute readings do not notice. A deleted product simply stops appearing.
  • At 02:17 on Wednesday the full check reads all 99,000 products and finds 140 missing. 140 is 0.14 %, well under the 5 % limit.
  • The 140 are marked removed. Offer 101577 on every account becomes Orphaned, its stock to publish becomes 0, and 0 is sent to every account that is Live (paused or suspended ones send it once they are back).

Example 4: the PIM has a bad night ​

At 02:17 the PIM returns only 60,000 of its 99,000 products because of a fault. 39,000 missing is 39 %. Stock Sync refuses: the Full PIM check fails with "Refused to remove 39000 of 99000 catalog items (limit 5%)", nothing is removed and nothing is set to 0. Stock changes it read are still applied; only the removals are refused. The next morning the Overview's Needs your attention shows "Full PIM check failed". Tell the technical team.

What you see when the PIM is late ​

The Overview's PIM data tile shows how long ago the last PIM reading succeeded:

Time since the last successful readingWhat you see
Up to 20 minutesGreen. Normal: a reading happens every 15 minutes
More than 20 minutesAmber, and "PIM reading is late" in Needs your attention, with Read PIM now on the row. One reading was missed
More than 35 minutesRed, and "PIM data is out of date". Two readings were missed; every account is sending old stock

See When things happen and Troubleshooting.

Channel Hub — user guide for operators and viewers