Product States
General
In SCAYLE, products can have different states: live, draft, problem, blocked, inApproval and new. To set the product state to live, a product will first be validated by the following rules:
- The product is not missing any mandatory attributes (for configured mandatory attribute groups).
- The product has at least one image or document (if configured as mandatory).
- The product does not include blacklisted terms (if the feature is enabled).
- The product does not have the same differentiating attribute as other products of the same master (if the feature is enabled).
- The product passes all other filters (e.g., product/variant is neither deleted nor blocked).
Not all state transitions are allowed. For example, a live product can not be converted to a draft. The possible transitions are outlined in the table below.\
↓ from / to ➡ | new | draft | inApproval | problem | blocked | live |
---|---|---|---|---|---|---|
new | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
draft | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
inApproval | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
problem | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
blocked | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
live | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
Additionally, the following two conditions must be met in order to have product displayed and sellable in the shop:
- At least one variant of the product has a valid price for the country that is connected to the shop.
- At least one variant of the product is in stock (or sellable without stock) for the warehouse that is connected to the shop.
Admin API
Update product state
Updating the product state will trigger the state evaluation. When the desired state is live
, the product might end up in the problem
state.
Not all state transitions are allowed!
Parameter | Details |
---|---|
state | String The state of the product determined by the state evaluation process. The only possible values to request are |
merchantReferenceKeys | String[] A list of merchant reference keys the merchant product belongs to. |
merchantProductStatesREAD-ONLY | MerchantProductState[] A list of merchant keys to which the merchant product belongs to and the state of the merchant product. |
let response = await adminApi.apis.Products.updateProductState({productIdentifier: productIdentifier}, {requestBody: productState});
let productState = response.body;
Update product's first live at
Update or create the time when products go live for the first time in a shop country.
let response = await adminApi.apis.Products.updateProductsFirstLiveAt({}, {requestBody: productsFirstLiveAt});
let productsFirstLiveAt = response.body;
Check Admin API Reference for more details.