Shopobjects
Shopobjects in Sleekshop include products and contents. On this page, we'll explore the different endpoints you can use to manage these shopobjects programmatically. We'll look at how to retrieve, create, and update products and contents.
The product model
The product model contains all the information about your products, such as their name, attributes, categories, and availability.
Properties
- Name
id
- Type
- integer
- Description
Unique identifier for the product.
- Name
name
- Type
- string
- Description
The name of the product.
- Name
creation_date
- Type
- string
- Description
The date and time when the product was created.
- Name
class
- Type
- string
- Description
The class of the product.
- Name
seo
- Type
- object
- Description
SEO information for the product.
- Name
availability
- Type
- object
- Description
Availability information for the product.
- Name
metadata
- Type
- object
- Description
Metadata for the product.
- Name
categories
- Type
- array
- Description
Categories the product belongs to.
- Name
attributes
- Type
- object
- Description
Custom attributes of the product.
- Name
variations
- Type
- array
- Description
Variations of the product.
Get product details
This endpoint allows you to retrieve the details of a specific product by its ID.
Required attributes
- Name
id_product
- Type
- integer
- Description
The ID of the product.
- Name
language
- Type
- string
- Description
A valid language code.
- Name
country
- Type
- string
- Description
A valid country code.
Optional attributes
- Name
needed_attributes
- Type
- array
- Description
An array of attribute names you want to be included in the response.
Request
curl https://demo.sleekshop.net/srv/service/ \
-d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
-d licence_password='s9vmrbwT23B7bmjR4Vmz' \
-d request='get_product_details' \
-d id_product=42 \
-d language="de_DE" \
-d country="DE" \
-d needed_attributes='["name","price"]'
Response
{
"object": "product",
"id": 42,
"name": "Schneehut dunkelblau",
"creation_date": "2016-03-25 17:22:22",
"class": "colorprod",
"seo": {
"permalink": "dunkelblau-schneehut-warm",
"title": "Dunkelblauer Schneehut",
"description": "Cooler Schneehut in dunkelblau",
"keywords": "dunkelblau, Schneehut, Muetze"
},
"availability": {
"quantity": 15,
"quantity_warning": 6,
"allow_override": 0,
"active": 1
},
"metadata": {
"element_number": "123321",
"taxclass": {
"name": "Standard",
"calculation": "INC",
"value": 0.19
},
"length": 20,
"width": 18,
"height": 25,
"weight": 0,
"notes": "",
"categories": [
{
"name": "Start",
"prio": 1,
"id": 1,
"id_parent": 0,
"label": "Start",
"seo": {
"permalink": "start",
"title": "demo"
},
"attributes": {}
}
],
"attributes": {
"name": {
"type": "CHAR",
"id": 532,
"name": "name",
"label": "Name",
"value": "Schneehut dunkelblau"
},
"price": {
"type": "FLOAT",
"id": 535,
"name": "price",
"label": "Preis",
"value": 27.9
}
},
"variations": []
}
Get content details
This endpoint allows you to retrieve the details of a specific content object by its ID.
Required attributes
- Name
id_content
- Type
- integer
- Description
The ID of the content object.
- 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 request='get_content_details' \
-d id_content=5 \
-d language="de_DE"
Response
{
"object": "content",
"id": 5,
"name": "Teaser 1",
"creation_date": "2016-03-25 12:38:23",
"class": "teaser_pic",
"seo": {
"permalink": "",
"title": "",
"description": "",
"keywords": ""
},
"attributes": {
"img": {
"type": "IMG",
"id": 51,
"name": "img",
"label": "Bild",
"value": "https://demo.sleekshop.net/srv/uploads/shopobject_images/1c14058528a52ddae559cb29d7faa94a.jpg",
"width": "NAN",
"height": "NAN"
},
"headline": {
"type": "CHAR",
"id": 52,
"name": "headline",
"label": "Überschrift",
"value": ""
},
"text": {
"type": "TXT",
"id": 53,
"name": "text",
"label": "Text",
"value": ""
}
},
"variations": {}
}
SEO Get product details
This endpoint delivers the product details for the product defined by its permalink.
Required attributes
- Name
permalink
- Type
- string
- Description
The permalink of the product.
- Name
country
- Type
- string
- Description
A valid country code.
Optional attributes
- Name
needed_attributes
- Type
- array
- Description
This array specifies a selection of attributes you want to be listed.
Request
curl https://demo.sleekshop.net/srv/service/ \
-d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
-d licence_password='s9vmrbwT23B7bmjR4Vmz' \
-d request='seo_get_product_details' \
-d permalink='dunkelblau-schneehut-warm' \
-d country="DE" \
-d needed_attributes='["name","price"]'
Response
{
"object": "product",
"id": 42,
"name": "Schneehut dunkelblau",
"creation_date": "2016-03-25 17:22:22",
"class": "colorprod",
"seo": {
"permalink": "dunkelblau-schneehut-warm",
"title": "Dunkelblauer Schneehut",
"description": "Cooler Schneehut in dunkelblau",
"keywords": "dunkelblau, Schneehut, Muetze"
},
"availability": {
"quantity": 15,
"quantity_warning": 6,
"allow_override": 0,
"active": 1
},
"metadata": {
"element_number": "123321",
"taxclass": {
"name": "Standard",
"calculation": "INC",
"value": 0.19
},
"length": 20,
"width": 18,
"height": 25,
"weight": 0,
"notes": ""
},
"categories": [
{
"name": "Start",
"prio": 1,
"id": 1,
"id_parent": 0,
"label": "Start",
"seo": {
"permalink": "start",
"title": "demo"
},
"attributes": {}
}
],
"attributes": {
"name": {
"type": "CHAR",
"id": 532,
"name": "name",
"label": "Name",
"value": "Schneehut dunkelblau"
},
"price": {
"type": "FLOAT",
"id": 535,
"name": "price",
"label": "Preis",
"value": 27.9
}
},
"variations": []
}
SEO Get content details
This endpoint delivers the content details for the content defined by its permalink.
Required attributes
- Name
permalink
- Type
- string
- Description
The permalink of the content.
Request
curl https://demo.sleekshop.net/srv/service/ \
-d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
-d licence_password='s9vmrbwT23B7bmjR4Vmz' \
-d request='seo_get_content_details' \
-d permalink='impressum'
Response
{
"object": "content",
"id": 52,
"name": "imprint",
"creation_date": "2016-07-29 16:04:24",
"class": "content",
"seo": {
"permalink": "impressum",
"title": "Impressum",
"description": "",
"keywords": ""
},
"attributes": {
"headline": {
"type": "CHAR",
"id": 647,
"name": "headline",
"label": "Überschrift",
"value": "Impressum"
},
"content": {
"type": "HTML",
"id": 648,
"name": "content",
"label": "Inhalt",
"value": "<p>Hier steht das Impressum</p><br><p><br></p>"
},
"img": {
"type": "IMG",
"id": 649,
"name": "img",
"label": "Bild",
"value": "https://demo.sleekshop.net/srv/uploads/shopobject_images/",
"width": "",
"height": ""
}
},
"variations": {}
}
Create a product
This endpoint allows you to create a new product in Sleekshop.
Required attributes
- Name
class
- Type
- string
- Description
The class of the product you want to create.
- Name
name
- Type
- string
- Description
The name of the new product.
- Name
shop_active
- Type
- integer
- Description
Indicating whether the product is shop_active or not. Use 1 for active and 0 for inactive.
Optional attributes
- Name
attributes
- Type
- object
- Description
Custom attributes for the product.
- Name
seo
- Type
- object
- Description
SEO information for the product.
- Name
metadata
- Type
- object
- Description
Metadata for the product.
- Name
availability
- Type
- object
- Description
Availability information for the product.
- Name
categories
- Type
- array
- Description
Categories the product belongs to.
- Name
add_binding
- Type
- boolean
- Description
Determines whether the created product shall be bound to its warehouse_entity.
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_product' \
-d class='your-class' \
-d name='name_new2' \
-d shop_active=1 \
-d attributes='{"de_DE":{"name":"Test"}}' \
-d metadata='{"element_number":"12asddsa3321"}' \
-d seo='{"de_DE":{"permalink":"test546576"}}' \
-d availability='{"quantity":2,"active":1}'
Response
{
"object": "create_product",
"id": "162"
}
Update a product
This endpoint allows you to update an existing product in Sleekshop.
Required attributes
- Name
id_product
- Type
- integer
- Description
The ID of the product you want to update.
- Name
name
- Type
- string
- Description
The new name of the product.
- Name
shop_active
- Type
- integer
- Description
Indicates whether the product is shop active or not. Use 1 for active and 0 for inactive.
- Name
licence_username
- Type
- string
- Description
Your license username.
- Name
licence_password
- Type
- string
- Description
Your license password.
- Name
licence_secret_key
- Type
- string
- Description
Your license secret key.
Optional attributes
- Name
attributes
- Type
- object
- Description
Custom attributes for the product, structured by language. Example:
{ "de_DE": { "attr1": "myvalue" } }
.
- Name
seo
- Type
- object
- Description
SEO information for the product, structured by language. Available fields:
permalink
,title
,description
,keywords
. Example:{ "de_DE": { "permalink": "myvalue" } }
.
- Name
metadata
- Type
- object
- Description
Metadata for the product. Available fields:
element_number
,ean
,length
,width
,height
,kg
,taxclass
. Example:{ "element_number": "123" }
.
- Name
availability
- Type
- object
- Description
Availability information for the product. Available fields:
quantity
,quantity_warning
,active
(0 or 1),allow_override
(0 or 1). Example:{ "quantity": 123, "active": 1 }
.
- Name
categories
- Type
- array
- Description
Categories the product belongs to. Example:
["cat1", "cat2"]
.
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='update_product' \
-d id_product=163 \
-d name='name_new2' \
-d shop_active=1 \
-d attributes='{"de_DE":{"name":"Test"}}' \
-d metadata='{"element_number":"12asddsa3321"}' \
-d seo='{"de_DE":{"permalink":"test546576"}}' \
-d availability='{"quantity":2,"active":1}'
Response
{
"object": "update_product",
"status": "success"
}
Create a variation
This endpoint allows you to create a variation of an existing product in Sleekshop.
Required attributes
- Name
id_product
- Type
- integer
- Description
The ID of the product you want to create a variation for.
- Name
name
- Type
- string
- Description
The name of the new variation.
- Name
shop_active
- Type
- integer
- Description
Indicating whether the variation is shop_active or not. Use 1 for active and 0 for inactive.
Optional attributes
- Name
attributes
- Type
- object
- Description
Custom attributes for the variation.
- Name
seo
- Type
- object
- Description
SEO information for the variation.
- Name
metadata
- Type
- object
- Description
Metadata for the variation.
- Name
availability
- Type
- object
- Description
Availability information for the variation.
- Name
categories
- Type
- array
- Description
Categories the variation belongs to.
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_variation' \
-d id_product=163 \
-d name='name_new_variation' \
-d shop_active=1 \
-d attributes='{"de_DE":{"name":"Test"}}' \
-d metadata='{"element_number":"123321"}' \
-d seo='{"de_DE":{"permalink":"test546576"}}' \
-d availability='{"quantity":2,"active":1}'
Response
{
"object": "create_variation",
"id": "165"
}
Delete a product
This endpoint allows you to delete a product from Sleekshop.
Required attributes
- Name
id_product
- Type
- integer
- Description
The ID of the product you want 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_product' \
-d id_product=163
Response
{
"object": "delete_product",
"status": "success"
}
Create a content
This endpoint allows you to create a new content object in Sleekshop.
Required attributes
- Name
class
- Type
- string
- Description
The class of the content you want to create.
- Name
name
- Type
- string
- Description
The name of the new content.
- Name
shop_active
- Type
- integer
- Description
Indicating whether the content is shop_active or not. Use 1 for active and 0 for inactive.
Optional attributes
- Name
attributes
- Type
- object
- Description
Custom attributes for the content.
- Name
seo
- Type
- object
- Description
SEO information for the content.
- Name
categories
- Type
- array
- Description
Categories the content belongs to.
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_content' \
-d class='your-class' \
-d name='name_new2' \
-d shop_active=1 \
-d attributes='{"de_DE":{"name":"Test"}}' \
-d seo='{"de_DE":{"permalink":"test546576"}}'
Response
{
"object": "create_content",
"id": "162"
}
Update a content
This endpoint allows you to update an existing content object in Sleekshop.
Required attributes
- Name
id_content
- Type
- integer
- Description
The ID of the content you want to update.
Optional attributes
- Name
name
- Type
- string
- Description
The new name for the content.
- Name
shop_active
- Type
- integer
- Description
Indicating whether the content is shop_active or not. Use 1 for active and 0 for inactive.
- Name
attributes
- Type
- object
- Description
Updated custom attributes for the content.
- Name
seo
- Type
- object
- Description
Updated SEO information for the content.
- Name
categories
- Type
- array
- Description
Updated categories the content belongs to.
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='update_content' \
-d id_content=163 \
-d name='name_new2' \
-d shop_active=1 \
-d attributes='{"de_DE":{"name":"Test"}}' \
-d seo='{"de_DE":{"permalink":"test546576"}}'
Response
{
"object": "update_content",
"status": "success"
}
Delete a content
This endpoint allows you to delete a content object from Sleekshop.
Required attributes
- Name
id_content
- Type
- integer
- Description
The ID of the content you want 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_content' \
-d id_content=163
Response
{
"object": "delete_content",
"status": "success"
}