booking_custom_attributes_api = client.booking_custom_attributes
BookingCustomAttributesApi
- List Booking Custom Attribute Definitions
- Create Booking Custom Attribute Definition
- Delete Booking Custom Attribute Definition
- Retrieve Booking Custom Attribute Definition
- Update Booking Custom Attribute Definition
- Bulk Delete Booking Custom Attributes
- Bulk Upsert Booking Custom Attributes
- List Booking Custom Attributes
- Delete Booking Custom Attribute
- Retrieve Booking Custom Attribute
- Upsert Booking Custom Attribute
Get all bookings custom attribute definitions.
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_booking_custom_attribute_definitions(self,
limit=None,
cursor=None)
Parameter | Type | Tags | Description |
---|---|---|---|
limit |
int |
Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory. The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. The default value is 20. For more information, see Pagination. |
cursor |
str |
Query, Optional | The cursor returned in the paged response from the previous call to this endpoint. Provide this cursor to retrieve the next page of results for your original request. For more information, see Pagination. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type List Booking Custom Attribute Definitions Response
.
result = booking_custom_attributes_api.list_booking_custom_attribute_definitions()
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Creates a bookings custom attribute definition.
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_custom_attribute_definition(self,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Create Booking Custom Attribute Definition 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 Custom Attribute Definition Response
.
body = {
'custom_attribute_definition': {}
}
result = booking_custom_attributes_api.create_booking_custom_attribute_definition(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Deletes a bookings custom attribute definition.
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 delete_booking_custom_attribute_definition(self,
key)
Parameter | Type | Tags | Description |
---|---|---|---|
key |
str |
Template, Required | The key of the custom attribute definition to delete. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Delete Booking Custom Attribute Definition Response
.
key = 'key0'
result = booking_custom_attributes_api.delete_booking_custom_attribute_definition(key)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Retrieves a bookings custom attribute definition.
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_custom_attribute_definition(self,
key,
version=None)
Parameter | Type | Tags | Description |
---|---|---|---|
key |
str |
Template, Required | The key of the custom attribute definition to retrieve. If the requesting application is not the definition owner, you must use the qualified key. |
version |
int |
Query, Optional | The current version of the custom attribute definition, which is used for strongly consistent reads to guarantee that you receive the most up-to-date data. When included in the request, Square returns the specified version or a higher version if one exists. If the specified version is higher than the current version, Square returns a BAD_REQUEST error. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Retrieve Booking Custom Attribute Definition Response
.
key = 'key0'
result = booking_custom_attributes_api.retrieve_booking_custom_attribute_definition(key)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Updates a bookings custom attribute definition.
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_custom_attribute_definition(self,
key,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
key |
str |
Template, Required | The key of the custom attribute definition to update. |
body |
Update Booking Custom Attribute Definition 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 Custom Attribute Definition Response
.
key = 'key0'
body = {
'custom_attribute_definition': {}
}
result = booking_custom_attributes_api.update_booking_custom_attribute_definition(
key,
body
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Bulk deletes bookings custom attributes.
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 bulk_delete_booking_custom_attributes(self,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Bulk Delete Booking Custom Attributes 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 Delete Booking Custom Attributes Response
.
body = {
'values': {
'key0': {
'booking_id': 'booking_id4',
'key': 'key0'
},
'key1': {
'booking_id': 'booking_id4',
'key': 'key0'
}
}
}
result = booking_custom_attributes_api.bulk_delete_booking_custom_attributes(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Bulk upserts bookings custom attributes.
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 bulk_upsert_booking_custom_attributes(self,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Bulk Upsert Booking Custom Attributes 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 Upsert Booking Custom Attributes Response
.
body = {
'values': {
'key0': {
'booking_id': 'booking_id4',
'custom_attribute': {}
},
'key1': {
'booking_id': 'booking_id4',
'custom_attribute': {}
}
}
}
result = booking_custom_attributes_api.bulk_upsert_booking_custom_attributes(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Lists a booking's custom attributes.
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_booking_custom_attributes(self,
booking_id,
limit=None,
cursor=None,
with_definitions=False)
Parameter | Type | Tags | Description |
---|---|---|---|
booking_id |
str |
Template, Required | The ID of the target booking. |
limit |
int |
Query, Optional | The maximum number of results to return in a single paged response. This limit is advisory. The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. The default value is 20. For more information, see Pagination. |
cursor |
str |
Query, Optional | The cursor returned in the paged response from the previous call to this endpoint. Provide this cursor to retrieve the next page of results for your original request. For more information, see Pagination. |
with_definitions |
bool |
Query, Optional | Indicates whether to return the custom attribute definition in the definition field of eachcustom attribute. Set this parameter to true to get the name and description of each customattribute, information about the data type, or other definition details. The default value is false .Default: False |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type List Booking Custom Attributes Response
.
booking_id = 'booking_id4'
with_definitions = False
result = booking_custom_attributes_api.list_booking_custom_attributes(
booking_id,
with_definitions=with_definitions
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Deletes a bookings custom attribute.
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 delete_booking_custom_attribute(self,
booking_id,
key)
Parameter | Type | Tags | Description |
---|---|---|---|
booking_id |
str |
Template, Required | The ID of the target booking. |
key |
str |
Template, Required | The key of the custom attribute to delete. This key must match the key of a customattribute definition in the Square seller account. If the requesting application is not the definition owner, you must use the qualified key. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Delete Booking Custom Attribute Response
.
booking_id = 'booking_id4'
key = 'key0'
result = booking_custom_attributes_api.delete_booking_custom_attribute(
booking_id,
key
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Retrieves a bookings custom attribute.
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_custom_attribute(self,
booking_id,
key,
with_definition=False,
version=None)
Parameter | Type | Tags | Description |
---|---|---|---|
booking_id |
str |
Template, Required | The ID of the target booking. |
key |
str |
Template, Required | The key of the custom attribute to retrieve. This key must match the key of a customattribute definition in the Square seller account. If the requesting application is not the definition owner, you must use the qualified key. |
with_definition |
bool |
Query, Optional | Indicates whether to return the custom attribute definition in the definition field ofthe custom attribute. Set this parameter to true to get the name and description of the customattribute, information about the data type, or other definition details. The default value is false .Default: False |
version |
int |
Query, Optional | The current version of the custom attribute, which is used for strongly consistent reads to guarantee that you receive the most up-to-date data. When included in the request, Square returns the specified version or a higher version if one exists. If the specified version is higher than the current version, Square returns a BAD_REQUEST error. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Retrieve Booking Custom Attribute Response
.
booking_id = 'booking_id4'
key = 'key0'
with_definition = False
result = booking_custom_attributes_api.retrieve_booking_custom_attribute(
booking_id,
key,
with_definition=with_definition
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
Upserts a bookings custom attribute.
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 upsert_booking_custom_attribute(self,
booking_id,
key,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
booking_id |
str |
Template, Required | The ID of the target booking. |
key |
str |
Template, Required | The key of the custom attribute to create or update. This key must match the key of acustom attribute definition in the Square seller account. If the requesting application is not the definition owner, you must use the qualified key. |
body |
Upsert Booking Custom Attribute 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 Upsert Booking Custom Attribute Response
.
booking_id = 'booking_id4'
key = 'key0'
body = {
'custom_attribute': {}
}
result = booking_custom_attributes_api.upsert_booking_custom_attribute(
booking_id,
key,
body
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)