Bookers
Bookers are also an extension of the Person resource, except Bookers are the ones who create bookings in the system whereas Guests are actually participating in the Booking.
Bookers are a Person that created a Booking using Bookinglayer. Each Booker contains Person data with an addition of some booking related data. The data contained within the Booker is a snapshot of the Person at the time of making the Booking. This means the Person resource could potentially have fresher data than that of any of the Booker resources tied to the Person. Anyway, the Person always contains the freshest data and Bookers contain their snapshots.
The Booker object
The Person
resource is already explained in its own page, and the only additional data this resource offers is the booking_related_data.booking_id
.
booking_related_data.booking_id
booking_related_data.booking_id
ID of the Booking the Booker is assigned to.
Endpoints
Bookers are closely entangled with Bookings and cannot exist without them, nor can Bookings exist without Bookers. Due to that tight coupling it is not possible to create nor delete Bookers on their own. Instead, bookers are always created/deleted along with their Bookings.
Fetch a Booking Booker
GET
https://api.bookinglayer.io/private/bookings/{booking_id}/booker
Fetches a Booker for the specified Booking.
Path Parameters
booking_id
UUID
ID of the booking the fetched Booker belongs to.
Update a Booking Booker
PUT
https:/api.bookinglayer.io/private/bookings/{booking_id}/booker
Updates a Booker entity. Updating a Booker will also update its Person entity, because Persons always contain the latest data from their Booker/Guest instances.
When updating a Booker's email there are three possible flows based on the create_new
flag and whether the new email you are setting is already assigned to another Person.
The first flow, when the create_new
flag is missing or null
and a new email is provided, will update the email of the Booker, as well as the Person.
The second flow is initiated by sending the create_new
flag as true
and, again, sending an email that is not assigned to any other Person. In this case a new Person will be created, the Booker being updated attached to it and detached from its old Person.
The last flow is relevant when an email that is already assigned to another person is sent. In this flow the create_new
flag has no effect, and the Booker is merged with the existing Person.
Path Parameters
booking_id*
UUID
ID of the booking the guest belongs to.
guest_id*
UUID
ID of the guest that should be updated.
Request Body
Update the Bookers email or creates a new Person, depending on the create_new
flag.
salutation
string
Updates the Bookers salutation.
first_name
string
Updates the Bookers first name.
last_name
String
Updates the Bookers last name.
language_code
Country alpha-2 code.
Updates the Bookers language.
phone_country_code
Country alpha-2 code.
Updates the Bookers phone country code and phone calling code accordingly.
phone
string
Updates the Bookers phone.
address_line_1
string
Updates the Bookers address line 1.
address_line_2
string
Updates the Bookers address line 2.
address_line_3
string
Updates the Bookers address line 3.
zip_code
string
Updates the Bookers zip code.
city
string
Updates the Bookers city.
state
string
Updates the Bookers state.
tax_number
string
Updates the Bookers tax number.
birth_date
date
Updates the Bookers birth date.
gender
male or female
Updates the Bookers gender.
country_code
Country alpha-2 code.
Updates the Bookers country.
nationality_code
Country alpha-2 code.
Updates the Guest nationality.
id_type
id_card, passport, driver_license or other
Updates the Bookers ID type.
id_number
string
Updates the Bookers ID number.
id_expiry_date
date
Updates the Bookers ID expiration date.
custom_fields
object
Updates the Bookers custom fields.
create_new
bool
Determines whether to create a new Person or not. Only takes effect when email
is updated.
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.
BookerCreated
BookerCreated
Sends a new Booker ID via a webhook call when a Booker gets created. Bookers are created when Bookings are created so a BookingCreated
webhook call could be triggered by the same action that triggers BookerCreated
. Also, if this is the Bookers first appearance in Bookinglayer a Person for that booker will be created and the PersonCreated
webhook call could be dispatched as well.
BookerUpdated
BookerUpdated
Sends a Booker ID via a webhook call when an existing Booker gets updated. Updating Booker data also updates the Person this booker belongs to so the PersonUpdated
webhook call could be triggered by the same action.
Last updated