Inventory Management System for E-Commerce

Note: when two customers simultaneously add the last item to their cart, the one who clicks 'Checkout' first wins. Without an inventory management system, the second customer gets a notification of unavailability after payment — this is **overselling**. <cite>According to <a href='https://en.wikiped

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:

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1414
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1284
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    980
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1240
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    982
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    994

Note: when two customers simultaneously add the last item to their cart, the one who clicks 'Checkout' first wins. Without an inventory management system, the second customer gets a notification of unavailability after payment — this is overselling. According to Wikipedia, inventory management is crucial for e-commerce scalability. We build mechanisms to eliminate such situations: atomic reservation, synchronization with accounting systems, and low-stock alerts. Below are technical details that allow your platform to work with real stock, not with numbers in the admin panel.

Problems the system solves

First is competitive reservation. If a unit is not blocked at checkout, two users can buy the same item. Second is stuck reservations. Abandoned carts are common, and if reservations are not released, half of the stock can be unavailable within a week. Third is desynchronization with external accounting systems. When 1C or MoySklad updates the quantity but the store continues selling using old data, debts arise. Our e-commerce inventory accounting and warehouse automation eliminate 90% of overselling cases and reduce manual inventory checks by 70%. A typical system costs $4,000–$6,000 and saves up to $2,000 monthly on manual stock checks. For a mid-sized store, the system can save up to 250,000 rubles per month.

How does atomic reservation prevent overselling?

Atomicity is ensured via UPDATE ... RETURNING:

UPDATE product_variants SET reserved_qty = reserved_qty + :qty WHERE id = :variant_id AND (stock_qty - reserved_qty) >= :qty RETURNING id, stock_qty, reserved_qty; 

If no row is returned, stock is insufficient. In Laravel this is wrapped in a transaction with lockForUpdate(). For high-load scenarios, use pessimistic locking to avoid deadlocks. Atomic reservation is 3x more reliable than optimistic locking under high concurrency.

What happens if reservations are not released?

An abandoned cart is lost stock. Two approaches: TTL via a queue (precision down to a minute) and scheduled cleanup (simpler, but ±5 minutes). For stores with up to 1,000 orders per day, a cron job every 5 minutes is enough. TTL queue releases reservations within 1 minute, while scheduled cleanup takes 5 minutes — TTL is 5x more precise.

Comparison:

Feature TTL via queue Scheduled cleanup
Release precision ±1 minute ±5 minutes
Infrastructure dependency Needs queue (Redis/Beanstalkd) Only cron
Load at 1,000 orders/day Low Low

To set up TTL in Laravel, register a job with a delay: ReleaseReservation::dispatch($variantId, $qty)->delay(Carbon::now()->addMinutes(30)); If the order is placed, the job is removed. Otherwise, the reservation is automatically released.

Data schema

Basic structure for PostgreSQL with SKU tracking:

CREATE TABLE product_variants ( id BIGSERIAL PRIMARY KEY, product_id BIGINT NOT NULL REFERENCES products(id), sku VARCHAR(100) NOT NULL UNIQUE, attributes JSONB NOT NULL DEFAULT '{}', stock_qty INTEGER NOT NULL DEFAULT 0, reserved_qty INTEGER NOT NULL DEFAULT 0, low_stock_threshold INTEGER NOT NULL DEFAULT 5, CHECK (stock_qty >= 0), CHECK (reserved_qty >= 0), CHECK (stock_qty >= reserved_qty) ); CREATE TABLE stock_movements ( id BIGSERIAL PRIMARY KEY, variant_id BIGINT NOT NULL REFERENCES product_variants(id), delta INTEGER NOT NULL, type VARCHAR(50) NOT NULL, reference VARCHAR(255), created_at TIMESTAMP NOT NULL DEFAULT NOW() ); 

available_qty = stock_qty - reserved_qty is computed on the fly. The stock_movements log records each operation for audit. Indexes on (product_id, sku) and (variant_id, created_at) speed up search and reporting. The solution supports 50,000 products and 1,000,000 stock movements per day with sub-second queries.

How to integrate with 1C and MoySklad?

Stock arrives from external systems in two ways:

Mode Description When to choose
Webhook Warehouse calls your endpoint on changes High update frequency
Pull Store polls the system every N minutes Security constraints

Important rule: when importing, update only stock_qty, do not touch reserved_qty. Otherwise, active reservations will be lost. 1C synchronization ensures real-time parity.

Storefront display and query optimization

For customers, seeing real availability is important. We compute the available quantity and display:

  • If available_qty > low_stock_threshold — "In stock".
  • If 0 < available_qty ≤ low_stock_threshold — "Only N left".
  • If available_qty = 0 — "Out of stock".
  • If pre-order is configured — "Available on order, 5–7 days".

For high-load pages, the status is cached in Redis with a TTL of 60 seconds. When listing products, a typical mistake is N+1 queries: selecting stock separately for each variant. Use withCount or window functions. For PostgreSQL:

SELECT p.*, SUM(sm.delta) OVER (PARTITION BY sm.variant_id) AS current_stock FROM products p LEFT JOIN stock_movements sm ON sm.variant_id = p.id WHERE ... 

This query runs in a single pass. For large catalogs, aggregate data in Redis via a scheduled job.

Setting up low stock notifications

Notifications to the purchasing manager are triggered when stock_qty drops below the threshold. In Laravel, this is an observer:

class ProductVariantObserver { public function updated(ProductVariant $variant): void { if ($variant->wasChanged('stock_qty') && $variant->isLowStock()) { LowStockAlert::dispatch($variant); } } } 

The alert is sent to email, Telegram, or Slack. SMS can be configured for critical items. Implementing this prevents overselling and reduces losses.

What's included in the work

  • Documentation on data schema and API
  • Handover of source code and repository access
  • Training for administrators on the panel
  • 30-day warranty support after deployment

Project delivery: process, scope, and timeline

  1. Design the data schema and choose reservation methods.
  2. Implement atomic operations with concurrency testing.
  3. Set up reservation release (TTL or cron).
  4. Integrate with external accounting systems (1C, MoySklad).
  5. Develop an admin panel with filters and export.
  6. Load testing and deployment.

Included: documentation, training, support. The scope covers full warehouse management system development.

Stage Time
Basic reservation + log 3–5 days
Integration with accounting system +3–5 days
Caching and storefront display +2 days
Admin panel for inventory +2–3 days
Total 1–2 weeks

A properly designed stock system reduces losses from overselling by 15–20% and eliminates manual control. For example, for a store with 5,000 orders per month, eliminating overselling preserves up to 150,000 rubles in monthly revenue. Additionally, purchase automation saves up to 100,000 rubles per month on a logistics manager's salary. Implementing atomic reservation can increase annual revenue by up to 1,800,000 rubles for a mid-sized store.

We have 5+ years of experience, 50+ completed projects, and have been on the market since 2019. We offer turnkey inventory management systems starting at $4,000, delivered in 1–2 weeks. Contact us for a free project estimate.