Bitrix-1C XML Exchange: Fixing Timeouts and Duplicates

We've faced this situation dozens of times: a client starts an exchange with 1C, and the result is timeouts, duplicate products, or prices that don't update. The standard **Trade Catalog** module (catalog) supports the [CommerceML](https://en.wikipedia.org/wiki/CommerceML) 2.x protocol, but in pract

Our competencies:

Frequently Asked Questions

Latest works

  • B2B ADVANCE company website development
    B2B ADVANCE company website development
    1461
  • Website development for FIXPER company
    Website development for FIXPER company
    1019
  • Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    764
  • Development based on 1C Enterprise for MIRSANBEL
    Development based on 1C Enterprise for MIRSANBEL
    882
  • Website development on CRM Bitrix24 for DOLBIMBY
    Website development on CRM Bitrix24 for DOLBIMBY
    810
  • Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1166

We've faced this situation dozens of times: a client starts an exchange with 1C, and the result is timeouts, duplicate products, or prices that don't update. The standard Trade Catalog module (catalog) supports the CommerceML 2.x protocol, but in practice it breaks in three scenarios: non-UTF-8 encoding, non-standard <Классификатор> structure, and exceeding time limits with files over 50 MB. We configure import turnkey in 1-2 days with guaranteed stable operation.

Why timeouts occur when importing large XML files

The main cause is the max_execution_time limit in PHP. When uploading a 180 MB file containing 200,000 products, the 1c_exchange.php script cannot process the data within the standard 30 seconds. Even set_time_limit(0) doesn't help if PHP-FPM has request_terminate_timeout configured. The solution is to enable step-by-step import. In the 1C module settings, we set the "File size for step-by-step processing" (parameter CATALOG_IMPORT_STEP_SIZE). Bitrix uses a SAX parser to split the file into chunks of 10 MB and processes them sequentially. This not only prevents timeouts but also reduces database load: each step is committed, and if a failure occurs, the exchange resumes from the last successful chunk. On one project with an equipment catalog (150,000 SKUs), this approach reduced import time from 4 hours to 40 minutes.

How to avoid duplicate products during exchange?

Duplicates occur when the GUID of an item (<Ид>) changes in 1C. For example, after migrating to a new configuration version or transferring data. Bitrix cannot match the new GUID with the existing XML_ID in b_iblock_element and creates a new element. To fix duplicates, we use a direct SQL query or CIBlockElement::Update(). Prevention: configure in 1C to prohibit unloading elements with empty or non-unique GUID. In complex cases, we write an OnSuccessCatalogImport event handler that checks uniqueness and forcibly updates XML_ID.

What to do if prices are not updating?

A common reason is mismatched price type names. In 1C, the price type might be called "Основная", while in Bitrix it's "Розничная". Mapping is set in /bitrix/admin/cat_price_type.php. Ensure that <ТипЦены><Наименование> in XML matches NAME in b_catalog_price_type. If multiple price types need mapping, we write a custom OnSuccessCatalogImport handler. In it, we parse XML using SimpleXMLElement and update prices via CPrice::Update().

Setting up export from Bitrix to 1C

For the reverse flow (orders → 1C), the endpoint with parameter type=sale is used. Bitrix generates orders.xml with the <Документ> structure containing order items. It is critical to check that the exchange settings have the "Export deliveries" flag enabled and the required order status is set. Parameters of the bitrix:catalog.import.1c component:

  • IBLOCK_ID — information block of the catalog
  • PRICE_TYPE — default price type
  • STORE_ID — default warehouse
  • USE_CML2_DESCRIPTION — take description from XML

Configuration process

Stage Duration
Diagnostics of current exchange scheme (encoding check, XML structure, log errors) 2-4 hours
Setting up price type and warehouse mapping 3-6 hours
Enabling and configuring step-by-step import 2-4 hours
Test run with live data + debugging (fixing duplicates, errors) 4-8 hours
Documenting the scheme and consultation 1-2 hours

Total setup takes 1-2 working days.

Comparison of approaches: standard vs custom

Criteria Standard exchange Custom processing
Large file support Limited (timeout) Step-by-step SAX parser without timeouts
Mapping flexibility Only through admin panel Arbitrary events and SQL
Setup time 2 hours From 1 day
Integrity guarantee Medium (risk of duplicates) High (automated tests and logging)

What is included in the work

  • Diagnostics of current exchange configuration (encoding, <Классификатор> structure, price types)
  • Setting up step-by-step import for large files (optimal chunk size)
  • Mapping price types and warehouses (direct mapping or custom handlers)
  • Fixing duplicates and GUID errors (SQL or API)
  • Test run with real export (timing, checking prices and stock)
  • Exchange scheme documentation (data scheme, field descriptions)
  • Consultation on further maintenance

We have 10+ years of Bitrix development experience, over 200 projects with 1C integration. Certified engineers guarantee correct synchronization of catalog, prices, and stock. For non-standard tasks (custom handlers, non-standard 1C structure), an additional day for development is added.

We will assess your project within 1 hour — contact us. Get an engineer consultation and a turnkey import setup proposal.

CommerceML — official specification of the exchange protocol.