calculatePrice( )


Calculates the current base price for an existing booking.

Use this method to display booking costs in external apps or dashboards, or to retrieve accurate pricing for bookings created through other channels.

The returned price represents the fundamental booking cost before additional charges during eCommerce checkout (SDK | REST). For recently created unpaid bookings, this typically matches the original booking price. However, this method calculates prices based on the service's current pricing configuration, so the returned price may differ from the original booking price if service pricing has changed since the booking was created.

Price calculation methods

Standard pricing: Wix Bookings calculates prices based on the number of participants for each service variant (SDK | REST). Specify booking.bookedEntity.slot.serviceId for appointment-based services and classes, or booking.bookedEntity.schedule.serviceId for courses.

Custom pricing: When a Pricing Service Provider Plugin is installed, Calculate Price gets responses directly from the external provider instead of using standard Wix pricing logic. In this case, specify booking.bookedEntity. Note that external apps can't currently check whether a plugin is installed on the site before calling Calculate Price.

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

Permissions
Manage Bookings Services and Settings
Manage Bookings - all permissions
Read Bookings - all read permissions
Manage Bookings
Read Bookings - Including Participants
Manage Stores
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
bookingBookingRequired

Existing booking (SDK | REST) to calculate the base price for. Must include bookedEntity details and participant information.

Returns
Return Type:Promise<CalculatePriceResponse>
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?