Disabling active SKUs using the Incremental Feed API
When a product on your e-commerce site is no longer available, you can use the Incremental Feed API to disable the active stock keeping unit (SKU).
You can only disable SKUs that were previously made active as a result of running the full product data feed. You cannot make a SKU active again using the Incremental Feed API. To re-enable a SKU, you must pass the active status as part of the full product feed.
The following diagram shows how Sitecore Discover might process SKU status changes in a sequence of full product feeds running at regular intervals, and incremental product feeds running in between.
To disable an active SKU using the Sitecore API Incremental Feed, you pass the stock_quantity attribute with the value 0 (zero), as shown in the following example:
{
"data": {
"products": [
{
"sku": "123",
"attributes": {
"stock_quantity": 0,
}
},
}
]
}
}If your Discover implementation is set up for B2B or multistore support, you pass the store or customer ID and the stock_quantity attribute to disable the SKU for the specified store or B2B customer, as shown in the following example:
{
"data": {
"products": [
{
"sku": "123",
"store": {
"id": "STORE001"
},
"attributes": {
"stock_quantity": 0,
}
},
]
}
}If your Discover implementation is set up for B2B or multistore support, and you use restriction to manage product availability for each store or customer, you pass the store or customer ID, and the restriction object to disable the SKU for the specified store or customer:
{
"data":{
"products":[
{
"sku": "8096540",
"attributes":{
},
"restriction":{
"isAvailable": false
},
"store":{
"id": "online"
}
}
]
}