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/1411 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 71e82ee77eed75fd18f09ee71809ddc6768fb79f010fbe0d431576245f7c812fc1f07f9932de16b4b43e39a9705229c88c9eac2cad3df43e88fccf2aeffedafdd1641a21755b723108815c1d06613a10d34892758daa3045ba8d0b04db27420b234b825b
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": [
        2170,
        2168,
        2167,
        2169
    ],
    "category_groups": [
        {
            "name": {
                "en": "Group name",
                "nl": "Groep naam"
            },
            "active": true,
            "category_ids": [
                2168,
                2169,
                2170
            ]
        },
        {
            "name": {
                "en": "Group name 2",
                "nl": "Groep naam 2"
            },
            "active": true,
            "category_ids": [
                2168
            ]
        },
        {
            "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/1411 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 71e82ee77eed75fd18f09ee71809ddc6768fb79f010fbe0d431576245f7c812fc1f07f9932de16b4b43e39a9705229c88c9eac2cad3df43e88fccf2aeffedafdd1641a21755b723108815c1d06613a10d34892758daa3045ba8d0b04db27420b234b825b
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": [
                2168,
                2169,
                2170
            ]
        },
        {
            "name": {
                "en": "Group name 2",
                "nl": "Groep naam 2"
            },
            "active": true,
            "category_ids": [
                2168,
                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/1413 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 71e82ee77eed75fd18f09ee71809ddc6768fb79f010fbe0d431576245f7c812fc1f07f9932de16b4b43e39a9705229c88c9eac2cad3df43e88fccf2aeffedafdd1641a21755b723108815c1d06613a10d34892758daa3045ba8d0b04db27420b234b825b
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": [
                2171,
                2172,
                2173
            ]
        },
        {
            "uuid": "abc124",
            "name": {
                "en": "Group name 2",
                "nl": "Groep naam 2"
            },
            "active": true,
            "category_ids": [
                2171
            ]
        },
        {
            "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: 3353

{
    "id": 1411,
    "name": "Shop name",
    "active": true,
    "address": {
        "street": "Sint-Denijslaan",
        "nr": "96",
        "zipcode": "9000",
        "city": "Gent",
        "country": "BE",
        "position": {
            "latitude": 51.05,
            "longitude": 3.71667
        }
    },
    "avatar": null,
    "banner": {
        "resolutions": [
            {
                "src": "https://bakeronline.be/uploads/banner/1411/1300x315/bakkerij-stefaan-zwevezelestraat.jpg",
                "width": 300,
                "height": 192
            }
        ]
    },
    "allow_comments": true,
    "allow_orders": true,
    "delivery_use_intervals": true,
    "categories": [
        {
            "id": 2170,
            "name": {
                "nl": "Gray"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        },
        {
            "id": 2168,
            "name": {
                "nl": "DarkKhaki"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        },
        {
            "id": 2167,
            "name": {
                "nl": "MediumBlue"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        },
        {
            "id": 2169,
            "name": {
                "nl": "SeaGreen"
            },
            "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": [
                2168,
                2169,
                2170
            ],
            "uuid": "f15d821b-e873-4f54-aff6-827d55c27a5c"
        },
        {
            "name": {
                "en": "Group name 2",
                "nl": "Groep naam 2"
            },
            "active": true,
            "category_ids": [
                2168
            ],
            "uuid": "bf970d8f-8c5e-4906-b5da-f7112312b8f6"
        },
        {
            "name": {
                "en": "Group name 3",
                "nl": "Groep naam 3"
            },
            "active": false,
            "category_ids": [],
            "uuid": "c1f0af43-2a80-43d2-9db3-de30ec50581c"
        }
    ]
}

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: 3275

{
    "id": 1413,
    "name": "Common Scents",
    "active": true,
    "address": {
        "street": "De Costerpad",
        "nr": "74",
        "zipcode": "2370",
        "city": "Binche",
        "country": "BE",
        "position": {
            "latitude": 50.8503396,
            "longitude": 4.3517103
        }
    },
    "avatar": {
        "resolutions": [
            {
                "src": "https://bakeronline.be/uploads/shop-avatars/1413/180x180/bakkerij-in-side-out.gif",
                "width": 180,
                "height": 210
            },
            {
                "src": "https://bakeronline.be/uploads/shop-avatars/1413/360x360/bakkerij-in-side-out.gif",
                "width": 257,
                "height": 300
            }
        ]
    },
    "banner": {
        "resolutions": [
            {
                "src": "https://bakeronline.be/uploads/banner/1413/1300x315/brood-fijngebak-victor.jpg",
                "width": 300,
                "height": 119
            }
        ]
    },
    "allow_comments": true,
    "allow_orders": true,
    "delivery_use_intervals": false,
    "categories": [
        {
            "id": 2171,
            "name": {
                "nl": "SteelBlue"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        },
        {
            "id": 2172,
            "name": {
                "nl": "LightSlateGray"
            },
            "description": {
                "nl": "This is a random description"
            },
            "banner": null,
            "active": true,
            "only_order_in_store": false,
            "seo": {
                "title": [],
                "description": [],
                "url": []
            }
        },
        {
            "id": 2173,
            "name": {
                "nl": "Coral"
            },
            "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": [
                2171,
                2172,
                2173
            ],
            "uuid": "abc123"
        },
        {
            "name": {
                "en": "Group name 2",
                "nl": "Groep naam 2"
            },
            "active": true,
            "category_ids": [
                2171
            ],
            "uuid": "abc124"
        },
        {
            "name": {
                "en": "Group name 3",
                "nl": "Groep naam 3"
            },
            "active": false,
            "category_ids": [],
            "uuid": "abc125"
        }
    ]
}
1.5.0 stable