Back to blog
Architecture 11 min read

Suppliers microservice: own warehouse, bins, barcodes, and automated stock feeds

In e-commerce a supplier is a fulfilment source — including your own warehouse. How to run sections, inventory counts, and multi-channel stock ingest without lying to the storefront.

Suppliers microservice: own warehouse, bins, barcodes, and automated stock feeds

Why a dedicated Suppliers microservice

In an auto-parts storefront, “stock and price” is not a product-card field. It is a stream: who can fulfil the line, how many units are real, today’s price, how fast you can pick and ship. The suppliers microservice owns that perimeter — separate from TecDoc catalog, search, and checkout.

Typical responsibilities:

  • supplier registry and contract terms (lead time, MOQ, returns);
  • offers: article ↔ price ↔ qty ↔ delivery promise;
  • priority rules (own warehouse → local partner → remote);
  • multi-channel stock ingestion;
  • for own stock — bin addressing, barcodes, inventory counts.

A “supplier” is not only someone else’s price file

In the domain model, a supplier is best treated as a fulfilment source. That can be:

  • an external wholesaler with API/FTP;
  • a local partner with a manual or semi-automated feed;
  • your own warehouse — same entity type, with a real WMS behind it.

For the storefront and cart, own stock is still a supplier: offers, ship SLA, priority. Operationally it is warehouse management: sections, levels, floors, barcodes, inventory.

                    ┌─────────────────────────┐
                    │     Storefront / BFF    │
                    └───────────┬─────────────┘
                                │ offers, stock
                    ┌───────────▼─────────────┐
                    │   Suppliers microservice │
                    └─┬──────────┬──────────┬─┘
          ┌───────────┘          │          └───────────┐
          ▼                      ▼                      ▼
 ┌────────────────┐   ┌──────────────────┐   ┌────────────────────┐
 │ External API   │   │ Files / FTP/SFTP │   │ Own warehouse      │
 │ supplier       │   │ prices & stock   │   │ (WMS + barcodes)   │
 └────────────────┘   └──────────────────┘   └────────────────────┘

Own warehouse must behave like a real warehouse

If you model own stock as “one Excel column”, you save a week at kickoff and lose months in operations. A sane addressing model:

  • warehouse / branch → floor → zone/section → aisle → rack → level → bin;
  • every bin and every unit (or lot) has a barcode;
  • stock moves only via documents: receipt, transfer, reserve, pick, ship, write-off;
  • storefront qty = sum of bins minus reservations — not a number from memory.
  Warehouse “Minsk-1”
  └── Floor 1
      └── Section A (fast movers)
          └── Aisle A-03
              └── Rack 02
                  └── Level 3
                      └── Bin A-03-02-3-07  [barcode]
                          └── lot / unit     [barcode]

Without barcodes, inventory is “walk and look”. With barcodes it is scanner + task + plan/fact per bin.

Why “not running the warehouse” burns time

Typical cost of chaos I see during rollouts:

  • sales says “in stock”, picker searches 15–40 minutes;
  • duplicates and mis-slots: one article in three places with no address;
  • quarterly “all hands” inventory instead of cyclic counts by section;
  • returns from shipping the wrong lot/cross;
  • you cannot honestly prioritize own stock in search — the number is not trustworthy.

Time is lost in daily minutes of searching, recounting, and firefighting — not only in “writing a WMS”. Automation pays off when addressable stock becomes the source of truth for offers.

Inventory counts in a mature loop

  1. count plan: warehouse → section/zone → bin set;
  2. freeze or soft-lock bins while counting;
  3. scan facts (empty / variance / OK);
  4. variance acts and stock corrections;
  5. publish fresh availability into the offer layer.
┌──────────────┐    ┌──────────────┐    ┌──────────────┐    ┌──────────────┐
│ Count plan   │───▶│ Handheld /   │───▶│ Scan bin +   │───▶│ Act / corr.  │
│ by section   │    │ scanner task │    │ product      │    │ of stock     │
└──────────────┘    └──────────────┘    └──────┬───────┘    └──────┬───────┘
                                               │                   │
                                               ▼                   ▼
                                        variance?            storefront
                                        recount              offer updated

Cyclic counts of hot sections beat a single overnight marathon every six months.

Automated stock ingest: many paths, many quirks

External suppliers rarely speak one protocol. One service needs adapters for:

  • REST/SOAP API — live qty/price, rate limits, tokens, idempotent calls;
  • FTP/SFTP + files (CSV/XML/XLSX) — schedules, encodings, drifting columns, partial dumps;
  • email attachments — mailbox parsing, attachment quarantine, dedup;
  • portal / scraping as a last resort — fragile; needs break monitoring;
  • manual manager upload — same validation pipeline as auto-feeds.

The shared pipeline stays one: ingest → normalize (article/brand) → validate → pricing rules → publish offers. Quirks live in the adapter, not in the UI.

  Source                    Adapter              Suppliers core
 ─────────                 ────────             ──────────────
  API  ──────┐
  FTP  ──────┼──▶ decode ──▶ map SKU ──▶ rules ──▶ offers store ──▶ search/cart
  Mail ──────┤              │
  Manual ────┘              └── dead-letter / retry / alert

Stock semantics differ too: exact qty vs “>10 / low / none” vs qty delayed 6–24h. Persist a confidence type, or the UI will lie with equal confidence.

Own warehouse and external feeds under one priority policy

Request: article + customer region
        │
        ▼
 Collect offers: [OWN_WH] [LOCAL_1] [API_A] [FTP_B]
        │
        ▼
 Filters: qty>0 or allowed backorder, geo, stop-list
        │
        ▼
 Sort: source priority → lead time → price → stock confidence
        │
        ▼
 Cart: hard reserve on OWN_WH; soft-hold / recheck on externals

Own-warehouse reservation must be bin-level (or at least document-level). Otherwise two salespeople sell the same part from the same shelf.

Rollout order

  1. Supplier registry + article normalization.
  2. Feed adapters and a single offers store.
  3. Own warehouse as a supplier: addressing + barcodes + receipt/pick.
  4. Section-based inventory and variance monitoring.
  5. Offer priority and reservations tied to real stock.

Jumping to a 20-screen WMS without addressable stock is a common failure mode. Truth of quantity first, UI polish second.

How I can help (offer)

If you build or already run an aftermarket shop, I can take concrete work:

  • 1-call audit — what to extract from OpenCart/PrestaShop first, where margin and warehouse/content time leak;
  • architecture & delivery — catalog, suppliers/WMS, search, applicability microservices;
  • AI/MCP loop — faster fitment, category moves, and analogues with human-in-the-loop.

Format: paid consultation or staged delivery with measurable outcomes (card queue, stock confidence, time-to-shelf). Reach me via the contact form or info@prybytkow.ru — short note on stack and bottleneck.

Related posts