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.

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.

Concepts