Multi-supplier dropshipping implementation

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 1 servicesAll 2065 services
Multi-supplier dropshipping implementation
Complex
~1-2 weeks
FAQ
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

Implementation of Multi-Supplier Dropshipping

Working with multiple suppliers solves two tasks: expanding assortment and backup reservation — when main supplier runs out, order goes to backup. Technically much more complex than single supplier: need to manage competing prices for one item, priorities, order routing rules, and consolidated stock.

Key Concepts

Supplier routing — logic for selecting supplier for specific order. Can consider: stock availability, price, priority, delivery region, processing speed.

Product mapping — one product in store catalog may correspond to multiple suppliers' SKUs. Need matching table.

Price aggregation — if multiple suppliers offer same product, catalog price formed based on best wholesale price.

Stock consolidation — aggregated stock across all suppliers or only primary supplier.

Data Schema

// One product → multiple suppliers
Schema::create('product_supplier_mappings', function (Blueprint $table) {
    $table->id();
    $table->foreignId('product_id')->constrained();
    $table->foreignId('supplier_id')->constrained('dropship_suppliers');
    $table->string('supplier_sku');
    $table->integer('priority')->default(10); // lower = higher priority
    $table->decimal('supplier_price', 10, 2)->nullable();
    $table->integer('supplier_stock')->default(0);
    $table->boolean('is_active')->default(true);
    $table->timestamp('price_synced_at')->nullable();
    $table->timestamp('stock_synced_at')->nullable();

    $table->unique(['product_id', 'supplier_id']);
    $table->index(['product_id', 'is_active', 'priority']);
});

Supplier Router

class SupplierRouter
{
    /**
     * Select optimal supplier for order item
     */
    public function route(OrderItem $item, RoutingStrategy $strategy): ?ProductSupplierMapping
    {
        $candidates = ProductSupplierMapping::where('product_id', $item->product_id)
            ->where('is_active', true)
            ->where('supplier_stock', '>=', $item->quantity)
            ->with('supplier')
            ->orderBy('priority')
            ->get();

        if ($candidates->isEmpty()) {
            return null; // no available suppliers
        }

        return $strategy->select($candidates, $item);
    }
}

// Strategy: minimum wholesale price
class CheapestSupplierStrategy implements RoutingStrategy
{
    public function select(Collection $candidates, OrderItem $item): ProductSupplierMapping
    {
        return $candidates->sortBy('supplier_price')->first();
    }
}

// Strategy: maximum priority (manually configured)
class PrioritySupplierStrategy implements RoutingStrategy
{
    public function select(Collection $candidates, OrderItem $item): ProductSupplierMapping
    {
        return $candidates->sortBy('priority')->first();
    }
}

// Strategy: nearest warehouse to delivery address (needs warehouse coordinates)
class NearestWarehouseStrategy implements RoutingStrategy
{
    public function select(Collection $candidates, OrderItem $item): ProductSupplierMapping
    {
        $deliveryCoords = $this->geocode($item->order->delivery_address);

        return $candidates->sortBy(function ($mapping) use ($deliveryCoords) {
            $warehouse = $mapping->supplier->primaryWarehouse;
            return $this->haversineDistance($deliveryCoords, $warehouse->coordinates);
        })->first();
    }
}

Price Aggregation

class MultiSupplierPriceAggregator
{
    /**
     * Calculate retail price based on best wholesale price among suppliers
     */
    public function aggregate(Product $product): float
    {
        $bestMapping = ProductSupplierMapping::where('product_id', $product->id)
            ->where('is_active', true)
            ->where('supplier_stock', '>', 0)
            ->whereNotNull('supplier_price')
            ->orderBy('supplier_price')
            ->first();

        if (!$bestMapping) {
            // All suppliers out of stock — keep current price
            return $product->price;
        }

        return $this->calculator->calculate(
            supplierPrice: $bestMapping->supplier_price,
            marginRule: $this->resolveMarginRule($product, $bestMapping->supplier),
        );
    }
}

Stock Consolidation

class StockConsolidator
{
    public function getDisplayStock(Product $product, string $mode = 'sum'): int
    {
        $mappings = ProductSupplierMapping::where('product_id', $product->id)
            ->where('is_active', true)
            ->get();

        return match($mode) {
            // Sum all suppliers (show 999+ if > 100)
            'sum'      => min($mappings->sum('supplier_stock'), 9999),
            // Only primary supplier
            'priority' => $mappings->sortBy('priority')->first()?->supplier_stock ?? 0,
            // Maximum among suppliers
            'max'      => $mappings->max('supplier_stock') ?? 0,
            // Boolean: available at any supplier
            'any'      => $mappings->where('supplier_stock', '>', 0)->isNotEmpty() ? 1 : 0,
        };
    }
}

Order Item Distribution to Suppliers

One order with multiple items can go to different suppliers:

class OrderSplitter
{
    public function split(Order $order): Collection
    {
        $groups = collect();

        foreach ($order->items as $item) {
            $mapping = $this->router->route($item, new PrioritySupplierStrategy());

            if (!$mapping) {
                throw new NoSupplierAvailableException($item->product);
            }

            $supplierId = $mapping->supplier_id;

            if (!$groups->has($supplierId)) {
                $groups->put($supplierId, [
                    'supplier'  => $mapping->supplier,
                    'items'     => collect(),
                ]);
            }

            $groups[$supplierId]['items']->push([
                'item'        => $item,
                'supplier_sku' => $mapping->supplier_sku,
            ]);
        }

        return $groups;
    }
}

Fallback When Stock Insufficient

If primary supplier cannot fulfill order completely:

public function routeWithFallback(OrderItem $item): array
{
    $remaining = $item->quantity;
    $allocations = [];

    $mappings = ProductSupplierMapping::where('product_id', $item->product_id)
        ->where('is_active', true)
        ->where('supplier_stock', '>', 0)
        ->orderBy('priority')
        ->get();

    foreach ($mappings as $mapping) {
        if ($remaining <= 0) break;

        $take = min($remaining, $mapping->supplier_stock);
        $allocations[] = ['mapping' => $mapping, 'quantity' => $take];
        $remaining -= $take;
    }

    if ($remaining > 0) {
        throw new InsufficientMultiSupplierStockException($item, $remaining);
    }

    return $allocations;
}

Supplier Reporting

Admin panel displays:

  • Revenue per supplier
  • Average order fulfillment time
  • Rejection rate (item not available after order acceptance)
  • Wholesale price dynamics

Timeline

Component Timeline
Data schema, supplier mapping 2 days
SupplierRouter + 2–3 strategies 3 days
Price aggregation and stock consolidation 2 days
Order split + fallback 3 days
Admin reporting 2 days
Testing scenarios 3 days

Total: 15–20 business days depending on supplier count and routing complexity.