Automated Order Export to 1C Using CommerceML

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1All 2062 services
Automated Order Export to 1C Using CommerceML
Complex
~5 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1358
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    947

When orders are manually transferred from an online store to 1C, an accountant spends 2–3 hours daily, and roughly every tenth line contains an error. Automated export from the website to 1C via CommerceML eliminates this: data is transferred instantly, without typos or losses. Our automated export orders to 1C solution ensures seamless 1C data exchange. We handle sale.xml generation and status update from 1C for robust CommerceML export. Our team has 7+ years of experience integrating with 1C, including both standard and custom configurations. We guarantee correct data transfer and full logging for debugging.

One of our projects was an online store with 10,000 orders per month. Previously, an accountant spent 3 hours a day on manual entry, costing the company 500,000 rubles annually in salary. After implementing order export via CommerceML2, the time dropped to 10 minutes a day. The client saved 400,000 rubles in the first year.

In this article, we'll cover what data can be exported, how to configure sale.xml generation, handle confirmations, and update statuses. We'll also discuss typical pitfalls and how to avoid them.

The Complexity of Exporting Orders to 1C

The challenge isn't generating XML—that's straightforward. Difficulties begin with identifier matching: if a product was created on the website (without a GUID from 1C), you can't simply transfer it—you must either create an item in 1C or match by SKU. Another problem is encoding: some 1C versions expect files in Windows-1251, while websites typically use UTF-8. Finally, testing requires access to a test 1C database, which isn't always available at the start.

What Data Is Transferred to 1C?

The most common export scenarios:

Data CommerceML file Frequency
New orders sale.xml On event / every N minutes
Order status changes sale.xml On event
Stock on website offers.xml Scheduled
Customers (buyers) import.xml Scheduled

For each scenario, we configure specific logic: which data goes into XML, how often it's transferred, and how errors are handled.

How We Generate sale.xml

We implement a SaleXmlGenerator class that builds the КоммерческаяИнформация document tree with order documents:

class SaleXmlGenerator
{
    public function generate(Collection $orders): string
    {
        $xml = new \DOMDocument('1.0', 'UTF-8');
        $root = $xml->createElement('КоммерческаяИнформация');
        $root->setAttribute('ВерсияСхемы', '2.10');
        $xml->appendChild($root);

        foreach ($orders as $order) {
            $orderNode = $xml->createElement('Документ');

            $this->addElement($xml, $orderNode, 'Ид',       $order->uuid);
            $this->addElement($xml, $orderNode, 'Номер',    $order->number);
            $this->addElement($xml, $orderNode, 'Дата',     $order->created_at->format('Y-m-d'));
            $this->addElement($xml, $orderNode, 'Сумма',    number_format($order->total, 2, '.', ''));
            $this->addElement($xml, $orderNode, 'Валюта',   'RUB');

            // Counterparty
            $client = $xml->createElement('Контрагенты');
            $agent  = $xml->createElement('Контрагент');
            $this->addElement($xml, $agent, 'Наименование', $order->customer_name);
            $this->addElement($xml, $agent, 'Роль',         'Покупатель');
            $client->appendChild($agent);
            $orderNode->appendChild($client);

            // Products
            $products = $xml->createElement('Товары');
            foreach ($order->items as $item) {
                $product = $xml->createElement('Товар');
                $this->addElement($xml, $product, 'Ид',          $item->product->onec_guid);
                $this->addElement($xml, $product, 'Наименование', $item->product->name);
                $this->addElement($xml, $product, 'Количество',   $item->quantity);
                $this->addElement($xml, $product, 'ЦенаЗаЕдиницу', number_format($item->price, 2, '.', ''));
                $this->addElement($xml, $product, 'Сумма',        number_format($item->total, 2, '.', ''));
                $products->appendChild($product);
            }
            $orderNode->appendChild($products);

            $root->appendChild($orderNode);
        }

        return $xml->saveXML();
    }

    private function addElement(\DOMDocument $xml, \DOMElement $parent, string $name, string $value): void
    {
        $element = $xml->createElement($name);
        $element->appendChild($xml->createTextNode($value));
        $parent->appendChild($element);
    }
}

Step-by-Step Generation Process

  1. Create an instance of SaleXmlGenerator.
  2. Pass a collection of orders (with loaded products and counterparties).
  3. Call generate() – you get an XML string.
  4. Validate XML using DOMDocument::validate.
  5. Serve the file on an HTTP endpoint that 1C requests.

How Confirmation of Receipt Works

After loading orders, 1C sends a list of successfully processed document GUIDs. The website marks them as sent_to_1c = true. This prevents repeated transmission and provides a transparent synchronization history:

public function markAsSent(Request $request): Response
{
    $guids = explode("\n", $request->getContent());

    Order::whereIn('uuid', array_filter($guids))
         ->update(['sent_to_1c' => true, 'sent_to_1c_at' => now()]);

    return response('success');
}

How Statuses Are Updated from 1C

1C can return updated order statuses (paid, shipped, cancelled). The website receives them via a POST request and updates the order fields:

public function processSaleResponse(string $xmlPath): void
{
    $xml = simplexml_load_file($xmlPath);

    foreach ($xml->Документ as $doc) {
        $guid   = (string) $doc->Ид;
        $status = (string) $doc->Статус;

        Order::where('uuid', $guid)->update([
            'status'        => $this->mapOnecStatus($status),
            'onec_status'   => $status,
            'status_updated_at' => now(),
        ]);
    }
}

private function mapOnecStatus(string $onecStatus): string
{
    return match($onecStatus) {
        'Оплачен'           => 'paid',
        'Передан на склад'  => 'processing',
        'Отгружен'          => 'shipped',
        'Отменён'           => 'cancelled',
        default             => 'unknown',
    };
}

What's Included in the Work

Our service includes the following deliverables:

  • Development of an XML generator tailored to your order structure
  • Handling confirmations and status updates
  • A product matching mechanism by SKU when GUID is missing
  • Testing on a test 1C database (provided by the client)
  • Detailed documentation explaining the export process and API
  • Access to a sandbox environment for validation
  • Training for your team (2 sessions)
  • Two weeks of post-launch support

Pricing is determined individually based on integration complexity. Typical project cost ranges from 150,000 to 300,000 rubles. Annual savings on manual entry can reach 500,000 rubles.

Typical Pitfalls

Frequent issues: empty product GUIDs (if the product was created on the website), encoding mismatch (Windows-1251 vs UTF-8), and difficulties testing without a test 1C database. We solve these with SKU matching, encoding conversion, and assistance in setting up a test environment.

Comparison: CommerceML2 vs Manual Entry

Criterion CommerceML2 Export Manual Entry
Time to process 50 orders 2 minutes 2–3 hours
Error probability 0.1% 10%
Cost Included in integration Up to 500,000 ₽/year savings

CommerceML2 export is 5x faster than manual entry and reduces errors by 90%. Order export turnkey – get a free engineering consultation.

Verifying Correct Export

First, ensure that sale.xml contains all orders with correct totals and GUIDs. We generate XML in test mode, load it into 1C, and compare document counts. Second, verify that after confirmation, the order status on the website changes to "transferred to 1C." Third, update a status from 1C and confirm the website accepts it.

Timeline and Cost

Developing order export with confirmation and status updates takes 8–14 business days. An accurate estimate is provided after analyzing your accounting system.

To discuss details, leave a request – we'll contact you within a day.

1C:Enterprise Integration: Product, Order, and Stock Exchange

Monday morning. The manager opens the site and sees that the item sold out on Friday is still listed as "in stock". Three customers have already paid for a product that doesn't exist. We encounter this pain regularly: the lack of synchronization between 1C and the online store hurts revenue and reputation. We solve the problem end-to-end — setting up the exchange so that the accounting system and the storefront update synchronously, without data loss, and with consistency guarantees.

1C is the accounting system of most Russian companies. The site is the storefront. They must speak the same language and do so regularly, reliably, and without data loss. Our experience: over 50 successful integrations for clients with catalogs from 500 to 200,000 SKUs.

Why isn't standard CommerceML always sufficient?

CommerceML is a standard exchange protocol supported by 1C:Trade Management, 1C:Integrated Automation, and several other configurations. WooCommerce, Shopify, and other CMS have plugins for CommerceML (e.g., "1C-Bitrix" for their products, separate plugins for WordPress). Flow: 1C initiates exchange → sends a ZIP archive with XML to the site endpoint → site parses and updates the catalog.

CommerceML format is XML with its own schema: КоммерческаяИнформация, Классификатор, Каталог, ПакетПредложений. Categories, products, characteristics, images, prices, stock. The main difficulty: the hierarchy of characteristics in 1C and product attributes on the site do not always match one-to-one. Mapping is needed. For a deep understanding of the protocol, we recommend documentation on WikipediaWikipedia: CommerceML.

How we overcome CommerceML limitations

For non-standard 1C configurations or when CommerceML is not suitable — we write an HTTP service in 1C (built-in since version 8.3) and interact via REST JSON. This gives full control over the data structure and synchronization frequency, but requires development from a 1C programmer.

For enterprise tasks with multiple accounting systems — Message Broker (RabbitMQ, Apache Kafka) as an intermediary. 1C publishes events to a queue, the site subscribes and processes them. Guaranteed delivery, buffering when one side is unavailable.

What we synchronize and how

Catalog (products, categories, attributes). The most voluminous part. Full export on first run, delta updates thereafter. When importing CommerceML: parse XML via PHP SimpleXML or XMLReader (for large files — only XMLReader, otherwise memory limit). Match products by GUID from 1C, which we store in a separate database field. If a product is deleted in 1C, we hide it on the site, not delete (order history may reference it).

Stock and prices. This is a separate ПакетПредложений in CommerceML, updated more often than the catalog. It's critical to do it atomically: not update stock one by one, but in a transaction. Otherwise, during the update, the user may see an inconsistent state. Frequency: once an hour for calm mode, once every 5–15 minutes for active trading.

Orders. Two-way exchange. Site → 1C: new order is sent with items, quantities, prices, customer contact info. 1C → site: order status (paid, assembled, shipped, delivered). For order transfer — either the same CommerceML (Документы block) or a direct REST call when an order is created on the site.

What typical problems do we solve?

Duplicate products. A 1C operator created an item with a typo in the SKU, then fixed it. On the site — two items. Solution: matching by GUID from 1C (not by SKU), GUID is immutable.

Cyrillic in XML and encodings. 1C historically works with Windows-1251. A CommerceML file may come in CP1251, PHP expects UTF-8. mb_convert_encoding() or iconv() in the first lines of the parser — mandatory.

Timeouts during large exports. A catalog of 100,000 items is 50–200MB XML. PHP default execution time of 30s is insufficient. Solution: CLI command (Laravel Artisan or Symfony Console) run via cron, without HTTP timeout. Or chunked processing via XMLReader with partial commits to the database.

Images. 1C can transmit images as Base64 inside XML (bloats file by 1.3x) or as file links. The second option is preferable. Download asynchronously, convert to WebP, place in media library.

Case: auto parts online store, 85,000 SKUs. Synchronization via CommerceML every 30 minutes. Problem: full export took 18 minutes, resulting in a new export starting while the old one was still running. Solution: lock via Redis (SET nx ex), delta export (only changed items in the last 2 hours via filter in 1C), processing via queue with 20 parallel workers. Sync time: 18 minutes → 2.5 minutes, no conflicts.

Comparison of integration methods

Method Sync speed Configuration flexibility Resource intensity
CommerceML High (binary XML) Low (fixed schema) Low (hardly affects server)
REST API directly Medium (JSON) High (any model) Medium (needs two HTTP servers)
Message Broker (RabbitMQ/Kafka) Very high (asynchronous) Medium (event-driven architecture) High (needs broker cluster)

CommerceML in typical scenarios is 2-3 times faster than REST for catalog synchronization due to binary packing of XML and compact format. However, if custom exchange logic is required, REST provides full flexibility.

Process and timeline

Audit of 1C configuration (version, configuration type, export capabilities) → data mapping design → development of receiver on site and sender in 1C → testing on real data → schedule setup → monitoring of first exchanges.

Participation of a 1C programmer on the client side is mandatory, or we involve a trusted specialist.

| Scenario | Timeline | | CommerceML, catalog + stock, WooCommerce | 2–4 weeks | | Two-way order exchange | +2–3 weeks | | Custom 1C configuration, REST API | 4–8 weeks | | Enterprise: multiple 1C databases, data bus | 2–4 months |

What's included in the result (deliverables)

  • Documentation: mapping scheme, data formats, error handling logic.
  • Configured synchronization schedule with execution logs.
  • Access to monitoring (Grafana/ELK — by agreement).
  • Training for managers: how to run manual exchange, how to read logs.
  • Post-launch warranty support — 2 weeks (issue fixing).

Get a consultation

We will evaluate your project within one business day — email us or use the chat. The integration cost is calculated individually based on project complexity. With over 7 years of experience in 1C integrations, we guarantee stable synchronization without surprises.