This article shares some possible use cases your code could support, as well as a sample flow that could support each use case. This can be a helpful jumping off point as you plan your code's implementation.
You could collect a cancellation fee from the customer when the business cancels a booking in their dashboard on behalf of the customer. Note that Wix Bookings automatically applies the cancellation fee to an eCommerce order if the customer cancels the booking themselves.
To collect a cancellation fee:
initiatedBy
is set to a wixUserId
. Don't apply cancellation fees
for bookings that were canceled by customers themselves, since Wix Bookings
does that automatically.You could create a dashboard that allows you to manage cancellation fees for bookings.
To create a cancellation fee dashboard:
query.filter
. This retrieves all
upcoming bookings. If you want to display only bookings for a specific list
of services, also provide the relevant service IDs in the filter. Save the
list of retrieved booking IDs.PREVIEW
since the customer hasn't
canceled the associated booking.priceOverride
object with the amount stored on your servers.