Inventory Updates
Inventory Updates
There a 2 ways in which the inventory count for a product can be updated and below we'll describe both, presenting the advantages and disadvantages of using them.
1. Full inventory flow via dedicated features.
The first solution is what we recommend for the majority of use cases and definitely for all the stores where Lightspeed Retail (X-Series) is the source of truth for all the inventory and cost information.
To achieve this, all inventory adjustments should be done by using the dedicated functions.
E.g. e-commerce orders coming from another system should be submitted as sales, supplier deliveries should be logged as stock orders (consignments with type SUPPLIER
) and manual adjustments should be performed with inventory counts.
This approach ensures that the product will have a consistent history where all changes can be attributed to specific operations. It enables accurate inventory cost and discrepancy reporting as well as correct margin calculations for sales reports.
2. Direct update on the product.
The second way works by directly modifying the inventory record associated with the product. It's important to note that while this solution is much easier to implement it has some serious drawbacks in terms of data consistency. First of all, when used, it will create very non-specific product history records. Secondly, using this method will adversely affect the attributed cost information for the product.
Update request
In order to update the count for a specific product in a particular outlet a PUT request can be made to the /api/2.1/products/{id}
endpoint with the following payload:
{
"details": {
"inventory": [
{
"outlet_id": "b8ca3a65-0183-11e4-fbb5-2816d2677218",
"current_amount": 21,
"reorder_point": 5,
"reorder_amount": 10
}
]
}
}
It is also possible to change just the current_amount
value by sending a payload like:
{
"details": {
"inventory": [
{
"outlet_id": "b8ca3a65-0183-11e4-fbb5-2816d2677218",
"current_amount": 21
}
]
}
}
WARNING: It is important to note that using a payload where
reorder_point
andrestock_level
are included in the payload but havenull
values, will set those values to an empty string. If it's important to preserve the original value for those attributes, they should be either submitted in the payload with the value or omitted completely in the request.
Updated 4 months ago