Appearance
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 PIM | Used for | Example |
|---|---|---|
| PIM product id | Matching the product to marketplace offers | 101577 |
| SKU and size | Showing and searching only | K50K510943-BAX, M |
| Barcodes (the EAN Code and Barcode fields) | Showing and searching only | 5901234123457 |
| Available stock (the PIM's quantity) | The stock to publish | 7 |
| On hand stock (the PIM's quantity on hand) | Shown beside available, for information; never published | 9 |
| Lead time | Deciding whether an offer is eligible | 1 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).
Three 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.
- It remembers where it got to only if the whole reading succeeded. If the PIM is down, 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.
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, your request adds nothing. A change that reached the PIM after that reading started waits for the next one.
- If several people press it at once, it costs one reading, not several.
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.
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 holds | Stock Sync uses |
|---|---|
| A whole number, such as 7 | 7 |
| A negative number, such as −3 | 0 |
| A decimal, such as 7.9 | 7 (rounded down) |
| Nothing, or text that is not a number | 0 |
Lead time comes from the first of these that is filled in:
- The product's Lead Time field in the PIM.
- 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.
- Otherwise, the lead time is unknown. An unknown lead time always counts as eligible.
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).
- At 10:07 the PIM reading asks for products changed since about 09:50 (the previous reading, minus 2 minutes).
- The PIM returns 101577 among others. Stock Sync compares: available was 7, now 5. That is a real change.
- The copy is updated and every offer of 101577 is recalculated.
- 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 lead time stays 2 days: the shortest time among suppliers with stock.
- The first supplier sells out (0 units). The lead time is now 6 days, the only supplier with stock left.
- On an account with a Lead-time limit of 3 days the offer becomes Eligible: No — 6 days > 3 days and gets stock 0.
- On an account with No limit nothing changes.
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 reading | What you see |
|---|---|
| Up to 20 minutes | Green. Normal: a reading happens every 15 minutes |
| More than 20 minutes | Amber, and "PIM reading is late" in Needs your attention, with Read PIM now on the row. One reading was missed |
| More than 35 minutes | Red, and "PIM data is out of date". Two readings were missed; every account is sending old stock |
See When things happen and Troubleshooting.