Query api
Stock Query API
Introduction
The Stock Query API is to be used by the POS (or other services) for fetching the stock quantity. The POS can use this API independent of the source being used.
The Stock Query API can support different sources for the stock:
- External systems
- Plugins for external systems like SAP, M3, etc can be developed.
- Note: Since systems like SAP, M3, etc, are often customized/adjusted for each customer, the plugins might end up being customer-specific.
- Note: Some ERP systems are not updating the stock quantity in real-time, hence this plugin could risk fetching outdated quantities.
- Hii Retail Stock service
- Plugin for fetching stock quantity from Hii Retail Stock service.
- Hii Retail Stock service could:
- be master of the stock
- be a slave, i.e. an external system being master for stock synchronizes the stock in real-time (or any other schedule) to make the stock available for other Hii Retail services.
- be partly slave, partly master:
- being synchronized regularly, for instance, every night.
- between each synchronization, the Hii Retail Stock service processes the PosLog transactions to ensure stock quantity is updated in real-time when sales are done.
Note: Currently, the only plugin created is for fetching the stock quantity from Hii Retail Stock service.
APIs
- Stock quantity
- An API for fetching stock quantity for one or several items, for specified business unit(s).
- Stock quantity for nearby business units
- An API for fetching stock quantity for one or several items, for nearby business units. Nearby business units are first fetched from Business Unit Management (BUM), and then the stock quantity is fetched for those business units.
Plugins
Currently, only a plugin for fetching stock quantity from the Hii retail Stock service is created. However, the Stock Query API can in the future support fetching stock quantity from external systems. This would need to be configurable, so for instance POS in tenant A could fetch stock quantity from Hii Retail Stock service, while POS in tenant B fetch stock quantity from an external ERP system like in the high-level architecture below: