confirmOrDeclineBooking( )


Updates the booking status to CONFIRMED, PENDING, or DECLINED based on the paymentStatus you provide, double booking conflicts, and whether the service requires business approval.

eCommerce checkout restriction

Call this method only when using a custom checkout page. Don't call it when using a Wix eCommerce checkout (SDK | REST). In such cases, Wix automatically updates the booking status based on the paymentStatus of the corresponding Wix eCommerce order (SDK | REST).

New booking status

The booking status is set to DECLINED if both of the following conditions are met:

  • You provide UNDEFINED, NOT_PAID, REFUNDED, or EXEMPT as payment status.
  • There is a double booking conflict.

If only one or none of these conditions is met, status is set to PENDING or CONFIRMED depending on whether the service requires business approval.

Double bookings

If there is a double booking conflict, but the booking has already been at least partially paid, the method still marks the booking as PENDING or CONFIRMED. Then, it also sets doubleBooked to true.

Admin overwrites

There are small but important differences in confirmation behavior if the booking was created with special flowControlSettings:

  • If the booking's flowControlSettings.skipAvailabilityValidation was set to true, the booking is never declined regardless of double booking conflicts. Instead, it's marked CONFIRMED or PENDING, depending on whether the service requires business approval.
  • If the booking's flowControlSettings.skipBusinessConfirmation was set to true, the booking skips PENDING status and is marked CONFIRMED immediately.
Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user's permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Bookings - all permissions
Manage Bookings
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
bookingIdstringRequired

ID of the booking to confirm or decline.


optionsConfirmOrDeclineBookingOptions
Returns
Return Type:Promise<ConfirmOrDeclineBookingResponse>
Errors
404Not Found

There is 1 error with this status code.

428Failed Precondition

There is 1 error with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?