Setting up 1C-Bitrix XML import and export

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

XML Import and Export Configuration for 1C-Bitrix

The standard "Trade Catalog" module (catalog) supports data exchange with 1C via the CommerceML 2.x protocol — XML files containing product listings, prices, and stock levels. In practice, this mechanism breaks down in three common scenarios: the file encoding is not UTF-8, there is a non-standard <Classifier> node structure from 1C, or the execution time limit is exceeded for files larger than 50 MB.

How the standard exchange works

1C-Bitrix expects files strictly in CommerceML 2.08 format. The exchange runs through /bitrix/admin/1c_exchange.php — a receiver script that reads the exchange session from $_SESSION['BX_CML2_IMPORT'] and processes chunks sequentially via CCatalogImport.

Tables affected by the import:

  • b_iblock_element — catalog elements
  • b_catalog_price — prices by type
  • b_catalog_store_product — stock levels by warehouse
  • b_iblock_element_property — element properties

Common issues and solutions

Issue 1: timeout with large files

1C exports a single XML with 200,000 items — the file is 180 MB. set_time_limit(0) does not help if PHP-FPM is configured with request_terminate_timeout. The solution is to enable step-by-step mode: in the module settings at "1C-Bitrix: Site Management → Settings → Product Settings → 1C", set the "File size for step-by-step processing" parameter (CATALOG_IMPORT_STEP_SIZE). 1C-Bitrix will automatically split the file into parts using the SAX parser.

Issue 2: duplicate products

The import identifies a product by the Id XML attribute inside the <Product> tag. If the nomenclature GUID was changed in 1C, 1C-Bitrix creates a new element. Check the XML_ID field in b_iblock_element — that is where this identifier is stored. Fix it via a direct update or re-linking through CIBlockElement::Update().

Issue 3: prices not updating

A common cause: the price type in 1C is called "Base", while in 1C-Bitrix a type named "Retail" was created. The mapping is set in /bitrix/admin/cat_price_type.php. Ensure that the XML tag <PriceType><Name> matches the NAME field in the b_catalog_price_type table.

Configuring export from 1C-Bitrix to 1C

For the reverse flow (orders → 1C), the same endpoint is used with the type=sale parameter. 1C-Bitrix generates orders.xml with a <Document> structure that includes order line items. Critically, verify that the exchange settings have the "Export sales" flag enabled and that the correct order statuses for export are specified.

Fine-tuning parameters via CBitrixComponent bitrix:catalog.import.1c:

IBLOCK_ID — catalog infoblock
PRICE_TYPE — default price type
STORE_ID — default warehouse
USE_CML2_DESCRIPTION — take description from XML

Work timeline

Phase Duration
Diagnosing the current exchange scheme 2–4 hours
Configuring price type and warehouse mapping 3–6 hours
Setting up step-by-step import 2–4 hours
Test run + debugging 4–8 hours

Full configuration for a non-standard 1C structure takes 1–2 working days. If custom handling of the OnSuccessCatalogImport or OnBeforeCatalogImport events is required, add another day for handler development.