This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Updates the number of participants for a booking.
You can only update the number of participants for class and course bookings, you can't update it for appointment bookings.
Calling this method also changes the
session's
totalNumberOfParticipants
.
When updating the number of participants for a booking you must pass either
participantsChoices
or totalParticipants
. If you pass participantsChoices
for services that have variants,
all of the provided choices must exist for the service. Otherwise, the
call returns an INVALID_SERVICE_CHOICES
error.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function updateNumberOfParticipants(
bookingId: string,
options: UpdateNumberOfParticipantsOptions,
): Promise<UpdateNumberOfParticipantsResponse>;
ID of the booking to update the number of participants for.
import { bookings } from "wix-bookings.v2";
async function updateNumberOfParticipants(bookingId, options) {
try {
const result = await bookings.updateNumberOfParticipants(
bookingId,
options,
);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.