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/19/categories HTTP/1.1
Host: api.bakeronline.be
X-VERSION: 1.5.1
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 796
{
    "name": "Bart McLaughlin",
    "description": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "active": true,
    "only_order_in_store": true,
    "shop_ids": [
        10,
        11,
        15
    ],
    "seo": {
        "title": {
            "en": "Distinctio voluptatibus doloribus distinctio unde perspiciatis asperiores quo."
        },
        "description": {
            "en": "Ipsam omnis quas perferendis exercitationem unde. Enim alias velit omnis voluptatibus. Enim eum maxime est nostrum. Sequi praesentium dolores ad sed ea."
        },
        "url": {
            "en": "http://jakubowski.com/libero-culpa-temporibus-incidunt-eaque-excepturi-nostrum-corporis-quo"
        }
    },
    "product_ids": [
        14,
        18,
        17
    ]
}

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

{
    "name": "Harry Yost",
    "description": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "active": true,
    "only_order_in_store": true,
    "products": [
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "description": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "specialty": true,
            "active": true,
            "only_order_in_store": false,
            "price_type": "PER_UNIT",
            "price": 16,
            "target_price": false,
            "url_type": "none",
            "url": "https://example.com",
            "min_max": {
                "amount": {
                    "minimum": 12,
                    "maximum": 17,
                    "maximum_day": 18,
                    "maximum_week": 12
                },
                "weight": {
                    "minimum": 10,
                    "maximum": 11,
                    "maximum_day": 17,
                    "maximum_week": 16,
                    "suggested": 15
                },
                "persons": {
                    "minimum": 18,
                    "maximum": 15
                }
            },
            "id": 16,
            "allergens": [
                {
                    "id": 15,
                    "name": "Fish"
                },
                {
                    "id": 10,
                    "name": "Mollusc"
                },
                {
                    "id": 16,
                    "name": "Nuts"
                }
            ],
            "category_id": 11,
            "price_look_up_code": "...",
            "code": "...",
            "seo": {
                "title": {
                    "en": "Illum eos facere aut non maiores quibusdam assumenda aut quia."
                },
                "description": {
                    "en": "Rerum quo vel commodi voluptatem unde dolores rerum. Minima vel vel odit fugit earum accusantium."
                },
                "url": {
                    "en": "http://bosco.com/blanditiis-at-quo-eveniet-et"
                }
            }
        },
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "description": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "specialty": false,
            "active": false,
            "only_order_in_store": true,
            "price_type": "PER_UNIT",
            "price": 15,
            "target_price": true,
            "url_type": "none",
            "url": "https://example.com",
            "min_max": {
                "amount": {
                    "minimum": 17,
                    "maximum": 17,
                    "maximum_day": 11,
                    "maximum_week": 18
                },
                "weight": {
                    "minimum": 15,
                    "maximum": 11,
                    "maximum_day": 11,
                    "maximum_week": 11,
                    "suggested": 14
                },
                "persons": {
                    "minimum": 10,
                    "maximum": 12
                }
            },
            "id": 14,
            "allergens": [
                {
                    "id": 16,
                    "name": "Mustard"
                },
                {
                    "id": 16,
                    "name": "Gluten"
                },
                {
                    "id": 14,
                    "name": "Crustaceans"
                }
            ],
            "category_id": 15,
            "price_look_up_code": "...",
            "code": "...",
            "seo": {
                "title": {
                    "en": "Quas qui nihil ullam sunt sequi et praesentium voluptas sed doloribus."
                },
                "description": {
                    "en": "Aut quo sed quo et minus neque molestias vitae. Et omnis perferendis optio eos quia ea ex. Inventore non et odit vel. Et porro porro beatae quam voluptatem quam blanditiis molestiae."
                },
                "url": {
                    "en": "http://johnston.com/occaecati-tempore-expedita-sequi-aut-id-necessitatibus-et"
                }
            }
        },
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "description": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "specialty": true,
            "active": true,
            "only_order_in_store": false,
            "price_type": "PER_UNIT",
            "price": 15,
            "target_price": true,
            "url_type": "none",
            "url": "https://example.com",
            "min_max": {
                "amount": {
                    "minimum": 15,
                    "maximum": 12,
                    "maximum_day": 12,
                    "maximum_week": 19
                },
                "weight": {
                    "minimum": 16,
                    "maximum": 11,
                    "maximum_day": 11,
                    "maximum_week": 12,
                    "suggested": 12
                },
                "persons": {
                    "minimum": 13,
                    "maximum": 10
                }
            },
            "id": 16,
            "allergens": [
                {
                    "id": 18,
                    "name": "Soy"
                },
                {
                    "id": 12,
                    "name": "Fish"
                },
                {
                    "id": 17,
                    "name": "Peanut"
                }
            ],
            "category_id": 14,
            "price_look_up_code": "...",
            "code": "...",
            "seo": {
                "title": {
                    "en": "Dolor aliquid et quis non itaque voluptas vero aut."
                },
                "description": {
                    "en": "Inventore quidem et dolores cupiditate voluptatem labore. Voluptatum perferendis non odit itaque. Saepe repellat laboriosam tempore facilis. Fuga corrupti delectus dignissimos quo enim vero et."
                },
                "url": {
                    "en": "http://koch.com/ipsum-reprehenderit-laborum-nobis-soluta-repudiandae-placeat"
                }
            }
        }
    ],
    "shops": [
        {
            "name": "Allison Beatty",
            "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,
            "allow_invoices": true,
            "id": 19,
            "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": "Prof. Monique Boyle",
            "active": false,
            "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,
            "allow_invoices": 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": true
            }
        },
        {
            "name": "Payton Greenholt",
            "active": false,
            "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,
            "allow_invoices": true,
            "id": 10,
            "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
            }
        }
    ],
    "id": 11,
    "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
    },
    "seo": {
        "title": {
            "en": "Ea sint debitis placeat dignissimos maiores dolorem temporibus enim laborum."
        },
        "description": {
            "en": "Aut possimus ipsum cum pariatur dolorem eligendi. Cum ut qui nisi et veritatis est sed officia."
        },
        "url": {
            "en": "https://pouros.biz/rerum-et-consequatur-repudiandae-ab-esse.html"
        }
    }
}
Version update available Please adjust your integration to the latest stable version (1.9.0)
1.5.1 stable