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.2
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 713
{
    "name": "Dustin Fadel",
    "description": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "active": true,
    "only_order_in_store": true,
    "shop_ids": [
        17,
        14,
        16
    ],
    "seo": {
        "title": {
            "en": "Quo quis nulla dicta pariatur necessitatibus."
        },
        "description": {
            "en": "Ut expedita tenetur dolor similique et. Dolorem maiores illo magnam laborum quam consequuntur eum. Officia quia ut aut sunt qui."
        },
        "url": {
            "en": "https://www.pfannerstill.org/velit-qui-nihil-consequatur-voluptas-ut"
        }
    },
    "product_ids": [
        19,
        16,
        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: 13746

{
    "name": "Monroe Armstrong",
    "description": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "active": true,
    "only_order_in_store": false,
    "products": [
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "description": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "specialty": true,
            "active": false,
            "only_order_in_store": false,
            "price_type": "PER_UNIT",
            "price": 18,
            "target_price": false,
            "url_type": "none",
            "url": "https://example.com",
            "min_max": {
                "amount": {
                    "minimum": 10,
                    "maximum": 15,
                    "maximum_day": 16,
                    "maximum_week": 13
                },
                "weight": {
                    "minimum": 13,
                    "maximum": 14,
                    "maximum_day": 16,
                    "maximum_week": 14,
                    "suggested": 13
                },
                "persons": {
                    "minimum": 12,
                    "maximum": 14
                }
            },
            "id": 15,
            "allergens": [
                {
                    "id": 19,
                    "name": "Peanut"
                },
                {
                    "id": 10,
                    "name": "Fish"
                },
                {
                    "id": 19,
                    "name": "Egg"
                }
            ],
            "category_id": 11,
            "price_look_up_code": "...",
            "code": "...",
            "seo": {
                "title": {
                    "en": "Eaque vel inventore quod adipisci cumque nulla illum."
                },
                "description": {
                    "en": "Neque quia est aut. Explicabo et et quis nobis unde atque. In eum voluptatem quaerat et alias tenetur aut. Accusamus quibusdam non fuga quis."
                },
                "url": {
                    "en": "http://bernier.com/sit-iste-ab-et-vero"
                }
            }
        },
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "description": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "specialty": true,
            "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": 12,
                    "maximum": 17,
                    "maximum_day": 15,
                    "maximum_week": 12
                },
                "weight": {
                    "minimum": 18,
                    "maximum": 17,
                    "maximum_day": 14,
                    "maximum_week": 14,
                    "suggested": 16
                },
                "persons": {
                    "minimum": 19,
                    "maximum": 19
                }
            },
            "id": 15,
            "allergens": [
                {
                    "id": 14,
                    "name": "Soy"
                },
                {
                    "id": 11,
                    "name": "Lupine"
                },
                {
                    "id": 16,
                    "name": "Milk"
                }
            ],
            "category_id": 10,
            "price_look_up_code": "...",
            "code": "...",
            "seo": {
                "title": {
                    "en": "Itaque et ipsam eaque blanditiis quisquam nisi itaque."
                },
                "description": {
                    "en": "Harum et magnam quo architecto consequuntur. Cum et adipisci dolorem. Occaecati quia rerum non modi eos rerum. Consequatur pariatur ut repellendus doloremque consequatur fugiat provident."
                },
                "url": {
                    "en": "https://zieme.biz/voluptate-nisi-vel-delectus-quia.html"
                }
            }
        },
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "description": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "specialty": false,
            "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": 17,
                    "maximum": 18,
                    "maximum_day": 11,
                    "maximum_week": 10
                },
                "weight": {
                    "minimum": 14,
                    "maximum": 17,
                    "maximum_day": 13,
                    "maximum_week": 16,
                    "suggested": 10
                },
                "persons": {
                    "minimum": 11,
                    "maximum": 13
                }
            },
            "id": 11,
            "allergens": [
                {
                    "id": 18,
                    "name": "Sulphite"
                },
                {
                    "id": 13,
                    "name": "Egg"
                },
                {
                    "id": 10,
                    "name": "Peanut"
                }
            ],
            "category_id": 19,
            "price_look_up_code": "...",
            "code": "...",
            "seo": {
                "title": {
                    "en": "Est aut voluptatem esse non aut veniam."
                },
                "description": {
                    "en": "Consequatur ratione tempore nam tenetur voluptatem mollitia suscipit. Quis quis voluptatibus libero aliquid perferendis quis. Minus veritatis voluptates repudiandae exercitationem veniam rem dolorum."
                },
                "url": {
                    "en": "http://romaguera.com/ut-enim-blanditiis-molestiae-ab-autem-similique.html"
                }
            }
        }
    ],
    "shops": [
        {
            "name": "Dr. Cloyd Considine Jr.",
            "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": true,
            "delivery_use_intervals": true,
            "allow_invoices": true,
            "allow_order_comments": false,
            "allow_product_comments": false,
            "takeout_use_intervals": false,
            "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": 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": "Prof. Ivah Rutherford Jr.",
            "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,
            "allow_invoices": true,
            "allow_order_comments": false,
            "allow_product_comments": true,
            "takeout_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": "Scarlett Lubowitz",
            "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,
            "allow_invoices": true,
            "allow_order_comments": false,
            "allow_product_comments": true,
            "takeout_use_intervals": false,
            "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": 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": 15,
    "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": "Non adipisci iure magnam nam molestiae."
        },
        "description": {
            "en": "Qui fugiat eum quaerat aut et ut exercitationem. Quis voluptates deleniti est quo. Qui mollitia dolores non a alias ab. Cumque nemo in aliquid velit."
        },
        "url": {
            "en": "http://purdy.com/neque-non-omnis-quos-magni-vitae-libero"
        }
    }
}
Version update available Please adjust your integration to the latest stable version (1.9.0)
1.5.2 stable