Classes
Classes in Sleekshop define the structure for products, content, warehouse entities, and users. On this page, we'll explore the different class endpoints you can use to manage classes programmatically. We'll look at how to retrieve, create, update, and delete classes and their attributes.
The class model
The class model contains all the information about your classes, such as their name, type, and associated attributes.
Properties
- Name
id
- Type
- integer
- Description
Unique identifier for the class.
- Name
name
- Type
- string
- Description
The name of the class.
- Name
type
- Type
- string
- Description
The type of the class (product, content, warehouse_entity, or user).
- Name
creation_date
- Type
- string
- Description
The date and time when the class was created.
- Name
attributes
- Type
- object
- Description
An object containing the attributes associated with the class.
Get class details
This endpoint allows you to retrieve the details of a specific class by its ID.
Required attributes
- Name
id_class
- Type
- integer
- Description
The ID of the class.
- Name
language
- Type
- string
- Description
A valid language code.
Request
curl https://demo.sleekshop.net/srv/service/ \
-d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
-d licence_password='s9vmrbwT23B7bmjR4Vmz' \
-d licence_secret_key='your_secret_key' \
-d request='get_class_details' \
-d id_class=265 \
-d language='de_DE'
Response
{
"object": "class",
"id": 265,
"name": "test",
"creation_date": "2024-06-14 02:01:51",
"attributes": {
"attribute_5122": {
"type": "CHAR",
"id": 5123,
"name": "attribute_5122",
"label": "",
"value": ""
},
"short_description": {
"type": "TXT",
"id": 5124,
"name": "short_description",
"label": "Kurzbeschreibung",
"value": ""
},
"price": {
"type": "FLOAT",
"id": 5125,
"name": "price",
"label": "Preis",
"value": 0
}
}
}
Create a class
This endpoint allows you to create a new class in Sleekshop.
Required attributes
- Name
name
- Type
- string
- Description
The name of the class you want to create.
- Name
type
- Type
- string
- Description
A valid type (product, content, warehouse_entity, user).
Request
curl https://demo.sleekshop.net/srv/service/ \
-d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
-d licence_password='s9vmrbwT23B7bmjR4Vmz' \
-d licence_secret_key='your_secret_key' \
-d request='create_class' \
-d name='your-class' \
-d type='product'
Response
{
"object": "create_class",
"id": "42"
}
Delete a class
This endpoint allows you to delete a class from Sleekshop.
Required attributes
- Name
id_class
- Type
- integer
- Description
The ID of the class to delete.
Request
curl https://demo.sleekshop.net/srv/service/ \
-d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
-d licence_password='s9vmrbwT23B7bmjR4Vmz' \
-d licence_secret_key='your_secret_key' \
-d request='delete_class' \
-d id_class=163
Response
{
"object": "delete_class",
"status": "success"
}
Create class attributes
This endpoint allows you to create new attributes for an existing class.
Required attributes
- Name
id_class
- Type
- integer
- Description
The ID of the class to add attributes to.
- Name
attributes
- Type
- array
- Description
An array of attribute objects to create.
Request
curl https://demo.sleekshop.net/srv/service/ \
-d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
-d licence_password='s9vmrbwT23B7bmjR4Vmz' \
-d licence_secret_key='your_secret_key' \
-d request='create_class_attributes' \
-d id_class=42 \
-d attributes='[{"name":"test","type":"TXT","de_DE":{"label":"testlabel","value":"test-val"}}]'
Response
{
"object": "create_class_attributes",
"status": "success"
}
Delete class attributes
This endpoint allows you to delete attributes from an existing class.
Required attributes
- Name
id_class
- Type
- integer
- Description
The ID of the class to delete attributes from.
- Name
attributes
- Type
- array
- Description
An array of attribute names to delete.
Request
curl https://demo.sleekshop.net/srv/service/ \
-d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
-d licence_password='s9vmrbwT23B7bmjR4Vmz' \
-d licence_secret_key='your_secret_key' \
-d request='delete_class_attributes' \
-d id_class=42 \
-d attributes='["attr1","attr2"]'
Response
{
"object": "delete_class_attributes",
"status": "success"
}