graduation-capAvailability Tutorial

How to specify availability, popularity, or stock level for a product

circle-exclamation

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

circle-exclamation

To add availability-related information for a specific product, you need to send a request to the Creating a new availability for a productarrow-up-right endpoint.

circle-check
rectangle-terminalAPI Referencechevron-right

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:

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 availabilityarrow-up-right endpoint with the product's ID in the request body.

circle-exclamation
circle-check
rectangle-terminalAPI Referencechevron-right

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.

circle-exclamation

Before you start

Make sure the following requirements are fulfilled:

  • You have already created all products that make up the bundle.

circle-exclamation
  • You have already specified stock levels for all products that make up the bundle.

circle-exclamation
  • You have already created a product bundle.

circle-exclamation

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 availabilityarrow-up-right endpoint with the product bundle's ID in the path.

circle-check
rectangle-terminalAPI Referencechevron-right

The response includes both the availability information of the bundle as a whole, as well as the bundled products.

Last updated

Was this helpful?