docs
  1. SCAYLE Resource Center
  2. Developer Guides
  3. Shops
  4. Manage Shops

Manage Shops

General

Shop structure

The shop structure of SCAYLE consists of two levels:

  1. Shop.
  2. Shop Country.

Make sure to assign each shop to a country.
Shop settings can be overwritten at the country level.

For more information, check shop structure.

Admin API

Create your first shop

You can create your first minimal shop by defining the Name and a unique key for your instance:

let newShop = {
  name: "My Shop",
  key: "ms"
};

let response = await adminApi.apis.Shops.createShop({}, {requestBody: newShop});
let createdShop = response.body;

Create a shop with a shop country

To be able to sell something you need to setup a Shop with a Shop Country. The Shop Country holds all the information (e.g. currency & language) for your new shop.
You can create a new Shop with a new Shop Country by defining the countries information of the shop:

let newShop = {
    name: "my Shop",
    key: "ms",
    logoUrl: "http://www.example.com/myLogo.png",
    countries: [
        {
            countryCode: "DE",
            defaultLanguageCode: "de_DE",
            url: "http://www.example.com"  
        }
    ]
};

let response = await adminApi.apis.Shops.createShop({}, {requestBody: newShop});
let createdShop = response.body;

Understand Price Groups

When you create a new Shop you can define a price group for the shop.
This should be used if you want to run multiple Shops (e.g. 'acme-fashion.com' and 'acme-shoes.com') and share the same prices in both shops. In this case you need to create both shops with the same price group key:

let fashionShopPayload = {
    name: "ACME Fashion",
    key: "fash",
    logoUrl: "http://www.acme-fashion.com/myLogo.png",
    priceGroupKey: "shared"
};

let response = await adminApi.apis.Shops.createShop({}, {requestBody: fashionShopPayload});
let fashionShop = response.body;

let shoeShopPayload = {
    name: "ACME Shoes",
    key: "shoe",
    logoUrl: "http://www.acme-shoes.com/myLogo.png",
    priceGroupKey: "shared"
};

let response = await adminApi.apis.Shops.createShop({}, {requestBody: shoeShopPayload});
let shoeShop = response.body;

In the example above the prices for your products will be shared for the same currencies. Sho both shops will have the same prices.

Understand Shop Category Tree

If you operate your Shop in multiple countries you can share the category tree across the Shop Countries by setting a shared Shop Category Tree ID.
This has the benefit that you don't need to manage your Shop Category Tree individually in every country:

let newShop = {
    name: "My Shop",
    key: "ms",
    shopCategoryTreeId: 1
};

let response = await adminApi.apis.Shops.createShop({}, {requestBody: newShop});
let createdShop = response.body;

Typically you don't need to use this Feature.
If you just share your category tree across different Shop Countries the ID is set as default for you.

It's possible to use one SCAYLE instance to operate multiple shops which run under different legal entities.

If you want to create a new shop and assign the shop to a new legal entity you can simply add the legal entity ID to the create call:

let newShop = {
    name: "My Shop",
    key: "ms",
    companyId: 1
};

let response = await adminApi.apis.Shops.createShop({}, {requestBody: newShop});
let createdShop = response.body;

Update your shop

To update your Shop you can lever the API / SDK in a very similar fashion than the Shop Create call.

It's not possible to update the `shopCategoryTreeId`, `companyId` and `priceGroupKey` settings after a Shop is created. If you want to change them you have to create a new Shop and delete the old one.

let response = await adminApi
.apis.Shops.getShop({shopKey: "ms"}); 
let shop = response.body;

shop.name = "My updated Shop";

let updateResponse = await adminApi.apis.Shops.updateShop({shopKey: shop.key}, {requestBody: shop});
let updatedShop = updateResponse.body;

Add a shop country

If you want to start selling in a new Country you just need to create a new Shop Country for your Shop:

let newShopCountry = {
    countryCode: "DE",
    defaultLanguageCode: "de_DE",
    supportedLanguageCodes: ["de_DE", "en_GB"],
    url: "https://ms.de"
};

let response = await adminApi.apis.Shops.createShopCountry({shopKey: "ms"}, {requestBody: newShopCountry});
let createdShopCountry = response.body;

The Price Group is set on Shop level. If you create a new Shop Country the Price Group of the Shop is inherited.

Update a shop country

You can update a Shop Country by the following call:

let response = await adminApi
.apis.Shops.getShopCountry({shopKey: "ms", countryCode: "DE"}); 
let shopCountry = response.body;

shopCountry.url = "https://ms.de";

let updateResponse = await adminApi.apis.Shops.updateShopCountry({shopKey: "ms", countryCode: "DE"}, {requestBody: shopCountry});
let updatedShopCountry = updateResponse.body;

Get a single shop

You can request any given shop with its dependent countries.

This method can be used to get an existing shop by providing the shop key.

This method allows to include nested resources using the with parameter.

Method Signature

let response = await adminApi.apis.Shops.getShop({shopKey: shopKey});
let shop = response.body;

Options

Shop read can be used with optional parameters - called options:

ParameterDetails
with

String

Allows to load the following nested resources within this request:

  • countries
  • countries.properties
  • countries.assortment
  • countries.warehouses
  • customData

See this example for details on how to use options.

Get a Shop

let response = await adminApi.apis.Shops.getShop({shopKey: "ms"});
let shop = response.body;

console.log(shop.name);

Get a Shop with country properties and assortment

let response = await adminApi.apis.Shops.getShop({shopKey: "ms", with: "countries.properties,countries.assortment"});
let shop = response.body;

shop.countries.forEach(
    country => country.properties.forEach(
        property => console.log(property.key + ": " + property.value)
    )
);

Fetch multiple shops

SCAYLE allows you to request multiple shops at the same time considering different parameters to narrow down the query, e.g., price group key.

This method can be used to get a collection of existing shops. It is possible to refine the search by applying filters in the options.

This method allows to include nested resources using the with parameter.

Method Signature

let response = await adminApi.apis.Shops.getShops();
let shops = response.body.entities;

Options

Shop collection read can be used with optional parameters - called options:

ParameterDetails
with

String

Allows to load the following nested resources within this request:

  • countries
  • countries.assortment
  • countries.warehouses
  • customData
limit

Integer

Maximum number of items in the result. (default: 100, maximum: 1000)

filters[priceGroupKey]

String

Comma-separated list of price group keys.

See this example for details on how to use options.

Get a list of Shops

let response = await adminApi.apis.Shops.getShops();
let shops = response.body.entities;

shops.forEach(
    shop => console.log(shop.name)
);

Get a list of Shops filtered by price group key

let response = await adminApi.apis.Shops.getShops({
  "filters[priceGroupKey]": "MyPriceGroupKey"
});

let shops = response.body.entities;

shops.forEach(
  shop => console.log(shop.name)
);

Storefront API

Shops and assortments can be entirely customized, but can also share specific information to facilitate multi-shop management within a single SCAYLE instance.

Some of the core functions of SCAYLE relate to the creation and administration of shops. The system allows individual settings for each shop within the instance. For example, for category trees and assortments. However, the system also lets shops inherit certain information from other shops, if needed.

Shop assortments

Assortments of different shops can be customized based on:

  • assortment related rules
  • shop categories and filters
  • shop-specific product information

The system enables users to assign different assortments and product scopes for each shop. They can define new assortments on a highly granular level, using inclusion and exclusion rules. All rules can be applied to:

  • attribute groups
  • products
  • merchants

Category tree and filter

In SCAYLE, users can define shop-specific category trees, which allows them to adapt quickly to changes and adjust product data for an individual shop. Similar to creating shop assortments, inclusion and exclusion rules define which products should be included in which shop category. All rules can be created for each category level and will automatically be inherited by the respective subcategories.

There are different options available for each shop category:

  • naming the shop category
  • defining the shop category path
  • showing/hiding shop categories
  • activating/deactivating shop categories

Multi-Shop management

It is possible to manage several shops in the same instance of the SCAYLE Panel. Every (new) shop can run entirely independently from any other shop. Some everyday use cases for operating multiple shops are:

  • individual shops for different assortments (e.g., only fashion, only furniture)
  • individual shops for different target groups (e.g., only women, only men)
  • individual shops for different markets (e.g., German shop, French shop)
  • individual shops for different brands (e.g., ABOUT YOU, EDITED)

Since we highly value and support our client's flexibility, there are no limitations on how shops can be handled in the same instance. It is possible to operate shops with overlapping assortments and shared products. Each shop will run independently from any other shop that is part of the same instance.

Shop-Specific product information

Additional product information can be added on the shop level to the predefined, global product structure. Similar to the master data configuration, users can work with different data types.

Information related to shop-specific attributes is connected to the Storefront API and will only be shown on the product detail page if a customer is visiting this specific shop.

Get shop configuration

With this method, it is possible to get the current shop configuration with all shop-specific properties. It is possible to modify these properties through the SCAYLE Panel.

Example

All examples require a configured Storefront API client to be available as client.

See Authentication for how to set it up.

const response = await client.shopConfiguration.get();
Response
{
  "shopId": 1001,
  "name": "SCAYLE Demo",
  "shopCustomData": {},
  "properties": [],
  "customData": {},
  "country": "DE"
}

Further education - SCAYLE Academy