docs
  1. SCAYLE Resource Center
  2. Onboarding Guide
  3. Onboarding: Backend
  4. Importing Your First Products

Importing Your First Products

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:

  1. Create a product.
  2. Add at least one variant to the product.
  3. Add at least one image to the product.
  4. Add price information to at least one variant.
  5. Add stock information to at least one variant.

We'll explain each topic in a separate section of this guide, and in the end, you’ll have successfully created a sellable product!

Create your first product

In general, there are three different ways to create products in SCAYLE:

  1. Via the Admin API.
  2. Create a product within the SCAYLE Panel.
  3. Importing a product list file into the SCAYLE Panel.

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.

Breaking down the product creation 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.

ParameterTypeDetails
referenceKeySTRINGA key that uniquely identifies the product (e.g., a shirt in a specific color) within the tenant's ecosystem.
nameOBJECTThe 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.
masterOBJECTThe 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.
stateSTRINGThe state of the product determined by the state evaluation process. The only possible values to assign are live and draft.
attributesARRAY OBJECTA list of attributes attached to the product.

Guiding principles when integrating this endpoint

  • You can send the whole product structure via the create product endpoint. However, please consider that sending lots of data along with this request can slow down response times.
  • We recommend using the dedicated endpoints sequentially to create the entire product structures, e.g. first create the product, then the variants, and so on. This approach is also presented in this guide.
  • You can increase the performance of the create endpoints by setting the with parameter to empty (?with='') to streamline the response body.

Creating an example product for Fashion Store

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.

Example Payload
{
  "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:

Example Response

{
  "id": 1,
  "referenceKey": "FS-100-black",
  "state": "live",
  "master": {...},
  "name": {...},
}
ParameterDescription
idThe 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!

Further education - SCAYLE Academy