pub struct BookingsApi { /* private fields */ }Expand description
The Bookings API allows you to create, retrieve, update, and cancel appointments online.
Implementations§
Source§impl BookingsApi
impl BookingsApi
Sourcepub fn new(square_client: SquareClient) -> BookingsApi
pub fn new(square_client: SquareClient) -> BookingsApi
Instantiates a new BookingsAPI
Sourcepub async fn list_bookings(
&self,
params: &ListBookingsParameters,
) -> Result<ListBookingsResponse, SquareApiError>
pub async fn list_bookings( &self, params: &ListBookingsParameters, ) -> Result<ListBookingsResponse, SquareApiError>
Retrieve a collection of [Bookings].
To call this endpoint with buyer-level permissions, set AppointmentsRead for the OAuth scope. To call this endpoint with seller-level permissions, set AppointmentsAllRead and AppointmentsRead for the OAuth scope.
Sourcepub async fn create_booking(
&self,
body: &CreateBookingRequest,
) -> Result<CreateBookingResponse, SquareApiError>
pub async fn create_booking( &self, body: &CreateBookingRequest, ) -> Result<CreateBookingResponse, SquareApiError>
Creates a booking.
The required input must include the following:
Booking.location_id Booking.start_at Booking.team_member_id Booking.AppointmentSegment.service_variation_id Booking.AppointmentSegment.service_variation_version
To call this endpoint with buyer-level permissions, set AppointmentsWrite for the OAuth scope. To call this endpoint with seller-level permissions, set AppointmentsAllWrite and AppointmentsWrite 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.
Sourcepub async fn search_availability(
&self,
body: &SearchAvailabilityRequest,
) -> Result<SearchAvailabilityResponse, SquareApiError>
pub async fn search_availability( &self, body: &SearchAvailabilityRequest, ) -> Result<SearchAvailabilityResponse, SquareApiError>
Searches for availabilities for booking.
To call this endpoint with buyer-level permissions, set AppointmentsRead for the OAuth scope. To call this endpoint with seller-level permissions, set AppointmentsAllRead and AppointmentsRead for the OAuth scope. Permissions: AppointmentsRead
Sourcepub async fn bulk_retrieve_bookings(
&self,
body: &BulkRetrieveBookingsRequest,
) -> Result<BulkRetrieveBookingsResponse, SquareApiError>
pub async fn bulk_retrieve_bookings( &self, body: &BulkRetrieveBookingsRequest, ) -> Result<BulkRetrieveBookingsResponse, SquareApiError>
Bulk-Retrieves a list of bookings by booking IDs.
To call this endpoint with buyer-level permissions, set AppointmentsRead for the OAuth scope. To call this endpoint with seller-level permissions, set AppointmentsAllRead and AppointmentsRead for the OAuth scope.
Permissions:AppointmentsRead
Sourcepub async fn retrieve_business_booking_profile(
&self,
) -> Result<RetrieveBusinessBookingProfileResponse, SquareApiError>
pub async fn retrieve_business_booking_profile( &self, ) -> Result<RetrieveBusinessBookingProfileResponse, SquareApiError>
Retrieves a seller’s booking profile. Permissions:AppointmentsBusinessSettingsRead
Sourcepub async fn list_location_booking_profiles(
&self,
params: &ListLocationBookingProfilesParameters,
) -> Result<ListLocationBookingProfilesResponse, SquareApiError>
pub async fn list_location_booking_profiles( &self, params: &ListLocationBookingProfilesParameters, ) -> Result<ListLocationBookingProfilesResponse, SquareApiError>
Lists location booking profiles of a seller. Permissions:AppointmentsBusinessSettingsRead
Sourcepub async fn retrieve_location_booking_profile(
&self,
location_id: impl AsRef<str>,
) -> Result<RetrieveLocationBookingProfileResponse, SquareApiError>
pub async fn retrieve_location_booking_profile( &self, location_id: impl AsRef<str>, ) -> Result<RetrieveLocationBookingProfileResponse, SquareApiError>
Retrieves a seller’s location booking profile. Permissions:AppointmentsBusinessSettingsRead
Sourcepub async fn list_team_member_booking_profiles(
&self,
params: &ListTeamMemberBookingProfilesParameters,
) -> Result<ListTeamMemberBookingProfilesResponse, SquareApiError>
pub async fn list_team_member_booking_profiles( &self, params: &ListTeamMemberBookingProfilesParameters, ) -> Result<ListTeamMemberBookingProfilesResponse, SquareApiError>
Lists booking profiles for team members. Permissions:AppointmentsBusinessSettingsRead
Sourcepub async fn bulk_retrieve_team_member_booking_profiles(
&self,
body: &BulkRetrieveTeamMemberBookingProfilesRequest,
) -> Result<BulkRetrieveTeamMemberBookingProfilesResponse, SquareApiError>
pub async fn bulk_retrieve_team_member_booking_profiles( &self, body: &BulkRetrieveTeamMemberBookingProfilesRequest, ) -> Result<BulkRetrieveTeamMemberBookingProfilesResponse, SquareApiError>
Retrieves one or more team members’ booking profiles. Permissions:AppointmentsBusinessSettingsRead
Sourcepub async fn retrieve_team_member_booking_profile(
&self,
team_member_id: impl AsRef<str>,
) -> Result<RetrieveTeamMemberBookingProfileResponse, SquareApiError>
pub async fn retrieve_team_member_booking_profile( &self, team_member_id: impl AsRef<str>, ) -> Result<RetrieveTeamMemberBookingProfileResponse, SquareApiError>
Retrieves a team member’s booking profile. Permissions:AppointmentsBusinessSettingsRead
Sourcepub async fn retrieve_booking(
&self,
booking_id: impl AsRef<str>,
) -> Result<RetrieveBookingResponse, SquareApiError>
pub async fn retrieve_booking( &self, booking_id: impl AsRef<str>, ) -> Result<RetrieveBookingResponse, SquareApiError>
Retrieves a booking. To call this endpoint with buyer-level permissions, set AppointmentsRead for the OAuth scope. To call this endpoint with seller-level permissions, set AppointmentsAllRead and AppointmentsRead for the OAuth scope.
Permissions:AppointmentsRead
Sourcepub async fn update_booking(
&self,
booking_id: impl AsRef<str>,
body: &UpdateBookingRequest,
) -> Result<UpdateBookingResponse, SquareApiError>
pub async fn update_booking( &self, booking_id: impl AsRef<str>, body: &UpdateBookingRequest, ) -> Result<UpdateBookingResponse, SquareApiError>
Updates a booking. To call this endpoint with buyer-level permissions, set AppointmentsWrite for the OAuth scope. To call this endpoint with seller-level permissions, set AppointmentsAllWrite and AppointmentsWrite 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.
Permissions:AppointmentsWrite
Sourcepub async fn cancel_booking(
&self,
booking_id: impl AsRef<str>,
body: &CancelBookingRequest,
) -> Result<CancelBookingResponse, SquareApiError>
pub async fn cancel_booking( &self, booking_id: impl AsRef<str>, body: &CancelBookingRequest, ) -> Result<CancelBookingResponse, SquareApiError>
Cancels an existing booking. To call this endpoint with buyer-level permissions, set AppointmentsWrite for the OAuth scope. To call this endpoint with seller-level permissions, set AppointmentsAllWrite and AppointmentsWrite 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.
Permissions:AppointmentsWrite