Create a category

POST /company/companies/@id/categories

Request

Authentication

This endpoint requires authentication.

Header Value
Authorization Set the value to Bearer + + access_token

URL parameters

Replace the @ keywords in the URL with their corresponding value.

A dictionary with fields

Field Type Description
id Int The company where to create a new category

Body

Pass the following properties via application/json or form encoding in the body of the request.

Field Type Description
name [Language: String] Translated category name
description [Language: String] Description of this category
active Bool A boolean value
only_order_in_store Bool Whether this product can only get ordered in the store with a separate UI for the shop employees, and not in the public webshop
shop_ids [Int] Minimum 1. IDs of the shops the category will be available for
seo company.SeoData Optional. The category's webpage search engine metatags
product_ids [Int] Optional. Set the order of the products in a category by setting the IDs of the products in the right order. You can't add or remove products, only change the order. Don't set this field if you don't want to make changes.

Example request 1

POST /company/companies/11/categories HTTP/1.1
Host: api.bakeronline.be
X-VERSION: 1.1.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 764
{
    "name": "Joanne Leannon",
    "description": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "active": true,
    "only_order_in_store": true,
    "shop_ids": [
        15,
        11,
        19
    ],
    "seo": {
        "title": {
            "en": "Et suscipit accusantium voluptatem omnis hic eligendi veniam fugiat distinctio."
        },
        "description": {
            "en": "In et illum ut harum dolores vero. Ut qui ducimus non ut voluptatem ut mollitia. Cum aspernatur voluptatem aut est consequatur exercitationem facilis. Suscipit alias nihil itaque est autem et."
        },
        "url": {
            "en": "http://dubuque.com/"
        }
    },
    "product_ids": [
        19,
        11,
        15
    ]
}

Response

Field Type Description
name [Language: String] Translated category name
description [Language: String] Description of this category
active Bool A boolean value
only_order_in_store Bool Whether this product can only get ordered in the store with a separate UI for the shop employees, and not in the public webshop
products [company.Product.simple] Array of company.Product.simple
shops [company.Shop.simple] Array of company.Shop.simple
id Int ID of the category
banner Image? Nullable.
seo company.SeoData Optional. The category's webpage search engine metatags

Example response 1

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 13220

{
    "name": "Zelma Lynch",
    "description": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "active": false,
    "only_order_in_store": false,
    "products": [
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "description": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "specialty": false,
            "active": false,
            "only_order_in_store": false,
            "price_type": "PER_UNIT",
            "price": 13,
            "target_price": true,
            "url_type": "none",
            "url": "https://example.com",
            "min_max": {
                "amount": {
                    "minimum": 14,
                    "maximum": 12,
                    "maximum_day": 12,
                    "maximum_week": 16
                },
                "weight": {
                    "minimum": 19,
                    "maximum": 11,
                    "maximum_day": 18,
                    "maximum_week": 12,
                    "suggested": 16
                },
                "persons": {
                    "minimum": 17,
                    "maximum": 18
                }
            },
            "id": 12,
            "allergens": [
                {
                    "id": 16,
                    "name": "Peanut"
                },
                {
                    "id": 11,
                    "name": "Egg"
                },
                {
                    "id": 10,
                    "name": "Nuts"
                }
            ],
            "category_id": 17,
            "price_look_up_code": "...",
            "seo": {
                "title": {
                    "en": "Quibusdam culpa rerum et dolor vel veritatis fuga molestias."
                },
                "description": {
                    "en": "Vel dignissimos dicta maiores placeat libero non est. Quod temporibus quaerat ipsum ut. Quo necessitatibus sint perferendis quibusdam sit voluptas nostrum."
                },
                "url": {
                    "en": "http://www.hermann.net/quia-fuga-ea-illo-sit-pariatur-delectus-qui-dolore.html"
                }
            },
            "code": "..."
        },
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "description": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "specialty": true,
            "active": true,
            "only_order_in_store": true,
            "price_type": "PER_UNIT",
            "price": 18,
            "target_price": true,
            "url_type": "none",
            "url": "https://example.com",
            "min_max": {
                "amount": {
                    "minimum": 11,
                    "maximum": 11,
                    "maximum_day": 16,
                    "maximum_week": 15
                },
                "weight": {
                    "minimum": 10,
                    "maximum": 13,
                    "maximum_day": 10,
                    "maximum_week": 19,
                    "suggested": 19
                },
                "persons": {
                    "minimum": 10,
                    "maximum": 17
                }
            },
            "id": 12,
            "allergens": [
                {
                    "id": 13,
                    "name": "Soy"
                },
                {
                    "id": 15,
                    "name": "Milk"
                },
                {
                    "id": 18,
                    "name": "Peanut"
                }
            ],
            "category_id": 11,
            "price_look_up_code": "...",
            "seo": {
                "title": {
                    "en": "A et quam inventore qui cum."
                },
                "description": {
                    "en": "Enim accusantium et consectetur ea. Enim et illo saepe non. Repudiandae magnam facilis in a quam. Perferendis et ut quia eos laborum aut. Enim suscipit rerum fuga esse illo numquam."
                },
                "url": {
                    "en": "http://skiles.net/eum-ut-repellendus-cupiditate-quasi-expedita.html"
                }
            },
            "code": "..."
        },
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "description": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "specialty": true,
            "active": false,
            "only_order_in_store": false,
            "price_type": "PER_UNIT",
            "price": 19,
            "target_price": false,
            "url_type": "none",
            "url": "https://example.com",
            "min_max": {
                "amount": {
                    "minimum": 18,
                    "maximum": 11,
                    "maximum_day": 12,
                    "maximum_week": 14
                },
                "weight": {
                    "minimum": 14,
                    "maximum": 16,
                    "maximum_day": 17,
                    "maximum_week": 13,
                    "suggested": 12
                },
                "persons": {
                    "minimum": 13,
                    "maximum": 17
                }
            },
            "id": 10,
            "allergens": [
                {
                    "id": 13,
                    "name": "Mollusc"
                },
                {
                    "id": 13,
                    "name": "Milk"
                },
                {
                    "id": 10,
                    "name": "Crustaceans"
                }
            ],
            "category_id": 12,
            "price_look_up_code": "...",
            "seo": {
                "title": {
                    "en": "Est totam corrupti consequatur reprehenderit aut maiores consequatur."
                },
                "description": {
                    "en": "Fugiat rerum sunt est similique et ipsum eveniet deserunt. Veritatis dolores iste nesciunt qui sunt officiis eius."
                },
                "url": {
                    "en": "http://www.sanford.com/sed-aperiam-ipsam-dolor-eum-aut"
                }
            },
            "code": "..."
        }
    ],
    "shops": [
        {
            "name": "Selena Crist",
            "active": true,
            "address": {
                "street": "Sint-Denijslaan",
                "nr": "96",
                "zipcode": "9000",
                "city": "Gent",
                "country": "BE",
                "position": {
                    "latitude": 1.54361,
                    "longitude": 0.45645
                }
            },
            "allow_comments": false,
            "allow_orders": false,
            "delivery_use_intervals": true,
            "id": 16,
            "avatar": {
                "resolutions": [
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    }
                ],
                "white_background": false
            },
            "banner": {
                "resolutions": [
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    }
                ],
                "white_background": false
            }
        },
        {
            "name": "Jessika Brekke",
            "active": false,
            "address": {
                "street": "Sint-Denijslaan",
                "nr": "96",
                "zipcode": "9000",
                "city": "Gent",
                "country": "BE",
                "position": {
                    "latitude": 1.54361,
                    "longitude": 0.45645
                }
            },
            "allow_comments": true,
            "allow_orders": true,
            "delivery_use_intervals": true,
            "id": 16,
            "avatar": {
                "resolutions": [
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    }
                ],
                "white_background": true
            },
            "banner": {
                "resolutions": [
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    }
                ],
                "white_background": false
            }
        },
        {
            "name": "Melyna Treutel",
            "active": false,
            "address": {
                "street": "Sint-Denijslaan",
                "nr": "96",
                "zipcode": "9000",
                "city": "Gent",
                "country": "BE",
                "position": {
                    "latitude": 1.54361,
                    "longitude": 0.45645
                }
            },
            "allow_comments": true,
            "allow_orders": false,
            "delivery_use_intervals": false,
            "id": 15,
            "avatar": {
                "resolutions": [
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    }
                ],
                "white_background": false
            },
            "banner": {
                "resolutions": [
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    }
                ],
                "white_background": true
            }
        }
    ],
    "id": 14,
    "banner": {
        "resolutions": [
            {
                "src": "https://example.com",
                "width": 600,
                "height": 350
            },
            {
                "src": "https://example.com",
                "width": 600,
                "height": 350
            },
            {
                "src": "https://example.com",
                "width": 600,
                "height": 350
            }
        ],
        "white_background": false
    },
    "seo": {
        "title": {
            "en": "Ex praesentium amet voluptatem expedita laudantium fugit nemo."
        },
        "description": {
            "en": "Hic doloribus iusto pariatur et quia in optio. Aliquid enim sit omnis placeat alias molestiae. Placeat ut unde incidunt quis et. Praesentium sed ut quasi."
        },
        "url": {
            "en": "https://schimmel.info/nihil-cum-consequuntur-delectus.html"
        }
    }
}
Version update available Please adjust your integration to the latest stable version (1.9.0)
1.1.0 stable