previewPrice( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Previews the base price for a set of line items belonging to the same service before a potential 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 previewPrice().

You cannot call previewPrice() if you have customized Bookings pricing logic using the BookingsCustomPricing service plugin. Calling previewPrice if custom pricing logic has been implemented for the site results in an error.

Permissions
Manage Bookings Services and Settings
Manage Bookings - all permissions
Read Bookings - all read permissions
Manage Bookings
Read Bookings - Including Participants
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
bookingLineItemsArray<BookingLineItem>Required

List of line items to preview the price for.

Returns
Return Type:Promise<PreviewPriceResponse>
Was this helpful?
Yes
No