Create a holiday

POST /company/companies/@id/holidays

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 company

Body

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

Field Type Description
shop_ids [Int] Shop ids this holiday applies to
closed Bool Whether the shop is closed during this time or changed it's openings hours
start_date Date Date of when it starts
end_date Date Date of when it ends
message String Message to the customer
upfront Dictionary A dictionary with fields
takeout Dictionary Adjusted calendar hours for takeout
delivery Dictionary Adjusted calendar hours for delivery
open Dictionary Adjusted opening hours

Example request 1

POST /company/companies/11/holidays HTTP/1.1
Host: api.bakeronline.be
X-VERSION: 1.10.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 1413
{
    "shop_ids": [
        15,
        14,
        15
    ],
    "closed": true,
    "start_date": "2019-01-31",
    "end_date": "2019-01-31",
    "message": "...",
    "upfront": {
        "type": "default",
        "days": 18,
        "time": "12:00",
        "hours": 15,
        "minutes": 15
    },
    "takeout": {
        "action": "default",
        "custom_hours": [
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            }
        ]
    },
    "delivery": {
        "action": "default",
        "custom_hours": [
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            }
        ]
    },
    "open": {
        "action": "default",
        "custom_hours": [
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            }
        ]
    }
}

Response

Field Type Description
shop_ids [Int] Shop ids this holiday applies to
closed Bool Whether the shop is closed during this time or changed it's openings hours
start_date Date Date of when it starts
end_date Date Date of when it ends
message String Message to the customer
upfront Dictionary A dictionary with fields
takeout Dictionary Adjusted calendar hours for takeout
delivery Dictionary Adjusted calendar hours for delivery
open Dictionary Adjusted opening hours
id Int Id of the holiday

Example response 1

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

{
    "shop_ids": [
        11,
        17,
        10
    ],
    "closed": false,
    "start_date": "2019-01-31",
    "end_date": "2019-01-31",
    "message": "...",
    "upfront": {
        "type": "default",
        "days": 11,
        "time": "12:00",
        "hours": 10,
        "minutes": 15
    },
    "takeout": {
        "action": "default",
        "custom_hours": [
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            }
        ]
    },
    "delivery": {
        "action": "default",
        "custom_hours": [
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            }
        ]
    },
    "open": {
        "action": "default",
        "custom_hours": [
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            },
            {
                "start": "12:00",
                "end": "12:00"
            }
        ]
    },
    "id": 10
}
This is a development version Do not use this version in production
1.10.0 development