bookings_api = client.bookings
BookingsApi
- Create Booking
- Search Availability
- Retrieve Business Booking Profile
- List Team Member Booking Profiles
- Retrieve Team Member Booking Profile
- Retrieve Booking
- Update Booking
- Cancel Booking
Creates a booking.
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. |
body = {}
body['idempotency_key'] = 'idempotency_key2'
body['booking'] = {}
body['booking']['id'] = 'id8'
body['booking']['version'] = 148
body['booking']['status'] = 'ACCEPTED'
body['booking']['created_at'] = 'created_at6'
body['booking']['updated_at'] = 'updated_at4'
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.
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. |
body = {}
body['query'] = {}
body['query']['filter'] = {}
body['query']['filter']['start_at_range'] = {}
body['query']['filter']['start_at_range']['start_at'] = 'start_at8'
body['query']['filter']['start_at_range']['end_at'] = 'end_at4'
body['query']['filter']['location_id'] = 'location_id6'
body['query']['filter']['segment_filters'] = []
body['query']['filter']['segment_filters'].append({})
body['query']['filter']['segment_filters'][0]['service_variation_id'] = 'service_variation_id8'
body['query']['filter']['segment_filters'][0]['team_member_id_filter'] = {}
body['query']['filter']['segment_filters'][0]['team_member_id_filter']['all'] = ['all7']
body['query']['filter']['segment_filters'][0]['team_member_id_filter']['any'] = ['any0', 'any1']
body['query']['filter']['segment_filters'][0]['team_member_id_filter']['none'] = ['none5']
body['query']['filter']['segment_filters'].append({})
body['query']['filter']['segment_filters'][1]['service_variation_id'] = 'service_variation_id7'
body['query']['filter']['segment_filters'][1]['team_member_id_filter'] = {}
body['query']['filter']['segment_filters'][1]['team_member_id_filter']['all'] = ['all6', 'all7', 'all8']
body['query']['filter']['segment_filters'][1]['team_member_id_filter']['any'] = ['any1', 'any2', 'any3']
body['query']['filter']['segment_filters'][1]['team_member_id_filter']['none'] = ['none6', 'none7']
body['query']['filter']['booking_id'] = 'booking_id6'
result = bookings_api.search_availability(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)
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 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. |
cursor |
string |
Query, Optional | The cursor for paginating through the results. |
location_id |
string |
Query, Optional | Indicates whether to include only team members enabled at the given location in the returned result. |
List Team Member Booking Profiles Response
bookable_only = False
limit = 172
cursor = 'cursor6'
location_id = 'location_id4'
result = bookings_api.list_team_member_booking_profiles(bookable_only, limit, cursor, location_id)
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 |
string |
Template, Required | The ID of the team member to retrieve. |
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.
def retrieve_booking(self,
booking_id)
Parameter | Type | Tags | Description |
---|---|---|---|
booking_id |
string |
Template, Required | The ID of the Booking object representing the to-be-retrieved booking. |
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.
def update_booking(self,
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 |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
booking_id = 'booking_id4'
body = {}
body['idempotency_key'] = 'idempotency_key2'
body['booking'] = {}
body['booking']['id'] = 'id8'
body['booking']['version'] = 148
body['booking']['status'] = 'ACCEPTED'
body['booking']['created_at'] = 'created_at6'
body['booking']['updated_at'] = 'updated_at4'
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.
def cancel_booking(self,
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 |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
booking_id = 'booking_id4'
body = {}
body['idempotency_key'] = 'idempotency_key2'
body['booking_version'] = 8
result = bookings_api.cancel_booking(booking_id, body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)