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 together | Stock processing |
| know how movements and master data get into the service | Data sources |
| understand stock types, batches, and the sign of a quantity | The stock model |
| see which business operations are supported | Operations |
| read stock quantities from an application or POS | Query API |
| subscribe to stock events as an external system | External Events |
| let an external ERP own the stock instead | Synchronizing 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
- Stock processing — what the service does
- Data sources — where transactions and master data come from
- The stock model — stock types, batches, quantities and signs
- Operations — the supported business operations
- Multiple transactions — why one operation can produce several transactions
- Synchronizing stock — running with an external system as master
- Structured items — bundles and packages
- Cost calculations — FIFO, FEFO, LIFO and average cost
- Delayed transactions — handling movements that arrive out of sequence
- Configuration — tenant, store and item settings
- Query API — reading stock
- External Events — subscribing to stock events