confirmBooking( )
Confirms a booking request.
Description
The confirmBooking()
function returns a Promise that resolves when the booking is confirmed.
A service can be set to "Automatically accept all bookings when staff are available" or "Manually approve or decline booking requests" in the Online Booking Preferences page under "Additional Settings". When set to manual, the business must confirm or decline each request.
When a booking is confirmed, the following events occur:
- The booking status changes to
CONFIRMED
. - The participant status in the session changes to
APPROVED
. - Slot availability is updated.
- An offline order is created in the Wix Payment Service.
- An email notification is sent to the participant according to the
participantNotification
properties.
Note: Only users with Bookings Admin permissions can confirm a booking. Override the permissions by setting the
suppressAuth
options totrue
.
Syntax
function confirmBooking(bookingId: string, options: ConfirmBookingOptions): Promise<string>
confirmBooking Parameters
NAME
TYPE
DESCRIPTION
ID of the booking to be confirmed.
An object representing the available options for confirming a booking.
Returns
Fulfilled - ID of the confirmed booking.
Return Type:
Was this helpful?
Confirm a booking request
1import { Permissions, webMethod } from "wix-web-module";2import { bookings } from "wix-bookings-backend";34export const confirmBooking = webMethod(Permissions.Anyone, () => {5 const bookingId = "001c0674-d7c9-4c77-acb5-b492b427b201";6 const confirmBookingOptions = {7 participantNotification: {8 notifyParticipants: true,9 message: "We are pleased to let you know that your booking has been confirmed"10 },11 suppressAuth: true12 };1314 return bookings15 .confirmBooking(bookingId, confirmBookingOptions)16 .then((result) => {17 return result;18 })19 .catch((error) => {20 return error;21 });22});2324/* Returns a promise that resolves to:25 *26 * {27 * "bookingId": "001c0674-d7c9-4c77-acb5-b492b427b201"28 * }29 */