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 https://example.picqer.com/api/v1/products/{idproduct}/stock
HTTP/1.1 200 OK [ { "idwarehouse": 1, "stock": 22, "reserved": 1, "reservedbackorders": 0, "reservedpicklists": 1, "reservedallocations": 0, "freestock": 21 }, { "idwarehouse": 3835, "stock": 2, "reserved": 0, "reservedbackorders": 0, "reservedpicklists": 0, "reservedallocations": 0, "freestock": 2 } ]

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.

GET https://example.picqer.com/api/v1/products/{idproduct}/stock/{idwarehouse}
HTTP/1.1 200 OK { "idwarehouse": 1, "stock": 22, "reserved": 1, "reservedbackorders": 0, "reservedpicklists": 1, "reservedallocations": 0, "freestock": 21, "locations": [ { "idlocation": 8, "idwarehouse": 1, "name": "A.1.1.5", "stock": 0, "reserved_picklists": 0, "free_stock": 0, "is_bulk_location": true }, { "idlocation": 5, "idwarehouse": 1, "name": "A.1.1.2", "stock": 0, "reserved_picklists": 0, "free_stock": 0, "is_bulk_location": false }, { "idlocation": 3, "idwarehouse": 1, "name": "A.1.1", "stock": 16, "reserved_picklists": 1, "free_stock": 15, "is_bulk_location": false } ] }

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

POST https://example.picqer.com/api/v1/products/{idproduct}/stock/{idwarehouse}
{ "idlocation": 5, "change": 6, "reason": "Purchased inventory" }
HTTP/1.1 200 OK { "idwarehouse": 1, "stock": 28, "reserved": 1, "reservedbackorders": 0, "reservedpicklists": 1, "reservedallocations": 0, "freestock": 27, "locations": [ { "idlocation": 8, ... }, { "idlocation": 5, "idwarehouse": 1, "name": "A.1.1.2", "stock": 6, "reserved_picklists": 0, "free_stock": 6, "is_bulk_location": false }, { "idlocation": 3, ... } ] }

No specific location

Another example to lower the stock on no specific location:

POST https://example.picqer.com/api/v1/products/{idproduct}/stock/{idwarehouse}
{ "idlocation": null, "change": -2, "reason": "Stock count corrections" }
HTTP/1.1 200 OK { "idwarehouse": 1, "stock": 26, "reserved": 1, "reservedbackorders": 0, "reservedpicklists": 1, "reservedallocations": 0, "freestock": 25, "locations": [ { "idlocation": 8, "idwarehouse": 1, "name": "A.1.1.5", "stock": 0, ... }, { "idlocation": 5, "idwarehouse": 1, "name": "A.1.1.2", "stock": 6, ... }, { "idlocation": 3, "idwarehouse": 1, "name": "A.1.1", "stock": 16, ... } ] }

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.

POST https://example.picqer.com/api/v1/products/{idproduct}/move-stock
{ "amount": 1, "from": { "idlocation": 8 }, "to": { "idlocation": 5 } }
HTTP/1.1 200 OK { "amount": 1, "from": { "location": { "idlocation": 8, "idwarehouse": 1, "type": "location", "name": "A.1.1.5", ... }, "warehouse": { "idwarehouse": 1, "stock": 26, "reserved": 1, "reservedbackorders": 0, "reservedpicklists": 1, "reservedallocations": 0, "freestock": 25, "locations": [ { "idlocation": 8, "idwarehouse": 1, "name": "A.1.1.5", "stock": 1, "reserved_picklists": 0, "free_stock": 1, "is_bulk_location": true }, { "idlocation": 5, "idwarehouse": 1, "name": "A.1.1.2", "stock": 7, "reserved_picklists": 0, "free_stock": 7, "is_bulk_location": false } ] } }, "to": { "location": { "idlocation": 5, "idwarehouse": 1, "type": "location", "name": "A.1.1.2", ... }, "warehouse": { ... same warehouse object as in "from" ... } } }

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.

POST https://example.picqer.com/api/v1/products/{idproduct}/move-stock
{ "amount": 2, "from": { "idlocation": null, "idwarehouse": 1 }, "to": { "idlocation": 8 } }
HTTP/1.1 200 OK { "amount": 2, "from": { "location": null, "warehouse": { "idwarehouse": 1, "stock": 26, ... "locations": [ ... ] } }, "to": { "location": { "idlocation": 8, "idwarehouse": 1, "type": "location", "name": "A.1.1.5", ... }, "warehouse": { ... same warehouse object as in "from" ... } } }

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.

POST https://example.picqer.com/api/v1/products/{idproduct}/move-stock
{ "amount": 5, "from": { "idlocation": 8 }, "to": { "idlocation": null, "idwarehouse": 2 }, "reason": "Restocking store warehouse" }
HTTP/1.1 200 OK { "amount": 5, "from": { "location": { "idlocation": 8, "idwarehouse": 1, "type": "location", "name": "A.1.1.5", ... }, "warehouse": { "idwarehouse": 1, "stock": 21, "reserved": 1, "reservedbackorders": 0, "reservedpicklists": 1, "reservedallocations": 0, "freestock": 20, "locations": [ ... ] } }, "to": { "location": null, "warehouse": { "idwarehouse": 2, "stock": 5, "reserved": 0, "reservedbackorders": 0, "reservedpicklists": 0, "reservedallocations": 0, "freestock": 5, "locations": [] } } }