# Guests

Guests are basically Persons in relation with Bookings. Each Guest contains the same person data and additional booking related data. It is important to note that the data contained within a Guest does not necessarily have to match the data contained within the Person related to this guest. This is caused by the fact that each time a Guest is added to a Booking they enter all the required information again. For that reason, each Guest could have data different than the Person it belongs to, and the person will always hold the data from the latest Booking.

## The Guest object

<pre class="language-json"><code class="lang-json">{
    "person": {
        "id": "6e3ab460-55cf-11e7-9300-04016aacf401",
        "first_name": "John",
        "last_name": "Smith",
        "initials": "JS",
        "gender": "male",
        "birth_date": "2003-08-20",
        "email": "john.smith@bookinglayer.com",
        "language_code": "en",
        "nationality_code": "gb",
        "phone_country_calling_code": "44",
        "phone_country_code": "gb",
        "phone": "2071234567",
        "country_code": "gb",
        "state": "England",
        "city": "London",
        "zip_code": "SW1A 1AA",
        "address_line_1": "10 Downing Street",
        "address_line_2": null,
        "address_line_3": null,
        "custom_fields": {
            "surf_level_6375066bbc27f": "550e8400-e29b-41d4-a716-446655440000",
            "yoga_level_61f2619ca4746": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "dietary_requirements_61f2619ca4746": "vegan"
        },
        "totals": {
            "last_booking": "2020-04-15T13:08:58+00:00",
            "booking_count": 2,
            "total_as_guest": 2,
            "total_as_booker": 1,
            "total_paid_as_booker": 2310,
            "booking_inquiry_count": 1
        },
        "id_type": "passport",
        "id_number": "7700225VH",
        "id_expiry_date": "2030-01-10",
        "company_name": "Bookinglayer",
        "tax_number": "AB123456D",
        "diet_id": 357,
        "diet": {
            "id": 357,
            "backoffice_title": "Omnivorous",
            "abbreviation": "OV"
        },
        "is_guest": true,
        "is_booker": true,
        "created_at": "2017-06-20T15:45:05+00:00",
        "updated_at": "2020-04-15T13:08:58+00:00"
    },
    "booking_related_data": {
<strong>        "booking_id": "83d8ac7b-10c5-3839-abfc-9c2d9643cac5",
</strong><strong>        "web_checked_in_at": "2023-05-01",
</strong>        "check_in_at": "2023-05-05",
        "checked_in_at": "2023-05-05T08:33:54+00:00",
        "check_out_at": "2023-05-25",
        "checked_out_at": null,
        "arrival_date": "2023-05-05",
        "odd_arrival_date": null,
        "arrival_time": "08:35:00",
        "arrival_location_id": 52632,
        "arrival_location": {
            "id": 52632,
            "title": "Hotel A",
            "abbreviation": "HTLA"
        },
        "arrival_flight": "W221HFS",
        "arrival_airline": "Wintheiser PLC",
        "departure_date": "2023-05-26",
        "odd_departure_date": "2023-05-26",
        "departure_time": "18:30:00",
        "departure_location": {
            "id": 52633,
            "title": "Hotel B",
            "abbreviation": "HTLB"
        },
        "departure_flight": "ZGK3RR1",
        "departure_airline": "Ziegler Group",
        "transfer_comment": null,
        "final_price_incl_tax": 500,
        "cancelled_at": null,
        "created_at": "2023-12-01T15:29:13+00:00",
        "updated_at": "2023-12-01T15:29:13+00:00"
    }
}
</code></pre>

Since the `Person` resource is already explained in [its own page](https://docs.bookinglayer.com/api/persons#the-person-object), this document will focus on `booking_related_data`.

#### `booking_related_data.booking_id`

ID of the booking the Guest is assigned to.

#### `booking_related_data.web_checked_in_at` \[nullable]

The date and time the guest completed their online check-in.

#### `booking_related_data.check_in_at` \[nullable]

The date the guest is supposed to check in on.

#### `booking_related_data.checked_in_at` \[nullable]

The date and time the guest actually checks in.

#### `booking_related_data.check_out_at` \[nullable]

The date the guest is supposed to check out on.

#### `booking_related_data.checked_out_at` \[nullable]

The date and time the guest actually checks out.

#### `booking_related_data.arrival_date` \[nullable]

The date the guest is supposed to arrive on.

#### `booking_related_data.odd_arrival_date` \[nullable]

In case the actual date of guests arrival is different from the `start_date` of the guests earliest booking line this field is used for specifying the actual arrival date.

#### `booking_related_data.arrival_time` \[nullable]

The time the guest is due to arrive at.

#### `booking_related_data.arrival_location_id` \[nullable]

ID of the location the guest will arrive to.

#### `booking_related_data.arrival_location.id`

Expanded ID of the location the guest will arrive to.

#### `booking_related_data.arrival_location.backoffice_title`

Expanded title of the location the guest will arrive to.

#### `booking_related_data.arrival_location.abbreviation`

Expanded abbreviation of the title of the location the guest will arrive to.

#### `booking_related_data.arrival_flight` \[nullable]

Number of the flight the guest will arrive on.

#### `booking_related_data.arrival_airline` \[nullable]

Name of the airline operating the guests arrival flight.

#### `booking_related_data.departure_date` \[nullable]

The date the guest is supposed to leave.

#### `booking_related_data.odd_departure_date` \[nullable]

In case the actual date of guests departure is different from the `end_date` of the guests latest booking line this field is used for specifying the actual departure date.

#### `booking_related_data.departure_time` \[nullable]

The time the guest is due to depart at.

#### `booking_related_data.departure_location_id` \[nullable]

ID of the location the guest will depart from.

#### `booking_related_data.departure_location.id`

Expanded ID of the location the guest will depart from.

#### `booking_related_data.departure_location.backoffice_title`

Expanded title of the location the guest will depart from.

#### `booking_related_data.departure_location.abbreviation`

Expanded abbreviation of the title of the location the guest will depart from.

#### `booking_related_data.departure_flight` \[nullable]

Number of the flight the guest will depart on.

#### `booking_related_data.departure_airline` \[nullable]

Name of the airline operating the guests departure flight.

#### `booking_related_data.transfer_comment` \[nullable]

Arbitrary comments about the Guest's transfer.

#### `booking_related_data.final_price_incl_tax`

The total cost of the booking for the relevant guest.

#### `booking_related_data.cancelled_at` \[nullable]

The date and time when this guest was cancelled. Contains `null` if the guest is not cancelled.

#### `booking_related_data.created_at`

The date and time when this guest was created. Note: this is the date and time of creating the relationship between the booking and the person, not the date and time when the person was created.

#### `booking_related_data.updated_at`

The date and time when the guest was last modified. Note: this represents the last time the guest was modified, not the person.

## Endpoints

## List guests

> List all guests

```json
{"openapi":"3.0.3","info":{"title":"Bookinglayer Private API","version":"1.0.0"},"servers":[{"url":"http://api.bookinglayer.io/private"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}},"schemas":{"Guest":{"properties":{"person":{"$ref":"#/components/schemas/Person"},"booking_related_data":{"$ref":"#/components/schemas/Guest_booking_related_data"}},"type":"object"},"Person":{"properties":{"id":{"format":"uuid","readOnly":true,"type":"string"},"first_name":{"maxLength":255,"nullable":true,"type":"string"},"last_name":{"maxLength":255,"nullable":true,"type":"string"},"initials":{"type":"string"},"gender":{"enum":["male","female"],"nullable":true,"type":"string"},"birth_date":{"format":"date","nullable":true,"type":"string"},"email":{"format":"email","maxLength":255,"type":"string"},"language_code":{"format":"iso-639-1","type":"string"},"nationality_code":{"format":"iso-639-1","type":"string"},"phone_country_calling_code":{"type":"string"},"phone_country_code":{"type":"string"},"phone":{"type":"string"},"country_code":{"format":"iso-3166-1-alpha-2","type":"string"},"state":{"type":"string"},"city":{"type":"string"},"zip_code":{"type":"string"},"address_line_1":{"type":"string"},"address_line_2":{"type":"string"},"address_line_3":{"type":"string"},"id_type":{"type":"string"},"id_number":{"type":"string"},"id_expiry_date":{"format":"date","type":"string"},"company_name":{"type":"string"},"tax_number":{"type":"string"},"company_address_line_1":{"type":"string"},"company_address_line_2":{"type":"string"},"custom_fields":{"format":"json","type":"object"},"totals":{"format":"json","type":"object"},"deleted_at":{"format":"date-time","nullable":true,"type":"string"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"type":"object"},"Guest_booking_related_data":{"format":"json","properties":{"web_check_in_at":{"format":"date-time","nullable":true,"type":"string"},"check_in_at":{"format":"date-time","nullable":true,"type":"string"},"checked_in_at":{"format":"date-time","nullable":true,"type":"string"},"check_out_at":{"format":"date-time","nullable":true,"type":"string"},"checked_out_at":{"format":"date-time","nullable":true,"type":"string"},"arrival_date":{"format":"date","nullable":true,"type":"string"},"odd_arrival_date":{"format":"date","nullable":true,"type":"string"},"arrival_time":{"format":"time","nullable":true,"type":"string"},"arrival_location_id":{"nullable":true,"type":"integer"},"arrival_flight":{"nullable":true,"type":"string"},"arrival_airline":{"nullable":true,"type":"string"},"departure_date":{"format":"date","nullable":true,"type":"string"},"odd_departure_date":{"format":"date","nullable":true,"type":"string"},"departure_time":{"format":"time","nullable":true,"type":"string"},"departure_location_id":{"nullable":true,"type":"integer"},"departure_flight":{"nullable":true,"type":"string"},"departure_airline":{"nullable":true,"type":"string"},"transfer_comment":{"nullable":true,"type":"string"},"guest_group_id":{"nullable":true,"type":"integer"},"level_id":{"nullable":true,"type":"integer"}},"type":"object"}}},"paths":{"/guests":{"get":{"description":"List all guests","operationId":"listGuests","parameters":[{"description":"Number of guests to return","in":"query","name":"limit","required":false,"schema":{"default":10,"format":"int32","maximum":100,"minimum":1,"type":"integer"}},{"description":"Page number","in":"query","name":"page","required":false,"schema":{"default":1,"format":"int32","minimum":1,"type":"integer"}},{"description":"Sorts the results based on the passed field. All possible values can be appended with \",asc\" or \",desc\"","in":"query","name":"sort_by","required":false,"schema":{"enum":["booking_related_data.arrival_date","booking_related_data.departure_date","booking_related_data.check_in_at","booking_related_data.check_out_at","booking_related_data.checked_in_at","booking_related_data.checked_out_at","person.gender"],"type":"object"}},{"description":"Expand related resources","in":"query","name":"expand","required":false,"schema":{"items":{"enum":["booking_related_data.guest_group","booking_related_data.waivers","booking_related_data.agreements","booking_related_data.arrival_location","booking_related_data.departure_location","booking_related_data.booking"],"type":"string"},"type":"array"}},{"description":"Filter by arrival date","in":"query","name":"arrives_at","required":false,"schema":{"format":"datetime or range","type":"string"}},{"description":"Filter by arrival location","in":"query","name":"arrival_location_id","required":false,"schema":{"format":"Single ID or list","type":"string"}},{"description":"Filter by departure date","in":"query","name":"departs_at","required":false,"schema":{"format":"datetime or range","type":"string"}},{"description":"Filter by departure location","in":"query","name":"departure_location_id","required":false,"schema":{"format":"Single ID or list","type":"string"}},{"description":"Filter by check-in date","in":"query","name":"checked_in_at","required":false,"schema":{"format":"datetime, range, `null` or `notnull`","type":"string"}},{"description":"Filter by check-out date","in":"query","name":"checked_out_at","required":false,"schema":{"format":"datetime, range, `null` or `notnull`","type":"string"}},{"description":"Filter by booking status","in":"query","name":"booking_status","required":false,"schema":{"format":"Booking status or list of booking statuses","type":"string"}},{"description":"Filter by guest check in date","in":"query","name":"check_in_at","required":false,"schema":{"format":"datetime or range","type":"string"}},{"description":"Filter by guest check out date","in":"query","name":"check_out_at","required":false,"schema":{"format":"datetime or range","type":"string"}},{"description":"Filter by booking ID's","in":"query","name":"booking_id","required":false,"schema":{"format":"single ID or list","type":"string"}},{"description":"Filter by booking line product ID's","in":"query","name":"booking_product_id","required":false,"schema":{"format":"single ID or list","type":"string"}},{"description":"Filter by booking line product types","in":"query","name":"booking_product_type","required":false,"schema":{"format":"single type or list","type":"string"}},{"description":"Filter by booking line product variant ID's","in":"query","name":"booking_product_variant_id","required":false,"schema":{"format":"single ID or list","type":"string"}},{"description":"Filter by booking location ID","in":"query","name":"booking_location_id","required":false,"schema":{"format":"Single ID or list","type":"string"}},{"description":"Filter by guest diet ID","in":"query","name":"diet_id","required":false,"schema":{"format":"Single ID or list","type":"string"}},{"description":"Filter guests that are on-site at the provided date(time)","in":"query","name":"on_site_at","required":false,"schema":{"format":"datetime or range","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Guest"},"type":"array"}}},"description":"A list of guests"}},"summary":"List guests"}}}}
```

## Create a guest

> Create a guest for a booking

```json
{"openapi":"3.0.3","info":{"title":"Bookinglayer Private API","version":"1.0.0"},"servers":[{"url":"http://api.bookinglayer.io/private"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}},"schemas":{"Guest":{"properties":{"person":{"$ref":"#/components/schemas/Person"},"booking_related_data":{"$ref":"#/components/schemas/Guest_booking_related_data"}},"type":"object"},"Person":{"properties":{"id":{"format":"uuid","readOnly":true,"type":"string"},"first_name":{"maxLength":255,"nullable":true,"type":"string"},"last_name":{"maxLength":255,"nullable":true,"type":"string"},"initials":{"type":"string"},"gender":{"enum":["male","female"],"nullable":true,"type":"string"},"birth_date":{"format":"date","nullable":true,"type":"string"},"email":{"format":"email","maxLength":255,"type":"string"},"language_code":{"format":"iso-639-1","type":"string"},"nationality_code":{"format":"iso-639-1","type":"string"},"phone_country_calling_code":{"type":"string"},"phone_country_code":{"type":"string"},"phone":{"type":"string"},"country_code":{"format":"iso-3166-1-alpha-2","type":"string"},"state":{"type":"string"},"city":{"type":"string"},"zip_code":{"type":"string"},"address_line_1":{"type":"string"},"address_line_2":{"type":"string"},"address_line_3":{"type":"string"},"id_type":{"type":"string"},"id_number":{"type":"string"},"id_expiry_date":{"format":"date","type":"string"},"company_name":{"type":"string"},"tax_number":{"type":"string"},"company_address_line_1":{"type":"string"},"company_address_line_2":{"type":"string"},"custom_fields":{"format":"json","type":"object"},"totals":{"format":"json","type":"object"},"deleted_at":{"format":"date-time","nullable":true,"type":"string"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"type":"object"},"Guest_booking_related_data":{"format":"json","properties":{"web_check_in_at":{"format":"date-time","nullable":true,"type":"string"},"check_in_at":{"format":"date-time","nullable":true,"type":"string"},"checked_in_at":{"format":"date-time","nullable":true,"type":"string"},"check_out_at":{"format":"date-time","nullable":true,"type":"string"},"checked_out_at":{"format":"date-time","nullable":true,"type":"string"},"arrival_date":{"format":"date","nullable":true,"type":"string"},"odd_arrival_date":{"format":"date","nullable":true,"type":"string"},"arrival_time":{"format":"time","nullable":true,"type":"string"},"arrival_location_id":{"nullable":true,"type":"integer"},"arrival_flight":{"nullable":true,"type":"string"},"arrival_airline":{"nullable":true,"type":"string"},"departure_date":{"format":"date","nullable":true,"type":"string"},"odd_departure_date":{"format":"date","nullable":true,"type":"string"},"departure_time":{"format":"time","nullable":true,"type":"string"},"departure_location_id":{"nullable":true,"type":"integer"},"departure_flight":{"nullable":true,"type":"string"},"departure_airline":{"nullable":true,"type":"string"},"transfer_comment":{"nullable":true,"type":"string"},"guest_group_id":{"nullable":true,"type":"integer"},"level_id":{"nullable":true,"type":"integer"}},"type":"object"}}},"paths":{"/bookings/{booking_id}/guests":{"post":{"description":"Create a guest for a booking","operationId":"createBookingGuest","parameters":[{"description":"ID of the booking to create a guest for","in":"path","name":"booking_id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Guest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Guest"}}},"description":"The created guest"}},"summary":"Create a guest"}}}}
```

## Update a guest

> Update a guest by ID

```json
{"openapi":"3.0.3","info":{"title":"Bookinglayer Private API","version":"1.0.0"},"servers":[{"url":"http://api.bookinglayer.io/private"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}},"schemas":{"Guest":{"properties":{"person":{"$ref":"#/components/schemas/Person"},"booking_related_data":{"$ref":"#/components/schemas/Guest_booking_related_data"}},"type":"object"},"Person":{"properties":{"id":{"format":"uuid","readOnly":true,"type":"string"},"first_name":{"maxLength":255,"nullable":true,"type":"string"},"last_name":{"maxLength":255,"nullable":true,"type":"string"},"initials":{"type":"string"},"gender":{"enum":["male","female"],"nullable":true,"type":"string"},"birth_date":{"format":"date","nullable":true,"type":"string"},"email":{"format":"email","maxLength":255,"type":"string"},"language_code":{"format":"iso-639-1","type":"string"},"nationality_code":{"format":"iso-639-1","type":"string"},"phone_country_calling_code":{"type":"string"},"phone_country_code":{"type":"string"},"phone":{"type":"string"},"country_code":{"format":"iso-3166-1-alpha-2","type":"string"},"state":{"type":"string"},"city":{"type":"string"},"zip_code":{"type":"string"},"address_line_1":{"type":"string"},"address_line_2":{"type":"string"},"address_line_3":{"type":"string"},"id_type":{"type":"string"},"id_number":{"type":"string"},"id_expiry_date":{"format":"date","type":"string"},"company_name":{"type":"string"},"tax_number":{"type":"string"},"company_address_line_1":{"type":"string"},"company_address_line_2":{"type":"string"},"custom_fields":{"format":"json","type":"object"},"totals":{"format":"json","type":"object"},"deleted_at":{"format":"date-time","nullable":true,"type":"string"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"type":"object"},"Guest_booking_related_data":{"format":"json","properties":{"web_check_in_at":{"format":"date-time","nullable":true,"type":"string"},"check_in_at":{"format":"date-time","nullable":true,"type":"string"},"checked_in_at":{"format":"date-time","nullable":true,"type":"string"},"check_out_at":{"format":"date-time","nullable":true,"type":"string"},"checked_out_at":{"format":"date-time","nullable":true,"type":"string"},"arrival_date":{"format":"date","nullable":true,"type":"string"},"odd_arrival_date":{"format":"date","nullable":true,"type":"string"},"arrival_time":{"format":"time","nullable":true,"type":"string"},"arrival_location_id":{"nullable":true,"type":"integer"},"arrival_flight":{"nullable":true,"type":"string"},"arrival_airline":{"nullable":true,"type":"string"},"departure_date":{"format":"date","nullable":true,"type":"string"},"odd_departure_date":{"format":"date","nullable":true,"type":"string"},"departure_time":{"format":"time","nullable":true,"type":"string"},"departure_location_id":{"nullable":true,"type":"integer"},"departure_flight":{"nullable":true,"type":"string"},"departure_airline":{"nullable":true,"type":"string"},"transfer_comment":{"nullable":true,"type":"string"},"guest_group_id":{"nullable":true,"type":"integer"},"level_id":{"nullable":true,"type":"integer"}},"type":"object"}}},"paths":{"/bookings/{booking_id}/guests/{guest_id}":{"put":{"description":"Update a guest by ID","operationId":"updateBookingGuest","parameters":[{"description":"ID of the booking to update a guest for","in":"path","name":"booking_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"ID of the guest to update","in":"path","name":"guest_id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Guest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Guest"}}},"description":"The updated guest"}},"summary":"Update a guest"}}}}
```

## Delete a guest

> Delete a guest by ID

```json
{"openapi":"3.0.3","info":{"title":"Bookinglayer Private API","version":"1.0.0"},"servers":[{"url":"http://api.bookinglayer.io/private"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}},"paths":{"/bookings/{booking_id}/guests/{guest_id}":{"delete":{"description":"Delete a guest by ID","operationId":"deleteBookingGuest","parameters":[{"description":"ID of the booking to delete a guest for","in":"path","name":"booking_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"ID of the guest to delete","in":"path","name":"guest_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Guest deleted"},"400":{"description":"Invalid request"},"404":{"description":"Guest not found"}},"summary":"Delete a guest"}}}}
```

## Get a guest

> Get a guest by ID

```json
{"openapi":"3.0.3","info":{"title":"Bookinglayer Private API","version":"1.0.0"},"servers":[{"url":"http://api.bookinglayer.io/private"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}},"schemas":{"Guest":{"properties":{"person":{"$ref":"#/components/schemas/Person"},"booking_related_data":{"$ref":"#/components/schemas/Guest_booking_related_data"}},"type":"object"},"Person":{"properties":{"id":{"format":"uuid","readOnly":true,"type":"string"},"first_name":{"maxLength":255,"nullable":true,"type":"string"},"last_name":{"maxLength":255,"nullable":true,"type":"string"},"initials":{"type":"string"},"gender":{"enum":["male","female"],"nullable":true,"type":"string"},"birth_date":{"format":"date","nullable":true,"type":"string"},"email":{"format":"email","maxLength":255,"type":"string"},"language_code":{"format":"iso-639-1","type":"string"},"nationality_code":{"format":"iso-639-1","type":"string"},"phone_country_calling_code":{"type":"string"},"phone_country_code":{"type":"string"},"phone":{"type":"string"},"country_code":{"format":"iso-3166-1-alpha-2","type":"string"},"state":{"type":"string"},"city":{"type":"string"},"zip_code":{"type":"string"},"address_line_1":{"type":"string"},"address_line_2":{"type":"string"},"address_line_3":{"type":"string"},"id_type":{"type":"string"},"id_number":{"type":"string"},"id_expiry_date":{"format":"date","type":"string"},"company_name":{"type":"string"},"tax_number":{"type":"string"},"company_address_line_1":{"type":"string"},"company_address_line_2":{"type":"string"},"custom_fields":{"format":"json","type":"object"},"totals":{"format":"json","type":"object"},"deleted_at":{"format":"date-time","nullable":true,"type":"string"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"type":"object"},"Guest_booking_related_data":{"format":"json","properties":{"web_check_in_at":{"format":"date-time","nullable":true,"type":"string"},"check_in_at":{"format":"date-time","nullable":true,"type":"string"},"checked_in_at":{"format":"date-time","nullable":true,"type":"string"},"check_out_at":{"format":"date-time","nullable":true,"type":"string"},"checked_out_at":{"format":"date-time","nullable":true,"type":"string"},"arrival_date":{"format":"date","nullable":true,"type":"string"},"odd_arrival_date":{"format":"date","nullable":true,"type":"string"},"arrival_time":{"format":"time","nullable":true,"type":"string"},"arrival_location_id":{"nullable":true,"type":"integer"},"arrival_flight":{"nullable":true,"type":"string"},"arrival_airline":{"nullable":true,"type":"string"},"departure_date":{"format":"date","nullable":true,"type":"string"},"odd_departure_date":{"format":"date","nullable":true,"type":"string"},"departure_time":{"format":"time","nullable":true,"type":"string"},"departure_location_id":{"nullable":true,"type":"integer"},"departure_flight":{"nullable":true,"type":"string"},"departure_airline":{"nullable":true,"type":"string"},"transfer_comment":{"nullable":true,"type":"string"},"guest_group_id":{"nullable":true,"type":"integer"},"level_id":{"nullable":true,"type":"integer"}},"type":"object"}}},"paths":{"/bookings/{booking_id}/guests/{guest_id}":{"get":{"description":"Get a guest by ID","operationId":"getBookingGuest","parameters":[{"description":"ID of the booking to get a guest for","in":"path","name":"booking_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"ID of the guest to get","in":"path","name":"guest_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Expand related resources","in":"query","name":"expand","required":false,"schema":{"items":{"enum":["waivers","agreements","guest_group","arrival_location","departure_location","person"],"type":"string"},"type":"array"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Guest"}}},"description":"A guest"}},"summary":"Get a guest"}}}}
```

## Webhooks

Webhooks are a mechanism for Bookinglayer to notify other apps when something happens in the system. They are described in detail in a dedicated [Webhooks document](https://docs.bookinglayer.com/api/webhooks).

### `GuestCreated`

Sends a new Guest ID via a webhook call when a Guest gets created. If this is the first time that Person is being created in Bookinglayer the `PersonCreated` event would get dispatched at the same time as well, so you should be careful if you're subscribed to both events.

```json
{
    "event": "GuestCreated",
    "data": {
        "person_id": "0bfacfba-9a71-414a-8736-4c16bba211b5",
        "booking_id": "a4a853cc-9769-4e88-9640-469507b2ccaa"
    }
}
```

### `GuestUpdated`

Sends a Guest ID via a webhook call when an existing Guest gets updated. Updating a Guest also results in updating the Person that Guest belongs to so the `PersonUpdated` event would get dispatched at the same time.&#x20;

```json
{
    "event": "GuestUpdated",
    "data": {
        "person_id": "1d08ccbe-f978-42ed-be95-1c5a09ba1ca2",
        "booking_id": "eac4506b-0dbd-4576-b7a1-c49612ec801b"
    }
}
```

### `GuestDeleted`

Sends a Person ID and Booking ID via a webhook call when an existing Guest gets deleted. Deleting a Guest from a Booking does not automatically delete the Person the guest belonged to so there are no conflicts in this scenario.

```json
{
    "event": "GuestDeleted",
    "data": {
        "person_id": "9e9f1565-d87f-4222-bff3-abd9faa37e75",
        "booking_id": "3b3b4f72-3cb7-444d-bc7a-d60873a09efb"
    }
}
```
