Check Stock Level
Version: 1.2 | Release Date: 07/02/2024
# Scenario
ABC Fruit Company has experienced significant success as a result of its marketing campaign, leading to an increase in online orders through their web store.
This surge in demand has placed considerable strain on the delivery team, who have discovered that certain products are in short supply.
Consequently, customer service representatives are occupied with contacting customers to delay deliveries.
To prevent a similar crisis in the future, Chris has been consulted.
Chris has decided to implement a feature in the online store that checks the inventory level before customers add products to their cart.
# Refer to the document
The Web Service that can help us achieve this is Get Inventory Level per Product.
HTTP Request
GET http://[server]/jsf/rfws/erp/trdg/stock/viewLocLvl/{beId}/{proId}
Parameters
Name | Type | Description |
---|---|---|
beId | int (Path) | Required. Business entity ID |
proId | int (Path) | Required. Product ID (0 means all) |
unitId | int (Query) | Unit ID (in Product's unit table). If provided, result will return quantity in this unit. By default, result will return in base unit. |
tranId | int (Query) | Skip transaction ID. If provided, this transaction will be excluded from the calculation of the result. |
tranType | string (Query) | The transaction type of tranId . |
locTypeId | int (Query) | Location Type ID. If provided, result will be filtered by this location type. |
asAt | date (Query) | As at date. The date stock level calculated up to. |
showLoc | boolean (Query) | If true , result will be grouped by location. |
showLotno | boolean (Query) | If true , result will be grouped by Lot number. |
includeNonApv | boolean (Query) | If true , result will include non-approved records. |
excludeExpiredLoc | boolean (Query) | If true , result will be exclude expired location. |
locId | int (Query) | Location ID. If provided, result will be filtered by this location |
includeUc | boolean (Query) | If true , result will be include AVG uc (Entity Currency) |
The two necessary parameters are beId
and proId
, which stand for Business Entity
and Product
, respectively.
As previously discussed, to obtain the ID of a Business Entity
or Product
, please refer to the provided FAQ.
# Parsing of responses
A typical response is shown below
{
"basicUnitId":52,
"basicQty":7000.0,
"basicCode":"RTUNIT",
"locCode":"L0001-A",
"lotno":"RT01_OPENINGS",
"proId":3081,
"qty":7000.0,
"unitCode":"RTUNIT",
"unitId":3791,
"lotnoLot":"A",
"locType":31,
"locId":40.0,
"lotNoId":1681.0
}