# 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

```json
{"openapi":"3.0.3","info":{"title":"Bookinglayer Private API","version":"1.0.0"},"components":{"schemas":{"Guest":{"description":"Represents a guest with personal information and booking-specific details.","properties":{"person":{"$ref":"#/components/schemas/Person"},"booking_related_data":{"$ref":"#/components/schemas/Guest_booking_related_data"}},"type":"object"},"Person":{"description":"Represents a person with personal, contact, and address information.","properties":{"id":{"description":"Unique identifier for the person (UUID).","format":"uuid","readOnly":true,"type":"string"},"first_name":{"description":"First name of the person.","maxLength":255,"nullable":true,"type":"string"},"last_name":{"description":"Last name of the person.","maxLength":255,"nullable":true,"type":"string"},"initials":{"description":"Initials of the person.","type":"string"},"gender":{"description":"Gender of the person.","enum":["male","female","nonbinary"],"nullable":true,"type":"string"},"birth_date":{"description":"Birth date of the person.","format":"date","nullable":true,"type":"string"},"email":{"description":"Email address of the person.","format":"email","maxLength":255,"type":"string"},"language_code":{"description":"ISO 639-1 language code for the person.","format":"iso-639-1","type":"string"},"nationality_code":{"description":"ISO 639-1 nationality code for the person.","format":"iso-639-1","type":"string"},"phone_country_calling_code":{"description":"Phone country calling code (e.g. 34).","type":"string"},"phone_country_code":{"description":"Phone country ISO code (e.g. es).","type":"string"},"phone":{"description":"Phone number of the person.","type":"string"},"country_code":{"description":"ISO 3166-1 alpha-2 country code of the address.","format":"iso-3166-1-alpha-2","type":"string"},"state":{"description":"State, province or region of the address.","type":"string"},"city":{"description":"City of the address.","type":"string"},"zip_code":{"description":"ZIP or postal code of the address.","type":"string"},"address_line_1":{"description":"First line of the address.","type":"string"},"address_line_2":{"description":"Second line of the address.","type":"string"},"address_line_3":{"description":"Third line of the address.","type":"string"},"id_type":{"description":"Type of identification document.","enum":["passport","id_card","driver_license","other"],"type":"string"},"id_number":{"description":"Number of the identification document.","type":"string"},"id_expiry_date":{"description":"Expiry date of the identification document.","format":"date","type":"string"},"company_name":{"description":"Name of the company.","type":"string"},"tax_number":{"description":"Tax identification number of the company.","type":"string"},"company_address_line_1":{"description":"First line of the company address.","type":"string"},"company_address_line_2":{"description":"Second line of the company address.","type":"string"},"custom_fields":{"description":"Custom fields associated with the person.","format":"json","type":"object"},"totals":{"$ref":"#/components/schemas/Person_totals"},"deleted_at":{"description":"Date and time when the person was deleted (soft delete).","format":"date-time","nullable":true,"type":"string"},"created_at":{"description":"Date and time when the person was created.","format":"date-time","type":"string"},"updated_at":{"description":"Date and time when the person was last updated.","format":"date-time","type":"string"}},"type":"object"},"Person_totals":{"description":"Totals associated with the person.","format":"json","properties":{"last_booking":{"description":"Date of the last booking.","format":"date","nullable":true,"type":"string"},"booking_count":{"description":"Total number of bookings.","type":"integer"},"total_as_guest":{"description":"Total amount spent as a guest.","type":"number"},"total_as_booker":{"description":"Total amount of bookings made as a booker.","type":"number"},"total_paid_as_booker":{"description":"Total amount paid for bookings made as a booker.","type":"number"},"booking_inquiry_count":{"description":"Number of booking inquiries made.","type":"integer"}},"type":"object"},"Guest_booking_related_data":{"description":"Detailed booking and travel information for the guest.","format":"json","properties":{"web_check_in_at":{"description":"The date and time when the guest checked in via the customer portal.","format":"date-time","nullable":true,"type":"string"},"check_in_at":{"description":"The date and time when the guest is expected to check in.","format":"date-time","nullable":true,"type":"string"},"checked_in_at":{"description":"The actual date and time when the guest checked in.","format":"date-time","nullable":true,"type":"string"},"check_out_at":{"description":"The date and time when the guest is expected to check out.","format":"date-time","nullable":true,"type":"string"},"checked_out_at":{"description":"The actual date and time when the guest checked out.","format":"date-time","nullable":true,"type":"string"},"arrival_date":{"description":"The date of arrival.","format":"date","nullable":true,"type":"string"},"odd_arrival_date":{"description":"Alternative arrival date for irregular travel schedules (late/early).","format":"date","nullable":true,"type":"string"},"arrival_time":{"description":"The time of arrival.","format":"time","nullable":true,"type":"string"},"arrival_location_id":{"description":"The Transfer Location ID of the location where the guest will arrive.","nullable":true,"type":"integer"},"arrival_flight":{"description":"The flight number of the arrival flight.","nullable":true,"type":"string"},"arrival_airline":{"description":"The airline of the arrival flight.","nullable":true,"type":"string"},"departure_date":{"description":"The date of departure.","format":"date","nullable":true,"type":"string"},"odd_departure_date":{"description":"Alternative departure date for irregular travel schedules.","format":"date","nullable":true,"type":"string"},"departure_time":{"description":"The time of departure.","format":"time","nullable":true,"type":"string"},"departure_location_id":{"description":"The Transfer Location ID of the location from which the guest will depart.","nullable":true,"type":"integer"},"departure_flight":{"description":"The flight number of the departure flight.","nullable":true,"type":"string"},"departure_airline":{"description":"The airline of the departure flight.","nullable":true,"type":"string"},"transfer_comment":{"description":"Additional comments regarding the guest transfer.","nullable":true,"type":"string"},"guest_group_id":{"description":"The Guest Group ID of the group the guest belongs to.","nullable":true,"type":"integer"},"level_id":{"description":"The Level ID representing the level of the guest (e.g. skill level).","nullable":true,"type":"integer"}},"type":"object"}}}}
```

## Endpoints

## List guests

> List all guests

```json
{"openapi":"3.0.3","info":{"title":"Bookinglayer Private API","version":"1.0.0"},"tags":[{"name":"Persons"}],"servers":[{"url":"http://api.bookinglayer.io/private"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}},"schemas":{"listBookings_agreement_id_parameter":{"oneOf":[{"items":{"format":"uuid","type":"string"},"type":"array"},{"format":"comma-separated UUIDs","type":"string"}]},"Guest":{"description":"Represents a guest with personal information and booking-specific details.","properties":{"person":{"$ref":"#/components/schemas/Person"},"booking_related_data":{"$ref":"#/components/schemas/Guest_booking_related_data"}},"type":"object"},"Person":{"description":"Represents a person with personal, contact, and address information.","properties":{"id":{"description":"Unique identifier for the person (UUID).","format":"uuid","readOnly":true,"type":"string"},"first_name":{"description":"First name of the person.","maxLength":255,"nullable":true,"type":"string"},"last_name":{"description":"Last name of the person.","maxLength":255,"nullable":true,"type":"string"},"initials":{"description":"Initials of the person.","type":"string"},"gender":{"description":"Gender of the person.","enum":["male","female","nonbinary"],"nullable":true,"type":"string"},"birth_date":{"description":"Birth date of the person.","format":"date","nullable":true,"type":"string"},"email":{"description":"Email address of the person.","format":"email","maxLength":255,"type":"string"},"language_code":{"description":"ISO 639-1 language code for the person.","format":"iso-639-1","type":"string"},"nationality_code":{"description":"ISO 639-1 nationality code for the person.","format":"iso-639-1","type":"string"},"phone_country_calling_code":{"description":"Phone country calling code (e.g. 34).","type":"string"},"phone_country_code":{"description":"Phone country ISO code (e.g. es).","type":"string"},"phone":{"description":"Phone number of the person.","type":"string"},"country_code":{"description":"ISO 3166-1 alpha-2 country code of the address.","format":"iso-3166-1-alpha-2","type":"string"},"state":{"description":"State, province or region of the address.","type":"string"},"city":{"description":"City of the address.","type":"string"},"zip_code":{"description":"ZIP or postal code of the address.","type":"string"},"address_line_1":{"description":"First line of the address.","type":"string"},"address_line_2":{"description":"Second line of the address.","type":"string"},"address_line_3":{"description":"Third line of the address.","type":"string"},"id_type":{"description":"Type of identification document.","enum":["passport","id_card","driver_license","other"],"type":"string"},"id_number":{"description":"Number of the identification document.","type":"string"},"id_expiry_date":{"description":"Expiry date of the identification document.","format":"date","type":"string"},"company_name":{"description":"Name of the company.","type":"string"},"tax_number":{"description":"Tax identification number of the company.","type":"string"},"company_address_line_1":{"description":"First line of the company address.","type":"string"},"company_address_line_2":{"description":"Second line of the company address.","type":"string"},"custom_fields":{"description":"Custom fields associated with the person.","format":"json","type":"object"},"totals":{"$ref":"#/components/schemas/Person_totals"},"deleted_at":{"description":"Date and time when the person was deleted (soft delete).","format":"date-time","nullable":true,"type":"string"},"created_at":{"description":"Date and time when the person was created.","format":"date-time","type":"string"},"updated_at":{"description":"Date and time when the person was last updated.","format":"date-time","type":"string"}},"type":"object"},"Person_totals":{"description":"Totals associated with the person.","format":"json","properties":{"last_booking":{"description":"Date of the last booking.","format":"date","nullable":true,"type":"string"},"booking_count":{"description":"Total number of bookings.","type":"integer"},"total_as_guest":{"description":"Total amount spent as a guest.","type":"number"},"total_as_booker":{"description":"Total amount of bookings made as a booker.","type":"number"},"total_paid_as_booker":{"description":"Total amount paid for bookings made as a booker.","type":"number"},"booking_inquiry_count":{"description":"Number of booking inquiries made.","type":"integer"}},"type":"object"},"Guest_booking_related_data":{"description":"Detailed booking and travel information for the guest.","format":"json","properties":{"web_check_in_at":{"description":"The date and time when the guest checked in via the customer portal.","format":"date-time","nullable":true,"type":"string"},"check_in_at":{"description":"The date and time when the guest is expected to check in.","format":"date-time","nullable":true,"type":"string"},"checked_in_at":{"description":"The actual date and time when the guest checked in.","format":"date-time","nullable":true,"type":"string"},"check_out_at":{"description":"The date and time when the guest is expected to check out.","format":"date-time","nullable":true,"type":"string"},"checked_out_at":{"description":"The actual date and time when the guest checked out.","format":"date-time","nullable":true,"type":"string"},"arrival_date":{"description":"The date of arrival.","format":"date","nullable":true,"type":"string"},"odd_arrival_date":{"description":"Alternative arrival date for irregular travel schedules (late/early).","format":"date","nullable":true,"type":"string"},"arrival_time":{"description":"The time of arrival.","format":"time","nullable":true,"type":"string"},"arrival_location_id":{"description":"The Transfer Location ID of the location where the guest will arrive.","nullable":true,"type":"integer"},"arrival_flight":{"description":"The flight number of the arrival flight.","nullable":true,"type":"string"},"arrival_airline":{"description":"The airline of the arrival flight.","nullable":true,"type":"string"},"departure_date":{"description":"The date of departure.","format":"date","nullable":true,"type":"string"},"odd_departure_date":{"description":"Alternative departure date for irregular travel schedules.","format":"date","nullable":true,"type":"string"},"departure_time":{"description":"The time of departure.","format":"time","nullable":true,"type":"string"},"departure_location_id":{"description":"The Transfer Location ID of the location from which the guest will depart.","nullable":true,"type":"integer"},"departure_flight":{"description":"The flight number of the departure flight.","nullable":true,"type":"string"},"departure_airline":{"description":"The airline of the departure flight.","nullable":true,"type":"string"},"transfer_comment":{"description":"Additional comments regarding the guest transfer.","nullable":true,"type":"string"},"guest_group_id":{"description":"The Guest Group ID of the group the guest belongs to.","nullable":true,"type":"integer"},"level_id":{"description":"The Level ID representing the level of the guest (e.g. skill level).","nullable":true,"type":"integer"}},"type":"object"}}},"paths":{"/guests":{"get":{"description":"List all guests","operationId":"listGuests","parameters":[{"description":"Filter by agreement UUID(s). Returns guests who have agreed to at least one of the given agreements.\nAccepts either an array (`agreement_id[]=uuid&agreement_id[]=uuid`) or a comma-separated string (`agreement_id=uuid,uuid`).\n","in":"query","name":"agreement_id","required":false,"schema":{"$ref":"#/components/schemas/listBookings_agreement_id_parameter"}},{"description":"Filter by arrival location","in":"query","name":"arrival_location_id","required":false,"schema":{"format":"Single ID or list","type":"string"}},{"description":"Filter by arrival date","in":"query","name":"arrives_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 location ID","in":"query","name":"booking_location_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 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 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 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 guest diet ID","in":"query","name":"diet_id","required":false,"schema":{"format":"Single ID or list","type":"string"}},{"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 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"}},{"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":"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"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Guest"},"type":"array"}}},"description":"A list of guests"}},"summary":"List guests","tags":["Persons"]}}}}
```

## Create a guest

> Create a guest for a booking

```json
{"openapi":"3.0.3","info":{"title":"Bookinglayer Private API","version":"1.0.0"},"tags":[{"name":"Persons"}],"servers":[{"url":"http://api.bookinglayer.io/private"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}},"schemas":{"Guest":{"description":"Represents a guest with personal information and booking-specific details.","properties":{"person":{"$ref":"#/components/schemas/Person"},"booking_related_data":{"$ref":"#/components/schemas/Guest_booking_related_data"}},"type":"object"},"Person":{"description":"Represents a person with personal, contact, and address information.","properties":{"id":{"description":"Unique identifier for the person (UUID).","format":"uuid","readOnly":true,"type":"string"},"first_name":{"description":"First name of the person.","maxLength":255,"nullable":true,"type":"string"},"last_name":{"description":"Last name of the person.","maxLength":255,"nullable":true,"type":"string"},"initials":{"description":"Initials of the person.","type":"string"},"gender":{"description":"Gender of the person.","enum":["male","female","nonbinary"],"nullable":true,"type":"string"},"birth_date":{"description":"Birth date of the person.","format":"date","nullable":true,"type":"string"},"email":{"description":"Email address of the person.","format":"email","maxLength":255,"type":"string"},"language_code":{"description":"ISO 639-1 language code for the person.","format":"iso-639-1","type":"string"},"nationality_code":{"description":"ISO 639-1 nationality code for the person.","format":"iso-639-1","type":"string"},"phone_country_calling_code":{"description":"Phone country calling code (e.g. 34).","type":"string"},"phone_country_code":{"description":"Phone country ISO code (e.g. es).","type":"string"},"phone":{"description":"Phone number of the person.","type":"string"},"country_code":{"description":"ISO 3166-1 alpha-2 country code of the address.","format":"iso-3166-1-alpha-2","type":"string"},"state":{"description":"State, province or region of the address.","type":"string"},"city":{"description":"City of the address.","type":"string"},"zip_code":{"description":"ZIP or postal code of the address.","type":"string"},"address_line_1":{"description":"First line of the address.","type":"string"},"address_line_2":{"description":"Second line of the address.","type":"string"},"address_line_3":{"description":"Third line of the address.","type":"string"},"id_type":{"description":"Type of identification document.","enum":["passport","id_card","driver_license","other"],"type":"string"},"id_number":{"description":"Number of the identification document.","type":"string"},"id_expiry_date":{"description":"Expiry date of the identification document.","format":"date","type":"string"},"company_name":{"description":"Name of the company.","type":"string"},"tax_number":{"description":"Tax identification number of the company.","type":"string"},"company_address_line_1":{"description":"First line of the company address.","type":"string"},"company_address_line_2":{"description":"Second line of the company address.","type":"string"},"custom_fields":{"description":"Custom fields associated with the person.","format":"json","type":"object"},"totals":{"$ref":"#/components/schemas/Person_totals"},"deleted_at":{"description":"Date and time when the person was deleted (soft delete).","format":"date-time","nullable":true,"type":"string"},"created_at":{"description":"Date and time when the person was created.","format":"date-time","type":"string"},"updated_at":{"description":"Date and time when the person was last updated.","format":"date-time","type":"string"}},"type":"object"},"Person_totals":{"description":"Totals associated with the person.","format":"json","properties":{"last_booking":{"description":"Date of the last booking.","format":"date","nullable":true,"type":"string"},"booking_count":{"description":"Total number of bookings.","type":"integer"},"total_as_guest":{"description":"Total amount spent as a guest.","type":"number"},"total_as_booker":{"description":"Total amount of bookings made as a booker.","type":"number"},"total_paid_as_booker":{"description":"Total amount paid for bookings made as a booker.","type":"number"},"booking_inquiry_count":{"description":"Number of booking inquiries made.","type":"integer"}},"type":"object"},"Guest_booking_related_data":{"description":"Detailed booking and travel information for the guest.","format":"json","properties":{"web_check_in_at":{"description":"The date and time when the guest checked in via the customer portal.","format":"date-time","nullable":true,"type":"string"},"check_in_at":{"description":"The date and time when the guest is expected to check in.","format":"date-time","nullable":true,"type":"string"},"checked_in_at":{"description":"The actual date and time when the guest checked in.","format":"date-time","nullable":true,"type":"string"},"check_out_at":{"description":"The date and time when the guest is expected to check out.","format":"date-time","nullable":true,"type":"string"},"checked_out_at":{"description":"The actual date and time when the guest checked out.","format":"date-time","nullable":true,"type":"string"},"arrival_date":{"description":"The date of arrival.","format":"date","nullable":true,"type":"string"},"odd_arrival_date":{"description":"Alternative arrival date for irregular travel schedules (late/early).","format":"date","nullable":true,"type":"string"},"arrival_time":{"description":"The time of arrival.","format":"time","nullable":true,"type":"string"},"arrival_location_id":{"description":"The Transfer Location ID of the location where the guest will arrive.","nullable":true,"type":"integer"},"arrival_flight":{"description":"The flight number of the arrival flight.","nullable":true,"type":"string"},"arrival_airline":{"description":"The airline of the arrival flight.","nullable":true,"type":"string"},"departure_date":{"description":"The date of departure.","format":"date","nullable":true,"type":"string"},"odd_departure_date":{"description":"Alternative departure date for irregular travel schedules.","format":"date","nullable":true,"type":"string"},"departure_time":{"description":"The time of departure.","format":"time","nullable":true,"type":"string"},"departure_location_id":{"description":"The Transfer Location ID of the location from which the guest will depart.","nullable":true,"type":"integer"},"departure_flight":{"description":"The flight number of the departure flight.","nullable":true,"type":"string"},"departure_airline":{"description":"The airline of the departure flight.","nullable":true,"type":"string"},"transfer_comment":{"description":"Additional comments regarding the guest transfer.","nullable":true,"type":"string"},"guest_group_id":{"description":"The Guest Group ID of the group the guest belongs to.","nullable":true,"type":"integer"},"level_id":{"description":"The Level ID representing the level of the guest (e.g. skill level).","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","tags":["Persons"]}}}}
```

## Update a guest

> Update a guest by ID

```json
{"openapi":"3.0.3","info":{"title":"Bookinglayer Private API","version":"1.0.0"},"tags":[{"name":"Persons"}],"servers":[{"url":"http://api.bookinglayer.io/private"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}},"schemas":{"Guest":{"description":"Represents a guest with personal information and booking-specific details.","properties":{"person":{"$ref":"#/components/schemas/Person"},"booking_related_data":{"$ref":"#/components/schemas/Guest_booking_related_data"}},"type":"object"},"Person":{"description":"Represents a person with personal, contact, and address information.","properties":{"id":{"description":"Unique identifier for the person (UUID).","format":"uuid","readOnly":true,"type":"string"},"first_name":{"description":"First name of the person.","maxLength":255,"nullable":true,"type":"string"},"last_name":{"description":"Last name of the person.","maxLength":255,"nullable":true,"type":"string"},"initials":{"description":"Initials of the person.","type":"string"},"gender":{"description":"Gender of the person.","enum":["male","female","nonbinary"],"nullable":true,"type":"string"},"birth_date":{"description":"Birth date of the person.","format":"date","nullable":true,"type":"string"},"email":{"description":"Email address of the person.","format":"email","maxLength":255,"type":"string"},"language_code":{"description":"ISO 639-1 language code for the person.","format":"iso-639-1","type":"string"},"nationality_code":{"description":"ISO 639-1 nationality code for the person.","format":"iso-639-1","type":"string"},"phone_country_calling_code":{"description":"Phone country calling code (e.g. 34).","type":"string"},"phone_country_code":{"description":"Phone country ISO code (e.g. es).","type":"string"},"phone":{"description":"Phone number of the person.","type":"string"},"country_code":{"description":"ISO 3166-1 alpha-2 country code of the address.","format":"iso-3166-1-alpha-2","type":"string"},"state":{"description":"State, province or region of the address.","type":"string"},"city":{"description":"City of the address.","type":"string"},"zip_code":{"description":"ZIP or postal code of the address.","type":"string"},"address_line_1":{"description":"First line of the address.","type":"string"},"address_line_2":{"description":"Second line of the address.","type":"string"},"address_line_3":{"description":"Third line of the address.","type":"string"},"id_type":{"description":"Type of identification document.","enum":["passport","id_card","driver_license","other"],"type":"string"},"id_number":{"description":"Number of the identification document.","type":"string"},"id_expiry_date":{"description":"Expiry date of the identification document.","format":"date","type":"string"},"company_name":{"description":"Name of the company.","type":"string"},"tax_number":{"description":"Tax identification number of the company.","type":"string"},"company_address_line_1":{"description":"First line of the company address.","type":"string"},"company_address_line_2":{"description":"Second line of the company address.","type":"string"},"custom_fields":{"description":"Custom fields associated with the person.","format":"json","type":"object"},"totals":{"$ref":"#/components/schemas/Person_totals"},"deleted_at":{"description":"Date and time when the person was deleted (soft delete).","format":"date-time","nullable":true,"type":"string"},"created_at":{"description":"Date and time when the person was created.","format":"date-time","type":"string"},"updated_at":{"description":"Date and time when the person was last updated.","format":"date-time","type":"string"}},"type":"object"},"Person_totals":{"description":"Totals associated with the person.","format":"json","properties":{"last_booking":{"description":"Date of the last booking.","format":"date","nullable":true,"type":"string"},"booking_count":{"description":"Total number of bookings.","type":"integer"},"total_as_guest":{"description":"Total amount spent as a guest.","type":"number"},"total_as_booker":{"description":"Total amount of bookings made as a booker.","type":"number"},"total_paid_as_booker":{"description":"Total amount paid for bookings made as a booker.","type":"number"},"booking_inquiry_count":{"description":"Number of booking inquiries made.","type":"integer"}},"type":"object"},"Guest_booking_related_data":{"description":"Detailed booking and travel information for the guest.","format":"json","properties":{"web_check_in_at":{"description":"The date and time when the guest checked in via the customer portal.","format":"date-time","nullable":true,"type":"string"},"check_in_at":{"description":"The date and time when the guest is expected to check in.","format":"date-time","nullable":true,"type":"string"},"checked_in_at":{"description":"The actual date and time when the guest checked in.","format":"date-time","nullable":true,"type":"string"},"check_out_at":{"description":"The date and time when the guest is expected to check out.","format":"date-time","nullable":true,"type":"string"},"checked_out_at":{"description":"The actual date and time when the guest checked out.","format":"date-time","nullable":true,"type":"string"},"arrival_date":{"description":"The date of arrival.","format":"date","nullable":true,"type":"string"},"odd_arrival_date":{"description":"Alternative arrival date for irregular travel schedules (late/early).","format":"date","nullable":true,"type":"string"},"arrival_time":{"description":"The time of arrival.","format":"time","nullable":true,"type":"string"},"arrival_location_id":{"description":"The Transfer Location ID of the location where the guest will arrive.","nullable":true,"type":"integer"},"arrival_flight":{"description":"The flight number of the arrival flight.","nullable":true,"type":"string"},"arrival_airline":{"description":"The airline of the arrival flight.","nullable":true,"type":"string"},"departure_date":{"description":"The date of departure.","format":"date","nullable":true,"type":"string"},"odd_departure_date":{"description":"Alternative departure date for irregular travel schedules.","format":"date","nullable":true,"type":"string"},"departure_time":{"description":"The time of departure.","format":"time","nullable":true,"type":"string"},"departure_location_id":{"description":"The Transfer Location ID of the location from which the guest will depart.","nullable":true,"type":"integer"},"departure_flight":{"description":"The flight number of the departure flight.","nullable":true,"type":"string"},"departure_airline":{"description":"The airline of the departure flight.","nullable":true,"type":"string"},"transfer_comment":{"description":"Additional comments regarding the guest transfer.","nullable":true,"type":"string"},"guest_group_id":{"description":"The Guest Group ID of the group the guest belongs to.","nullable":true,"type":"integer"},"level_id":{"description":"The Level ID representing the level of the guest (e.g. skill level).","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","tags":["Persons"]}}}}
```

## Delete a guest

> Delete a guest by ID

```json
{"openapi":"3.0.3","info":{"title":"Bookinglayer Private API","version":"1.0.0"},"tags":[{"name":"Persons"}],"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","tags":["Persons"]}}}}
```

## Get a guest

> Get a guest by ID

```json
{"openapi":"3.0.3","info":{"title":"Bookinglayer Private API","version":"1.0.0"},"tags":[{"name":"Persons"}],"servers":[{"url":"http://api.bookinglayer.io/private"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}},"schemas":{"Guest":{"description":"Represents a guest with personal information and booking-specific details.","properties":{"person":{"$ref":"#/components/schemas/Person"},"booking_related_data":{"$ref":"#/components/schemas/Guest_booking_related_data"}},"type":"object"},"Person":{"description":"Represents a person with personal, contact, and address information.","properties":{"id":{"description":"Unique identifier for the person (UUID).","format":"uuid","readOnly":true,"type":"string"},"first_name":{"description":"First name of the person.","maxLength":255,"nullable":true,"type":"string"},"last_name":{"description":"Last name of the person.","maxLength":255,"nullable":true,"type":"string"},"initials":{"description":"Initials of the person.","type":"string"},"gender":{"description":"Gender of the person.","enum":["male","female","nonbinary"],"nullable":true,"type":"string"},"birth_date":{"description":"Birth date of the person.","format":"date","nullable":true,"type":"string"},"email":{"description":"Email address of the person.","format":"email","maxLength":255,"type":"string"},"language_code":{"description":"ISO 639-1 language code for the person.","format":"iso-639-1","type":"string"},"nationality_code":{"description":"ISO 639-1 nationality code for the person.","format":"iso-639-1","type":"string"},"phone_country_calling_code":{"description":"Phone country calling code (e.g. 34).","type":"string"},"phone_country_code":{"description":"Phone country ISO code (e.g. es).","type":"string"},"phone":{"description":"Phone number of the person.","type":"string"},"country_code":{"description":"ISO 3166-1 alpha-2 country code of the address.","format":"iso-3166-1-alpha-2","type":"string"},"state":{"description":"State, province or region of the address.","type":"string"},"city":{"description":"City of the address.","type":"string"},"zip_code":{"description":"ZIP or postal code of the address.","type":"string"},"address_line_1":{"description":"First line of the address.","type":"string"},"address_line_2":{"description":"Second line of the address.","type":"string"},"address_line_3":{"description":"Third line of the address.","type":"string"},"id_type":{"description":"Type of identification document.","enum":["passport","id_card","driver_license","other"],"type":"string"},"id_number":{"description":"Number of the identification document.","type":"string"},"id_expiry_date":{"description":"Expiry date of the identification document.","format":"date","type":"string"},"company_name":{"description":"Name of the company.","type":"string"},"tax_number":{"description":"Tax identification number of the company.","type":"string"},"company_address_line_1":{"description":"First line of the company address.","type":"string"},"company_address_line_2":{"description":"Second line of the company address.","type":"string"},"custom_fields":{"description":"Custom fields associated with the person.","format":"json","type":"object"},"totals":{"$ref":"#/components/schemas/Person_totals"},"deleted_at":{"description":"Date and time when the person was deleted (soft delete).","format":"date-time","nullable":true,"type":"string"},"created_at":{"description":"Date and time when the person was created.","format":"date-time","type":"string"},"updated_at":{"description":"Date and time when the person was last updated.","format":"date-time","type":"string"}},"type":"object"},"Person_totals":{"description":"Totals associated with the person.","format":"json","properties":{"last_booking":{"description":"Date of the last booking.","format":"date","nullable":true,"type":"string"},"booking_count":{"description":"Total number of bookings.","type":"integer"},"total_as_guest":{"description":"Total amount spent as a guest.","type":"number"},"total_as_booker":{"description":"Total amount of bookings made as a booker.","type":"number"},"total_paid_as_booker":{"description":"Total amount paid for bookings made as a booker.","type":"number"},"booking_inquiry_count":{"description":"Number of booking inquiries made.","type":"integer"}},"type":"object"},"Guest_booking_related_data":{"description":"Detailed booking and travel information for the guest.","format":"json","properties":{"web_check_in_at":{"description":"The date and time when the guest checked in via the customer portal.","format":"date-time","nullable":true,"type":"string"},"check_in_at":{"description":"The date and time when the guest is expected to check in.","format":"date-time","nullable":true,"type":"string"},"checked_in_at":{"description":"The actual date and time when the guest checked in.","format":"date-time","nullable":true,"type":"string"},"check_out_at":{"description":"The date and time when the guest is expected to check out.","format":"date-time","nullable":true,"type":"string"},"checked_out_at":{"description":"The actual date and time when the guest checked out.","format":"date-time","nullable":true,"type":"string"},"arrival_date":{"description":"The date of arrival.","format":"date","nullable":true,"type":"string"},"odd_arrival_date":{"description":"Alternative arrival date for irregular travel schedules (late/early).","format":"date","nullable":true,"type":"string"},"arrival_time":{"description":"The time of arrival.","format":"time","nullable":true,"type":"string"},"arrival_location_id":{"description":"The Transfer Location ID of the location where the guest will arrive.","nullable":true,"type":"integer"},"arrival_flight":{"description":"The flight number of the arrival flight.","nullable":true,"type":"string"},"arrival_airline":{"description":"The airline of the arrival flight.","nullable":true,"type":"string"},"departure_date":{"description":"The date of departure.","format":"date","nullable":true,"type":"string"},"odd_departure_date":{"description":"Alternative departure date for irregular travel schedules.","format":"date","nullable":true,"type":"string"},"departure_time":{"description":"The time of departure.","format":"time","nullable":true,"type":"string"},"departure_location_id":{"description":"The Transfer Location ID of the location from which the guest will depart.","nullable":true,"type":"integer"},"departure_flight":{"description":"The flight number of the departure flight.","nullable":true,"type":"string"},"departure_airline":{"description":"The airline of the departure flight.","nullable":true,"type":"string"},"transfer_comment":{"description":"Additional comments regarding the guest transfer.","nullable":true,"type":"string"},"guest_group_id":{"description":"The Guest Group ID of the group the guest belongs to.","nullable":true,"type":"integer"},"level_id":{"description":"The Level ID representing the level of the guest (e.g. skill level).","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","tags":["Persons"]}}}}
```

## 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](/api/webhooks.md).

### `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"
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bookinglayer.com/api/core-resources/guests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
