docs
  1. SCAYLE Resource Center
  2. Developer Guides
  3. Products
  4. Product States

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:

  1. The product is not missing any mandatory attributes (for configured mandatory attribute groups).
  2. The product has at least one image or document (if configured as mandatory).
  3. The product does not include blacklisted terms (if the feature is enabled).
  4. The product does not have the same differentiating attribute as other products of the same master (if the feature is enabled).
  5. 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 ➡newdraftinApprovalproblemblockedlive
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!

ParameterDetails
state

String

The state of the product determined by the state evaluation process. The only possible values to request are live, draft and blocked. The problem state can only be the result of the state evaluation process. If product is in problem state, the reasons are listed in read-only 'problems' field. The new and inApproval states can be set in the SCAYLE Panel. If a product belongs to multiple merchants, the state is returned based on the hierarchical order live, inApproval, problem, blocked, draft

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.