calculatePrice( )


Developer Preview

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

Calculates the base price of a booking.

You can call calculatePrice() 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 previewPrice() 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 calculatePrice().

Alternatively you can customize the pricing logic using the BookingsCustomPricing service plugin. If you integrate with a pricing provider, the customized pricing logic becomes the default logic. This means that, if the Custom Pricing service plugin is implemented, when calling calculatePrice(), the customized logic is used instead.

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
bookingBookingRequired

Booking to calculate the price for.

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