Skip to content

How the quantity is calculated ​

For every linked offer, Stock Sync works out one number: the stock to publish. This page gives every rule that goes into that number, in order, with examples you can check by hand.

The short version ​

Stock to publish = the PIM's available stock, cleaned up (no negatives, no decimals), capped at the marketplace's maximum (65,535 on eMAG and Fashion Days, 1,000,000 on ABOUT YOU), or 0 if the product's lead time is longer than the account's Lead-time limit. An orphaned offer always gets 0.

It is sent only when it differs from the number the marketplace last confirmed (Published).

That is all. There is no safety buffer (such as "stock minus 1"), no minimum, and no price, handling-time or delivery-promise logic.

The decision, step by step ​

Every rule in detail ​

Rule 1: only linked and orphaned offers have a number ​

Link statusStock to publish
LinkedCalculated by rules 2 to 5
Orphaned (product removed from the PIM)Always 0
Not linkedNone. Stock Sync never sends anything for it

See Matching offers to products.

Rule 2: the PIM numbers are cleaned up ​

Before anything else, each PIM stock number becomes a whole number of 0 or more:

PIM valueBecomes
77
−30
7.97 (always rounded down, never up)
empty, or not a number0

Rounding down is deliberate: publishing 8 when there are 7.9 pieces would oversell.

Rule 3: available stock is the number ​

Stock Sync publishes the PIM's available stock on every account: what we can sell now. There is nothing to choose.

The PIM's on hand stock (what is physically in the warehouse) is shown beside it on the offer page and in the Offers list's Stock breakdown (and its optional PIM stock column), for information only. It includes pieces Odoo has reserved for other orders, so publishing it would sell them twice. A change of on hand alone sends nothing.

Available can be higher than on hand (stock a supplier holds counts in available, not in our warehouse) or lower (pieces reserved for orders). Either way, available is what is sent.

Rule 4: never more than the marketplace accepts ​

eMAG and Fashion Days accept a stock between 0 and 65,535; ABOUT YOU accepts 0 to 1,000,000. A larger number is capped at the marketplace's highest value.

Rule 5: the lead-time limit ​

Each account can have a Lead-time limit, a whole number of days (for example 2, meaning the platform's 48-hour delivery promise). An empty field means No limit.

An offer is eligible when any of these is true:

  • the account has No limit;
  • the product's lead time is unknown;
  • the product's lead time is equal to or shorter than the limit.

An offer that is not eligible gets stock to publish 0, whatever the PIM says. The Offers list shows 5 d > 2 d in its Eligible column and "Not eligible — publishes 0" under the status, and the offer page Eligible: No — 5 days > 2 days, so you can see the lead time and the limit side by side. When the lead time comes back within the limit, the normal stock is published again at the next reading.

Where the lead time comes from is explained in Reading the catalog from the PIM.

Changing the limit starts a Recalculation of the whole account (or, if the account is paused or suspended, when it is resumed or recovered).

Rule 6: only differences are sent ​

The stock to publish is compared with Published, the number the marketplace last confirmed.

  • Equal: the offer is In sync. Nothing is sent. Stock Sync never sends the same number twice for no reason.
  • Different: the offer becomes Waiting to send, and the next sending round sends it if the account is Live, not paused and not suspended. See Sending stock to the marketplace.

Rule 7: ended offers are kept up to date but not sent ​

An offer the marketplace reports as Ended on the marketplace keeps a current stock to publish, but nothing is sent, because nobody can buy it. See Matching offers to products.

Table of examples ​

Every row can be checked with the rules above.

#PIM available / on handLead time / account limitStock to publishWhy
17 / 95 days / No limit7No limit, so eligible; available is sent
27 / 91 day / 2 days7Eligible; on hand is not sent
39 / 31 day / No limit9Available above on hand: still available
40 / 5unknown / No limit0Nothing available to sell; on hand is reserved
580,000 / 80,000unknown / No limit65,535The marketplace maximum
67 / 9unknown / 2 days7An unknown lead time counts as eligible
77 / 92 days / 2 days7Equal to the limit is still eligible
87 / 95 days / 2 days0Not eligible: "No — 5 days > 2 days"
97 / 92.5 days / 2 days02.5 is longer than 2
10−3 / 0— / No limit0A negative number becomes 0
114.8 / 6— / No limit4Rounded down
12(empty) / 9— / No limit0An empty value becomes 0
13anyany0The offer is Orphaned
14anyany—The offer is Not linked: nothing is calculated or sent

Worked examples ​

Example 1: an ordinary change ​

eMAG RO has a Lead-time limit of 2 days. Offer 101577 shows Published 4.

The PIM says 7 pieces available, 9 on hand, lead time 1 day.

  1. The offer is Linked.
  2. Lead time 1 day is within 2 days: eligible.
  3. The PIM's available stock: 7.
  4. 7 is under 65,535: stays 7.
  5. 7 is not 4: Waiting to send. eMAG RO is Live, so 7 is sent a second later and the offer becomes In sync, Published 7.

Example 2: a long lead time ​

The same offer, a week later. The product's stock now comes from a supplier with a lead time of 3 days. The PIM says 7 available.

  1. Linked.
  2. 3 days is longer than the 2-day limit: not eligible. The offer page shows Eligible: No — 3 days > 2 days.
  3. Stock to publish is 0, although the PIM says 7.
  4. 0 is not 7: 0 is sent. The offer stops selling on eMAG RO.

On Fashion Days RO, which has No limit, the same product still publishes 7.

When our own stock arrives and the PIM's lead time goes back to 1 day, the next reading makes the offer eligible again and 7 is sent.

Example 3: on hand changes, available does not ​

A delivery for a customer's order arrives at the warehouse. The PIM's on hand for product 300001 goes from 5 to 8; its available stays 3, because the pieces are reserved for that order.

At the next reading the product is recalculated: Stock to publish is still 3, so nothing is sent. The Offers list now shows "3 / 8".

Example 4: the cap and rounding together ​

The PIM holds 70,000.4 available for a bulk item. Rounded down: 70,000. Capped: 65,535. That is what is sent.

Where you see the numbers ​

On the Offers list, the Stock column shows three numbers, PIM available › Stock to publish › Marketplace shows, and its tooltip gives every step. The offer page and the side panel draw the same path as five steps (PIM stock › Rules › Stock to publish › Sent › Marketplace shows), with the step that is off coloured, and list the numbers under Details:

FieldWhich number
PIM stockThe two PIM numbers after rule 2, available / on hand; available is the one that is sent
EligibleYes, or No — 5 days > 2 days (the list's Eligible column: Yes or 5 d > 2 d)
Stock to publishThe result of rules 1 to 5
Published (the Sent step)The number the marketplace last confirmed
Marketplace showsWhat the marketplace reported at the last offer import

If a number looks wrong, Find out why a stock number is wrong walks you through these fields one by one.

Channel Hub Stock Sync — user guide for operators and viewers