Out of Stock Recommendations
Miso's Recommendation Engine can help keep customers exploring on your site, even when certain products are out of stock.
Introduction
It’s common for things to be out of stock. Whether it’s because of a seasonal sale, a viral new trend, or supply chain issues, it is undoubtedly a frustrating experience for retailers looking to build customer loyalty and for customers trying to purchase the products they want. Here are some scenarios where this sentiment is all-too-familiar:
- Adding a product to the shopping cart and returning shortly after to find it’s no longer available
- Receiving an email for a clearance sale, only to find no products in your size
- Seeing an interesting product in the search results, only to find it’s unavailable in the product detail page
In this article, we’ll take a look at techniques you can employ on your site to keep customers exploring products and drive conversions, even when certain products are out of stock.
Do it with APIs
Handling Out of Stock recommendation scenarios simply requires two steps: (1) sending product inventory data to Miso and (2) using the Product to Products API to recommend in stock products.
Sending product inventory data to Miso
You can periodically upload inventory data to Miso with the Products API, using any upload schedule that makes sense for your business. The availability
field in the product catalog can be updated with values such as "IN_STOCK"
or "OUT_OF_STOCK"
. You can also create a custom attribute such as "custom_attributes.inventory_amt" : int
to track the exact quantity available.
Here’s a sample request for updating inventory data, using both the availability
field and a custom attribute called inventory_amt
.
//Sample Request
POST /v1/products
{
"data" : [
{
"product_id" : "Sony_PS5_Digital",
"availability" : "OUT_OF_STOCK",
"custom_attributes" : {
"inventory_amt" : 0
}
}
]
}
There are several key benefits to sending inventory updates to Miso:
- Fewer API calls - By consolidating inventory data, you can make fewer API calls when loading web pages and create a more responsive browsing experience for your customers.
- Train your engine - Have Miso’s Recommendation Engine account for inventory data during training to rank items lower if they’re out of stock.
- Strategically merchandise based on inventory - Miso supports various merchandising tools, such as filtering, boosting, and anchoring, to fine-tune your product recommendations based on inventory level.
Use the Product to Products API to show similar products
Suppose a customer clicks on a product details page and sees the item they are interested in is out of stock - or a customer adds an item to their cart and returns a while later to find out that it is no longer available. In these cases, it is advantageous to provide the customer with a “Similar Products” carousel. With a single API call, Miso’s Product to Products API can be used to recommend products that are similar to the out of stock product.
In this example, a customer is looking for some whole wheat bread, only to find that their go-to brand is out of stock. We’ll use the Product to Products API to recommend similar products, based on the product_id
, and using a filter (fq
) to ensure the recommended products are in stock.
//Request
POST /v1/recommendation/product_to_products
{
"user_id" : "user-123",
"product_id" : "daves_killer_whole_grain_27oz"
"fq" : "availability:\"IN_STOCK\"" //only recommend in stock products
}
//Response
{
"data" : {
"products" : [
{
"product_id" : "simple_truth_whole_grain_17oz"
"availability" : "IN_STOCK"
},
{
"product_id" : "sara_lee_whole_grain_15oz"
"availability" : "IN_STOCK"
}
]
}
}
Miso’s Product to Products API will return related items - the Simple Truth whole grain bread and the Sara Lee whole grain bread - which are comparable substitutes for someone looking to make a sandwich.
For more information on the Product to Products API, check out our Product to Products API documentation.
Tips and Tricks
- If you’d like to entirely exclude out of stock products from being recommended, you can filter the results using the
fl
parameter. For more information on filtering, check out our Filtering Recipe.
Additional Resources
For more information on Miso’s Recommendation API, check out the official API Documentation.
For more recipes like this, visit the Recipes page on our Docs site.
Published Date: March 18th, 2022
API Reference
Need more info on the API? Check out our dedicated API page with all the info you could ever want.
Read API Reference