Product stock
Products in Picqer have stock: the amount of a product that is physically in the warehouse.
Stock is registered per warehouse, and (optionally) per location.
Locations and non-location stock
A location is a specific bin or shelf in the warehouse. Stock for a product can be registered at a specific location, or on "no specific location" in a warehouse. If you see the stock for a warehouse, this is always the total stock for all locations in that warehouse and the stock on no specific location.
Changing and moving stock
You can change the stock by adding, removing or setting the stock level. You can do this for a specific location or for the stock without a specific location. When lowering the stock, keep in mind that stock cannot be negative or lower than is reserved for picklists.
You can move stock between locations in the same warehouse, and between warehouses.
Get stock for single product
Requesting the stock for a product gives you the total stock for the warehouse.
Get stock in single warehouse
When you request the stock for a product in a specific warehouse, you get all the linked locations and the stock per location.
Change stock
With this endpoint you can change the stock for a product. Either the stock on a specific location, or on "no specific location".
You can either 'change' the stock to add or remove stock, or set the stock to a specific 'amount'.
Heads up: Property "idlocation" is optional for backwards compatibility, but we advise to always provide the "idlocation" property to be explicit of your intent.
Give the id of the location you want to change the stock of, or give `null` if you want to change the stock on "no specific location". If you omit the idlocation property, Picqer will try to find a matching location or use "no specific location" if it cannot find a good location candidate.
Attributes
| Name | Type | Required | Description |
|---|---|---|---|
| idlocation | integer | optional, but recommended | Linked to resource Locations, or `null` for no specific location |
| change | integer | required if `amount` not provided | Positive number to add stock, negative number to remove stock |
| amount | integer | required if `change` not provided | Amount of stock to set, overrides current stock level. Do not provide `idlocation` if you provide this attribute. |
| reason | string | required | Reason of the change |
Add stock to a location
No specific location
Another example to lower the stock on no specific location:
You can only change stock of active products of type 'normal' or 'composition_with_stock'.
Move stock
With this endpoint you can move stock between locations in the same warehouse, between "no specific location" and a specific location, and between warehouses.
You can only move stock of active products of type 'normal' or 'composition_with_stock'.
The endpoint `POST /api/v1/products/{idproduct}/stock/{idwarehouse}/move` (with attributes `from_idlocation`, `to_idlocation` and `amount`) is deprecated. It keeps working for existing integrations, but new integrations should use the `move-stock` endpoint documented below.
Attributes
| Name | Type | Required | Description |
|---|---|---|---|
| amount | integer | required | Amount of stock to move |
| from | object | required | Source of the movement |
| from.idlocation | integer/null | required | Source location, linked to resource Locations, or `null` for "no specific location". The key must always be present. |
| from.idwarehouse | integer | required when `from.idlocation` is `null` | Source warehouse. When both are given, the location must be in this warehouse. When only `from.idlocation` is given, the warehouse is derived from the location. |
| to | object | required | Target of the movement, same structure as `from` |
| to.idlocation | integer/null | required | Target location, or `null` for "no specific location". The key must always be present. |
| to.idwarehouse | integer | required when `to.idlocation` is `null` | Target warehouse |
| reason | string | required when moving between warehouses | Reason of the movement, shown in the stock history |
Move between locations in the same warehouse
Move directly between 2 specific locations by giving those idlocations. The warehouse is derived from the locations. You can move reserved stock: reservations for picklists move along to the target location.
Move from "no specific location" to a location
Use value `null` for `idlocation` if you want to move from or to "no specific location". Because the warehouse cannot be derived from a `null` location, `idwarehouse` is required.
Move between warehouses
To move stock between warehouses, give a `from` and `to` in different warehouses. A `reason` is then required. Only free stock can be moved between warehouses: stock that is reserved for picklists cannot leave its warehouse.

