Sorting
General
Product sorting in e-commerce is the process of arranging products in a specific order by applying different sorting parameters through our API.
Sorting has different use cases:
- Shop users may organize products based on their preferences, making it easier for them to find what they want and thus improving their shopping experience.
- You can control which products appear first in your store or campaign. This may help when you want to clear out specific stock or promote certain items.
In this guide, you will learn how to use the sorting features provided by SCAYLE and set up your own custom, highly flexible sorting for special occasions.
Sorting in a nutshell
SCAYLE offers three different sorting mechanisms to allow you to sort the products according to your needs:
Basic Sorting is a straightforward sorting based on a single attribute, such as price or recency, allowing you to quickly organize products according to the most relevant factor.
In contrast to that, Smart Sorting provides a more advanced, purpose-driven sorting that combines and prioritizes multiple attributes. This supports you to tailor the order of the products to specific goals, like optimizing clearance or ensuring good availability across all variants for the products being shown to the customer.
In case you want to dig even deeper, you can utilize the Custom Sorting. It offers the highest grade of flexibility as it allows you to define a sorting score (sortValue
) for each product of your shop, that is completely customizable depending on your needs.
Sorting direction
When sorting the products, you may decide to see the results with lower values first (asc
) or higher values first (desc
).
Basic Sorting
As mentioned before, the Basic Sorting uses a single attribute, such as price or recency, to let you organize products according to the most relevant factor.
Utilizing the Basic Sorting, you can sort by:
Smart Sorting
Smart Sorting is a set of predefined sorting options based on frequently needed features of many SCAYLE customers.
Smart Sorting takes into account different weighted factors to allow you to tailor the order of products according to specific business goals, such as stock turnover.
Utilizing Smart Sorting, you can sort to optimize for:
- Sales Push
- New Arrivals Push
- Balanced Value Offerings
- Inventory Optimization
- Luxury Promotion
- Comprehensive Stock Coverage
- Topseller
- Revenue Maximization
- Recently Popular
Custom Sorting
With Custom Sorting, you are completely flexible in ranking your products depending on your needs.
To set up a custom sorting, you need to decide
- the name of the sorting (called
sortingKey
) - the products to sort
- the ranking of the products (called
sortingValue
) - the attribution of the sorting (general level, shop level, country code level)
You can configure these details manually in the SCAYLE Panel or utilize the Admin API.
Products without a sortValue
for the respective sortingKey
are returned after all products that have a sortValue
assigned.
Custom Sorting Key Creation
Custom product sortings are created on the global or shop-country level. The following permissions are required in order to maintain custom product sortings:
permission shop__product__custom_sorting__list
= to see the overview of configured sortings
permission shop__product__custom_sorting__show
= to see the details of the configured sortings
shop__product__custom_sorting__update
= to update sortings
shop__product__custom__sorting__create
= to create sortings
shop__product__custom_sorting__delete
= to delete sortings
If a shop country does not have its own sorting, the sorting configuration from the global shop is used. Creating a new sorting will override the global default.
Create a product sorting:
- Navigate to Shops ➜ [Shop] ➜ Products ➜ Sorting ➜ New Sorting.
- Click New Sorting.
- Enter a Sorting Key. For every sorting, a unique Sorting Key must be defined.
- Click Add Products to add several products to the Sorting Key.
- Define a Sorting Value for each product. Use the up/down arrows or enter values manually.
- When complete, click Save Sorting.
Sorting values will be saved relative to each product ID. The sorting key can be used for the Storefront API endpoints.

Product Sorting
Sorting Bulk Import
The bulk import for the product sorting can be found under Settings ➜ Imports & Jobs ➜ Imports ➜ Products ➜ Product Sorting Keys.
To import product sortings, create a CSV file with one row per product and sorting key, and the following column headers:
product_id
: the SCAYLE product id, which should get a sorting value.application_id
: the application / shop id for which the sorting should be used.sort_key
: the sorting key for the product sorting.sort_value
: the sorting value (Score) of the product for the sorting key.
For more general information about imports, see the Imports page.
Applying Sorting Keys to a Shop and Its Categories
Basic Sorting
With no sorting applied at all, the default basic sorting by Product ID will be assigned. Products will then be sorted by their Product ID in descending order. If either a basic or a smart sorting is applied to shop categories, the basic sorting will not apply anymore.
Smart Sorting
With the permission shop__product__smart_sorting__edit
you can define a default smart sorting on global shop level, which will apply to all categories in all countries of the respective shop. You can also define a default smart sorting on country shop level, which will override default sorting configurations on global shop level and will only apply to the respective shop country.

Defining Smart Sorting and Custom Sorting Keys on global shop level
On shop country category level, you have the possibility to further refine smart sortings category-specific. Find out how to do that here.
Custom Sorting
Custom Sortings can be applied to categories on country category level. Only one smart sorting or one custom sorting or a combination of one of each can be applied to a category. If both, a custom sorting and a smart sorting are defined for a category, products will first be sorted by the custom sorting, if multiple products have the same custom sorting key value, those products will then be sorted by the smart sorting.
For further information on how custom and smart sorting configuration is maintained and inherited on category level, please refer to the Shop Categories Section.
Define Sorting for a Price Campaign
You can assign a product sorting to a price campaign as follows:
- Define a sorting key to be used for the shop category via the SCAYLE Panel (see above) or the Admin API.
- Define a custom data parameter on Price Campaigns level via the SCAYLE Panel.
- Add the sorting key for the price campaign in the custom data parameter.
- The parameter will be shown as part of the price campaign creation (see image below).

Sorting as part of a price campaign