Skip to content

Bookings

Booking List

GET /api/v2/booking_list : List of bookings under a manager.

  • Every call expects the following parameters: resource_id, date_from, date_to, time_from, time_to, show_details
  • resource_id field should contain the unique ID of the Resource at Locaboo.
  • date_from and date_to are the date-range of the bookings to retrieve. The expected format is Y-m-d.
  • time_from and time_to are the time-range of the bookings to retrieve. The expected format is H:i. This is optional.
  • show_details is a flag to retrieve additional information of the bookings. Expected values are true|false. This is optional, and defaults to false.

Each booking carries created_on (creation timestamp, Y-m-d H:i:s, null for bookings predating timestamp tracking) and created_by (the user who created the booking as {id, name}, or null when unknown). Bookings created via the API or the public widget's guest checkout are attributed to the resource-owning manager.

Example request

GET /api/v2/booking_list?api_secret_key=<api_secret_key>&date_from=2023-10-11&date_to=2023-10-13&show_details=true

Example response

json
{
    "data": [
        {
            "id": 312834,
            "title": "",
            "resources": [
                {
                    "resource_id": 48,
                    "resource": "Sample Resource B",
                    "instances": {
                        "39518": {
                            "id": 39518,
                            "resource_id": 49,
                            "resource": "Sample Resource B > Kleine Halle",
                            "from": "2023-10-11 11:00",
                            "to": "2023-10-11 14:00",
                            "custom_fields": []
                        },
                        "39519": {
                            "id": 39519,
                            "resource_id": 49,
                            "resource": "Sample Resource B > Kleine Halle",
                            "from": "2023-10-12 11:00",
                            "to": "2023-10-12 14:00",
                            "custom_fields": []
                        }
                    }
                }
            ],
            "custom_fields": {
                "48": {
                    "56": {
                        "label": "New MF field ",
                        "value": "Geschäftleitungsmeeting / Managementtagung",
                        "category": 0
                    }
                }
            },
            "comments": "",
            "customer_id": "21749",
            "customer": "DemoStore GmbH",
            "color": "#17df26"
        },
        {
            "id": 312838,
            "title": "",
            "resources": [
                {
                    "resource_id": 48,
                    "resource": "Sample Resource B",
                    "instances": {
                        "39526": {
                            "id": 39526,
                            "resource_id": 50,
                            "resource": "Sample Resource B > Große Halle",
                            "from": "2023-10-11 00:00",
                            "to": "2023-10-11 23:59",
                            "custom_fields": []
                        },
                        "39527": {
                            "id": 39527,
                            "resource_id": 50,
                            "resource": "Sample Resource B > Große Halle",
                            "from": "2023-10-12 00:00",
                            "to": "2023-10-12 23:59",
                            "custom_fields": []
                        },
                        "39528": {
                            "id": 39528,
                            "resource_id": 50,
                            "resource": "Sample Resource B > Große Halle",
                            "from": "2023-10-13 00:00",
                            "to": "2023-10-13 18:00",
                            "custom_fields": []
                        }
                    }
                }
            ],
            "custom_fields": {
                "48": {
                    "56": {
                        "label": "New MF field ",
                        "value": "Geschäftleitungsmeeting / Managementtagung",
                        "category": 0
                    }
                }
            },
            "comments": "",
            "customer_id": "21749",
            "customer": "DemoStore GmbH",
            "color": "#17df26"
        },
        {
            "id": 312886,
            "title": "Test booking for api",
            "resources": [
                {
                    "resource_id": 5721,
                    "resource": "Conference Room C",
                    "instances": {
                        "39593": {
                            "id": 39593,
                            "resource_id": 8795,
                            "resource": "Conference Room C > The only child",
                            "from": "2023-10-11 11:00",
                            "to": "2023-10-11 16:00",
                            "custom_fields": []
                        },
                        "39594": {
                            "id": 39594,
                            "resource_id": 8795,
                            "resource": "Conference Room C > The only child",
                            "from": "2023-10-12 11:00",
                            "to": "2023-10-12 16:00",
                            "custom_fields": {
                                "5721": {
                                    "49": {
                                        "label": "Radi-O",
                                        "value": "Yo!",
                                        "category": null
                                    },
                                    "58": {
                                        "label": "Your comment",
                                        "value": "Sample comment for API from instance",
                                        "category": 0
                                    },
                                    "56": {
                                        "label": "New MF field ",
                                        "value": "Tagung / Konferenz",
                                        "category": 0
                                    },
                                    "55": {
                                        "label": "Seat Type",
                                        "value": "L shape",
                                        "category": 0
                                    },
                                    "36": {
                                        "label": "Just admin",
                                        "value": "off",
                                        "category": null
                                    },
                                    "33": {
                                        "label": "Manager input field",
                                        "value": "test input field",
                                        "category": null
                                    },
                                    "32": {
                                        "label": "Mumbo Jumbo",
                                        "value": "off",
                                        "category": null
                                    },
                                    "28": {
                                        "label": "Just admin",
                                        "value": "off",
                                        "category": null
                                    },
                                    "22": {
                                        "label": "Manager input field",
                                        "value": "",
                                        "category": null
                                    },
                                    "21": {
                                        "label": "Yolo cb?",
                                        "value": "off",
                                        "category": null
                                    },
                                    "5": {
                                        "label": "Select Field B",
                                        "value": "A",
                                        "category": null
                                    },
                                    "4": {
                                        "label": "Input Field C",
                                        "value": "API input C",
                                        "category": null
                                    },
                                    "1": {
                                        "label": "Test Seats A",
                                        "value": "8",
                                        "category": null
                                    }
                                }
                            }
                        },
                        "39595": {
                            "id": 39595,
                            "resource_id": 8795,
                            "resource": "Conference Room C > The only child",
                            "from": "2023-10-13 11:00",
                            "to": "2023-10-13 16:00",
                            "custom_fields": []
                        }
                    }
                }
            ],
            "custom_fields": {
                "5721": {
                    "49": {
                        "label": "Radi-O",
                        "value": "Hey",
                        "category": null
                    },
                    "58": {
                        "label": "Your comment",
                        "value": "Sample comment for api",
                        "category": 0
                    },
                    "56": {
                        "label": "New MF field ",
                        "value": "Tagung / Konferenz",
                        "category": 0
                    },
                    "55": {
                        "label": "Seat Type",
                        "value": "L shape",
                        "category": 0
                    },
                    "36": {
                        "label": "Just admin",
                        "value": "off",
                        "category": null
                    },
                    "33": {
                        "label": "Manager input field",
                        "value": "test input field",
                        "category": null
                    },
                    "32": {
                        "label": "Mumbo Jumbo",
                        "value": "on",
                        "category": null
                    },
                    "28": {
                        "label": "Just admin",
                        "value": "on",
                        "category": null
                    },
                    "21": {
                        "label": "Yolo cb?",
                        "value": "on",
                        "category": null
                    },
                    "5": {
                        "label": "Select Field B",
                        "value": "A",
                        "category": null
                    },
                    "4": {
                        "label": "Input Field C",
                        "value": "API input C",
                        "category": null
                    },
                    "1": {
                        "label": "Test Seats A",
                        "value": "11",
                        "category": null
                    }
                }
            },
            "color": "#17df26",
            "comments": "",
            "customer_id": "21749",
            "persons": [],
            "customer": "DemoStore GmbH",
            "created_on": "2023-10-09 14:32:11",
            "created_by": {
                "id": 46,
                "name": "Max Mustermann"
            }
        }
    ],
    "total": 3,
    "success": true
}

Booking

GET /api/v2/booking/<booking-id> : Details of booking based on ID.

The response carries created_on (creation timestamp, Y-m-d H:i:s, null for bookings predating timestamp tracking) and created_by (the user who created the booking as {id, name}, or null when unknown). Bookings created via the API or the public widget's guest checkout are attributed to the resource-owning manager.

entrance_hall is returned as the stored flag of the booking, "1" if it is marked for the Entrance hall widget and "0" if not. Bookings saved before this flag existed also return "0". This is the value stored on the booking, not the effective visibility in the widget: an account whose Entrance hall default is switched on can still show a booking whose stored flag is "0".

Example request

GET /api/v2/booking/312842?api_secret_key=<api_secret_key>

Example response

json
{
    "data": {
        "id": 312842,
        "title": "",
        "resources": [
            {
                "resource_id": 5721,
                "resource": "Conference Room C",
                "instances": [
                    {
                        "id": 39535,
                        "resource_id": 8795,
                        "resource": "Conference Room C > The only child",
                        "from": "2023-10-10 05:00",
                        "to": "2023-10-10 09:00",
                        "custom_fields": []
                    },
                    {
                        "id": 39536,
                        "resource_id": 8795,
                        "resource": "Conference Room C > The only child",
                        "from": "2023-10-11 05:00",
                        "to": "2023-10-11 09:00",
                        "custom_fields": []
                    },
                    {
                        "id": 39537,
                        "resource_id": 8795,
                        "resource": "Conference Room C > The only child",
                        "from": "2023-10-12 05:00",
                        "to": "2023-10-12 09:00",
                        "custom_fields": []
                    }
                ],
                "features": {
                    "451": {
                        "rule_interval": "per_quantity",
                        "rule_price": 10.149,
                        "rule_name": "Projectors",
                        "price_cost": 0,
                        "quantity": "0"
                    },
                    "699": {
                        "rule_interval": "per_hour",
                        "rule_price": 0,
                        "rule_name": "t1",
                        "price_cost": 0,
                        "quantity": "0"
                    }
                },
                "inventory": {
                    "13": {
                        "rule_interval": "per_hour",
                        "rule_price": 2.371,
                        "rule_name": "Inv_item1",
                        "price_cost": 0,
                        "quantity": "0"
                    }
                },
                "custom_fields": {
                    "5721": {
                        "58": {
                            "label": "Your comment",
                            "value": "",
                            "category": 0
                        },
                        "56": {
                            "label": "New MF field ",
                            "value": "Geschäftleitungsmeeting / Managementtagung",
                            "category": 0
                        },
                        "36": {
                            "label": "Just admin",
                            "value": "off",
                            "category": null
                        },
                        "28": {
                            "label": "Just admin",
                            "value": "off",
                            "category": null
                        },
                        "21": {
                            "label": "Yolo cb?",
                            "value": "off",
                            "category": null
                        },
                        "5": {
                            "label": "Select Field B",
                            "value": "A",
                            "category": null
                        },
                        "4": {
                            "label": "Input Field C",
                            "value": "",
                            "category": null
                        },
                        "1": {
                            "label": "Test Seats A",
                            "value": "11",
                            "category": null
                        }
                    }
                }
            }
        ],
        "comments": "",
        "customer_id": "21749",
        "persons": [],
        "color": "#17df26",
        "entrance_hall": "1",
        "created_on": "2023-10-09 14:32:11",
        "created_by": {
            "id": 46,
            "name": "Max Mustermann"
        }
    },
    "total": 1,
    "success": true
}

Availability

GET /api/v2/availability : List of available time-slots at resource.

  • Every call expects the following parameters: resource_id, date_from, date_to, time_from, time_to, duration, limit
  • resource_id field should contain either a single Resource ID or a comma-separated string containing Resource IDs. This is optional.
  • date_from and date_to are the date-range of the results to retrieve. The expected format is Y-m-d.
  • time_from and time_to are the time-range of the results to retrieve. The expected format is H:i. This is optional.
  • duration is the time-duration of the results to retrieve. The expected format is H:i. This is optional, and defaults to 01:00.
  • free_text_field_ids_str is a comma-separated value of all Custom field IDs. The expected format is id1,id2... This is optional. The Custom field IDs can be obtained from the GET /api/v2/resource_list call, inside the free_text_fields list.
  • free_text_field_conditions_str is a comma-separated value of all Custom field conditions. The expected values are less_than, less_than_et, et, great_than, great_than_et, or empty. This is required if free_text_field_ids_str is passed. The order is important and should follow the order of the corresponding free_text_field_ids_str value.
  • free_text_field_values_str is a comma-separated value of all Custom field values. The expected format is value1,value2... Empty values can also be passed. This is required if free_text_field_ids_str is passed. The order is important and should follow the order of the corresponding free_text_field_ids_str value.
  • limit is the number of the results to retrieve. This is optional.

Example request

GET /api/v2/availability?resource_id=48&date_from=2018-11-01&date_to=2019-01-01&duration=02:00&free_text_field_ids_str=1,2,3&free_text_field_conditions_str=great_than_et,,et&free_text_field_values_str=0,True,10&limit=4&api_secret_key=<api_secret_key>

Example response

json
{
  "data":[
     {
        "resource_id":49,
        "dates":{
           "2018-11-01":[
              {
                 "time_from":"08:00",
                 "time_to":"10:00"
              },
              {
                 "time_from":"10:00",
                 "time_to":"12:00"
              },
              {
                 "time_from":"12:00",
                 "time_to":"14:00"
              },
              {
                 "time_from":"14:00",
                 "time_to":"16:00"
              }
           ]
        }
     },
     {
        "resource_id":50,
        "dates":[

        ]
     }
  ],
  "total":4,
  "success":true
}

Booking Save

GET /api/v2/booking_save : Create/Update the bookings.

  • Every call expects the following parameters: booking_id, resource_id, date_from, date_to, time_from, time_to, booking_status, customer_first_name, customer_last_name, customer_email, customer_company, customer_salutation, customer_street, customer_zip, customer_phone, customer_city
  • booking_id field should contain the unique ID of the Booking at Locaboo. This is optional. This field is required only for updating a booking.
  • resource_id field should contain the unique ID of the Resource at Locaboo.
  • date_from and date_to are the date-range of the booking to create. The expected format is Y-m-d.
  • time_from and time_to are the time-range of the booking to create. The expected format is H:i. This is optional.
  • booking_status is the status of the booking. Expected values are live|draft|complete|cancel. This is optional, and defaults to live.
  • customer_first_name is the first name of the customer associated with the booking. This is optional.
  • customer_last_name is the last name of the customer associated with the booking. This is optional.
  • customer_email is the email of the customer associated with the booking. This is optional.
  • customer_company is the company name of the customer associated with the booking. This is optional.
  • customer_salutation is the salutation of the customer associated with the booking. Expected values are Mr|Ms/Mrs|Pr|Dr. This is optional.
  • customer_street is the street name of the customer associated with the booking. This is optional.
  • customer_zip is the zip code of the customer associated with the booking. This is optional.
  • customer_phone is the phone number of the customer associated with the booking. This is optional.
  • customer_city is the city name of the customer associated with the booking. This is optional.

Example request

GET /api/v2/booking_save?api_secret_key=<api_secret_key>

Example response

json
{
  "data":[
     {
         "id":46330,
         "message":"Successfully created the booking."
      }
  ],
  "total":0,
  "success":true
}

Booking Add

POST /api/v2/booking_add : Add new booking or booking request.

  • Every call expects the following parameters: booking_mode, title, customer_id, persons, recurring, season_id, date_from, date_to, recurrence_type, daily_recurrence, weekly_type_select, weekly_recurrence, monthly_recurrence, yearly_recurrence, time_from, time_to, category_fields, multi_day, main_resource, resource_parts, custom_color, color, entrance_hall, booking_hidden_widget, internal_comments, comments, inventory, services

  • booking_mode field accepts the values direct_booking|booking_request. This is required.

  • title is the title of the booking. This is optional.

  • customer_id is the customer ID of the customer. This is optional.

  • persons is an array of person IDs for the booking. This is optional.

  • recurring field accepts the values 0 if it is a single booking, and 1 if it is a recurring booking. This is required.

  • season_id is the Season ID if it is a season booking. This is only required for season bookings.

  • date_from is the start date of the booking in format YYYY-MM-DD. This is required.

  • date_to is the end date of the booking in format YYYY-MM-DD. This is required.

  • recurrence_type is the type of recurring booking. Accepted values are day, week, month, year. This is required if recurring is 1.

  • daily_recurrence is an array that defines the daily recurring timings. Accepted format is

    php
    [
       'from' => '09:00',
       'to' => '10:00',
       'full_day' => 0
    ]

    Where full_day is passed as 1 if full day booking. This is required if recurrence_type is day.

  • weekly_type_select is the repeats of weekly recurring. Accepted values are week, biweek, triweek, quadweek. This is optional, defaults to week.

  • weekly_recurrence is an array that defines the weekly recurring timings. Accepted format is

    php
    [
       ['day' => 'mon', 'full_day' => 1],
       ['day' => 'tue', 'from' => '09:00', 'to' => '10:00']
    ]

    Alternatively, it can be passed as a serialized string as well

    php
    'a:2:{i:0;a:2:{s:3:"day";s:3:"mon";s:6:"full_day";i:1;}i:1;a:2:{s:3:"day";s:3:"tue";s:3:"from";s:5:"09:00";s:2:"to";s:5:"10:00";}}'

    Where full_day is passed as 1 if full day booking. This is required if recurrence_type is week.

  • monthly_recurrence is an array that defines the monthly recurring timings. Accepted format is

    php
    [
       'mode' => 'day',
       'days' => ['day' => '01', 'month' => '01'],
       'from' => '09:00',
       'to' => '10:00',
       'full_day' => 0
    ]

    Where mode is passed as day. So it means it repeats every nth day of every nth month. full_day is passed as 1 if full day booking.

    -or-

    php
    [
       'mode' => 'week',
       'days' => ['week_number' => 1, 'week_day' => 'tue', 'month' => '01'],
       'from' => '09:00',
       'to' => '10:00',
       'full_day' => 0
    ]

    Where mode is passed as week. So it means it repeats every nth week_number of every week_day day of every nth month. full_day is passed as 1 if full day booking. This is required if recurrence_type is month.

  • yearly_recurrence is an array that defines the yearly recurring timings. Accepted format is

    php
    [
       'day' => '01',
       'month' => '06',
       'from' => '09:00',
       'to' => '10:00',
       'full_day' => 0
    ]

    This means it repeats every nth day of every nth month of every year. full_day is passed as 1 if full day booking. This is required if recurrence_type is year.

  • time_from is the start time of the booking in format HH:MM (24 hr format). This is required if recurring is 0. If recurring is 1, then it is still required to be passed as 00:00 (for validation purposes).

  • time_to is the end time of the booking in format HH:MM (24 hr format). This is required if recurring is 0. If recurring is 1, then it is still required to be passed as 00:00 (for validation purposes).

  • category_fields is the custom fields for the booking. Allowed format is

    php
    [
       'resource_id' => [
          'free_text_field_id1' => 'value1',
          'free_text_field_id2' => 'value2',
       ],
    ]

    Eg:

    php
    [
       '48' => [
          '52' => '21',
          '58' => 'B'
       ],
       '5721' => [
          '5' => 'A'
       ]
    ]

    This is optional.

  • multi_day field accepts the values 0 if it is a booking with from and to time, and 1 if it is a full day booking. This is optional and defaults to 0.

  • main_resource is the ID of the main resource of the booking. This is required.

  • resource_parts is an array of main resources and their parts for the booking. Allowed format is

    php
    [
       48 => [49],
       5721 => [8795]
    ]

    Alternatively, it can be passed as a JSON encoded string as well

    php
    '{"48":[49],"5721":[8795]}'

    This is required.

  • custom_color field accepts the values 0 if no custom color is defined, and 1 if a custom color is defined. This is optional and defaults to 0.

  • color is the custom color value in Hex Code format. Eg #ff0000. This is required if custom_color is 1.

  • entrance_hall field accepts the values 1 if the booking needs to be shown in the Entrance hall widget, and 0 if not needed. This is optional and defaults to 0.

  • booking_hidden_widget field accepts the values 1 if the booking needs to be hidden in the widget, and 0 if not hidden. This is optional and defaults to 0.

  • internal_comments is the internal comments for the booking. This is optional.

  • comments is the public comments for the booking. This is optional.

  • inventory is an array of inventory booked for this booking. Allowed format is

    php
    [
       'resource_id' => [
          'inventory_id' => [
             'checked' => 'on',
             'quantity' => 1
          ]
       ]
    ]

    Eg:

    php
    [
       '48' => [
          '1317' => [
             'checked' => 'on',
             'quantity' => 1
          ]
       ]
    ]

    This is optional.

  • services is an array of services booked for this booking. Allowed format is

    php
    [
       'resource_id' => [
          'service_id' => [
             'checked' => 'on',
             'quantity' => 1
          ]
       ]
    ]

    Eg:

    php
    [
       '48' => [
          '1317' => [
             'checked' => 'on',
             'quantity' => 1
          ]
       ]
    ]

    This is optional.

Example request

POST /api/v2/booking_add

Example response

json
{
  "data":[
     {
         "id":46330,
         "message":"Successfully created the booking."
      }
  ],
  "total":1,
  "success":true
}