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/18/holidays HTTP/1.1
Host: api.bakeronline.be
X-VERSION: 1.9.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 1414
{
    "shop_ids": [
        14,
        17,
        14
    ],
    "closed": false,
    "start_date": "2019-01-31",
    "end_date": "2019-01-31",
    "message": "...",
    "upfront": {
        "type": "default",
        "days": 16,
        "time": "12:00",
        "hours": 11,
        "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,
        15
    ],
    "closed": false,
    "start_date": "2019-01-31",
    "end_date": "2019-01-31",
    "message": "...",
    "upfront": {
        "type": "default",
        "days": 14,
        "time": "12:00",
        "hours": 14,
        "minutes": 18
    },
    "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": 17
}
1.9.0 stable