With the Wix Bookings Pricing API, you can preview and calculate the price of a booking.
- The
Preview Price
endpoint 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. - The
Calculate Price
endpoint 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.
- Site owners can set up basic varied pricing options in the site's dashboard.
- You can use the Wix Bookings Service Options and Variants APIs to set up more robust pricing options.
- You can use the Wix Bookings Pricing Integration SPI to implement your own custom pricing logic.
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 Integration SPI to use your own custom logic for varied pricing, the Preview Price endpoint is not supported and an error is issued.
ONE OF:
Previews the base price for a set of line items belonging to the same service, before a booking is actually created.
The returned price preview information about each line item's price and sums up each line item's price.
The previewed price is not the actual price that will be used to charge the customer.
Preview Price
only estimates the base price by adding up the price
of each line item before
the booking is actually created.
Use Calculate Price
to get the base price
after the booking is created.
Passing line items that belong to different services results in an error.
Calculating the previewed price
Wix Bookings has its own default pricing logic for previewing the price. You must
pass the serviceId
in the slot
or schedule
object to Preview Price
.
You cannot call Preview Price
if you have customized Bookings pricing logic using the
Bookings Pricing Integration SPI. Calling Preview Price
if custom pricing
logic has been implemented for the site results in an error.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Calculates the base price of a booking.
You can call Calculate Price
after a booking is created. The returned calculated price includes information about each line
item's price and the booking's total price.
You can use Preview Price
to get the base price
before a booking is created.
The calculated price is the base price that will be used as a basis for charging the customer. During checkout, additional taxes and fees might be added to this base price.
Calculating the price
Wix Bookings has its own default pricing logic for calculating the price. When
using Wix Bookings' default pricing logic, you must pass the serviceId
in the slot
or schedule
object to Calculate Price
.
Alternatively you can customize the pricing logic using the
Bookings Pricing Integration SPI.
If you integrate with a pricing provider, the customized pricing logic becomes
the default logic. This means that, if the Pricing Integration SPI is implemented,
when calling the API's Calculate Price
endpoint,
the SPI's Calculate Price
endpoint is used instead.