Patch product by id (edit favourite)

PATCH /shops/@shop/products/@id

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
shop Int An integer value
id Int An integer value

Body

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

Field Type Description
favourite Bool A boolean value

Example request 1 Set a product to favourite

PATCH /shops/114/products/299 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer bab7708c7366f127d6a8be4fdb4de27d0c13931fc8cff3653bd4efb15216ab222aa95072c164ab637ff068090a5909339ed2e3c0b086df79b28d15ac9214a0f7f762e425d8eb3b7c309092fb569ed9c9deb491813c4d911ce859d39a34ae06bde2958ce1
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 25
{
    "favourite": true
}

Example request 2 Set a product to favourite when it already is a favourite

PATCH /shops/114/products/299 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer bab7708c7366f127d6a8be4fdb4de27d0c13931fc8cff3653bd4efb15216ab222aa95072c164ab637ff068090a5909339ed2e3c0b086df79b28d15ac9214a0f7f762e425d8eb3b7c309092fb569ed9c9deb491813c4d911ce859d39a34ae06bde2958ce1
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 25
{
    "favourite": true
}

Example request 3 Set a product to favourite when it already is a favourite and check if we don't have multiple favourites

PATCH /shops/114/products/299 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer bab7708c7366f127d6a8be4fdb4de27d0c13931fc8cff3653bd4efb15216ab222aa95072c164ab637ff068090a5909339ed2e3c0b086df79b28d15ac9214a0f7f762e425d8eb3b7c309092fb569ed9c9deb491813c4d911ce859d39a34ae06bde2958ce1
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 25
{
    "favourite": true
}

Example request 4 Remove favourite

PATCH /shops/114/products/299 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer bab7708c7366f127d6a8be4fdb4de27d0c13931fc8cff3653bd4efb15216ab222aa95072c164ab637ff068090a5909339ed2e3c0b086df79b28d15ac9214a0f7f762e425d8eb3b7c309092fb569ed9c9deb491813c4d911ce859d39a34ae06bde2958ce1
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 26
{
    "favourite": false
}

Example request 5 No permission to edit other fields

PATCH /shops/114/products/299 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer bab7708c7366f127d6a8be4fdb4de27d0c13931fc8cff3653bd4efb15216ab222aa95072c164ab637ff068090a5909339ed2e3c0b086df79b28d15ac9214a0f7f762e425d8eb3b7c309092fb569ed9c9deb491813c4d911ce859d39a34ae06bde2958ce1
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 18
{
    "price": 0
}

Response

Field Type Description
id Int Id of the product
name String Name of the product (translated)
images [Image] Array of Image
price_type PriceType A product has a price type that defines the price calculations and the way consumers can order the product.
target_price Bool Is true when the price of the product can change on takeout (e.g. not exact weight)
price Price Price of the product (cents). It only makes sense to use this property when price_type is not multiple choice. Please also check if the shop where you want to order has an offer with a discount for this product available.
subtitle String? Nullable. Important text you need to display under the product name
description String Description of the product (translated)
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)
url URL? Nullable. An URL field starting with http:// or https://
url_type String String enumarion of 'none', 'recipe', 'website'
specialty Bool A boolean value
favourite Bool? Nullable. A boolean value
product_prices [ProductPrice.detailed] Array of ProductPrice.detailed
optionsets [OptionSet.detailed] Array of OptionSet.detailed
min_max MinMaxSummary An overview of the minimum and maximum values for all amount types.
info [Message] A list of messages with information you need to display on the product page.
offer OfferItem? Nullable. Specificies where a discount should get appllied. A shop can give a complete category a discount, or only a certain product, or only a fixed product price. When calculating the discount, always round the price to 1 cent before multiplying it with an amount, persons or kilograms.

Example response 1 Set a product to favourite

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

{
    "id": 299,
    "name": "Zacht Wit",
    "price": {
        "value": 9692,
        "currency": "EUR"
    },
    "images": [
        {
            "resolutions": [
                {
                    "src": "https://bakeronline.be/uploads/tests/250x200/product-paardevlees.jpg",
                    "width": 250,
                    "height": 223
                },
                {
                    "src": "https://bakeronline.be/uploads/tests/1080x720/product-paardevlees.jpg",
                    "width": 1080,
                    "height": 962
                }
            ],
            "white_background": false
        }
    ],
    "price_type": "MULTIPLE_CHOICE",
    "target_price": false,
    "subtitle": null,
    "description": "Random product description",
    "allergens": [
        {
            "id": 1,
            "name": "1319"
        },
        {
            "id": 2,
            "name": "1320"
        },
        {
            "id": 3,
            "name": "1321"
        },
        {
            "id": 4,
            "name": "1322"
        },
        {
            "id": 5,
            "name": "1323"
        },
        {
            "id": 7,
            "name": "1325"
        },
        {
            "id": 8,
            "name": "1326"
        },
        {
            "id": 9,
            "name": "1327"
        },
        {
            "id": 10,
            "name": "1328"
        },
        {
            "id": 12,
            "name": "1330"
        },
        {
            "id": 13,
            "name": "1331"
        },
        {
            "id": 14,
            "name": "1332"
        },
        {
            "id": 15,
            "name": "1333"
        }
    ],
    "url": "https://bodart.org/omnis-assumenda-reiciendis-quam-quod-dignissimos.html",
    "url_type": "recipe",
    "specialty": false,
    "favourite": true,
    "product_prices": [
        {
            "id": 165,
            "name": "3 persons",
            "price": {
                "value": 33,
                "currency": "EUR"
            },
            "offer": null
        },
        {
            "id": 166,
            "name": "4 persons",
            "price": {
                "value": 89,
                "currency": "EUR"
            },
            "offer": null
        },
        {
            "id": 167,
            "name": "5 persons",
            "price": {
                "value": 34,
                "currency": "EUR"
            },
            "offer": null
        }
    ],
    "optionsets": [
        {
            "id": 303,
            "name": "Do you want your bread sliced?",
            "code": null,
            "options": [
                {
                    "id": 1072,
                    "name": "No",
                    "price_change": {
                        "value": 16,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                },
                {
                    "id": 1073,
                    "name": "Yes please",
                    "price_change": {
                        "value": 843,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                }
            ]
        },
        {
            "id": 304,
            "name": "Extra baked?",
            "code": null,
            "options": [
                {
                    "id": 1074,
                    "name": "No",
                    "price_change": {
                        "value": 170,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                },
                {
                    "id": 1075,
                    "name": "Yes",
                    "price_change": {
                        "value": 610,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                }
            ]
        }
    ],
    "min_max": {
        "amount": {
            "suggested": 1,
            "minimum": 1,
            "maximum": null
        },
        "weight": {
            "suggested": 100,
            "minimum": 1,
            "maximum": null
        },
        "persons": {
            "suggested": 1,
            "minimum": 1,
            "maximum": null
        }
    },
    "info": [
        {
            "name": "description",
            "title": "3879",
            "text": "Random product description",
            "type": "PLAIN"
        },
        {
            "name": "availability-takeout",
            "title": "6736",
            "text": "<p>3841</p>",
            "type": "HTML"
        },
        {
            "name": "availability-delivery",
            "title": "5674",
            "text": "<p>3841</p>",
            "type": "HTML"
        },
        {
            "name": "allergens",
            "title": "3882",
            "text": "3883",
            "type": "PLAIN"
        }
    ],
    "offer": null
}

Example response 2 Set a product to favourite when it already is a favourite

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

{
    "id": 299,
    "name": "Zacht Wit",
    "price": {
        "value": 9692,
        "currency": "EUR"
    },
    "images": [
        {
            "resolutions": [
                {
                    "src": "https://bakeronline.be/uploads/tests/250x200/product-paardevlees.jpg",
                    "width": 250,
                    "height": 223
                },
                {
                    "src": "https://bakeronline.be/uploads/tests/1080x720/product-paardevlees.jpg",
                    "width": 1080,
                    "height": 962
                }
            ],
            "white_background": false
        }
    ],
    "price_type": "MULTIPLE_CHOICE",
    "target_price": false,
    "subtitle": null,
    "description": "Random product description",
    "allergens": [
        {
            "id": 1,
            "name": "1319"
        },
        {
            "id": 2,
            "name": "1320"
        },
        {
            "id": 3,
            "name": "1321"
        },
        {
            "id": 4,
            "name": "1322"
        },
        {
            "id": 5,
            "name": "1323"
        },
        {
            "id": 7,
            "name": "1325"
        },
        {
            "id": 8,
            "name": "1326"
        },
        {
            "id": 9,
            "name": "1327"
        },
        {
            "id": 10,
            "name": "1328"
        },
        {
            "id": 12,
            "name": "1330"
        },
        {
            "id": 13,
            "name": "1331"
        },
        {
            "id": 14,
            "name": "1332"
        },
        {
            "id": 15,
            "name": "1333"
        }
    ],
    "url": "https://bodart.org/omnis-assumenda-reiciendis-quam-quod-dignissimos.html",
    "url_type": "recipe",
    "specialty": false,
    "favourite": true,
    "product_prices": [
        {
            "id": 165,
            "name": "3 persons",
            "price": {
                "value": 33,
                "currency": "EUR"
            },
            "offer": null
        },
        {
            "id": 166,
            "name": "4 persons",
            "price": {
                "value": 89,
                "currency": "EUR"
            },
            "offer": null
        },
        {
            "id": 167,
            "name": "5 persons",
            "price": {
                "value": 34,
                "currency": "EUR"
            },
            "offer": null
        }
    ],
    "optionsets": [
        {
            "id": 303,
            "name": "Do you want your bread sliced?",
            "code": null,
            "options": [
                {
                    "id": 1072,
                    "name": "No",
                    "price_change": {
                        "value": 16,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                },
                {
                    "id": 1073,
                    "name": "Yes please",
                    "price_change": {
                        "value": 843,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                }
            ]
        },
        {
            "id": 304,
            "name": "Extra baked?",
            "code": null,
            "options": [
                {
                    "id": 1074,
                    "name": "No",
                    "price_change": {
                        "value": 170,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                },
                {
                    "id": 1075,
                    "name": "Yes",
                    "price_change": {
                        "value": 610,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                }
            ]
        }
    ],
    "min_max": {
        "amount": {
            "suggested": 1,
            "minimum": 1,
            "maximum": null
        },
        "weight": {
            "suggested": 100,
            "minimum": 1,
            "maximum": null
        },
        "persons": {
            "suggested": 1,
            "minimum": 1,
            "maximum": null
        }
    },
    "info": [
        {
            "name": "description",
            "title": "3879",
            "text": "Random product description",
            "type": "PLAIN"
        },
        {
            "name": "availability-takeout",
            "title": "6736",
            "text": "<p>3841</p>",
            "type": "HTML"
        },
        {
            "name": "availability-delivery",
            "title": "5674",
            "text": "<p>3841</p>",
            "type": "HTML"
        },
        {
            "name": "allergens",
            "title": "3882",
            "text": "3883",
            "type": "PLAIN"
        }
    ],
    "offer": null
}

Example response 3 Set a product to favourite when it already is a favourite and check if we don't have multiple favourites

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

{
    "id": 299,
    "name": "Zacht Wit",
    "price": {
        "value": 9692,
        "currency": "EUR"
    },
    "images": [
        {
            "resolutions": [
                {
                    "src": "https://bakeronline.be/uploads/tests/250x200/product-paardevlees.jpg",
                    "width": 250,
                    "height": 223
                },
                {
                    "src": "https://bakeronline.be/uploads/tests/1080x720/product-paardevlees.jpg",
                    "width": 1080,
                    "height": 962
                }
            ],
            "white_background": false
        }
    ],
    "price_type": "MULTIPLE_CHOICE",
    "target_price": false,
    "subtitle": null,
    "description": "Random product description",
    "allergens": [
        {
            "id": 1,
            "name": "1319"
        },
        {
            "id": 2,
            "name": "1320"
        },
        {
            "id": 3,
            "name": "1321"
        },
        {
            "id": 4,
            "name": "1322"
        },
        {
            "id": 5,
            "name": "1323"
        },
        {
            "id": 7,
            "name": "1325"
        },
        {
            "id": 8,
            "name": "1326"
        },
        {
            "id": 9,
            "name": "1327"
        },
        {
            "id": 10,
            "name": "1328"
        },
        {
            "id": 12,
            "name": "1330"
        },
        {
            "id": 13,
            "name": "1331"
        },
        {
            "id": 14,
            "name": "1332"
        },
        {
            "id": 15,
            "name": "1333"
        }
    ],
    "url": "https://bodart.org/omnis-assumenda-reiciendis-quam-quod-dignissimos.html",
    "url_type": "recipe",
    "specialty": false,
    "favourite": true,
    "product_prices": [
        {
            "id": 165,
            "name": "3 persons",
            "price": {
                "value": 33,
                "currency": "EUR"
            },
            "offer": null
        },
        {
            "id": 166,
            "name": "4 persons",
            "price": {
                "value": 89,
                "currency": "EUR"
            },
            "offer": null
        },
        {
            "id": 167,
            "name": "5 persons",
            "price": {
                "value": 34,
                "currency": "EUR"
            },
            "offer": null
        }
    ],
    "optionsets": [
        {
            "id": 303,
            "name": "Do you want your bread sliced?",
            "code": null,
            "options": [
                {
                    "id": 1072,
                    "name": "No",
                    "price_change": {
                        "value": 16,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                },
                {
                    "id": 1073,
                    "name": "Yes please",
                    "price_change": {
                        "value": 843,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                }
            ]
        },
        {
            "id": 304,
            "name": "Extra baked?",
            "code": null,
            "options": [
                {
                    "id": 1074,
                    "name": "No",
                    "price_change": {
                        "value": 170,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                },
                {
                    "id": 1075,
                    "name": "Yes",
                    "price_change": {
                        "value": 610,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                }
            ]
        }
    ],
    "min_max": {
        "amount": {
            "suggested": 1,
            "minimum": 1,
            "maximum": null
        },
        "weight": {
            "suggested": 100,
            "minimum": 1,
            "maximum": null
        },
        "persons": {
            "suggested": 1,
            "minimum": 1,
            "maximum": null
        }
    },
    "info": [
        {
            "name": "description",
            "title": "3879",
            "text": "Random product description",
            "type": "PLAIN"
        },
        {
            "name": "availability-takeout",
            "title": "6736",
            "text": "<p>3841</p>",
            "type": "HTML"
        },
        {
            "name": "availability-delivery",
            "title": "5674",
            "text": "<p>3841</p>",
            "type": "HTML"
        },
        {
            "name": "allergens",
            "title": "3882",
            "text": "3883",
            "type": "PLAIN"
        }
    ],
    "offer": null
}

Example response 4 Remove favourite

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

{
    "id": 299,
    "name": "Zacht Wit",
    "price": {
        "value": 9692,
        "currency": "EUR"
    },
    "images": [
        {
            "resolutions": [
                {
                    "src": "https://bakeronline.be/uploads/tests/250x200/product-paardevlees.jpg",
                    "width": 250,
                    "height": 223
                },
                {
                    "src": "https://bakeronline.be/uploads/tests/1080x720/product-paardevlees.jpg",
                    "width": 1080,
                    "height": 962
                }
            ],
            "white_background": false
        }
    ],
    "price_type": "MULTIPLE_CHOICE",
    "target_price": false,
    "subtitle": null,
    "description": "Random product description",
    "allergens": [
        {
            "id": 1,
            "name": "1319"
        },
        {
            "id": 2,
            "name": "1320"
        },
        {
            "id": 3,
            "name": "1321"
        },
        {
            "id": 4,
            "name": "1322"
        },
        {
            "id": 5,
            "name": "1323"
        },
        {
            "id": 7,
            "name": "1325"
        },
        {
            "id": 8,
            "name": "1326"
        },
        {
            "id": 9,
            "name": "1327"
        },
        {
            "id": 10,
            "name": "1328"
        },
        {
            "id": 12,
            "name": "1330"
        },
        {
            "id": 13,
            "name": "1331"
        },
        {
            "id": 14,
            "name": "1332"
        },
        {
            "id": 15,
            "name": "1333"
        }
    ],
    "url": "https://bodart.org/omnis-assumenda-reiciendis-quam-quod-dignissimos.html",
    "url_type": "recipe",
    "specialty": false,
    "favourite": false,
    "product_prices": [
        {
            "id": 165,
            "name": "3 persons",
            "price": {
                "value": 33,
                "currency": "EUR"
            },
            "offer": null
        },
        {
            "id": 166,
            "name": "4 persons",
            "price": {
                "value": 89,
                "currency": "EUR"
            },
            "offer": null
        },
        {
            "id": 167,
            "name": "5 persons",
            "price": {
                "value": 34,
                "currency": "EUR"
            },
            "offer": null
        }
    ],
    "optionsets": [
        {
            "id": 303,
            "name": "Do you want your bread sliced?",
            "code": null,
            "options": [
                {
                    "id": 1072,
                    "name": "No",
                    "price_change": {
                        "value": 16,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                },
                {
                    "id": 1073,
                    "name": "Yes please",
                    "price_change": {
                        "value": 843,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                }
            ]
        },
        {
            "id": 304,
            "name": "Extra baked?",
            "code": null,
            "options": [
                {
                    "id": 1074,
                    "name": "No",
                    "price_change": {
                        "value": 170,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                },
                {
                    "id": 1075,
                    "name": "Yes",
                    "price_change": {
                        "value": 610,
                        "currency": "EUR"
                    },
                    "image": null,
                    "require_image": false,
                    "code": null
                }
            ]
        }
    ],
    "min_max": {
        "amount": {
            "suggested": 1,
            "minimum": 1,
            "maximum": null
        },
        "weight": {
            "suggested": 100,
            "minimum": 1,
            "maximum": null
        },
        "persons": {
            "suggested": 1,
            "minimum": 1,
            "maximum": null
        }
    },
    "info": [
        {
            "name": "description",
            "title": "3879",
            "text": "Random product description",
            "type": "PLAIN"
        },
        {
            "name": "availability-takeout",
            "title": "6736",
            "text": "<p>3841</p>",
            "type": "HTML"
        },
        {
            "name": "availability-delivery",
            "title": "5674",
            "text": "<p>3841</p>",
            "type": "HTML"
        },
        {
            "name": "allergens",
            "title": "3882",
            "text": "3883",
            "type": "PLAIN"
        }
    ],
    "offer": null
}

Example response 5 No permission to edit other fields

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

[
    {
        "code": "unknown_field",
        "message": "Field price is not expected",
        "field": "data"
    }
]
1.5.0 stable