Orders synchronization between website and marketplaces

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

Order Synchronization Between Website and Marketplaces

Orders from marketplaces and the website are processed in a unified system: single warehouse, single CRM, unified status logic. Marketplaces see status updates; managers view all orders in one interface.

Unified Order Queue Pattern

Ozon Order    ─────┐
WB Order      ──────┼──→ Order Normalizer ──→ Unified Orders DB ──→ Processing
YM Order      ─────┘                                ↓
Site Order    ─────────────────────────────→        WMS / ERP / 1C

Normalized Order Structure

// Unified schema regardless of source
class UnifiedOrder
{
    public string   $id;
    public string   $source;          // 'site', 'ozon', 'wb', 'yandex_market'
    public string   $sourceOrderId;   // Order ID in source system
    public string   $status;          // mapped to unified statuses
    public Customer $customer;
    public array    $items;           // [{product_id, sku, quantity, price}]
    public Shipping $shipping;
    public float    $total;
    public string   $createdAt;
}

Adapters for Each Marketplace

interface MarketplaceAdapter
{
    public function getNewOrders(): array;
    public function toUnifiedOrder(array $raw): UnifiedOrder;
    public function updateStatus(string $orderId, string $status): void;
}

class OzonAdapter implements MarketplaceAdapter
{
    public function toUnifiedOrder(array $raw): UnifiedOrder
    {
        return new UnifiedOrder(
            source:        'ozon',
            sourceOrderId: $raw['posting_number'],
            status:        $this->mapStatus($raw['status']),
            customer: new Customer(
                name:  $raw['customer']['name'],
                phone: $raw['customer']['phone'] ?? null,
            ),
            items: array_map(fn($item) => [
                'sku'      => $item['offer_id'],
                'quantity' => $item['quantity'],
                'price'    => $item['price'],
                'name'     => $item['name'],
            ], $raw['products']),
            shipping: new Shipping(
                address:  $raw['delivery_method']['warehouse'] ?? null,
                method:   $raw['delivery_method']['name'],
            ),
            total:     $raw['financial_data']['total_amount'],
            createdAt: $raw['created_at'],
        );
    }

    public function updateStatus(string $orderId, string $unifiedStatus): void
    {
        $ozonStatus = $this->reverseMapStatus($unifiedStatus);
        $this->ozon->updatePostingStatus($orderId, $ozonStatus);
    }
}

Status Machine

class OrderStatusMachine
{
    private array $statusMap = [
        // unified → marketplace-specific
        'confirmed' => [
            'ozon' => 'awaiting_deliver',
            'wb'   => 'confirm',
            'ym'   => 'PROCESSING',
        ],
        'shipped' => [
            'ozon' => 'delivering',
            'wb'   => 'complete',
            'ym'   => 'DELIVERY',
        ],
    ];

    public function syncStatus(Order $order, string $newStatus): void
    {
        $order->update(['status' => $newStatus]);

        if ($order->source !== 'site') {
            $adapter = $this->getAdapter($order->source);
            $adapter->updateStatus($order->source_order_id, $newStatus);
        }
    }
}

Return Processing

class ReturnProcessor
{
    public function processMarketplaceReturn(array $returnData, string $source): void
    {
        $order = Order::where('source', $source)
                      ->where('source_order_id', $returnData['order_id'])
                      ->firstOrFail();

        Return::create([
            'order_id' => $order->id,
            'items'    => $returnData['items'],
            'reason'   => $returnData['reason'],
            'source'   => $source,
        ]);

        // Restore inventory
        foreach ($returnData['items'] as $item) {
            Product::find($item['product_id'])?->increment('stock', $item['quantity']);
        }

        // Notify manager
        app(TelegramNotifier::class)->notifyReturn($order);
    }
}

Timeline

Order synchronization for 2–3 marketplaces with unified control panel: 16–24 business days.