Skip to main content

Stock services

Introduction​

Hii Retail's stock handling keeps track of how much of each item exists in each store, what that stock cost, and every movement that changed it.

It is built around one idea: stock is not stored as a number that gets overwritten — it is calculated from an immutable ledger of transactions. Every sale, delivery, count, correction and transfer is recorded as a transaction that can never be changed, and the current quantity is the sum of those transactions. That is what makes it possible to answer "why is the quantity 7?" long after the fact, and to correct history without losing the original record.

Stock is the total of a ledger, not a number that is overwritten. In the Stockholm store, coffee receives a delivery of 24, sells 3 and then 1, and a stock count finds 18 where 20 were expected, a loss of 2. Each event adds a row that is never changed, and the quantity, 18, is the sum of the rows.

Where to start​

If you want to…Read
understand what the service calculates and how it fits togetherStock processing
know how movements and master data get into the serviceData sources
understand stock types, batches, and the sign of a quantityThe stock model
see which business operations are supportedOperations
read stock quantities from an application or POSQuery API
subscribe to stock events as an external systemExternal Events
let an external ERP own the stock insteadSynchronizing stock

The two API services​

  • Query API
    • Read stock quantities, search transactions, and run inventory reports. Used by the POS, by Hii Retail applications, and by customer integrations.
  • Input API
    • Submit stock movements that do not already arrive from another Hii Retail service.

Most movements do not need the Input API — sales, goods received, stock counts, corrections and store transfers already flow in automatically from other Hii Retail services. See Data sources for the full picture.

Sales from the tills, deliveries, stock counts, corrections and store transfers reach Stock Transaction Processing from other Hii Retail services, and an ERP or warehouse system can send movements through the Input API. Item settings, purchase prices and bundle links come from PnP. Stock Transaction Processing keeps the ledger and the quantities, which the POS and apps read through the Query API, and publishes stock levels and processed transactions that your systems and Stock Count subscribe to.

Concepts​