Â
Note: This module is universal. Functions in this module can run on both the backend and frontend, unless specified otherwise.
With the Wix Bookings Pricing API, you can preview and calculate the price of a booking.
previewPrice()
function lets you retrieve information about how much a customer would have to pay for a booking's line items before the actual booking has been created.calculatePrice()
function determines the base price of a booking.The price of the booking can be fixed, free, or varied. With varied pricing, site owners can offer different prices for the same service based on their customers' choices.
For a comprehensive glossary of Wix Bookings terms, see Terminology.
You can only preview the price for line items belonging to the same service.
If using the Wix Bookings Pricing Provider REST SPI to set up your own custom logic for varied pricing, the previewPrice() function is not supported and an error is issued.
To use the Bookings Pricing API, import { pricing }
from the wix-bookings.v2
module in your Velo code:
1