Update a shop

PATCH /company/shops/@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
id Int The ID of the shop you want to update

Body

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

Field Type Description
name String Name of the shop (not translateable for now)
active Bool A boolean value
address Address.detailed An address
allow_comments Bool A boolean value
allow_orders Bool A boolean value
delivery_use_intervals Bool A boolean value
category_ids [Int] List of the categories (in the right order) of all the categories visible for the shop
category_groups [company.CategoryGroup] List of the category groups linked to the shop. More information can be found on the category group documentation page.

Example request 1 Update basic shop

PATCH /company/shops/2977 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer be0275b39761320c4918fb6f50a6aeef735eb8df715af3cb0ddb3463f1670fdb508bc85913fda4dbb498268f7902693b2eeb2680542087da29d5c0cd7771f02a9bda5430d4b339a176244c0cc7e96cdbdf2ff4c5814ec598efefe8e303340b3b93290576
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 1093
{
    "name": "Shop name",
    "active": true,
    "address": {
        "street": "Sint-Denijslaan",
        "nr": "96",
        "zipcode": "9000",
        "city": "Gent",
        "country": "BE"
    },
    "allow_comments": true,
    "allow_orders": true,
    "delivery_use_intervals": true,
    "category_ids": [
        3979,
        3981,
        3980,
        3978
    ],
    "category_groups": [
        {
            "name": {
                "en": "Group name",
                "nl": "Groep naam"
            },
            "active": true,
            "category_ids": [
                3979,
                3980,
                3981
            ]
        },
        {
            "name": {
                "en": "Group name 2",
                "nl": "Groep naam 2"
            },
            "active": true,
            "category_ids": [
                3979
            ]
        },
        {
            "name": {
                "en": "Group name 3",
                "nl": "Groep naam 3"
            },
            "active": false,
            "category_ids": []
        }
    ]
}

Example request 2 Set category group categories to an invalid category

PATCH /company/shops/2977 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer be0275b39761320c4918fb6f50a6aeef735eb8df715af3cb0ddb3463f1670fdb508bc85913fda4dbb498268f7902693b2eeb2680542087da29d5c0cd7771f02a9bda5430d4b339a176244c0cc7e96cdbdf2ff4c5814ec598efefe8e303340b3b93290576
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 747
{
    "category_groups": [
        {
            "name": {
                "en": "Group name",
                "nl": "Groep naam"
            },
            "active": true,
            "category_ids": [
                3979,
                3980,
                3981
            ]
        },
        {
            "name": {
                "en": "Group name 2",
                "nl": "Groep naam 2"
            },
            "active": true,
            "category_ids": [
                3979,
                95691962323
            ]
        },
        {
            "name": {
                "en": "Group name 3",
                "nl": "Groep naam 3"
            },
            "active": false,
            "category_ids": []
        }
    ]
}

Example request 3 Update category groups with uuid

PATCH /company/shops/2979 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer be0275b39761320c4918fb6f50a6aeef735eb8df715af3cb0ddb3463f1670fdb508bc85913fda4dbb498268f7902693b2eeb2680542087da29d5c0cd7771f02a9bda5430d4b339a176244c0cc7e96cdbdf2ff4c5814ec598efefe8e303340b3b93290576
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 808
{
    "category_groups": [
        {
            "uuid": "abc123",
            "name": {
                "en": "Group name",
                "nl": "Groep naam"
            },
            "active": true,
            "category_ids": [
                3982,
                3983,
                3984
            ]
        },
        {
            "uuid": "abc124",
            "name": {
                "en": "Group name 2",
                "nl": "Groep naam 2"
            },
            "active": true,
            "category_ids": [
                3982
            ]
        },
        {
            "uuid": "abc125",
            "name": {
                "en": "Group name 3",
                "nl": "Groep naam 3"
            },
            "active": false,
            "category_ids": []
        }
    ]
}

Response

Field Type Description
name String Name of the shop (not translateable for now)
active Bool A boolean value
address Address.detailed An address
allow_comments Bool A boolean value
allow_orders Bool A boolean value
delivery_use_intervals Bool A boolean value
categories [company.Category.simple] List of the categories of all the categories visible for the shop
category_groups [company.CategoryGroup] List of the category groups linked to the shop. More information can be found on the category group documentation page.
id Int ID of the shop
avatar Image? Nullable.
banner Image? Nullable.

Example response 1 Update basic shop

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

{
    "id": 2977,
    "name": "Shop name",
    "active": true,
    "address": {
        "street": "Sint-Denijslaan",
        "nr": "96",
        "zipcode": "9000",
        "city": "Gent",
        "country": "BE",
        "position": {
            "latitude": 50.8503396,
            "longitude": 4.3517103
        }
    },
    "avatar": {
        "resolutions": [
            {
                "src": "https://bakeronline.be/uploads/shop-avatars/2977/180x180/bakkerij-laurens.jpg",
                "width": 180,
                "height": 271
            },
            {
                "src": "https://bakeronline.be/uploads/shop-avatars/2977/360x360/bakkerij-laurens.jpg",
                "width": 199,
                "height": 300
            }
        ]
    },
    "banner": null,
    "allow_comments": true,
    "allow_orders": true,
    "delivery_use_intervals": true,
    "categories": [
        {
            "id": 3979,
            "name": {
                "nl": "MediumBlue"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        },
        {
            "id": 3981,
            "name": {
                "nl": "DarkViolet"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        },
        {
            "id": 3980,
            "name": {
                "nl": "LightPink"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        },
        {
            "id": 3978,
            "name": {
                "nl": "Moccasin"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        }
    ],
    "category_groups": [
        {
            "name": {
                "en": "Group name",
                "nl": "Groep naam"
            },
            "active": true,
            "category_ids": [
                3979,
                3980,
                3981
            ],
            "uuid": "5e94b890-af81-4ca7-8c0c-1629892a9cb3"
        },
        {
            "name": {
                "en": "Group name 2",
                "nl": "Groep naam 2"
            },
            "active": true,
            "category_ids": [
                3979
            ],
            "uuid": "f0b71c7c-e293-456f-854d-d7fd3ed941e9"
        },
        {
            "name": {
                "en": "Group name 3",
                "nl": "Groep naam 3"
            },
            "active": false,
            "category_ids": [],
            "uuid": "820901ad-b816-4aec-9707-cd62b082b572"
        }
    ]
}

Example response 2 Set category group categories to an invalid category

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

{
    "code": "invalid_field",
    "message": "Invalid categories. Check if all the category ids are assigned to the shop first before adding them to a category group.",
    "field": "category_groups.1.category_ids"
}

Example response 3 Update category groups with uuid

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

{
    "id": 2979,
    "name": "The Secret Ingredient",
    "active": true,
    "address": {
        "street": "Gilsonring",
        "nr": "94",
        "zipcode": "3128",
        "city": "Bree",
        "country": "BE",
        "position": {
            "latitude": 51.05,
            "longitude": 3.71667
        }
    },
    "avatar": {
        "resolutions": [
            {
                "src": "https://bakeronline.be/uploads/shop-avatars/2979/180x180/bakkerij-kris-waarschoot.jpg",
                "width": 270,
                "height": 180
            },
            {
                "src": "https://bakeronline.be/uploads/shop-avatars/2979/360x360/bakkerij-kris-waarschoot.jpg",
                "width": 450,
                "height": 300
            }
        ]
    },
    "banner": null,
    "allow_comments": false,
    "allow_orders": true,
    "delivery_use_intervals": false,
    "categories": [
        {
            "id": 3982,
            "name": {
                "nl": "PaleTurquoise"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        },
        {
            "id": 3983,
            "name": {
                "nl": "NavajoWhite"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        },
        {
            "id": 3984,
            "name": {
                "nl": "LavenderBlush"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        }
    ],
    "category_groups": [
        {
            "name": {
                "en": "Group name",
                "nl": "Groep naam"
            },
            "active": true,
            "category_ids": [
                3982,
                3983,
                3984
            ],
            "uuid": "abc123"
        },
        {
            "name": {
                "en": "Group name 2",
                "nl": "Groep naam 2"
            },
            "active": true,
            "category_ids": [
                3982
            ],
            "uuid": "abc124"
        },
        {
            "name": {
                "en": "Group name 3",
                "nl": "Groep naam 3"
            },
            "active": false,
            "category_ids": [],
            "uuid": "abc125"
        }
    ]
}
Version update available Please adjust your integration to the latest stable version (1.5.2)
1.5.0 stable