Availability Tutorial
How to specify availability, popularity, or stock level for a product
Information about a specific product's availability, popularity, and stock levels is stored inside the Availability object.
Take a look at the relationships between the Availability object and other resources in the Emporix Commerce Engine:
Before you start
Make sure you created a product. For more information, check out How to add your first product.
Create the Availability object
To add availability-related information for a specific product, you need to send a request to the Creating a new availability for a product endpoint.
Manage product availabilities in bulk
You can also manage multiple availabilities for a product at once. A single product can have different availabilities per site, so each availability entry is identified by the combination of productId and site.
To create or update multiple product availabilities at once, send a request to one of the following endpoints:
Upserting multiple availabilities information of a product Example bulk request:
In this example, the same product has different availability on two sites: site-a and site-b where both records are created in a single bulk operation.
Retrieve the availability information of a product
To check if a product's availability was added successfully, you need to send a request to the Retrieving a product's availability endpoint with the product's ID in the request body.
How to calculate a product bundle's stock level
The Availability Service makes it possible to automatically calculate the stock level of a product bundle. The value is always equal to the lowest stock level of the bundled products.
Before you start
Make sure the following requirements are fulfilled:
You have already created all products that make up the bundle.
You have already specified stock levels for all products that make up the bundle.
You have already created a product bundle.
Retrieve the product bundle's availability information
To find out what the stock level of a product bundle is, you need to send a request to the Retrieving a product's availability endpoint with the product bundle's ID in the path.
The response includes both the availability information of the bundle as a whole, as well as the bundled products.
Last updated
Was this helpful?

