Create a product

POST /company/companies/@id/products

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 Company ID. Create a product in this company

Body

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

Field Type Description
name [Language: String] Name of the product
description [Language: String] Description of the product
specialty Bool Whether this product is a specialty. Specialties are also displayed in a separate category and are highlighted with a star icon.
active Bool Inactive products are not visible in the webshop
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.
price_type PriceType A product has a price type that defines the price calculations and the way consumers can order the product.
price UInt Price of the product (cents). Please note that this value is ignored when price_type is MULTIPLE_CHOICE.
target_price Bool Is true when it's not possible to provide an exact price of this product when ordering (e.g. not exact weight possible). This option might deactive online payments for orders with this product (shop settings).
url_type String String enumarion of 'none', 'recipe', 'website'
url URL? Nullable. An URL field starting with http:// or https://
min_max company.MinMaxSummary The allowed amounts a customer is allowed to order of a product for amount / weight / persons
option_set_ids [Int] ID's of the option sets you want to assign to this product. You can alter the order by switching the position of the ID's
allergen_ids [Int]? Nullable. ID's of the allergens of this product. Set to null if you don't want to specify allergens. Only use an empty array when the product has no allergens. It is a subtle difference but it has legal consequences if you set this to the wrong value. You can find all the available allergen ID's here.
category_id Int The category ID of the product
seo company.SeoData Optional. Product page SEO metatags
price_look_up_code String? Optional. Nullable. A String value
code String? Optional. Nullable. A custom code. You can set this to your own code and use this field to map your products to Bakeronline products
origin [Language: String] Optional. Origin of the product

Example request 1

POST /company/companies/13/products HTTP/1.1
Host: api.bakeronline.be
X-VERSION: 1.8.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 1475
{
    "name": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "description": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "specialty": false,
    "active": false,
    "only_order_in_store": true,
    "price_type": "PER_UNIT",
    "price": 19,
    "target_price": false,
    "url_type": "none",
    "url": "https://example.com",
    "min_max": {
        "amount": {
            "minimum": 14,
            "maximum": 15,
            "maximum_day": 18,
            "maximum_week": 14
        },
        "weight": {
            "minimum": 14,
            "maximum": 13,
            "maximum_day": 14,
            "maximum_week": 19,
            "suggested": 19
        },
        "persons": {
            "minimum": 12,
            "maximum": 18
        }
    },
    "option_set_ids": [
        14,
        14,
        10
    ],
    "allergen_ids": [
        17,
        18,
        19
    ],
    "category_id": 10,
    "seo": {
        "title": {
            "en": "Non est velit autem suscipit vero ullam perspiciatis nulla."
        },
        "description": {
            "en": "Sint aut eos et ducimus inventore consequatur. Autem quis impedit reprehenderit. Debitis quis recusandae sit non non."
        },
        "url": {
            "en": "http://green.com/"
        }
    },
    "price_look_up_code": "...",
    "code": "...",
    "origin": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    }
}

Response

Field Type Description
name [Language: String] Name of the product
description [Language: String] Description of the product
specialty Bool Whether this product is a specialty. Specialties are also displayed in a separate category and are highlighted with a star icon.
active Bool Inactive products are not visible in the webshop
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.
price_type PriceType A product has a price type that defines the price calculations and the way consumers can order the product.
price UInt Price of the product (cents). Please note that this value is ignored when price_type is MULTIPLE_CHOICE.
target_price Bool Is true when it's not possible to provide an exact price of this product when ordering (e.g. not exact weight possible). This option might deactive online payments for orders with this product (shop settings).
url_type String String enumarion of 'none', 'recipe', 'website'
url URL? Nullable. An URL field starting with http:// or https://
min_max company.MinMaxSummary The allowed amounts a customer is allowed to order of a product for amount / weight / persons
images [Image] Array of Image
product_prices [company.ProductPrice] Array of company.ProductPrice
option_sets [company.OptionSet.simple] Array of company.OptionSet.simple
id Int Id of the product
allergens [Allergen]? Nullable. The allergens of this product. An empty array means no allergens. Null means no allergens specified (= can have allergens, ask in shop).
category_id Int The category ID of the product
price_look_up_code String? Nullable. A String value
code String? Nullable. A custom code. You can set this to your own code and use this field to map your products to Bakeronline products
seo company.SeoData Optional. Product page SEO metatags
origin [Language: String] Optional. Origin of the product

Example response 1

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

{
    "name": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "description": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    },
    "specialty": false,
    "active": false,
    "only_order_in_store": false,
    "price_type": "PER_UNIT",
    "price": 12,
    "target_price": true,
    "url_type": "none",
    "url": "https://example.com",
    "min_max": {
        "amount": {
            "minimum": 17,
            "maximum": 18,
            "maximum_day": 13,
            "maximum_week": 15
        },
        "weight": {
            "minimum": 10,
            "maximum": 13,
            "maximum_day": 18,
            "maximum_week": 19,
            "suggested": 15
        },
        "persons": {
            "minimum": 13,
            "maximum": 18
        }
    },
    "images": [
        {
            "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
        },
        {
            "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
        },
        {
            "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
        }
    ],
    "product_prices": [
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "price": 10,
            "id": 11,
            "order": 10,
            "price_look_up_code": "...",
            "code": "..."
        },
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "price": 14,
            "id": 14,
            "order": 15,
            "price_look_up_code": "...",
            "code": "..."
        },
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "price": 13,
            "id": 11,
            "order": 16,
            "price_look_up_code": "...",
            "code": "..."
        }
    ],
    "option_sets": [
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "allow_attachment": false,
            "id": 15,
            "code": "...",
            "multiple_choice": true,
            "choose_amount": true,
            "min_different_options": 19,
            "max_different_options": 17,
            "min_amount_options": 19,
            "max_amount_options": 13
        },
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "allow_attachment": false,
            "id": 19,
            "code": "...",
            "multiple_choice": false,
            "choose_amount": false,
            "min_different_options": 16,
            "max_different_options": 19,
            "min_amount_options": 13,
            "max_amount_options": 12
        },
        {
            "name": {
                "nl": "...",
                "en": "...",
                "fr": "..."
            },
            "allow_attachment": false,
            "id": 17,
            "code": "...",
            "multiple_choice": true,
            "choose_amount": false,
            "min_different_options": 12,
            "max_different_options": 13,
            "min_amount_options": 19,
            "max_amount_options": 16
        }
    ],
    "id": 14,
    "allergens": [
        {
            "id": 16,
            "name": "Sulphite"
        },
        {
            "id": 13,
            "name": "Mustard"
        },
        {
            "id": 13,
            "name": "Lactose"
        }
    ],
    "category_id": 13,
    "price_look_up_code": "...",
    "code": "...",
    "seo": {
        "title": {
            "en": "Animi et nesciunt tempore ipsam ut voluptatem sunt amet."
        },
        "description": {
            "en": "Accusamus tempore officia cum soluta illum incidunt illum rerum. Quia ut et vel ratione eius omnis ad. Voluptatum aliquam eligendi et esse in."
        },
        "url": {
            "en": "http://www.hansen.com/fugit-nesciunt-sint-suscipit"
        }
    },
    "origin": {
        "nl": "...",
        "en": "...",
        "fr": "..."
    }
}
Version update available Please adjust your integration to the latest stable version (1.9.0)
1.8.0 stable