To optimize order routing and provide an overview of how many pieces of an article are in a facility or across the whole network, we use the stock entity.
Besides some other properties, you might have noticed reserved and facilityWideReserved. When there is a PickJob inside the facility which needs this stock or this article in the facility, the stock will be reserved until it is picked. When the item is picked, the reservation will be removed and the amount of stock will be decreased.
Bulk stock update
When updating stock, it is recommended to use the bulk PUT /api/stocksendpoint to regularly push stock level updates by SKU (tenantArticleId) and facility while minimizing the number of calls.
In the following example, all stocks of tenantArticleId4711 are updated.
The stock version and ID must be sent for an update. Otherwise, a new stock is created.
Search stock for obtaining the ID and version
First, stocks needs to be searched to obtain the IDs and versions of all stocks that exist for the respective tenantArticleId.
When stock should be updated per facility, the facilityRef must be included in the search query.
It might be necessary to iterate over multiple pages to get all stocks with the corresponding tenantArticleId. More information can be found under Pagination.
After creating the stock, a 200 OK response and the status UPDATED indicate a successful update.
The response includes additional fields that are automatically set. For example, the receiptDate is automatically set to the creation date of the stock. The traits automatically default to PICKABLE and ACCESSIBLE meaning that the stock will be available for incoming orders.
Versionless stock update
The UPDATE_VERSIONLESS action in the stock actions REST API enables versionless creation or update of stock quantities. This means users can update operations without without first retrieving the current stock version, helping reduce the total number of API calls.
Supports a maximum of 100 stock entries in a single request.
Executes with an all-or-nothing behavior; the request succeeds only if all stock records are processed.
Supports two operation types:
CREATE – Creates a new stock record for a specific tenantArticleId and facilityRef.
UPDATE – Updates an existing stock record identified by id.
To create or update stock without a version, use the endpoint of our API:
You can update stock that already has a version number using this endpoint.
The response format matches the structure of the stock upsert API.
Deleting stock by product / location / id in batch
To delete stocks by product, location or idm use the actions-endpoint of our API:
For deleting all stocks for a product in a facility, use the DELETE_BY_PRODUCTS action
For deleting all stocks on a storage location in a facility, use the DELETE_BY_LOCATIONS action
For deleting multiple stocks in a facility in one call, use the DELETE_BY_IDS action
Move stock to location
To move stock to a location, use the action MOVE_TO_LOCATION.
Note: In the options of the action the deleteFromStockIfZero is available. If this is set to true, the stock on the start location is deleted when value reaches 0, after move action was completed (even when the KEEP_ON_ZERO trait is active on the respective location).
Create safety stock
The PUT safetyStock endpoint lets us create the safety stock in a bulk operation:
The 207 MULTI-STATUS status code indicates success, the payload shows the status for each entity: