> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: calculatePrice(booking: Booking) # Method package: wixBookingsV2 # Method menu location: wixBookingsV2 --> pricing --> calculatePrice # Method Link: https://dev.wix.com/docs/velo/apis/wix-bookings-v2/pricing/calculate-price.md # Method Description: 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](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/service-plugins-spis/bookings-custom-pricing/introduction.md) 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. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## calculatePrice example ```javascript import { pricing } from 'wix-bookings.v2'; async function calculatePrice(booking) { try { const result = await pricing.calculatePrice(booking); return result; } catch (error) { console.error(error); // Handle the error } } ``` ## calculatePrice example for exporting from backend code ```javascript import { pricing } from 'wix-bookings.v2'; import { webMethod, Permissions } from 'wix-web-module'; export const calculatePrice = webMethod( Permissions.Anyone, async (booking) => { try { const result = await pricing.calculatePrice(booking); return result; } catch (error) { console.error(error); // Handle the error } } ); ``` ---