Case study · Laravel · marketplaces · updated November 18, 2026

Book Processing Pipeline

A CRM for a second-hand bookstore: from book photos to listings, orders and inventory reconciliation. AI recognition, comparable-book search, pricing management and a shared catalog for Ozon, Wildberries, Yandex Market and Avito.

4platforms in one CRM
7pipeline stages
1shared inventory ledger

The challenge

Each second-hand book has its own photos, condition and price. Often there is only one copy, although inventory may include several copies of the same book. Each item needs its bibliographic details extracted, comparable editions found, a price calculated and listings prepared for different platforms. Once an order arrives, available stock must be recalculated to account for reservations.

The system handles repetitive operations. An operator photographs the book, records its shelf location, checks its condition and reviews uncertain details. Recognition, listing enrichment and marketplace data exchange run in background queues.

The main constraint is that every storefront shares the same physical inventory. An order must reduce availability on the other platforms. External APIs introduce delays, so stock updates require confirmation, retries and separate discrepancy monitoring.

Seven pipeline stages

  1. Intake and photography

    A batch is registered through a single bulk-entry screen: SKUs are assigned automatically and photos are uploaded in batches. The photographer role is deliberately limited to this screen, preventing intake staff from changing the rest of the catalog.

    Blade + Alpine · image uploads and rotation · Intervention Image
  2. Recognition from photos

    A vision model reads the cover and publication details: title, author, publisher, ISBN, year, series, binding and age rating. A separate pass checks titles written in all caps. The corrected capitalization is accepted only if the text still matches the original when case and punctuation are ignored.

    Dimensions and weight come from size templates. The model identifies the book's size class, and the template supplies measurements in millimeters and grams suitable for marketplace listings.

    OpenAI Vision · openai / mock drivers · queue heartbeats and automatic restarts
  3. Finding comparable books

    Two separate Node services use Playwright to search Wildberries and Ozon in a real browser, with session cookies, proxies and health checks. Yandex Market is queried through its API. Results are matched against the book's title, author and ISBN, with a numeric similarity score.

    Express + Playwright in separate containers · Shadowsocks proxy · timeouts and fallbacks
  4. Price estimation

    Pricing rules translate the bookseller's judgment into code. Only comparable books with the same binding are considered; digital editions are excluded, outliers are filtered using ratios to the median, and a minimum price applies. The selling price is derived by applying a discount to the base price, with a premium for an author's signature.

    If comparable prices vary too widely, an AI reviewer selects a reference group and explains its decision to the operator.

    Median and mean · outlier filtering · manual prices protected from overwriting
  5. Listing preparation and publication

    The system generates descriptions and hashtags, selects the Ozon category and its required attributes, and builds a payload for each platform. Publication runs as a background job with retries, a dry-run mode and readable explanations of marketplace errors.

    A separate layer checks for duplicates to prevent a second listing for the same book. An existing sold Ozon listing can be reused instead of creating a new one.

    Publication logs and diagnostics · duplicate checks · publication across platforms
  6. Orders

    Orders arrive through marketplace webhooks and scheduled polling of seller accounts. Each order has an event timeline, including returns and confirmation that the item has reached the warehouse.

    Ozon and Yandex Market webhooks · order polling, including WB · timelines and returns
  7. Inventory

    The shared inventory ledger distinguishes physical quantity, reserved quantity and available stock. Confirmed order events are recorded as inventory movements. Updates are sent to connected platforms and verified by reading their state back. Hourly reconciliation identifies discrepancies: confirmed errors can be corrected from the interface, while uncertain cases require a manager's review.

    Auditable inventory movements · versioned stock updates · duplicate deduction protection

Four platforms, different integration rules

The CRM supports multiple seller accounts. Each platform has its own listing formats, warehouse model and moderation rules. Ozon, Wildberries and Yandex Market use their respective APIs; Avito adds an XML feed for automatic imports alongside API synchronization. Automatic publication and stock updates are enabled separately in account settings.

Ozon

  • Category and attribute synchronization, including book category selection
  • Content ratings and checks of actual selling status
  • Discounts from the book's base price, bulk repricing and API confirmation
  • Warehouses, stock, product imports and catalog reconciliation
  • Reuse of sold listings and correction of incorrect sold statuses
  • A dedicated search microservice with proxy support

Wildberries

  • Listings, prices and reports for each seller account
  • Delayed stock activation for new listings and recovery of stalled updates
  • A dedicated list of title issues and publication of eligible books from the imported catalog
  • Browser-based comparable-book search with cookies and optional proxy support
  • Logs for publication, errors and deferred stock updates

Yandex Market

  • Seller account access checks and book category selection
  • Listing publication and final status confirmation
  • Product imports and hourly stock synchronization
  • Order polling linked to the shared inventory ledger
  • Repricing for a selected account, with availability and open-order checks

Avito

  • Listing preparation and a protected XML feed for automatic imports
  • Listing imports with exact matching by the feed item identifier
  • Photos, promotional media, a video link and pricing from account settings
  • Orders, publication logs, stock and history in the shared CRM screens
  • Separate controls for automatic publication and stock updates

Avito is integrated into the CRM and has been verified on a limited set of listings. At the time of this update, automatic publication and stock updates remain disabled in the account; expanding the integration requires enabling them separately. Available operations depend on the account's access permissions. If the API does not confirm a quantity, it is shown as unknown: an empty response is not treated as zero stock.

Managing prices after publication

Estimating a book's price once is not enough: changes must reach existing listings consistently. The CRM stores the book's base price, while discount rules are configured per seller account. Ozon and Yandex Market support background bulk repricing with progress tracking, reasons for skipped items and API verification of the result.

Before changing a price, the system checks product identifiers, available stock, reservations and open orders. Clicking the action again does not start a second concurrent run. If the marketplace has not confirmed the new price, the update is not marked as successful.

Account settings · repricing queue · exception logs · API read-back verification

A published listing is not necessarily available for sale

A listing can exist in a catalog without being available to buyers: it may be under moderation, disabled, affected by an error or out of stock. The CRM therefore collects actual selling statuses from Ozon, Wildberries and Yandex Market separately.

A dedicated snapshot stores the result and the time of the check. This distinguishes a listing's existence from its availability to buyers and the state of warehouse inventory. Managers can see why records differ, publish a missing listing, correct its details or investigate the sales history.

Keeping the system reliable

Much of the code handles what happens after a routine operation goes wrong: an API returns an error, a job fails, stock figures diverge or package dimensions fail moderation.

  • Stock discrepancy detection — hourly snapshots distinguish confirmed errors, uncertain sales, incorrect product links and missing data. Automatic correction requires sufficient supporting evidence.
  • Dimension audits — identify listings with invalid weight or dimensions, build a correction plan and apply it through a background job.
  • Catalog reconciliation — match listings across platforms, check duplicates and product links, and identify missing publications. Imported products must pass price, photo, shelf-location and stock checks before publication.
  • Pipeline health dashboard — shows books stuck between stages and lets operators restart recognition without using the command line.
  • Backups — separate jobs cover the database and photos; internal operational data is stored outside the public directory.
  • Tests and production database protection — checks cover publication, prices, orders, repeated processing and inventory movements. Test runs include safeguards against connecting to the production database.

Architecture

Backend
PHP 8.4 — books, marketplace listings, orders, reservations and inventory movements
Laravel 13 — Eloquent, queues, scheduler and Sanctum
MySQL — transactions, locks and indexes for catalog queries
PhpSpreadsheet — stock imports from supplier spreadsheets
Frontend
Blade — warehouse, catalog, publication and reconciliation screens
Alpine.js — focused interactivity without an SPA
Tailwind 4 — built with Vite
Roles — administrator, manager, moderator and photographer
Infrastructure
Docker — nginx, PHP-FPM, MySQL and workers managed by Supervisor
Node · Playwright — two containerized search microservices
Certbot — TLS with automatic renewal
Proxy — a Shadowsocks container for marketplace search
Integrations
Ozon Seller API — catalog, listings, warehouses and orders
Wildberries API — listings, prices, stock and reports
Yandex Market API — listings, stock and orders
Avito — XML imports, listing and order APIs
OpenAI — recognition, descriptions and price review

The result

The project has grown from a listing pipeline into a working CRM for a bookstore: four platforms in a shared catalog, account-level pricing, orders, reservations, operation history and reconciliation against actual storefront status.

Repetitive tasks run in the background. Managers handle exceptions: an uncertain valuation, a moderation error, unconfirmed stock or conflicting history. Each operation has a status and diagnostics, so issues can be identified and investigated within the CRM.

Read the project overview in the portfolio

Laravel 13 · PHP 8.4 · MySQL · Docker · Playwright · OpenAI · Ozon · Wildberries · Yandex Market · Avito


Let’s discuss your project

Tell me what you would like to build. I will reply by email.

Or message me on Telegram @ifwcom