BookingsApi bookingsApi = client.getBookingsApi();
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.
CompletableFuture<ListBookingsResponse> listBookingsAsync(
final Integer limit,
final String cursor,
final String customerId,
final String teamMemberId,
final String locationId,
final String startAtMin,
final String startAtMax)
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. |
customerId |
String |
Query, Optional | The customer for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. |
teamMemberId |
String |
Query, Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. |
locationId |
String |
Query, Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. |
startAtMin |
String |
Query, Optional | The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. |
startAtMax |
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. |
bookingsApi.listBookingsAsync(null, null, null, null, null, null, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<CreateBookingResponse> createBookingAsync(
final CreateBookingRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
CreateBookingRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
CreateBookingRequest body = new CreateBookingRequest.Builder(
new Booking.Builder()
.build()
)
.build();
bookingsApi.createBookingAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<SearchAvailabilityResponse> searchAvailabilityAsync(
final SearchAvailabilityRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
SearchAvailabilityRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
SearchAvailabilityRequest body = new SearchAvailabilityRequest.Builder(
new SearchAvailabilityQuery.Builder(
new SearchAvailabilityFilter.Builder(
new TimeRange.Builder()
.build()
)
.build()
)
.build()
)
.build();
bookingsApi.searchAvailabilityAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<BulkRetrieveBookingsResponse> bulkRetrieveBookingsAsync(
final BulkRetrieveBookingsRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
BulkRetrieveBookingsRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
BulkRetrieveBookingsRequest body = new BulkRetrieveBookingsRequest.Builder(
Arrays.asList(
"booking_ids8",
"booking_ids9",
"booking_ids0"
)
)
.build();
bookingsApi.bulkRetrieveBookingsAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Retrieves a seller's booking profile.
CompletableFuture<RetrieveBusinessBookingProfileResponse> retrieveBusinessBookingProfileAsync()
RetrieveBusinessBookingProfileResponse
bookingsApi.retrieveBusinessBookingProfileAsync().thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Lists location booking profiles of a seller.
CompletableFuture<ListLocationBookingProfilesResponse> listLocationBookingProfilesAsync(
final Integer limit,
final String cursor)
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. |
ListLocationBookingProfilesResponse
bookingsApi.listLocationBookingProfilesAsync(null, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Retrieves a seller's location booking profile.
CompletableFuture<RetrieveLocationBookingProfileResponse> retrieveLocationBookingProfileAsync(
final String locationId)
Parameter | Type | Tags | Description |
---|---|---|---|
locationId |
String |
Template, Required | The ID of the location to retrieve the booking profile. |
RetrieveLocationBookingProfileResponse
String locationId = "location_id4";
bookingsApi.retrieveLocationBookingProfileAsync(locationId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Lists booking profiles for team members.
CompletableFuture<ListTeamMemberBookingProfilesResponse> listTeamMemberBookingProfilesAsync(
final Boolean bookableOnly,
final Integer limit,
final String cursor,
final String locationId)
Parameter | Type | Tags | Description |
---|---|---|---|
bookableOnly |
Boolean |
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. |
locationId |
String |
Query, Optional | Indicates whether to include only team members enabled at the given location in the returned result. |
ListTeamMemberBookingProfilesResponse
Boolean bookableOnly = false;
bookingsApi.listTeamMemberBookingProfilesAsync(bookableOnly, null, null, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Retrieves one or more team members' booking profiles.
CompletableFuture<BulkRetrieveTeamMemberBookingProfilesResponse> bulkRetrieveTeamMemberBookingProfilesAsync(
final BulkRetrieveTeamMemberBookingProfilesRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
BulkRetrieveTeamMemberBookingProfilesRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
BulkRetrieveTeamMemberBookingProfilesResponse
BulkRetrieveTeamMemberBookingProfilesRequest body = new BulkRetrieveTeamMemberBookingProfilesRequest.Builder(
Arrays.asList(
"team_member_ids3",
"team_member_ids4",
"team_member_ids5"
)
)
.build();
bookingsApi.bulkRetrieveTeamMemberBookingProfilesAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Retrieves a team member's booking profile.
CompletableFuture<RetrieveTeamMemberBookingProfileResponse> retrieveTeamMemberBookingProfileAsync(
final String teamMemberId)
Parameter | Type | Tags | Description |
---|---|---|---|
teamMemberId |
String |
Template, Required | The ID of the team member to retrieve. |
RetrieveTeamMemberBookingProfileResponse
String teamMemberId = "team_member_id0";
bookingsApi.retrieveTeamMemberBookingProfileAsync(teamMemberId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<RetrieveBookingResponse> retrieveBookingAsync(
final String bookingId)
Parameter | Type | Tags | Description |
---|---|---|---|
bookingId |
String |
Template, Required | The ID of the Booking object representing the to-be-retrieved booking. |
String bookingId = "booking_id4";
bookingsApi.retrieveBookingAsync(bookingId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<UpdateBookingResponse> updateBookingAsync(
final String bookingId,
final UpdateBookingRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
bookingId |
String |
Template, Required | The ID of the Booking object representing the to-be-updated booking. |
body |
UpdateBookingRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
String bookingId = "booking_id4";
UpdateBookingRequest body = new UpdateBookingRequest.Builder(
new Booking.Builder()
.build()
)
.build();
bookingsApi.updateBookingAsync(bookingId, body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<CancelBookingResponse> cancelBookingAsync(
final String bookingId,
final CancelBookingRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
bookingId |
String |
Template, Required | The ID of the Booking object representing the to-be-cancelled booking. |
body |
CancelBookingRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
String bookingId = "booking_id4";
CancelBookingRequest body = new CancelBookingRequest.Builder()
.build();
bookingsApi.cancelBookingAsync(bookingId, body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});