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 Bookings Pricing Integration REST 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 calculatePrice(), the customized logic is used instead.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Bookings Services and Settings
Manage Bookings
Read Bookings - Including Participants
Read Bookings - all read permissions
Manage Bookings - all permissions
Learn more about permission scopes.
Method Declaration
Method Parameters

Booking to calculate the price for.

Return Type:Promise<CalculatePriceResponse>
Was this helpful?