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/18/categories HTTP/1.1
Host: api.bakeronline.be
X-VERSION: 1.0.1
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 678
{
    "name": "Prof. Melvina Kessler PhD",
    "description": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "active": true,
    "only_order_in_store": true,
    "shop_ids": [
        13,
        12,
        10
    ],
    "seo": {
        "title": {
            "en": "Aut impedit ut eveniet et dolorum expedita et."
        },
        "description": {
            "en": "Nulla totam eius a ipsum ea. Modi occaecati aut voluptatem labore qui veritatis."
        },
        "url": {
            "en": "http://rempel.org/velit-qui-consequatur-qui-ex-quidem-deleniti.html"
        }
    },
    "product_ids": [
        14,
        15,
        14
    ]
}

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: 13154

{
    "name": "Bernardo Schultz",
    "description": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "active": true,
    "only_order_in_store": true,
    "products": [
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "description": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "specialty": true,
            "active": false,
            "only_order_in_store": false,
            "price_type": "PER_UNIT",
            "price": 16,
            "target_price": true,
            "url_type": "none",
            "url": "https://example.com",
            "min_max": {
                "amount": {
                    "minimum": 11,
                    "maximum": 16,
                    "maximum_day": 16,
                    "maximum_week": 13
                },
                "weight": {
                    "minimum": 14,
                    "maximum": 10,
                    "maximum_day": 17,
                    "maximum_week": 12,
                    "suggested": 16
                },
                "persons": {
                    "minimum": 12,
                    "maximum": 14
                }
            },
            "id": 15,
            "allergens": [
                {
                    "id": 11,
                    "name": "Egg"
                },
                {
                    "id": 19,
                    "name": "Fish"
                },
                {
                    "id": 15,
                    "name": "Gluten"
                }
            ],
            "category_id": 18,
            "price_look_up_code": "...",
            "seo": {
                "title": {
                    "en": "Unde veritatis quibusdam velit eum sequi et itaque sit."
                },
                "description": {
                    "en": "Quis magnam alias in temporibus repellat officiis similique repudiandae. Est maxime dolores quo dolores. Eum rerum quia illo. Nisi eos quisquam et fuga ut."
                },
                "url": {
                    "en": "http://weimann.com/"
                }
            },
            "code": "..."
        },
        {
            "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": 13,
                    "maximum": 12,
                    "maximum_day": 19,
                    "maximum_week": 15
                },
                "weight": {
                    "minimum": 15,
                    "maximum": 15,
                    "maximum_day": 17,
                    "maximum_week": 18,
                    "suggested": 19
                },
                "persons": {
                    "minimum": 17,
                    "maximum": 13
                }
            },
            "id": 19,
            "allergens": [
                {
                    "id": 15,
                    "name": "Lactose"
                },
                {
                    "id": 11,
                    "name": "Egg"
                },
                {
                    "id": 18,
                    "name": "Mollusc"
                }
            ],
            "category_id": 18,
            "price_look_up_code": "...",
            "seo": {
                "title": {
                    "en": "Mollitia consequatur quia architecto repellendus voluptas nesciunt distinctio est."
                },
                "description": {
                    "en": "Autem officia quam occaecati consequatur culpa magni. Eos quo aperiam et totam et. Ullam dolore vitae sequi et."
                },
                "url": {
                    "en": "http://www.funk.biz/"
                }
            },
            "code": "..."
        },
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "description": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "specialty": false,
            "active": false,
            "only_order_in_store": true,
            "price_type": "PER_UNIT",
            "price": 16,
            "target_price": false,
            "url_type": "none",
            "url": "https://example.com",
            "min_max": {
                "amount": {
                    "minimum": 10,
                    "maximum": 18,
                    "maximum_day": 18,
                    "maximum_week": 11
                },
                "weight": {
                    "minimum": 15,
                    "maximum": 11,
                    "maximum_day": 17,
                    "maximum_week": 17,
                    "suggested": 13
                },
                "persons": {
                    "minimum": 19,
                    "maximum": 17
                }
            },
            "id": 14,
            "allergens": [
                {
                    "id": 17,
                    "name": "Peanut"
                },
                {
                    "id": 10,
                    "name": "Nuts"
                },
                {
                    "id": 15,
                    "name": "Lactose"
                }
            ],
            "category_id": 10,
            "price_look_up_code": "...",
            "seo": {
                "title": {
                    "en": "Quas quo sit deleniti repudiandae dolor quis aut."
                },
                "description": {
                    "en": "Inventore corporis quidem aut voluptatem. Recusandae dolorum voluptates quasi necessitatibus. Perferendis molestias quia perferendis."
                },
                "url": {
                    "en": "https://www.abshire.com/omnis-ipsa-culpa-officia-sit"
                }
            },
            "code": "..."
        }
    ],
    "shops": [
        {
            "name": "Trevion Maggio",
            "active": true,
            "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": true,
            "id": 14,
            "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": true
            }
        },
        {
            "name": "Mr. Garfield Satterfield DDS",
            "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": true,
            "id": 14,
            "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
            }
        },
        {
            "name": "Kirstin Ruecker III",
            "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": false,
            "id": 11,
            "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
            }
        }
    ],
    "id": 19,
    "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": "Qui nobis aliquam labore est nihil optio."
        },
        "description": {
            "en": "Molestiae sed voluptatem quia corrupti accusamus fuga. Voluptatem nihil molestiae eum perferendis iusto. Aliquam dolorem nostrum atque rerum tempore. Ullam error consequatur architecto omnis et."
        },
        "url": {
            "en": "http://gerhold.com/exercitationem-ratione-aliquid-culpa-sed-nulla-possimus.html"
        }
    }
}
Version update available Please adjust your integration to the latest stable version (1.9.0)
1.0.1 stable