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.

The returned price serves as the foundation for charging the customer. During the eCommerce checkout (SDK | REST), additional taxes and fees may be added to this base price.

Price calculation method

By default, Wix Bookings calculates a booking's price based on the relevant serviceOptionsAndVariants.variants.values.price (SDK | REST). You must then specify either booking.bookedEntity.slot.serviceId or booking.bookedEntity.schedule.scheduleId.

If the business uses the Wix Bookings Pricing Integration service plugin (REST), the returned priceInfo object reflects values received from the SPI implementor in Calculate Price (REST). In this case, it suffices to specify booking.bookedEntity.

When to call Preview Price instead

To estimate the price for multiple booking line items before the booking exists, call Preview Price (SDK | REST).

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 (SDK | REST) to calculate the base price for.

Returns
Return Type:Promise<CalculatePriceResponse>
JavaScript
Errors
400Invalid Argument

There are 2 errors with this status code.

428Failed Precondition

There are 3 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?