Payments are experiencing issues due to temporary restrictions in Russia. If your payment does not go through, please submit a support request.Our support team is available 24/7 — we are always here to help with hosting and server issues.We are now accepting requests for dedicated server rental and colocation services in our data center.Reminder: we recommend enabling backups for additional data protection.A new VPS/VDS lineup with NVMe storage and improved performance is now available.Maintenance work on some servers has been completed. All services are operating normally.
Article8 min readViews7

Inventory in 1C and on the Site Does Not Match: Where the Final Figure Should Reside

Why inventory figures diverge even with a working exchange, how to separate physical quantity, availability, and reserve, calculate the desynchronization window, and verify conflicting scenarios.

Comments 0

Albina compares the warehouse sheet with items and scanner data
In this article

1C shows three units remaining for the item, the site displays five, and the fourth order is already placed. This could be an exchange error, but not necessarily. Between the accounting system, the site, and the warehouse, there is almost always a delay, and the word "inventory" in these systems can denote different values.

The main question is not "why the figures are not equal every second." You need to determine which system makes the decision at each moment: who publishes the available quantity, who reserves the item, who cancels the reserve, and who resolves the conflict after data is re-sent.

Separate physical, available, and displayed inventory

Physical inventory answers the question of how many units are recorded or physically on the warehouse shelf. Available-for-promise inventory accounts for reserves, unprocessed orders, safety stock, and restrictions of a specific sales channel. Displayed inventory is what the buyer sees: an exact number, a range, a "in stock" status, or a quantity limit in the cart.

These values do not have to match. The warehouse may hold ten units, two already reserved for paid orders, and one kept as a safety buffer. In this case, the physical stock is ten, the available stock is seven, and the site reasonably displays only "In stock". The error does not stem from the difference itself, but from the lack of a unified rule for recalculation.

In "1C-Bitrix: Site Management", quantity accounting and reservation affect the moment when available quantity is reduced. If quantity accounting is disabled, the product remains available for purchase regardless of the entered number. Warehouse data with warehouse accounting disabled may be informational only and cannot independently manage deductions after an order. Therefore, the same number in the administrative form does not guarantee identical cart behavior.

Physical stock of 10 decreases by two reserves and one safety unit to seven available
Example: physical, available, and displayed quantities may differ according to a unified rule.

Do not select a single source of truth for all events

The phrase "the source of truth is 1C" sounds neat until a customer places an order between two exchange sessions. If the site waits every minute for a new file and does not reserve stock locally, it can sell an item that another channel has already taken. If the site unconditionally considers itself the primary system, the accounting system may later overwrite its value and return the item to sale.

It is more useful to assign an owner to each event:

  • receipt, write-off, and inventory at the warehouse;
  • publishing the assortment and available quantity on the site;
  • reservation during order placement;
  • payment confirmation;
  • order cancellation and release of the reservation;
  • return and decision on resale;
  • manual adjustment and its reason.

For each event, record the transfer direction, the permanent product or product variant identifier, the change timestamp, and the reprocessing rule. Then the dispute over the primary system becomes a verifiable scheme: one participant creates a fact, the other confirms receipt, and neither applies the same change twice.

Calculate the desynchronization window

Suppose full inventory export runs every 15 minutes. A popular item may see up to four purchase attempts per minute during peak times. Between exports, the site can receive up to 60 attempts. This does not mean 60 lost orders: some items remain in stock, some carts will not be paid, and local reservation may take effect. The calculation shows the upper bound of load on the reconciliation rule.

If available units are fewer than possible purchases within the window, a single schedule is insufficient. At least one of the following mechanisms is needed: local atomic reservation, more frequent updates for changed objects, a safety buffer per channel, or synchronous verification before confirmation. Each mechanism carries a cost: increased load, response latency, complexity of releasing the reservation, or reduced displayed assortment.

A safety buffer does not fix the exchange. It only lowers the probability of selling the last unit while latency is low and demand is predictable. For a rare item with a single unit in stock or during a sales spike, the buffer quickly stops helping.

Between exchanges at 10:00 and 10:15 with four attempts per minute, up to 60 events are possible
The calculation shows the load on the reconciliation rule, not a forecast of lost orders.

Full and partial exports solve different tasks

CommerceML is used to transfer catalogs, product variants, and documents between an accounting system and an online store. The specific exchange protocol is defined by the project. Integration settings in 1C allow for the export of only changed objects: this speeds up routine cycles but increases requirements for versioning and recovery after skipped items.

Partial export works well as long as the chain of changes remains continuous. If a single package fails to arrive, a product identifier changes, or the processor terminates mid-way, the next small package may fail to restore the complete state. Therefore, periodic control exchanges or reconciliation are needed that compare not only the fact of successful task execution but also expected quantities in a sample.

Full export must not blindly override local events. If a file was generated at 10:00, an order was created at 10:03, and import finished at 10:05, blindly assigning a value from the snapshot may restore a reserved unit. The state timestamp and application rule matter, not the import completion time.

Align product and warehouse keys

The remaining quantity is not just tied to a product name. It is linked to a persistent identifier, sometimes to a specific product variant and warehouse. Size and color often exist at the SKU level, while the product card merely aggregates variants. If the exchange sends ten units of the blue model in size 42, adding them to other variants to update the availability of the entire product card is dangerous.

Warehouses also require an explicit model. The site may display the total remaining quantity, only warehouses with delivery available to the selected region, or a single pickup point. The official integration documentation separately distinguishes between total remaining quantity and warehouse-level inventory management. This is a business rule configuration, not a cosmetic report adjustment.

When replacing an identifier, you must not silently create a new product and leave the old one with a reserve. A mapping table and controlled migration are required: which object continues the history, what happens to reserves, and when the old variant stops being sold.

Define behavior for conflicts

A conflict must lead to a known result, not a random last value. For a store, four cases are typically important:

  • the accounting system reduced the remaining quantity while an order was being created on the site;
  • the order was cancelled on the site, but the reserve release has not yet arrived;
  • a single exchange package was delivered again after a connection error;
  • warehouse acceptance increased the stock, but the site received an older package later.

The 'last write wins' rule works only with reliable shared timestamps and identical record semantics. It is often safer to compare the object version or the timestamp of the business event itself, and to make repeated deliveries idempotent: the same document must not add or subtract inventory twice.

If automatic resolution is impossible, the item is temporarily removed from sale or its quantity is limited, and the conflict is placed in a queue with a reason. Silently continuing sales is more convenient for the interface, but it shifts the problem to cancelled orders and support operations.

Test the integration with scenarios, not a single number

Before launching, select a test item and reproduce the sequences in an isolated environment. The goal is not a pretty result from a single exchange, but the transitions between states.

  • Place two orders for the last unit almost simultaneously and check where the failure occurs.
  • Cancel the unpaid order before and after sending it to 1C; the reservation must be released exactly once.
  • Redeliver the same package and verify that the remaining balance does not change a second time.
  • Skip one partial package, then perform a control reconciliation.
  • Change the balance for a specific product variant and check the neighboring variants on the card.
  • Test a warehouse that does not serve the selected region.
  • Compare the event time, file generation time, and the start and end of the import.

For each scenario, the expected result is pre-recorded in 1C, on the website, in the reserve, and in the exchange log. Otherwise, identical numbers after the test can easily be mistaken for success, even though one of the transitions simply did not execute.

Monitor latency, not just job errors

The "exchange completed" status confirms the procedure worked, but not the currency of every product. Useful metrics include the age of the last accepted change, the number of conflicts, queue size, the share of repeated batches, and discrepancies in the control sample. Separately, track products with zero stock, single-unit stock, and fast-moving items — delays are most noticeable there.

If stock levels in 1C and on the site differ, first determine the meaning of each figure and the owner of the event. Then calculate the desynchronization window, verify identifiers, batch order, and reprocessing. Equality of two fields at a single moment looks pleasant, but sales reliability shows something else: the store must not promise the same item twice and must be able to explain every quantity change.

Discussion 0

Share your experience and ask questions. Comments without links appear after editorial review.

No comments yet. Start the discussion.