BookingCustomAttributesApi bookingCustomAttributesApi = client.getBookingCustomAttributesApi();
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.
CompletableFuture<ListBookingCustomAttributeDefinitionsResponse> listBookingCustomAttributeDefinitionsAsync(
final Integer limit,
final String cursor)
Parameter | Type | Tags | Description |
---|---|---|---|
limit |
Integer |
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 |
String |
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. |
ListBookingCustomAttributeDefinitionsResponse
bookingCustomAttributesApi.listBookingCustomAttributeDefinitionsAsync(null, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<CreateBookingCustomAttributeDefinitionResponse> createBookingCustomAttributeDefinitionAsync(
final CreateBookingCustomAttributeDefinitionRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
CreateBookingCustomAttributeDefinitionRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
CreateBookingCustomAttributeDefinitionResponse
CreateBookingCustomAttributeDefinitionRequest body = new CreateBookingCustomAttributeDefinitionRequest.Builder(
new CustomAttributeDefinition.Builder()
.build()
)
.build();
bookingCustomAttributesApi.createBookingCustomAttributeDefinitionAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<DeleteBookingCustomAttributeDefinitionResponse> deleteBookingCustomAttributeDefinitionAsync(
final String key)
Parameter | Type | Tags | Description |
---|---|---|---|
key |
String |
Template, Required | The key of the custom attribute definition to delete. |
DeleteBookingCustomAttributeDefinitionResponse
String key = "key0";
bookingCustomAttributesApi.deleteBookingCustomAttributeDefinitionAsync(key).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<RetrieveBookingCustomAttributeDefinitionResponse> retrieveBookingCustomAttributeDefinitionAsync(
final String key,
final Integer version)
Parameter | Type | Tags | Description |
---|---|---|---|
key |
String |
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 |
Integer |
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. |
RetrieveBookingCustomAttributeDefinitionResponse
String key = "key0";
bookingCustomAttributesApi.retrieveBookingCustomAttributeDefinitionAsync(key, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<UpdateBookingCustomAttributeDefinitionResponse> updateBookingCustomAttributeDefinitionAsync(
final String key,
final UpdateBookingCustomAttributeDefinitionRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
key |
String |
Template, Required | The key of the custom attribute definition to update. |
body |
UpdateBookingCustomAttributeDefinitionRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
UpdateBookingCustomAttributeDefinitionResponse
String key = "key0";
UpdateBookingCustomAttributeDefinitionRequest body = new UpdateBookingCustomAttributeDefinitionRequest.Builder(
new CustomAttributeDefinition.Builder()
.build()
)
.build();
bookingCustomAttributesApi.updateBookingCustomAttributeDefinitionAsync(key, body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<BulkDeleteBookingCustomAttributesResponse> bulkDeleteBookingCustomAttributesAsync(
final BulkDeleteBookingCustomAttributesRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
BulkDeleteBookingCustomAttributesRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
BulkDeleteBookingCustomAttributesResponse
BulkDeleteBookingCustomAttributesRequest body = new BulkDeleteBookingCustomAttributesRequest.Builder(
new LinkedHashMap<String, BookingCustomAttributeDeleteRequest>() {{
put("key0", new BookingCustomAttributeDeleteRequest.Builder(
"booking_id4",
"key0"
)
.build());
put("key1", new BookingCustomAttributeDeleteRequest.Builder(
"booking_id4",
"key0"
)
.build());
}}
)
.build();
bookingCustomAttributesApi.bulkDeleteBookingCustomAttributesAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<BulkUpsertBookingCustomAttributesResponse> bulkUpsertBookingCustomAttributesAsync(
final BulkUpsertBookingCustomAttributesRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
BulkUpsertBookingCustomAttributesRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
BulkUpsertBookingCustomAttributesResponse
BulkUpsertBookingCustomAttributesRequest body = new BulkUpsertBookingCustomAttributesRequest.Builder(
new LinkedHashMap<String, BookingCustomAttributeUpsertRequest>() {{
put("key0", new BookingCustomAttributeUpsertRequest.Builder(
"booking_id4",
new CustomAttribute.Builder()
.build()
)
.build());
put("key1", new BookingCustomAttributeUpsertRequest.Builder(
"booking_id4",
new CustomAttribute.Builder()
.build()
)
.build());
}}
)
.build();
bookingCustomAttributesApi.bulkUpsertBookingCustomAttributesAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<ListBookingCustomAttributesResponse> listBookingCustomAttributesAsync(
final String bookingId,
final Integer limit,
final String cursor,
final Boolean withDefinitions)
Parameter | Type | Tags | Description |
---|---|---|---|
bookingId |
String |
Template, Required | The ID of the target booking. |
limit |
Integer |
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 |
String |
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. |
withDefinitions |
Boolean |
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 |
ListBookingCustomAttributesResponse
String bookingId = "booking_id4";
Boolean withDefinitions = false;
bookingCustomAttributesApi.listBookingCustomAttributesAsync(bookingId, null, null, withDefinitions).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<DeleteBookingCustomAttributeResponse> deleteBookingCustomAttributeAsync(
final String bookingId,
final String key)
Parameter | Type | Tags | Description |
---|---|---|---|
bookingId |
String |
Template, Required | The ID of the target booking. |
key |
String |
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. |
DeleteBookingCustomAttributeResponse
String bookingId = "booking_id4";
String key = "key0";
bookingCustomAttributesApi.deleteBookingCustomAttributeAsync(bookingId, key).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<RetrieveBookingCustomAttributeResponse> retrieveBookingCustomAttributeAsync(
final String bookingId,
final String key,
final Boolean withDefinition,
final Integer version)
Parameter | Type | Tags | Description |
---|---|---|---|
bookingId |
String |
Template, Required | The ID of the target booking. |
key |
String |
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. |
withDefinition |
Boolean |
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 |
Integer |
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. |
RetrieveBookingCustomAttributeResponse
String bookingId = "booking_id4";
String key = "key0";
Boolean withDefinition = false;
bookingCustomAttributesApi.retrieveBookingCustomAttributeAsync(bookingId, key, withDefinition, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<UpsertBookingCustomAttributeResponse> upsertBookingCustomAttributeAsync(
final String bookingId,
final String key,
final UpsertBookingCustomAttributeRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
bookingId |
String |
Template, Required | The ID of the target booking. |
key |
String |
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 |
UpsertBookingCustomAttributeRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
UpsertBookingCustomAttributeResponse
String bookingId = "booking_id4";
String key = "key0";
UpsertBookingCustomAttributeRequest body = new UpsertBookingCustomAttributeRequest.Builder(
new CustomAttribute.Builder()
.build()
)
.build();
bookingCustomAttributesApi.upsertBookingCustomAttributeAsync(bookingId, key, body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});