Reliable Stock Sync from 1C to Bitrix with Warehouse Support

Stock quantities are part of the standard CommerceML exchange. They are transmitted in the `offers.xml` file as the `<Quantity>` element for each trade offer. However, in most projects, the standard exchange is insufficient: more frequent synchronization, breakdown by warehouse, or partial updates w

Our competencies:

Frequently Asked Questions

Stock quantities are part of the standard CommerceML exchange. They are transmitted in the offers.xml file as the <Quantity> element for each trade offer. However, in most projects, the standard exchange is insufficient: more frequent synchronization, breakdown by warehouse, or partial updates without a full catalog export are required. With over 10 years of experience and 200+ successful integrations, we ensure reliable synchronization. We configured the exchange for a store with 50,000+ items, where stock updated every 5 minutes via REST API — without failures or delays. A typical full CommerceML exchange for 30,000 SKUs takes 15–20 minutes, which is unacceptable with high sales dynamics.

What problems do we solve?

Delays during full export. Each full catalog exchange via CommerceML takes minutes, and with large volumes — hours. If stock requires updating every 15 minutes, this is unacceptable. We reduced synchronization time for a client from 20 minutes to 30 seconds using a separate XML file.

Lack of warehouse accounting. Standard exchange transmits only the total quantity, but for a chain of 20 stores, stock per warehouse is required. In Bitrix, the 'Warehouses' module is enabled and the breakdown is configured in 1C.

Synchronization errors. Often stock resets to zero after exchange or is not updated at all — this is related to incorrect export settings in 1C or component logic. According to our data, 70% of problems are solved by enabling the stock export flag in 1C.

Our typical project saves clients up to 40% on synchronization time, resulting in monthly savings of up to 5,000 rubles for a mid-size store.

How do we do it?

We offer three synchronization options — from simple to complex. The choice depends on volumes and update frequency requirements.

Method Comparison

Method Update Frequency Load Implementation Complexity
Standard CommerceML once per hour or less High (full catalog) Minimal
Separate XML file up to 5 minutes Low (only stock) Medium
REST API / JSON up to 1 minute Minimal (asynchronous) Medium
Agent + intermediate table up to 5 minutes Medium (non-blocking) High (agent required)

Synchronization Time Comparison for 50,000 Products

Method Full Exchange Time Stock Update Time
Standard CommerceML 15–20 minutes 15–20 minutes
Separate XML with stock not required 1–2 minutes
REST API not required 10–30 seconds
Agent + intermediate table not required 30–60 seconds
Example code for updating stock
// Find PRODUCT_ID by XML_ID $element = CIBlockElement::GetList( [], ['XML_ID' => $xmlId, 'IBLOCK_ID' => OFFERS_IBLOCK_ID], false, ['nTopCount' => 1], ['ID'] )->Fetch(); if ($element) { CCatalogProduct::Update($element['ID'], ['QUANTITY' => $newQuantity]); } 

For large numbers of products (10,000+ items), direct update via loop is slow — better to use batch UPDATE via $DB->Query() or \Bitrix\Main\Application::getConnection()->query() for improved performance and atomicity. According to the documentation at Bitrix documentation, bulk operations reduce server load by up to 40%.

Separate XML File

1C generates a lightweight XML without descriptions and images, sends it to a separate Bitrix endpoint. On the Bitrix side, a custom handler reads the XML and updates b_catalog_product.QUANTITY. This achieves stock update without catalog exchange. Suitable if direct connection from 1C is difficult.

REST API

1C sends a POST request with JSON: sku → quantity. The handler on the Bitrix side receives, validates, and updates stock. Using 1C REST API, this is faster than XML parsing, easier to debug. We implemented this for an auto parts online store — stock updates every 5 minutes without errors. This approach supports Bitrix stock by warehouse as needed.

Via Bitrix Agent

1C writes stock to an intermediate table or file on the server. A Bitrix agent reads the intermediate data every N minutes and updates the catalog. This Bitrix agent stock update method is chosen if a direct HTTP request from 1C is impossible (e.g., due to corporate security policies).

Warehouse Accounting

If the store has multiple warehouses, we enable warehouse accounting: Catalog → Warehouses. The b_catalog_store_product table stores stock per warehouse for each product. Update:

\Bitrix\Catalog\StoreProductTable::update( ['PRODUCT_ID' => $productId, 'STORE_ID' => $storeId], ['AMOUNT' => $newAmount] ); 

When warehouse accounting is enabled, b_catalog_product.QUANTITY becomes aggregated (sum across all warehouses) and updates automatically. This is key for Bitrix warehouse accounting.

Stock Update Frequency

The choice of method determines frequency: CommerceML — once per hour, separate XML — up to 5 minutes, REST API — up to 1 minute. For a clothing store with 10,000 SKUs, we configured an agent with updates every 3 minutes — sufficient to avoid overselling. The phrase "1C stock export every 5 minutes" is achievable with REST or separate XML.

Displaying Stock on the Site

Check which property the catalog component uses (QUANTITY or custom). If warehouse accounting is enabled, evaluate the stock at the corresponding warehouse. A common mistake is the component hiding a product at zero stock even if warehouse accounting is not configured. In this case, change to QUANTITY or add a check.

Stock Export Configuration from 1C

Details for each method are described above. Development and setup costs start from 15,000 rubles and depend on the complexity of integration, number of warehouses, and update frequency. For example, for a store with 20 warehouses and 30,000 SKUs, the time savings on synchronization is about 40%. Our average project cost is 25,000 rubles. The 1C-Bitrix exchange setup cost is included in the project.

Work Process

  1. Analytics — examine current exchange, error logs, catalog volume, number of warehouses.
  2. Design — choose synchronization method, handler architecture. Ensure Bitrix 1C integration stock requirements are met.
  3. Implementation — write custom handler or modify existing one.
  4. Testing — test on a test server with a copy of the catalog. Run load tests.
  5. Deployment — move to production, set up monitoring.

Deliverables and What Is Included

  • Development or modification of the stock export handler.
  • Configuration of warehouse accounting (if required).
  • Documentation on 1C and Bitrix interaction.
  • Testing for 3–5 days after launch.
  • Incident support (response within 1 business day).

Common Errors

  • Stock goes to zero with every full exchange — 1C does not transmit stock in offers.xml. Enable stock export in 1C exchange settings.
  • Stock updates, but the product shows as 'out of stock' on the site — check component logic: it may be using a custom property 'In stock' instead of QUANTITY.
  • Negative stock — 1C allows negative quantities. In the Bitrix handler, limit to max(0, $quantity).
  • 1C stock export errors like zero quantities are resolved by our specialists. We provide full 1C-Bitrix exchange setup to ensure seamless integration.

Contact us for a consultation — we will select the optimal method for your project. Order exchange setup and get stable synchronization with a work guarantee.