Why Custom CommerceML Exports Duplicate Bitrix Catalogs (And How to Fix UUID Generation)
The Mechanics of the Bitrix Duplicate Bug
Most custom CommerceML exporters fail at a very specific boundary: identity management. If you build a custom export pipeline from an internal PostgreSQL database, an enterprise ERP, or a headless backend, generating valid XML is easy. Generating XML that 1C-Bitrix recognizes across multiple runs without duplicating catalog items is where things break down.
When Bitrix imports an import.xml payload, its catalog module checks existing records in the database table b_iblock_element by matching the incoming <Ид> tag against the stored XML_ID column. If the system finds a match, it updates the record. If it does not, it executes an insert.
The problem stems from how custom scripts populate <Ид>. If your exporter generates standard random UUIDs (version 4) on every execution, every single sync payload tells Bitrix that every product is brand new. The result is immediate catalog inflation, broken URL structures, orphaned stock values, and database lockups during re-indexing.
Understanding Identity in CommerceML 2.05
CommerceML 2.05 expects strict XML hierarchy and specific identity formats across import.xml and offers.xml files.
For basic products without variations, <Ид> is a single unique string—typically a canonical 36-character UUID representation. For products with offer variations (SKUs), identity splits into two distinct parts connected by a hash delimiter:
[Product_UUID]#[Offer_UUID]
In import.xml, the base product is registered under its parent Product_UUID. In offers.xml, each commercial offer references the base product identity and appends its own variation identity after the hash.
If your custom backend uses integer primary keys (like an auto-incrementing ID), feeding raw integers directly into CommerceML XML elements causes collisions with internal Bitrix IBlock IDs or category keys. Bitrix catalog modules expect stable, canonical identifiers across all sync sessions.
Generating Deterministic Identifiers From Custom Databases
You do not need to alter your legacy database schema or add UUID columns to every product table just to produce clean CommerceML. The standard engineering solution relies on namespace-based RFC 4122 Version 5 UUIDs.
UUID v5 uses SHA-1 hashing combined with a designated namespace and a unique input string—such as your database table name combined with the internal primary key or SKU.
Because SHA-1 hashing is deterministic, passing the same SKU or primary key into the generator with the same namespace UUID will always produce the exact same 1C-compatible UUID string.
When your export script runs, product SKU-9941 generates the exact same identity string as it did three months ago. Bitrix receives the XML payload, queries b_iblock_element where XML_ID matches the deterministic UUID, finds the existing row, and executes an inline UPDATE instead of an INSERT.
Aligning import.xml and offers.xml Hierarchy
Generating proper UUIDs is only half the requirement. The relational bridge between catalog definitions and pricing packages must also remain intact.
import.xml defines catalog structures: groups (categories), basic product metadata, specifications, and properties. offers.xml defines commercial execution: price types, stock balances, warehouse positions, and SKU variations.
A common architecture error occurs when custom scripts generate different UUIDs for the product inside offers.xml than the one generated inside import.xml. If the prefix before the # character in an offer does not match the <Ид> tag of the product in import.xml, Bitrix detaches the commercial offer from the parent catalog item.
When this happens, Bitrix creates an unattached offer element or rejects the stock update silently. Your online store ends up with correct product descriptions but zero stock and missing prices.
Building Reliable Sync Engines
Hand-coding custom CommerceML generators requires strict adherence to schema specifications, character encoding constraints (UTF-8 without BOM), correct XML escaping, and streaming output buffers for large inventories to avoid memory limits.
If you are evaluating external technical support, looking for a qualified bitrix commerceml freelance specialist or integration engineering team who understands the underlying 1C-Bitrix API mechanics is essential. A naive integration script might pass an initial smoke test, but without proper UUID determinism and XML validation, it will break on routine catalog updates.
We build custom, production-grade integration bridges that handle complex catalog exports directly from proprietary databases, ERPs, and custom backend systems into Bitrix. If you need a robust, fault-tolerant exchange setup that guarantees clean catalog synchronization without duplicating records, explore our solution for Обмен каталогом 1С-Битрикс через CommerceML.