Update multiple products

PATCH /company/products/bulk

Request

Authentication

This endpoint requires authentication.

Header Value
Authorization Set the value to Bearer + + access_token

Body

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

Minimum 1. Maximum 50. Array of company.Product.detailed-id: [company.Product.detailed-id]

company.Product.detailed-id

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 seperate 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 seperate 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
id Int ID of the product you want to update
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

Example request 1 Update multiple products

PATCH /company/products/bulk HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer a5321c4a7903c90a924b3a9681470e034571433fe2aa7a4718bc1ec4f9429a4ba767b98479871e63a9a555a32dc7f787a4a2c091f9da8d7e2357039db838f1725b78abe8bcefafe7be27f17bf67b3e842cfd4c3bcbd70b141559076b2a0c97a0ad954f9b
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 3631
[
    {
        "id": 417,
        "name": {
            "nl": "Brood",
            "en": "Bread",
            "fr": "Pain"
        },
        "description": {
            "nl": "Beschrijving",
            "en": "Description",
            "fr": "Description"
        },
        "specialty": false,
        "active": true,
        "only_order_in_store": false,
        "allergen_ids": [
            1,
            2,
            4
        ],
        "price_look_up_code": "123",
        "price_type": "PER_UNIT",
        "price": 1200,
        "target_price": false,
        "url_type": "recipe",
        "url": "https://www.google.be",
        "min_max": {
            "amount": {
                "minimum": 1,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null
            },
            "weight": {
                "minimum": 100,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null,
                "suggested": 200
            },
            "persons": {
                "minimum": 1,
                "maximum": null
            }
        },
        "seo": {
            "title": {
                "nl": "testSeoTitle NL",
                "en": "testSeoTitle en",
                "fr": "testSeoTitle fr"
            },
            "description": {
                "nl": "testSeoDescr NL",
                "en": "testSeoDescr en",
                "fr": "testSeoDescr fr"
            },
            "url": {
                "nl": "product-nl",
                "en": "product-en",
                "fr": "product-fr"
            }
        },
        "code": "testproductcode",
        "option_set_ids": [
            430,
            431,
            432,
            433
        ]
    },
    {
        "id": 418,
        "name": {
            "nl": "Brood2",
            "en": "Bread2",
            "fr": "Pain2"
        },
        "description": {
            "nl": "Beschrijving",
            "en": "Description",
            "fr": "Description"
        },
        "specialty": false,
        "active": true,
        "only_order_in_store": false,
        "allergen_ids": [
            1,
            2,
            4
        ],
        "price_look_up_code": "123",
        "price_type": "PER_PERSON",
        "price": 1200,
        "target_price": false,
        "url_type": "recipe",
        "url": "https://www.google.be",
        "min_max": {
            "amount": {
                "minimum": 1,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null
            },
            "weight": {
                "minimum": 100,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null,
                "suggested": 200
            },
            "persons": {
                "minimum": 1,
                "maximum": null
            }
        },
        "seo": {
            "title": {
                "nl": "testSeoTitle NL",
                "en": "testSeoTitle en",
                "fr": "testSeoTitle fr"
            },
            "description": {
                "nl": "testSeoDescr NL",
                "en": "testSeoDescr en",
                "fr": "testSeoDescr fr"
            },
            "url": {
                "nl": "product-nl",
                "en": "product-en",
                "fr": "product-fr"
            }
        },
        "code": "testproductcode",
        "option_set_ids": [
            430,
            431,
            432,
            433
        ],
        "category_id": 251
    }
]

Example request 2 Setting an ID is required, even when it's a patch request

PATCH /company/products/bulk HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer a5321c4a7903c90a924b3a9681470e034571433fe2aa7a4718bc1ec4f9429a4ba767b98479871e63a9a555a32dc7f787a4a2c091f9da8d7e2357039db838f1725b78abe8bcefafe7be27f17bf67b3e842cfd4c3bcbd70b141559076b2a0c97a0ad954f9b
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 3612
[
    {
        "name": {
            "nl": "Brood",
            "en": "Bread",
            "fr": "Pain"
        },
        "description": {
            "nl": "Beschrijving",
            "en": "Description",
            "fr": "Description"
        },
        "specialty": false,
        "active": true,
        "only_order_in_store": false,
        "allergen_ids": [
            1,
            2,
            4
        ],
        "price_look_up_code": "123",
        "price_type": "PER_UNIT",
        "price": 1200,
        "target_price": false,
        "url_type": "recipe",
        "url": "https://www.google.be",
        "min_max": {
            "amount": {
                "minimum": 1,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null
            },
            "weight": {
                "minimum": 100,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null,
                "suggested": 200
            },
            "persons": {
                "minimum": 1,
                "maximum": null
            }
        },
        "seo": {
            "title": {
                "nl": "testSeoTitle NL",
                "en": "testSeoTitle en",
                "fr": "testSeoTitle fr"
            },
            "description": {
                "nl": "testSeoDescr NL",
                "en": "testSeoDescr en",
                "fr": "testSeoDescr fr"
            },
            "url": {
                "nl": "product-nl",
                "en": "product-en",
                "fr": "product-fr"
            }
        },
        "code": "testproductcode",
        "option_set_ids": [
            430,
            431,
            432,
            433
        ]
    },
    {
        "id": 418,
        "name": {
            "nl": "Brood2",
            "en": "Bread2",
            "fr": "Pain2"
        },
        "description": {
            "nl": "Beschrijving",
            "en": "Description",
            "fr": "Description"
        },
        "specialty": false,
        "active": true,
        "only_order_in_store": false,
        "allergen_ids": [
            1,
            2,
            4
        ],
        "price_look_up_code": "123",
        "price_type": "PER_PERSON",
        "price": 1200,
        "target_price": false,
        "url_type": "recipe",
        "url": "https://www.google.be",
        "min_max": {
            "amount": {
                "minimum": 1,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null
            },
            "weight": {
                "minimum": 100,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null,
                "suggested": 200
            },
            "persons": {
                "minimum": 1,
                "maximum": null
            }
        },
        "seo": {
            "title": {
                "nl": "testSeoTitle NL",
                "en": "testSeoTitle en",
                "fr": "testSeoTitle fr"
            },
            "description": {
                "nl": "testSeoDescr NL",
                "en": "testSeoDescr en",
                "fr": "testSeoDescr fr"
            },
            "url": {
                "nl": "product-nl",
                "en": "product-en",
                "fr": "product-fr"
            }
        },
        "code": "testproductcode",
        "option_set_ids": [
            430,
            431,
            432,
            433
        ],
        "category_id": 251
    }
]

Response

Array of company.Product.detailed: [company.Product.detailed]

company.Product.detailed

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 seperate 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 seperate 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

Example response 1 Update multiple products

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

[
    {
        "id": 417,
        "name": {
            "en": "Bread",
            "fr": "Pain",
            "nl": "Brood"
        },
        "description": {
            "en": "Description",
            "fr": "Description",
            "nl": "Beschrijving"
        },
        "specialty": false,
        "active": true,
        "only_order_in_store": false,
        "allergens": [
            {
                "id": 4,
                "name": "1322"
            },
            {
                "id": 1,
                "name": "1319"
            },
            {
                "id": 2,
                "name": "1320"
            }
        ],
        "price_look_up_code": "123",
        "price_type": "PER_UNIT",
        "price": 1200,
        "target_price": false,
        "url_type": "recipe",
        "url": "https://www.google.be",
        "min_max": {
            "amount": {
                "minimum": 1,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null
            },
            "weight": {
                "minimum": 100,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null,
                "suggested": 200
            },
            "persons": {
                "minimum": 1,
                "maximum": null
            }
        },
        "seo": {
            "title": {
                "en": "testSeoTitle en",
                "fr": "testSeoTitle fr",
                "nl": "testSeoTitle NL"
            },
            "description": {
                "en": "testSeoDescr en",
                "fr": "testSeoDescr fr",
                "nl": "testSeoDescr NL"
            },
            "url": {
                "en": "product-en",
                "fr": "product-fr",
                "nl": "product-nl"
            }
        },
        "code": "testproductcode",
        "category_id": 249,
        "images": [
            {
                "resolutions": [
                    {
                        "src": "https://bakeronline.be/uploads/tests/250x200/product-creme-bloemsuiker.jpg",
                        "width": 300,
                        "height": 200
                    },
                    {
                        "src": "https://bakeronline.be/uploads/tests/1080x720/product-creme-bloemsuiker.jpg",
                        "width": 1080,
                        "height": 720
                    }
                ],
                "white_background": true
            }
        ],
        "product_prices": [
            {
                "id": 240,
                "name": {
                    "nl": "6 persons"
                },
                "price": 56,
                "order": 1,
                "price_look_up_code": "6271",
                "code": "3750"
            }
        ],
        "option_sets": [
            {
                "id": 430,
                "name": {
                    "nl": "Please select an option"
                },
                "allow_attachment": false,
                "code": null
            },
            {
                "id": 431,
                "name": {
                    "nl": "Do you want your bread sliced?"
                },
                "allow_attachment": false,
                "code": null
            },
            {
                "id": 432,
                "name": {
                    "nl": "Extra baked?"
                },
                "allow_attachment": false,
                "code": null
            },
            {
                "id": 433,
                "name": {
                    "nl": "Do you want a picture on your cake?"
                },
                "allow_attachment": false,
                "code": null
            }
        ]
    },
    {
        "id": 418,
        "name": {
            "en": "Bread2",
            "fr": "Pain2",
            "nl": "Brood2"
        },
        "description": {
            "en": "Description",
            "fr": "Description",
            "nl": "Beschrijving"
        },
        "specialty": false,
        "active": true,
        "only_order_in_store": false,
        "allergens": [
            {
                "id": 1,
                "name": "1319"
            },
            {
                "id": 2,
                "name": "1320"
            },
            {
                "id": 4,
                "name": "1322"
            }
        ],
        "price_look_up_code": "123",
        "price_type": "PER_PERSON",
        "price": 1200,
        "target_price": false,
        "url_type": "recipe",
        "url": "https://www.google.be",
        "min_max": {
            "amount": {
                "minimum": 1,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null
            },
            "weight": {
                "minimum": 100,
                "maximum": null,
                "maximum_day": null,
                "maximum_week": null,
                "suggested": 200
            },
            "persons": {
                "minimum": 1,
                "maximum": null
            }
        },
        "seo": {
            "title": {
                "en": "testSeoTitle en",
                "fr": "testSeoTitle fr",
                "nl": "testSeoTitle NL"
            },
            "description": {
                "en": "testSeoDescr en",
                "fr": "testSeoDescr fr",
                "nl": "testSeoDescr NL"
            },
            "url": {
                "en": "product-en",
                "fr": "product-fr",
                "nl": "product-nl"
            }
        },
        "code": "testproductcode",
        "category_id": 251,
        "images": [
            {
                "resolutions": [
                    {
                        "src": "https://bakeronline.be/uploads/tests/250x200/product-wit-pannen.jpg",
                        "width": 300,
                        "height": 200
                    },
                    {
                        "src": "https://bakeronline.be/uploads/tests/1080x720/product-wit-pannen.jpg",
                        "width": 1080,
                        "height": 720
                    }
                ],
                "white_background": true
            }
        ],
        "product_prices": [],
        "option_sets": [
            {
                "id": 430,
                "name": {
                    "nl": "Please select an option"
                },
                "allow_attachment": false,
                "code": null
            },
            {
                "id": 431,
                "name": {
                    "nl": "Do you want your bread sliced?"
                },
                "allow_attachment": false,
                "code": null
            },
            {
                "id": 432,
                "name": {
                    "nl": "Extra baked?"
                },
                "allow_attachment": false,
                "code": null
            },
            {
                "id": 433,
                "name": {
                    "nl": "Do you want a picture on your cake?"
                },
                "allow_attachment": false,
                "code": null
            }
        ]
    }
]

Example response 2 Setting an ID is required, even when it's a patch request

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 120

[
    {
        "code": "missing_field",
        "message": "Field id is required",
        "field": "data.0.id"
    }
]
1.5.0 stable