Getting Started With SCAYLE
Import Products
- Getting started
- Tech
Robert Merten
VP Tech
Now that you're familiar with the three-level product structure and have defined master categories and attribute groups for Fashion Store, you’re ready to dive deeper into the product creation process within SCAYLE.
First, let's start with an overview of the five steps necessary to create a sellable product within SCAYLE:
We'll explain each topic in a separate section of this guide, and in the end, you’ll have successfully created a sellable product!
In general, there are three different ways to create products in SCAYLE:
Note that in the following sections, we will focus on creating products via the Admin API because this is the easiest way to handle lots of products.
We recommend this option using Admin API to create products.
The Admin API allows you to create, update, delete and fetch products. Each endpoint is described in more detail in the products section of the Admin API reference guide. For the sake of this tutorial, we will focus on creating products via the create endpoint.
POST /products
The product creation endpoint can technically receive and process a complete product structure, including prices and stock. However, this can slow down the processing time, so we recommend using the dedicated endpoints separately and orchestrating them. We’ll demonstrate this approach in the following chapter.
Furthermore, the endpoint supports a couple of query parameters that can be used to customize the product creation request. For example, you can specify what information you want the Admin API to provide in the request response.
Request body
In the request body, you need to specify all the details about the product you want to create. Find parameters relevant to this tutorial in the table below.
For the full list of all parameters, go to Create a product.
Parameter | Type | Details |
---|---|---|
referenceKey | STRING | A key that uniquely identifies the product (e.g., a shirt in a specific color) within the tenant's ecosystem. |
name | OBJECT | The localized product name. At least the base language that is configured in SCAYLE is mandatory. The base language is set when the SCAYLE commerce engine instance is initiated. |
master | OBJECT | The master object includes the fields referenceKey , categories and attributes . If you create a new product for which no master exists in SCAYLE, you create the master simultaneously with the first product in the product creation request. Therefore, you can provide information for all three fields to initially define and create your master. If a master already exists, providing only the master referenceKey is enough to link the new product to the existing master. The product will then inherit all attributes and categories of the existing master. |
state | STRING | The state of the product determined by the state evaluation process. The only possible values to assign are live and draft. |
attributes | ARRAY OBJECT | A list of attributes attached to the product. |
with
parameter to empty (?with=''
) to streamline the response body.Now let's create the first product, a black T-shirt, for our demo shop Fashion Store via the Admin API's product creation endpoint.
We can only create one product per request. Therefore, multiple products require multiple requests.
{
"referenceKey": "FS-100-black",
"name": {
"de_DE": "Schwarzes T-Shirt",
"de_CH": "Schwarzes T-Shirt",
"fr_FR": "T-shirt noir"
},
"state": "live",
"master": {
"referenceKey": "FS-100",
"categories": {
"paths": [["Storefront", "T-Shirt"]]
},
"attributes": [
{
"name": "brand",
"type": "localizedString",
"value": {
"de_DE": "adidas",
"de_CH": "adidas",
"fr_FR": "adidas"
}
}
]
},
"attributes": [
{
"name": "color",
"type": "localizedString",
"value":
{
"de_DE": "schwarz",
"de_CH": "schwarz",
"fr_FR": "noir"
}
},
{
"name": "description",
"type": "localizedString",
"value":
{
"de_DE": "Einfarbiges Basic T-Shirt.",
"de_CH": "Einfarbiges Basic T-Shirt.",
"fr_FR": "T-shirt basique uni."
}
}
]
}
For more information, see:
{
"id": 1,
"referenceKey": "FS-100-black",
"state": "live",
"master": {...},
"name": {...},
}
Parameter | Description |
---|---|
id | The response body of a product creation request provides the SCAYLE internal product id generated for the product. |
For other requests (e.g., update product) where a productIdentifier
has to be provided, the product id
or the referenceKey
can both be used.
Congratulations: You have successfully created your first product in SCAYLE!
Getting Started With SCAYLE
Robert Merten
VP Tech