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(self,
limit=None,
cursor=None,
customer_id=None,
team_member_id=None,
location_id=None,
start_at_min=None,
start_at_max=None)
Parameter | Type | Tags | Description |
---|---|---|---|
limit |
int |
Query, Optional | The maximum number of results per page to return in a paged response. |
cursor |
str |
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 |
str |
Query, Optional | The customer for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. |
team_member_id |
str |
Query, Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. |
location_id |
str |
Query, Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. |
start_at_min |
str |
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 |
str |
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 body
property of this instance returns the response data which is of type List Bookings Response
.
result = bookings_api.list_bookings()
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
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(self,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Create Booking Request |
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 body
property of this instance returns the response data which is of type Create Booking Response
.
body = {
'booking': {}
}
result = bookings_api.create_booking(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
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(self,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Search Availability Request |
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 body
property of this instance returns the response data which is of type Search Availability Response
.
body = {
'query': {
'filter': {
'start_at_range': {}
}
}
}
result = bookings_api.search_availability(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
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(self,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Bulk Retrieve Bookings Request |
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 body
property of this instance returns the response data which is of type Bulk Retrieve Bookings Response
.
body = {
'booking_ids': [
'booking_ids8',
'booking_ids9',
'booking_ids0'
]
}
result = bookings_api.bulk_retrieve_bookings(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Retrieves a seller's booking profile.
def retrieve_business_booking_profile(self)
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Retrieve Business Booking Profile Response
.
result = bookings_api.retrieve_business_booking_profile()
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Lists location booking profiles of a seller.
def list_location_booking_profiles(self,
limit=None,
cursor=None)
Parameter | Type | Tags | Description |
---|---|---|---|
limit |
int |
Query, Optional | The maximum number of results to return in a paged response. |
cursor |
str |
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 body
property of this instance returns the response data which is of type List Location Booking Profiles Response
.
result = bookings_api.list_location_booking_profiles()
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Retrieves a seller's location booking profile.
def retrieve_location_booking_profile(self,
location_id)
Parameter | Type | Tags | Description |
---|---|---|---|
location_id |
str |
Template, Required | The ID of the location to retrieve the booking profile. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Retrieve Location Booking Profile Response
.
location_id = 'location_id4'
result = bookings_api.retrieve_location_booking_profile(location_id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Lists booking profiles for team members.
def list_team_member_booking_profiles(self,
bookable_only=False,
limit=None,
cursor=None,
location_id=None)
Parameter | Type | Tags | Description |
---|---|---|---|
bookable_only |
bool |
Query, Optional | Indicates whether to include only bookable team members in the returned result (true ) or not (false ).Default: False |
limit |
int |
Query, Optional | The maximum number of results to return in a paged response. |
cursor |
str |
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 |
str |
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 body
property of this instance returns the response data which is of type List Team Member Booking Profiles Response
.
bookable_only = False
result = bookings_api.list_team_member_booking_profiles(
bookable_only=bookable_only
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Retrieves one or more team members' booking profiles.
def bulk_retrieve_team_member_booking_profiles(self,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Bulk Retrieve Team Member Booking Profiles Request |
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 body
property of this instance returns the response data which is of type Bulk Retrieve Team Member Booking Profiles Response
.
body = {
'team_member_ids': [
'team_member_ids3',
'team_member_ids4',
'team_member_ids5'
]
}
result = bookings_api.bulk_retrieve_team_member_booking_profiles(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Retrieves a team member's booking profile.
def retrieve_team_member_booking_profile(self,
team_member_id)
Parameter | Type | Tags | Description |
---|---|---|---|
team_member_id |
str |
Template, Required | The ID of the team member to retrieve. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Retrieve Team Member Booking Profile Response
.
team_member_id = 'team_member_id0'
result = bookings_api.retrieve_team_member_booking_profile(team_member_id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
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(self,
booking_id)
Parameter | Type | Tags | Description |
---|---|---|---|
booking_id |
str |
Template, Required | The ID of the Booking object representing the to-be-retrieved booking. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Retrieve Booking Response
.
booking_id = 'booking_id4'
result = bookings_api.retrieve_booking(booking_id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
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(self,
booking_id,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
booking_id |
str |
Template, Required | The ID of the Booking object representing the to-be-updated booking. |
body |
Update Booking Request |
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 body
property of this instance returns the response data which is of type Update Booking Response
.
booking_id = 'booking_id4'
body = {
'booking': {}
}
result = bookings_api.update_booking(
booking_id,
body
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
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(self,
booking_id,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
booking_id |
str |
Template, Required | The ID of the Booking object representing the to-be-cancelled booking. |
body |
Cancel Booking Request |
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 body
property of this instance returns the response data which is of type Cancel Booking Response
.
booking_id = 'booking_id4'
body = {}
result = bookings_api.cancel_booking(
booking_id,
body
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)