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.


POSTget_product_details

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

POST
get_product_details
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": []
}

POSTget_content_details

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

POST
get_content_details
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": {}
}

POSTcreate_product

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

POST
create_product
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"
}

POSTcreate_variation

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

POST
create_variation
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"
}

POSTdelete_product

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

POST
delete_product
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"
}

POSTcreate_content

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

POST
create_content
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"
}

POSTupdate_content

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

POST
update_content
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"
}

POSTdelete_content

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

POST
delete_content
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"
}

Was this page helpful?