bookings_api = client.bookings
BookingsApi
- List Bookings
- Create Booking
- Search Availability
- Bulk Retrieve Bookings
- Retrieve Business Booking Profile
- List Location Booking Profiles
- Retrieve Location Booking Profile
- List Team Member Booking Profiles
- Bulk Retrieve Team Member Booking Profiles
- Retrieve Team Member Booking Profile
- Retrieve Booking
- Update Booking
- Cancel Booking
Retrieve a collection of bookings.
To call this endpoint with buyer-level permissions, set APPOINTMENTS_READ
for the OAuth scope.
To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ
and APPOINTMENTS_READ
for the OAuth scope.
def list_bookings(limit: nil,
cursor: nil,
customer_id: nil,
team_member_id: nil,
location_id: nil,
start_at_min: nil,
start_at_max: nil)
Parameter | Type | Tags | Description |
---|---|---|---|
limit |
Integer |
Query, Optional | The maximum number of results per page to return in a paged response. |
cursor |
String |
Query, Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. |
customer_id |
String |
Query, Optional | The customer for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. |
team_member_id |
String |
Query, Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. |
location_id |
String |
Query, Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. |
start_at_min |
String |
Query, Optional | The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. |
start_at_max |
String |
Query, Optional | The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after start_at_min is used. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type List Bookings Response Hash
.
result = bookings_api.list_bookings
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Creates a booking.
The required input must include the following:
Booking.location_id
Booking.start_at
Booking.AppointmentSegment.team_member_id
Booking.AppointmentSegment.service_variation_id
Booking.AppointmentSegment.service_variation_version
To call this endpoint with buyer-level permissions, set APPOINTMENTS_WRITE
for the OAuth scope.
To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE
and APPOINTMENTS_WRITE
for the OAuth scope.
For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
def create_booking(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Create Booking Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Create Booking Response Hash
.
body = {
:booking => {}
}
result = bookings_api.create_booking(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Searches for availabilities for booking.
To call this endpoint with buyer-level permissions, set APPOINTMENTS_READ
for the OAuth scope.
To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ
and APPOINTMENTS_READ
for the OAuth scope.
def search_availability(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Search Availability Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Search Availability Response Hash
.
body = {
:query => {
:filter => {
:start_at_range => {}
}
}
}
result = bookings_api.search_availability(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Bulk-Retrieves a list of bookings by booking IDs.
To call this endpoint with buyer-level permissions, set APPOINTMENTS_READ
for the OAuth scope.
To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ
and APPOINTMENTS_READ
for the OAuth scope.
def bulk_retrieve_bookings(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Bulk Retrieve Bookings Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Bulk Retrieve Bookings Response Hash
.
body = {
:booking_ids => [
'booking_ids8',
'booking_ids9',
'booking_ids0'
]
}
result = bookings_api.bulk_retrieve_bookings(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Retrieves a seller's booking profile.
def retrieve_business_booking_profile
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Retrieve Business Booking Profile Response Hash
.
result = bookings_api.retrieve_business_booking_profile
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Lists location booking profiles of a seller.
def list_location_booking_profiles(limit: nil,
cursor: nil)
Parameter | Type | Tags | Description |
---|---|---|---|
limit |
Integer |
Query, Optional | The maximum number of results to return in a paged response. |
cursor |
String |
Query, Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type List Location Booking Profiles Response Hash
.
result = bookings_api.list_location_booking_profiles
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Retrieves a seller's location booking profile.
def retrieve_location_booking_profile(location_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
location_id |
String |
Template, Required | The ID of the location to retrieve the booking profile. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Retrieve Location Booking Profile Response Hash
.
location_id = 'location_id4'
result = bookings_api.retrieve_location_booking_profile(location_id: location_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Lists booking profiles for team members.
def list_team_member_booking_profiles(bookable_only: false,
limit: nil,
cursor: nil,
location_id: nil)
Parameter | Type | Tags | Description |
---|---|---|---|
bookable_only |
TrueClass | FalseClass |
Query, Optional | Indicates whether to include only bookable team members in the returned result (true ) or not (false ).Default: false |
limit |
Integer |
Query, Optional | The maximum number of results to return in a paged response. |
cursor |
String |
Query, Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. |
location_id |
String |
Query, Optional | Indicates whether to include only team members enabled at the given location in the returned result. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type List Team Member Booking Profiles Response Hash
.
bookable_only = false
result = bookings_api.list_team_member_booking_profiles(bookable_only: bookable_only)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Retrieves one or more team members' booking profiles.
def bulk_retrieve_team_member_booking_profiles(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Bulk Retrieve Team Member Booking Profiles Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Bulk Retrieve Team Member Booking Profiles Response Hash
.
body = {
:team_member_ids => [
'team_member_ids3',
'team_member_ids4',
'team_member_ids5'
]
}
result = bookings_api.bulk_retrieve_team_member_booking_profiles(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Retrieves a team member's booking profile.
def retrieve_team_member_booking_profile(team_member_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
team_member_id |
String |
Template, Required | The ID of the team member to retrieve. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Retrieve Team Member Booking Profile Response Hash
.
team_member_id = 'team_member_id0'
result = bookings_api.retrieve_team_member_booking_profile(team_member_id: team_member_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Retrieves a booking.
To call this endpoint with buyer-level permissions, set APPOINTMENTS_READ
for the OAuth scope.
To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ
and APPOINTMENTS_READ
for the OAuth scope.
def retrieve_booking(booking_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
booking_id |
String |
Template, Required | The ID of the Booking object representing the to-be-retrieved booking. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Retrieve Booking Response Hash
.
booking_id = 'booking_id4'
result = bookings_api.retrieve_booking(booking_id: booking_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Updates a booking.
To call this endpoint with buyer-level permissions, set APPOINTMENTS_WRITE
for the OAuth scope.
To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE
and APPOINTMENTS_WRITE
for the OAuth scope.
For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
def update_booking(booking_id:,
body:)
Parameter | Type | Tags | Description |
---|---|---|---|
booking_id |
String |
Template, Required | The ID of the Booking object representing the to-be-updated booking. |
body |
Update Booking Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Update Booking Response Hash
.
booking_id = 'booking_id4'
body = {
:booking => {}
}
result = bookings_api.update_booking(
booking_id: booking_id,
body: body
)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Cancels an existing booking.
To call this endpoint with buyer-level permissions, set APPOINTMENTS_WRITE
for the OAuth scope.
To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE
and APPOINTMENTS_WRITE
for the OAuth scope.
For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
def cancel_booking(booking_id:,
body:)
Parameter | Type | Tags | Description |
---|---|---|---|
booking_id |
String |
Template, Required | The ID of the Booking object representing the to-be-cancelled booking. |
body |
Cancel Booking Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Cancel Booking Response Hash
.
booking_id = 'booking_id4'
body = {}
result = bookings_api.cancel_booking(
booking_id: booking_id,
body: body
)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end