Search.../

rescheduleBooking( )

Developer Preview

Reschedules a booking to a different slot or session.

Description

You can only reschedule bookings for appointments or classes, you can't reschedule course bookings.

The old session is removed from the calendar and the new session is added.

If you reschedule a booking for a class session the new session must be an existing session for the same class.

You can pass a participantNotification.message to notify the customer of the rescheduling. You also need to pass participantNotification.notifyParticipants as true to actually send the message.

In case the service has variants, you can call this endpoint to update the booking's totalParticipants or participantsChoices. If you provide participantsChoices, all of the provided choices must exist for the service. Otherwise, the call returns an INVALID_SERVICE_CHOICES error. If you omit participantsChoices in the request, the existing choices are kept and not replaced with an empty object.

In case you want to reschedule a booking on behalf of a customer, we recommend to pass flowControlSettings.ignoreReschedulePolicy as false. This ensures that the rescheduling is validated against the service's rescheduling policy.

This function is not a universal function and runs only on the backend.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function rescheduleBooking(bookingId: string, slot: V2Slot, options: RescheduleBookingOptions): Promise<RescheduleBookingResponse>

rescheduleBooking Parameters

NAME
TYPE
DESCRIPTION
bookingId
string

ID of the booking to reschedule.

slot
V2Slot

Information about the new slot.

options
RescheduleBookingOptions

An object representing the available options for rescheduling a booking.

Returns

Return Type:

Promise<
RescheduleBookingResponse
>
NAME
TYPE
DESCRIPTION
booking
Booking

Rescheduled booking.

Was this helpful?

rescheduleBooking example

Copy Code
1import { bookings } from 'wix-bookings.v2';
2
3 async function rescheduleBooking(bookingId, slot, options) {
4 try {
5 const result = await bookings.rescheduleBooking(bookingId, slot, options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13