1C Integration with Magento 2

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.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

1C Integration with Magento 2

Bidirectional Magento 2 and 1C synchronization is standard task for Russian e-commerce: catalog and prices from 1C, orders to 1C, real-time stock. More complex than OpenCart due to Magento-specific concepts (attribute sets, configurable products, MSI).

Integration Architecture

1C ←→ Integration Layer ←→ Magento 2

Integration Layer:
- Queue (RabbitMQ / Redis)
- Transformer (1C format ↔ Magento format)
- Error Handler
- Retry Logic

Direct 1C → Magento REST API connection works but is unreliable under load. Intermediate layer with queue is right approach.

1C HTTP Service for Data Export

// 1C: HTTP Service ProductsService
// GET /products Method
Function GetProducts(Request)
    ProductArray = New Array;

    Selection = Catalogs.Nomenclature.Select();
    While Selection.Next() Do
        If NOT Selection.IsFolder Then
            Product = New Structure;
            Product.Insert("sku",      String(Selection.Ref.UniqueId()));
            Product.Insert("name",     Selection.Name);
            Product.Insert("price",    InformationRegisters.NomenclaturePrices.GetLast(Selection.Ref).Price);
            Product.Insert("quantity", AccumulationRegisters.GoodsInWarehouses.ProductBalance(Selection.Ref));
            ProductArray.Add(Product);
        EndIf;
    EndDo;

    Response = New HTTPServiceResponse(200);
    Response.SetBodyFromString(Format.JSON.Write(ProductArray));
    Return Response;
EndFunction

Import from 1C to Magento 2 (Python integration worker)

import requests
import json
from magento.models.product import Product

class OneCMagentoSync:
    def __init__(self, m2_url, m2_token, onec_url, onec_auth):
        self.m2_url = m2_url
        self.m2_headers = {"Authorization": f"Bearer {m2_token}", "Content-Type": "application/json"}
        self.onec_url = onec_url
        self.onec_auth = onec_auth

    def sync_products(self):
        # Get products from 1C
        response = requests.get(f"{self.onec_url}/products", auth=self.onec_auth)
        products_1c = response.json()

        for product_data in products_1c:
            self.upsert_product(product_data)

    def upsert_product(self, data: dict):
        sku = data['sku']

        # Check existence in Magento
        check = requests.get(f"{self.m2_url}/rest/V1/products/{sku}", headers=self.m2_headers)

        payload = {
            "product": {
                "sku": sku,
                "name": data['name'],
                "price": float(data['price']),
                "status": 1,
                "type_id": "simple",
                "attribute_set_id": 4,
                "extension_attributes": {
                    "stock_item": {
                        "qty": int(data['quantity']),
                        "is_in_stock": int(data['quantity']) > 0
                    }
                }
            }
        }

        if check.status_code == 200:
            # Update
            requests.put(f"{self.m2_url}/rest/V1/products/{sku}",
                        headers=self.m2_headers, json=payload)
        else:
            # Create
            requests.post(f"{self.m2_url}/rest/V1/products",
                         headers=self.m2_headers, json=payload)

Stock Synchronization (MSI)

Magento 2.3+ uses Multi-Source Inventory. Update stock via MSI API:

def update_stock_msi(self, sku: str, source_code: str, qty: float):
    payload = {
        "sourceItems": [{
            "sku": sku,
            "source_code": source_code,
            "quantity": qty,
            "status": 1 if qty > 0 else 0
        }]
    }
    requests.post(f"{self.m2_url}/rest/V1/inventory/source-items",
                 headers=self.m2_headers, json=payload)

Exporting Orders to 1C

def export_orders_to_1c(self):
    # Get unprocessed orders
    response = requests.get(
        f"{self.m2_url}/rest/V1/orders",
        params={
            "searchCriteria[filter_groups][0][filters][0][field]": "status",
            "searchCriteria[filter_groups][0][filters][0][value]": "pending",
            "searchCriteria[pageSize]": 50
        },
        headers=self.m2_headers
    )

    orders = response.json()['items']

    for order in orders:
        order_1c = self.transform_order(order)

        # Send to 1C
        result = requests.post(
            f"{self.onec_url}/orders",
            json=order_1c,
            auth=self.onec_auth,
            timeout=10
        )

        if result.status_code == 200:
            # Mark order as transmitted to 1C
            requests.post(
                f"{self.m2_url}/rest/V1/orders/{order['entity_id']}/comments",
                headers=self.m2_headers,
                json={"statusHistory": {"comment": "Transmitted to 1C", "status": "processing"}}
            )

Queue for Reliability

import pika  # RabbitMQ

def publish_to_queue(self, event_type: str, data: dict):
    connection = pika.BlockingConnection(pika.URLParameters(RABBITMQ_URL))
    channel = connection.channel()
    channel.queue_declare(queue='magento_1c_sync', durable=True)
    channel.basic_publish(
        exchange='',
        routing_key='magento_1c_sync',
        body=json.dumps({"type": event_type, "data": data}),
        properties=pika.BasicProperties(delivery_mode=2)  # persistent
    )
    connection.close()

Timelines

Basic synchronization (catalog + stock in one direction) — 10–14 days. Bidirectional integration with orders, queue, and monitoring — 3–4 weeks.