> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# CalculatePrice

# Package: pricing

# Namespace: BookingsPricingService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/calculate-price.md

## Permission Scopes:
Read Bookings - Including Participants: SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE

## Introduction

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](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction.md). 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.

---

## REST API

### Schema

```
 Method: calculatePrice
 Description: 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](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction.md). 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](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction.md). 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](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction.md) 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](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/preview-price.md) instead.
 URL: https://www.wixapis.com/bookings/v2/pricing/v2/pricing/calculate
 Method: POST
 Method parameters:
   param name: booking | type: Booking | description: An entity representing a scheduled appointment, class session, or course.  
    - ONE-OF: 
     - name: totalParticipants | type: integer | description: Total number of participants. When creating a booking, use this field only if the relevant service has fixed pricing and doesn't offer [variants and options](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction.md).  | validation: minimum 1
     - name: participantsChoices | type: ParticipantChoices | description: Information about the booked service choices and participant count for each choice. When creating a booking, use this field only if the booking includes multiple [service variants](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction.md).  For example, use this for a spa package booking that includes different service levels: - 2 participants chose "Standard Package". - 1 participant chose "VIP Package".  
        - name: serviceChoices | type: array<ServiceChoices> | description: Information about the booked service choices. Includes the number of participants.  | validation: minItems 1, maxItems 20
           - name: numberOfParticipants | type: integer | description: Number of participants for this [variant](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction.md).  | validation: minimum 1, format int32
           - name: choices | type: array<ServiceChoice> | description: Service choices for these participants.  | validation: maxItems 5
              - ONE-OF: 
                 - name: custom | type: string | description: Value for one of the choices in the [`CustomServiceOption.choices`](https://example.com) list. Choices are specific values for an option the customer can choose to book. For example, the option `ageGroup` may have these choices: `child`, `student`, `adult`, and `senior`. Each choice may have a different price.  
                 - name: duration | type: Duration | description:   
                    - name: minutes | type: integer | description: Duration of the service in minutes. Min: 1 minute, Max: 30 days, 23 hours, and 59 minutes  | validation: minimum 1, maximum 44639
                    - name: name | type: string | description: Name of the duration option. Defaults to the formatted duration e.g. "1 hour, 30 minutes".  | validation: maxLength 255
                 - name: dateTime | type: DateTimeRule | description: The matched date-time pricing rule. Available only for `DATE_TIME` options.  
                    - name: name | type: string | description: Name of the date-time rule. For example, "Weekend mornings".  | validation: maxLength 255
                 - name: participantRange | type: ParticipantsRange | description: The matched participants pricing rule. Available only for `NUMBER_OF_PARTICIPANTS` options.  
                    - name: name | type: string | description: Name of the participants range. For example, "Large group".  | validation: maxLength 255
                 - name: durationRange | type: DurationRange | description: The matched duration range tier. Available only for `DURATION_RANGE` options.  
                    - name: name | type: string | description: Name of the duration range tier. For example, "Long stay".  | validation: maxLength 255
              - name: optionId | type: string | description: GUID of the corresponding option for the choice. For example, the choice `child` could correspond to the option `ageGroup`. In this case, `optionId` is the GUID for the `ageGroup` option.  | validation: format GUID
              - name: choiceId | type: string | description: GUID of the service choice. When provided, the choice details are automatically populated based on this GUID.  | validation: format GUID
        - name: bookedEntity | type: BookedEntity | description: An object describing the bookable entity - either a specific time slot or a recurring schedule.  The structure depends on the type of service being booked:  __For appointment services__: Use `slot` to book a specific time slot with a service provider. Appointments are typically one-time sessions at a specific date and time.  __For class services__: Use `slot` to book a specific class session. Classes are individual sessions that can have multiple participants.  __For course services__: Use `schedule` to book an entire course consisting of multiple sessions over time. Courses are recurring, multi-session offerings.  Choose the appropriate field based on your service type and booking requirements.  
           - ONE-OF: 
              - name: slot | type: BookedSlot | description: [Booked slot](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings-and-time-slots/time-slots/availability-calendar/query-availability.md).  Specify `slot` when creating bookings for: - __Appointment-based services__: Individual sessions with service providers (consultations, treatments). Wix Bookings creates a new session when the booking is confirmed. - __Class services__: Group sessions at specific times (fitness classes, workshops). Wix Bookings links the booking to an existing scheduled session.  For course services, specify `schedule` instead of `slot`.  
                 - name: serviceId | type: string | description: Service GUID.  
                 - name: scheduleId | type: string | description: Schedule GUID.  
                 - name: eventId | type: string | description: GUID of the corresponding [event](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction.md). Available for both appointment and class bookings, not available for course bookings. For appointment-based services, Wix Bookings automatically populates `eventId` when the booking `status` changes to `CONFIRMED`. For class bookings, Wix Bookings automatically populates `eventId` upon booking creation.  | validation: minLength 36, maxLength 250
                 - name: startDate | type: string | description: The start time of this slot in `YYYY-MM-DDThh:mm:ss`, `YYYY-MM-DDThh:mm:ss:SSS`, or `YYYY-MM-DDThh:mm:ss:SSSZZ` [ISO-8601 format](https://en.wikipedia.org/wiki/ISO_8601). For example, `2026-01-30T13:30:00`, `2026-01-30T13:30:00:000`, or `2026-01-30T13:30:00:000-05:00`.  
                 - name: endDate | type: string | description: The end time of this slot in `YYYY-MM-DDThh:mm:ss`, `YYYY-MM-DDThh:mm:ss:SSS`, or `YYYY-MM-DDThh:mm:ss:SSSZZ` [ISO-8601 format](https://en.wikipedia.org/wiki/ISO_8601). For example, `2026-01-30T13:30:00`, `2026-01-30T13:30:00:000`, or `2026-01-30T13:30:00:000-05:00`.  
                 - name: timezone | type: string | description: Time zone in [IANA tz database format](https://en.wikipedia.org/wiki/Tz_database). For example, `America/New_York` or `UTC`. This is the time zone in which the slot was shown to the customer at the time of booking. Wix Bookings ensures that the slot is always displayed in this same time zone to the customer, including when they view or edit their booking in the future.  
                 - name: resource | type: BookedResource | description: [Primary resource](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/introduction.md) for the booking. For example, the [staff member](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/introduction.md) providing the service.  
                    - name: id | type: string | description: GUID of the booking's primary resource.  | validation: format GUID
                    - name: name | type: string | description: Resource's name at the time of booking.  | validation: maxLength 40
                    - name: email | type: string | description: Resource's email at the time of booking.  | validation: maxLength 500
                    - name: scheduleId | type: string | description: GUID of the schedule belonging to the booking's primary resource.  | validation: format GUID
                 - name: location | type: Location | description: Location where the session takes place.  
                    - name: id | type: string | description: Business location GUID. Available only for locations that are business locations, meaning the `location_type` is `"OWNER_BUSINESS"`.  | validation: format GUID
                    - name: name | type: string | description: Location name.  
                    - name: formattedAddress | type: string | description: The full address of this location.  
                    - name: formattedAddressTranslated | type: string | description: The full translated address of this location.  | validation: maxLength 512
                    - name: locationType | type: LocationType | description: Location type.  
                             - enum:
                             -     UNDEFINED: Undefined location type.
                             -     OWNER_BUSINESS: The business address, as set in the site’s general settings.
                             -     OWNER_CUSTOM: The address as set when creating the service.
                             -     CUSTOM: The address as set for the individual session.
                 - name: resourceSelections | type: array<ResourceSelection> | description: Information about how the customer has selected resources for the booking. Each resource type may have a different selection method. Check `resource` for resource details.  | validation: maxItems 3
                    - name: resourceTypeId | type: string | description: GUID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction.md).  | validation: format GUID
                    - name: selectionMethod | type: SelectionMethod | description: Information about how the customer has selected the resource for this resource type.  
                             - enum:
                             -     SPECIFIC_RESOURCE: The customer explicitly chose a particular resource.
                             -     ANY_RESOURCE: The customer explicitly chose "any available resource" for this resource type.
                             -     NO_SELECTION: The customer wasn't offered a resource selection or agreement option for this resource type.
                    - name: requestedGender | type: RequestedGenderValue | description: Gender the customer narrowed "any available resource" to, for a staff member resource type.  Populated only when `selectionMethod` is `ANY_RESOURCE`, the resource type is the staff member resource type, and the business allows customers to narrow "any available" by gender.  Omit the field for a plain "any available staff member" with no gender narrowing.  Requires `genderPubliclyAccessible` to be enabled in the business's [staff member settings](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-member-settings/introduction.md). Creating a booking with this field fails when it's disabled.  
                       - name: gender | type: RequestedGender | description: Requested gender.  
                                 - enum:
                                 -     ANY_MALE: The customer requested any available male staff member.
                                 -     ANY_FEMALE: The customer requested any available female staff member.
                 - name: allDay | type: boolean | description: Whether the booked slot spans one or more full days. For class bookings, this value is synced from the linked calendar event. For appointment bookings, this value is derived from the availability slot at booking creation or reschedule time.  When `true`, `startDate` is set to `00:00:00` of the first day and `endDate` is set to `00:00:00` of the day after the last day (exclusive). Midnight boundaries are interpreted in the slot's `timezone`.  Default: `false`  
              - name: schedule | type: BookedSchedule | description: [Booked schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md).  Specify `schedule` when creating bookings for: - __Course services__: Multi-session offerings spanning weeks or months (educational courses, training programs). Wix Bookings enrolls participants in all sessions defined by the course schedule.  
                 - name: scheduleId | type: string | description: [Schedule GUID](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md).  
                 - name: serviceId | type: string | description: Booked service GUID.  | validation: format GUID
                 - name: timezone | type: string | description: Time zone in [IANA tz database format](https://en.wikipedia.org/wiki/Tz_database). For example, `America/New_York` or `UTC`. This is the time zone in which the schedule was shown to the customer at the time of booking. Wix Bookings ensures that the schedule is always displayed in this same time zone to the customer, including when they view or edit their booking in the future.  
           - name: tags | type: array<string> | description: List of tags for the booking.  - "INDIVIDUAL": For bookings of appointment-based services. Including when the appointment is for a group of participants. - "GROUP": For bookings of individual class sessions. - "COURSE": For course bookings.  
        - name: contactDetails | type: ContactDetails | description: Contact details of the site visitor or [member](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/members/introduction.md) making the booking. When `bookedForSomeoneElse` is `true`, these are the guest's contact details.  
           - name: contactId | type: string | description: Contact GUID.  | validation: format GUID
           - name: firstName | type: string | description: Contact's first name. When populated from a standard booking form, this property corresponds to the `name` field.  
           - name: lastName | type: string | description: Contact's last name.  
           - name: email | type: string | description: Contact's email. If no [contact](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/contact-v4/contact-object.md) with this email exist, a new contact is created. Used to validate coupon usage limitations per contact. If not specified, the coupon usage limitation will not be enforced. (Coupon usage limitation validation is not supported yet).  | validation: format EMAIL
           - name: phone | type: string | description: Contact's phone number.  
           - name: fullAddress | type: Address | description: Contact's full address.  
              - ONE-OF: 
                 - name: streetAddress | type: StreetAddress | description: Street name, number and apartment number.  
                    - name: number | type: string | description: Street number.  
                    - name: name | type: string | description: Street name.  
                    - name: apt | type: string | description: Apartment number.  
                 - name: addressLine | type: string | description: Main address line, usually street and number, as free text.  
              - name: country | type: string | description: Country code.  | validation: format COUNTRY
              - name: subdivision | type: string | description: Subdivision. Usually state, region, prefecture or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2).  
              - name: city | type: string | description: City name.  
              - name: postalCode | type: string | description: Zip/postal code.  
              - name: addressLine2 | type: string | description: Free text providing more detailed address info. Usually contains Apt, Suite, and Floor.  
              - name: formattedAddress | type: string | description: A string containing the full address of this location.  
              - name: hint | type: string | description: Free text to help find the address.  
              - name: geocode | type: AddressLocation | description: Coordinates of the physical address.  
                 - name: latitude | type: number | description: Address latitude.  | validation: format double
                 - name: longitude | type: number | description: Address longitude.  | validation: format double
              - name: countryFullname | type: string | description: Country full name.  
              - name: subdivisions | type: array<Subdivision> | description: Multi-level subdivisions from top to bottom.  
                 - name: code | type: string | description: Subdivision code. Usually state, region, prefecture or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2).  
                 - name: name | type: string | description: Subdivision full name.  
           - name: countryCode | type: string | description: Contact's country in [ISO 3166-1 alpha-2 code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.  | validation: format COUNTRY
        - name: status | type: BookingStatus | description: Booking status. A booking is automatically confirmed if the service allows it and an eCommerce order is created. It is automatically declined if there is a double booking and the customer hasn't paid or is eligible for an automatic refund. Currently, only payments with pricing plans are automatically refundable.  
             - enum:
             -     CREATED: The booking was created, but the customer hasn't completed the related eCommerce order yet.
             -     CONFIRMED: The merchant has confirmed the booking and it appears in the business calendar. Merchants can set up their [services](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction.md) to automatically confirm all `PENDING` bookings.
             -     CANCELED: The customer has canceled the booking. Depending on the relevant service's [policy snapshot](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policy-snapshots/introduction.md) they may have to pay a [cancellation fee](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/booking-fees/introduction.md).
             -     PENDING: The merchant must manually confirm the booking before it appears in the business calendar.
             -     DECLINED: The merchant has declined the booking before the customer was charged.
             -     WAITING_LIST: Currently, you can't call [Register to Waitlist](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/waitlist/register-to-waitlist.md) for course or appointment bookings, even though this is supported in live sites.
        - name: paymentStatus | type: PaymentStatus | description: The payment status of the booking. This field automatically syncs with the `paymentStatus` of the corresponding [eCommerce order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/introduction.md) when customers use Wix eCommerce checkout.  ### Integration patterns  __When using Wix eCommerce checkout__: Wix Bookings automatically syncs the payment status based on the eCommerce order's payment status. Do not manually update this field.  __When using custom payment flows__: You can manually update the payment status with [Confirm Booking or Decline Booking](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking.md) to reflect the customer's payment state.  __For membership/pricing plan payments__: Wix Bookings automatically manages the payment status when customers pay with an active [pricing plan](https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/pricing-plans/introduction.md) subscription.  All payment statuses are supported for every booking `status`.  
             - enum:
             -     UNDEFINED: Undefined payment status.
             -     NOT_PAID: The booking isn't paid.
             -     PAID: The booking is fully paid.
             -     PARTIALLY_PAID: The booking is partially paid.
             -     REFUNDED: The booking is refunded.
             -     EXEMPT: The booking is free of charge.
             -     FAILED: The most recent subscription payment for this booking failed. If the payment is later recovered, the status changes back to `PAID`. Returned only for course bookings with subscription pricing.
        - name: selectedPaymentOption | type: SelectedPaymentOption | description: Payment option selected by the customer. If the customer hasn't completed their checkout, they may still change the payment method. Must be one of the payment options offered by the [service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md), unless `skipSelectedPaymentOptionValidation` is `true`.  When the customer pays with a [Wix eCommerce checkout](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/checkout/introduction.md), this field is required. Otherwise, the Create Booking call fails. For custom checkouts, you don't have to specify this field.  
             - enum:
             -     UNDEFINED: Undefined payment option.
             -     OFFLINE: Offline payment.
             -     ONLINE: Online payment.
             -     MEMBERSHIP: Payment using a Wix Pricing Plan.
             -     MEMBERSHIP_OFFLINE: Customers can pay only in person with a Wix Pricing Plan, while the Wix user must manually redeem the pricing plan in the dashboard.
        - name: externalUserId | type: string | description: External user GUID that you can provide.  
        - name: revision | type: string | description: Revision number to be used when updating, rescheduling, or cancelling the booking. Increments by 1 each time the booking is updated, rescheduled, or canceled. To prevent conflicting changes, the current revision must be specified when updating the booking.  | validation: format int64
        - name: extendedFields | type: ExtendedFields | description: Custom field data for this object. Extended fields must be configured in the app dashboard before they can be accessed with API calls.  
           - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
        - name: formSubmissionId | type: string | description: GUID of the [form submission](https://dev.wix.com/docs/rest/crm/forms/form-submissions/introduction.md) associated with this booking.  | validation: format GUID
        - name: bookedAddOns | type: array<BookedAddOn> | description: List of [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) associated with the booking.  | validation: maxItems 21
           - name: id | type: string | description: The GUID of the add-on.  | validation: format GUID
           - name: groupId | type: string | description: The GUID of the add-on group.  | validation: format GUID
           - name: quantity | type: integer | description: The quantity of booked add-ons. For duration-based add-ons, `quantity` is not applicable. If `quantity` is provided as `1` for a duration-based add-on, it will be accepted but the value will be cleared. If any other value is provided, an `INVALID_ARGUMENT` error will be returned with the message: "Invalid AddOn details: either duration or quantity must be set correctly".  | validation: minimum 1, maximum 1000, format int32
        - name: depositSelected | type: boolean | description: Whether the customer chooses to pay only the deposit amount upfront.  - `true`: The customer pays only the deposit amount upfront. - `false`: The customer pays the full price upfront.  Used only when `selectedPaymentOption` is `ONLINE` and the [service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) has a deposit amount set.  When the service supports deposit payments and `fullUpfrontPaymentAllowed` is `false`, this field must be `true`. When the service supports deposit payments and `fullUpfrontPaymentAllowed` is `true`, this field can be `true` or `false`.  
        - name: bookedForSomeoneElse | type: boolean | description: Whether a logged-in member made this booking for a guest, someone other than themselves.  When `true`, `contactDetails` are the guest's, not the member's. They aren't replaced with the details of the eCommerce order's buyer.  You can set this field to `true` only when the service's [booking policy](https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/introduction.md) has `bookForSomeoneElseAllowed` set to `true`. You can't set it to `true` when `selectedPaymentOption` is `MEMBERSHIP`.  Default: `false`.  
 Return type: CalculatePriceResponse
  - name: priceInfo | type: PriceInfo | description: Information about each line item's base price and the total base price.  
     - ONE-OF: 
        - name: calculatedPrice | type: number | description: Calculated total price. Available if the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `payment.rateType` is `FIXED`, `VARIED`, `NO_FEE`, or `SUBSCRIPTION`. For `SUBSCRIPTION`, this is the price of 1 billing cycle for all participants. When the booking is paid upfront in one payment, it's the price of all billing cycles, including cycles that are already over. For a `FIXED` or `VARIED` course that has started, this can be a prorated price for the remaining sessions, when the service's `bookingPolicy.prorationPolicy.enabled` is `true`. The prorated price is `0` when none of the course's sessions are remaining. `serviceFullPrice` then holds the price before proration.  
        - name: priceDescriptionInfo | type: PriceDescriptionInfo | description: Description of the total price. Available if the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `payment.rateType` is `CUSTOM`.  
           - name: original | type: string | description: Price description in the site's main language. Refer to the [Site Properties API](https://dev.wix.com/docs/api-reference/business-management/site-properties/properties/introduction.md) for more details.  | validation: maxLength 50
           - name: translated | type: string | description: Translated price description. Available if the booking was made in a secondary language.  | validation: maxLength 50
     - name: bookingLineItems | type: array<BookingLineItem> | description: List of line items, including the number of participants and the price per participant.  | validation: maxItems 40
        - name: serviceId | type: string | description: [Service GUID](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction.md).  Required parameter in: - [Preview Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/preview-price.md) for all service types. All line items must have the same service GUID. - [Calculate Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/calculate-price.md) when using Wix Bookings' default pricing logic. Optional in Calculate Price when using a Pricing Service Provider Plugin.  | validation: format GUID
        - name: resourceId | type: string | description: [Resource GUID](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/introduction.md).  Required parameter in: - [Calculate Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/calculate-price.md) for all service types ([service types](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-types.md)). - [Preview Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/preview-price.md) for appointment-based services and classes. Optional in Preview Price for courses.  | validation: format GUID
        - name: businessLocationId | type: string | description: GUID of the business location the booking takes place at. Used to resolve the price for `LOCATION` service options.  Limited to business locations. Custom and customer locations aren't supported.  Optional in [Preview Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/preview-price.md). If omitted, or if it doesn't match any `LOCATION` choice, the service's default price (`payment.varied.defaultPrice`) is used.  Returned in [Calculate Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/calculate-price.md) based on the location of the booking's slot or, for courses, the booking's schedule.  | validation: format GUID
        - name: serviceChoices | type: array<ServiceChoices> | description: Service choices selected by the customer when booking. Choices are specific values for service options that may affect pricing. For example, the option `ageGroup` may have choices like `child`, `student`, `adult`, and `senior`, each with different pricing. Refer to the [Service Options and Variants API](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md) for more details.  | validation: maxItems 40
           - name: numberOfParticipants | type: integer | description: Number of participants for this service variant.  | validation: minimum 1, format int32
           - name: choices | type: array<ServiceChoice> | description: Service choices selected by these participants. Each choice represents a specific value for a service option. For example, age group, duration, or equipment type.  | validation: maxItems 5
              - ONE-OF: 
                 - name: custom | type: string | description: Value for one of the choices in the [`CustomServiceOption.choices`](https://example.com) list. Choices are specific values for an option the customer can choose to book. For example, the option `ageGroup` may have these choices: `child`, `student`, `adult`, and `senior`. Each choice may have a different price.  
                 - name: duration | type: Duration | description:   
                    - name: minutes | type: integer | description: Duration of the service in minutes. Min: 1 minute, Max: 30 days, 23 hours, and 59 minutes  | validation: minimum 1, maximum 44639
                    - name: name | type: string | description: Name of the duration option. Defaults to the formatted duration e.g. "1 hour, 30 minutes".  | validation: maxLength 255
                 - name: dateTime | type: DateTimeRule | description: The matched date-time pricing rule. Available only for `DATE_TIME` options.  
                    - name: name | type: string | description: Name of the date-time rule. For example, "Weekend mornings".  | validation: maxLength 255
                 - name: participantRange | type: ParticipantsRange | description: The matched participants pricing rule. Available only for `NUMBER_OF_PARTICIPANTS` options.  
                    - name: name | type: string | description: Name of the participants range. For example, "Large group".  | validation: maxLength 255
                 - name: durationRange | type: DurationRange | description: The matched duration range tier. Available only for `DURATION_RANGE` options.  
                    - name: name | type: string | description: Name of the duration range tier. For example, "Long stay".  | validation: maxLength 255
              - name: optionId | type: string | description: GUID of the corresponding option for the choice. For example, the choice `child` could correspond to the option `ageGroup`. In this case, `optionId` is the GUID for the `ageGroup` option.  | validation: format GUID
              - name: choiceId | type: string | description: GUID of the service choice. When provided, the choice details are automatically populated based on this GUID.  | validation: format GUID
           - name: pricePerParticipant | type: number | description: Price per participant for this service variant.  Exception: a group appointment (a service of type `APPOINTMENT` with `multipleParticipants.enabled`) has one price for the whole session, and this field holds that session price. A group appointment priced by a `NUMBER_OF_PARTICIPANTS` or `CUSTOM` option is still priced per participant.  To get the amount to charge, use the line item's `calculatedPrice`.  | read-only: true | validation: format double
        - name: localStartDate | type: string | description: Local start date and time of the booking. For example, `"2024-01-30T13:30:00"`.  Used together with `localEndDate` and `timeZone` to calculate duration-based pricing for services with a duration range configured. If not provided, pricing is calculated based on the number of participants only.  | validation: format LOCAL_DATE_TIME
        - name: localEndDate | type: string | description: Local end date and time of the booking. For example, `"2024-01-30T14:30:00"`.  Used together with `localStartDate` and `timeZone` to calculate duration-based pricing for services with a duration range configured. If not provided, pricing is calculated based on the number of participants only.  | validation: format LOCAL_DATE_TIME
        - name: timeZone | type: string | description: Time zone for `localStartDate` and `localEndDate` in IANA format. For example, `"America/New_York"`.  Required when `localStartDate` and `localEndDate` are provided.  
        - name: calculatedPrice | type: number | description: Base price of this line item on its own. `PriceInfo.calculatedPrice` is the total across all line items. For `SUBSCRIPTION`, this is the price of 1 billing cycle for the line item's participants. When the booking is paid upfront in one payment, it's the price of all billing cycles, including cycles that are already over. For a `FIXED` or `VARIED` course that has started, this can be a prorated price for the remaining sessions, when the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `bookingPolicy.prorationPolicy.enabled` is `true`. The prorated price is `0` when none of the course's sessions are remaining.  | read-only: true | validation: format double
        - name: serviceFullPrice | type: number | description: Price of this line item from the service's price settings, for its participants and choices, before proration. Returned only for `FIXED` and `VARIED`, when `calculatedPrice` is lower. For example, for a course that has started, when the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `bookingPolicy.prorationPolicy.enabled` is `true`.  | read-only: true | validation: format double
        - name: subscriptionPriceInfo | type: SubscriptionPriceInfo | description: Subscription price info of this line item: its payment schedule. Returned only if the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `payment.rateType` is `SUBSCRIPTION`.  | read-only: true 
           - name: startDate | type: string | description: Date and time the subscription starts: the service's recurring start date when the course hasn't started and that date is still ahead, and otherwise the date and time of the calculation. When the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `bookingPolicy.prorationPolicy.enabled` is `true` and none of the course's sessions in the current billing cycle are remaining, it's the next billing day at 12:00 UTC instead.  | validation: format date-time
           - name: numberOfPayments | type: integer | description: Number of payments left in the payment schedule, starting at `startDate`: the service's number of payments minus the billing cycles that end before `startDate`, and at least 1. When the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `bookingPolicy.prorationPolicy.enabled` is `true` and none of the course's sessions are remaining, it's `0` and `startDate` isn't returned. Paying upfront in one payment doesn't change this number, while `calculatedPrice` then covers all of the service's billing cycles, including cycles that are already over.  | validation: minimum 0, format int32
           - name: cyclePriceOverrides | type: array<SubscriptionCyclePriceOverride> | description: Prices for specific billing cycles that differ from the regular price per cycle. For example, a prorated first payment for a customer who joins a monthly course after it started. Cycles that no entry covers are charged the regular price per billing cycle. Holds at most 1 entry, for billing cycle `1`. Empty when every cycle is charged the regular price.  | validation: maxItems 1
              - name: cycleFrom | type: integer | description: First billing cycle the price applies to. Always `1`: the first billing cycle of the payment schedule, which starts at `startDate`.  | validation: minimum 1, maximum 1
              - name: numberOfCycles | type: integer | description: Number of consecutive billing cycles the price applies to, starting at `cycleFrom`. Always `1`.  | validation: minimum 1, maximum 1, format int32
              - name: price | type: string | description: Price of each billing cycle this entry covers, for all of the line item's participants.  | validation: decimalValue {"gte":"0","lte":"1000000000000000","maxScale":2}
        - name: sessionCounts | type: SessionCounts | description: Number of sessions of this line item's course, and how many of them are remaining. Returned only for courses.  | read-only: true 
           - name: totalCount | type: integer | description: Number of the course's sessions. Canceled sessions aren't counted.  | validation: minimum 0, format int32
           - name: remainingCount | type: integer | description: Number of the course's sessions that start after the date and time of the calculation. A session that has started isn't remaining, even if it hasn't ended. Canceled sessions aren't counted.  | validation: minimum 0, format int32
        - name: additionalFees | type: array<AppliedAdditionalFee> | description: Additional fees of the line item, for example a cleaning fee. A fee that comes to `0` isn't returned.  | read-only: true | validation: maxItems 5
           - name: feeId | type: string | description: GUID of the additional fee in the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `payment.additionalFees`.  | validation: format GUID
           - name: units | type: number | description: Number of units the fee is charged for. `1` for a `PER_RESERVATION` fee. For a `PER_UNIT` fee, the reservation's duration in the service's `schedule.availabilityConstraints.durationRange.unitType`, for example `3` for a 3-day reservation, or for 3 nights of an overnight service. `1` when the service has no duration range.  | validation: format double
           - name: amount | type: number | description: Fee amount to charge: the service's fee amount multiplied by `units`, rounded half up to 2 decimal places.  | validation: format double
     - name: serviceFullPrice | type: number | description: Total of the line items' `serviceFullPrice`. A line item without `serviceFullPrice` adds its `calculatedPrice`. Returned only when at least 1 line item returns `serviceFullPrice`.  | read-only: true | validation: format double
     - name: deposit | type: number | description: Total deposit the customer must pay when booking the service. Available if the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `payment.options.deposit` is set to `true`. Doesn't include additional fees.  | validation: format double
     - name: totalAdditionalFees | type: number | description: Sum of the additional fees on all line items. Returned only when `calculatedPrice` is returned and at least 1 fee applies.  | read-only: true | validation: format double
     - name: calculatedPriceWithFees | type: number | description: `calculatedPrice` plus `totalAdditionalFees`. Returned only when `calculatedPrice` is returned and at least 1 fee applies.  | read-only: true | validation: format double

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_DURATION_CHOICE | Description: The booking range doesn't match the duration of the selected variant.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NUMBER_OF_PARTICIPANTS_NOT_FOUND | Description: The `numberOfParticipants` is missing or set to `0`. Specify the number of participants for the booking.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_BOOKING | Description: The booking data is invalid or missing required fields. Ensure `bookedEntity` includes valid service and participant information.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MULTIPLE_PRICING_PROVIDERS_FOUND | Description: Multiple pricing providers are installed. Only 1 pricing provider can be active at a time.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ERROR_CONTACTING_PRICING_PROVIDER | Description: Couldn't retrieve pricing from the external pricing provider. The provider may be unavailable or returned an error.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: FAILED_RESOLVING_SERVICE | Description: Couldn't retrieve service information. The service may not exist or is unavailable.


```

### Examples

### Calculate the price of a booking with custom pricing options
```curl
curl -X POST \
'https://www.wixapis.com/bookings/v2/pricing/calculate' \
-H 'Authorization: <AUTH>' \
-d '{
  "booking": {
    "bookedEntity": {
      "slot": {
        "serviceId": "b59d6285-098e-4ac4-8fd4-99e22231d0e9",
        "resource": {
          "id": "76570209-101f-409b-af97-b445bdb63125"
        }
      }
    },
    "totalParticipants": 1
  }
}'
```

### Calculate the price of a booking with staff-based pricing options.
```curl
curl -X POST \
'https://www.wixapis.com/bookings/v2/pricing/calculate' \
-H 'Authorization: <AUTH>' \
-d '{
  "booking": {
    "bookedEntity": {
      "slot": {
        "serviceId": "b2f1c9aa-1743-4cac-ae2c-48cc7666365c",
        "resource": {
          "id": "76570209-101f-409b-af97-b445bdb63125"
        }
      }
    },
    "totalParticipants": 1
  }
}'
```

### Calculate the price of a booking with custom choices
```curl
curl -X POST \
'https://www.wixapis.com/bookings/v2/pricing/calculate' \
-H 'Authorization: <AUTH>' \
-d '{
  "booking": {
    "bookedEntity": {
      "slot": {
        "serviceId": "dae13fbb-4314-4b1c-990d-1d82c280cb2f",
        "resource": {
          "id": "76570209-101f-409b-af97-b445bdb63125"
        } 
      } 
    },
    "participantsChoices": {
      "serviceChoices": [ {
        "numberOfParticipants": 1,
        "choices": [ {
          "optionId": "68ea3e36-4a40-461d-81ef-349499d51c74",
          "custom": "Adults"
        } ]
      } ]
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.bookings.pricing.calculatePrice(options)
 Description: 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](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction.md). 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](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction.md). 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](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction.md) 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](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/preview-price.md) instead.
 Method parameters:
   param name: options | type: CalculatePriceOptions  none  
 Return type: PROMISE<CalculatePriceResponse>
  - name: priceInfo | type: PriceInfo | description: Information about each line item's base price and the total base price.  
     - ONE-OF: 
        - name: calculatedPrice | type: number | description: Calculated total price. Available if the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `payment.rateType` is `FIXED`, `VARIED`, `NO_FEE`, or `SUBSCRIPTION`. For `SUBSCRIPTION`, this is the price of 1 billing cycle for all participants. When the booking is paid upfront in one payment, it's the price of all billing cycles, including cycles that are already over. For a `FIXED` or `VARIED` course that has started, this can be a prorated price for the remaining sessions, when the service's `bookingPolicy.prorationPolicy.enabled` is `true`. The prorated price is `0` when none of the course's sessions are remaining. `serviceFullPrice` then holds the price before proration.  
        - name: priceDescriptionInfo | type: PriceDescriptionInfo | description: Description of the total price. Available if the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `payment.rateType` is `CUSTOM`.  
           - name: original | type: string | description: Price description in the site's main language. Refer to the [Site Properties API](https://dev.wix.com/docs/api-reference/business-management/site-properties/properties/introduction.md) for more details.  | validation: maxLength 50
           - name: translated | type: string | description: Translated price description. Available if the booking was made in a secondary language.  | validation: maxLength 50
     - name: bookingLineItems | type: array<BookingLineItem> | description: List of line items, including the number of participants and the price per participant.  | validation: maxItems 40
        - name: serviceId | type: string | description: [Service GUID](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction.md).  Required parameter in: - [Preview Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/preview-price.md) for all service types. All line items must have the same service GUID. - [Calculate Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/calculate-price.md) when using Wix Bookings' default pricing logic. Optional in Calculate Price when using a Pricing Service Provider Plugin.  | validation: format GUID
        - name: resourceId | type: string | description: [Resource GUID](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/introduction.md).  Required parameter in: - [Calculate Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/calculate-price.md) for all service types ([service types](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-types.md)). - [Preview Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/preview-price.md) for appointment-based services and classes. Optional in Preview Price for courses.  | validation: format GUID
        - name: businessLocationId | type: string | description: GUID of the business location the booking takes place at. Used to resolve the price for `LOCATION` service options.  Limited to business locations. Custom and customer locations aren't supported.  Optional in [Preview Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/preview-price.md). If omitted, or if it doesn't match any `LOCATION` choice, the service's default price (`payment.varied.defaultPrice`) is used.  Returned in [Calculate Price](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/calculate-price.md) based on the location of the booking's slot or, for courses, the booking's schedule.  | validation: format GUID
        - name: serviceChoices | type: array<ServiceChoices> | description: Service choices selected by the customer when booking. Choices are specific values for service options that may affect pricing. For example, the option `ageGroup` may have choices like `child`, `student`, `adult`, and `senior`, each with different pricing. Refer to the [Service Options and Variants API](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md) for more details.  | validation: maxItems 40
           - name: numberOfParticipants | type: integer | description: Number of participants for this service variant.  | validation: minimum 1, format int32
           - name: choices | type: array<ServiceChoice> | description: Service choices selected by these participants. Each choice represents a specific value for a service option. For example, age group, duration, or equipment type.  | validation: maxItems 5
              - ONE-OF: 
                 - name: custom | type: string | description: Value for one of the choices in the [`CustomServiceOption.choices`](https://example.com) list. Choices are specific values for an option the customer can choose to book. For example, the option `ageGroup` may have these choices: `child`, `student`, `adult`, and `senior`. Each choice may have a different price.  
                 - name: duration | type: Duration | description:   
                    - name: minutes | type: integer | description: Duration of the service in minutes. Min: 1 minute, Max: 30 days, 23 hours, and 59 minutes  | validation: minimum 1, maximum 44639
                    - name: name | type: string | description: Name of the duration option. Defaults to the formatted duration e.g. "1 hour, 30 minutes".  | validation: maxLength 255
                 - name: dateTime | type: DateTimeRule | description: The matched date-time pricing rule. Available only for `DATE_TIME` options.  
                    - name: name | type: string | description: Name of the date-time rule. For example, "Weekend mornings".  | validation: maxLength 255
                 - name: participantRange | type: ParticipantsRange | description: The matched participants pricing rule. Available only for `NUMBER_OF_PARTICIPANTS` options.  
                    - name: name | type: string | description: Name of the participants range. For example, "Large group".  | validation: maxLength 255
                 - name: durationRange | type: DurationRange | description: The matched duration range tier. Available only for `DURATION_RANGE` options.  
                    - name: name | type: string | description: Name of the duration range tier. For example, "Long stay".  | validation: maxLength 255
              - name: optionId | type: string | description: GUID of the corresponding option for the choice. For example, the choice `child` could correspond to the option `ageGroup`. In this case, `optionId` is the GUID for the `ageGroup` option.  | validation: format GUID
              - name: choiceId | type: string | description: GUID of the service choice. When provided, the choice details are automatically populated based on this GUID.  | validation: format GUID
           - name: pricePerParticipant | type: number | description: Price per participant for this service variant.  Exception: a group appointment (a service of type `APPOINTMENT` with `multipleParticipants.enabled`) has one price for the whole session, and this field holds that session price. A group appointment priced by a `NUMBER_OF_PARTICIPANTS` or `CUSTOM` option is still priced per participant.  To get the amount to charge, use the line item's `calculatedPrice`.  | read-only: true 
        - name: localStartDate | type: string | description: Local start date and time of the booking. For example, `"2024-01-30T13:30:00"`.  Used together with `localEndDate` and `timeZone` to calculate duration-based pricing for services with a duration range configured. If not provided, pricing is calculated based on the number of participants only.  | validation: format LOCAL_DATE_TIME
        - name: localEndDate | type: string | description: Local end date and time of the booking. For example, `"2024-01-30T14:30:00"`.  Used together with `localStartDate` and `timeZone` to calculate duration-based pricing for services with a duration range configured. If not provided, pricing is calculated based on the number of participants only.  | validation: format LOCAL_DATE_TIME
        - name: timeZone | type: string | description: Time zone for `localStartDate` and `localEndDate` in IANA format. For example, `"America/New_York"`.  Required when `localStartDate` and `localEndDate` are provided.  
        - name: calculatedPrice | type: number | description: Base price of this line item on its own. `PriceInfo.calculatedPrice` is the total across all line items. For `SUBSCRIPTION`, this is the price of 1 billing cycle for the line item's participants. When the booking is paid upfront in one payment, it's the price of all billing cycles, including cycles that are already over. For a `FIXED` or `VARIED` course that has started, this can be a prorated price for the remaining sessions, when the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `bookingPolicy.prorationPolicy.enabled` is `true`. The prorated price is `0` when none of the course's sessions are remaining.  | read-only: true 
        - name: serviceFullPrice | type: number | description: Price of this line item from the service's price settings, for its participants and choices, before proration. Returned only for `FIXED` and `VARIED`, when `calculatedPrice` is lower. For example, for a course that has started, when the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `bookingPolicy.prorationPolicy.enabled` is `true`.  | read-only: true 
        - name: subscriptionPriceInfo | type: SubscriptionPriceInfo | description: Subscription price info of this line item: its payment schedule. Returned only if the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `payment.rateType` is `SUBSCRIPTION`.  | read-only: true 
           - name: startDate | type: Date | description: Date and time the subscription starts: the service's recurring start date when the course hasn't started and that date is still ahead, and otherwise the date and time of the calculation. When the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `bookingPolicy.prorationPolicy.enabled` is `true` and none of the course's sessions in the current billing cycle are remaining, it's the next billing day at 12:00 UTC instead.  
           - name: numberOfPayments | type: integer | description: Number of payments left in the payment schedule, starting at `startDate`: the service's number of payments minus the billing cycles that end before `startDate`, and at least 1. When the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `bookingPolicy.prorationPolicy.enabled` is `true` and none of the course's sessions are remaining, it's `0` and `startDate` isn't returned. Paying upfront in one payment doesn't change this number, while `calculatedPrice` then covers all of the service's billing cycles, including cycles that are already over.  | validation: minimum 0, format int32
           - name: cyclePriceOverrides | type: array<SubscriptionCyclePriceOverride> | description: Prices for specific billing cycles that differ from the regular price per cycle. For example, a prorated first payment for a customer who joins a monthly course after it started. Cycles that no entry covers are charged the regular price per billing cycle. Holds at most 1 entry, for billing cycle `1`. Empty when every cycle is charged the regular price.  | validation: maxItems 1
              - name: cycleFrom | type: integer | description: First billing cycle the price applies to. Always `1`: the first billing cycle of the payment schedule, which starts at `startDate`.  | validation: minimum 1, maximum 1
              - name: numberOfCycles | type: integer | description: Number of consecutive billing cycles the price applies to, starting at `cycleFrom`. Always `1`.  | validation: minimum 1, maximum 1, format int32
              - name: price | type: string | description: Price of each billing cycle this entry covers, for all of the line item's participants.  | validation: decimalValue {"gte":"0","lte":"1000000000000000","maxScale":2}
        - name: sessionCounts | type: SessionCounts | description: Number of sessions of this line item's course, and how many of them are remaining. Returned only for courses.  | read-only: true 
           - name: totalCount | type: integer | description: Number of the course's sessions. Canceled sessions aren't counted.  | validation: minimum 0, format int32
           - name: remainingCount | type: integer | description: Number of the course's sessions that start after the date and time of the calculation. A session that has started isn't remaining, even if it hasn't ended. Canceled sessions aren't counted.  | validation: minimum 0, format int32
        - name: additionalFees | type: array<AppliedAdditionalFee> | description: Additional fees of the line item, for example a cleaning fee. A fee that comes to `0` isn't returned.  | read-only: true | validation: maxItems 5
           - name: feeId | type: string | description: GUID of the additional fee in the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `payment.additionalFees`.  | validation: format GUID
           - name: units | type: number | description: Number of units the fee is charged for. `1` for a `PER_RESERVATION` fee. For a `PER_UNIT` fee, the reservation's duration in the service's `schedule.availabilityConstraints.durationRange.unitType`, for example `3` for a 3-day reservation, or for 3 nights of an overnight service. `1` when the service has no duration range.  
           - name: amount | type: number | description: Fee amount to charge: the service's fee amount multiplied by `units`, rounded half up to 2 decimal places.  
     - name: serviceFullPrice | type: number | description: Total of the line items' `serviceFullPrice`. A line item without `serviceFullPrice` adds its `calculatedPrice`. Returned only when at least 1 line item returns `serviceFullPrice`.  | read-only: true 
     - name: deposit | type: number | description: Total deposit the customer must pay when booking the service. Available if the [service's](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) `payment.options.deposit` is set to `true`. Doesn't include additional fees.  
     - name: totalAdditionalFees | type: number | description: Sum of the additional fees on all line items. Returned only when `calculatedPrice` is returned and at least 1 fee applies.  | read-only: true 
     - name: calculatedPriceWithFees | type: number | description: `calculatedPrice` plus `totalAdditionalFees`. Returned only when `calculatedPrice` is returned and at least 1 fee applies.  | read-only: true 

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_DURATION_CHOICE | Description: The booking range doesn't match the duration of the selected variant.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NUMBER_OF_PARTICIPANTS_NOT_FOUND | Description: The `numberOfParticipants` is missing or set to `0`. Specify the number of participants for the booking.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_BOOKING | Description: The booking data is invalid or missing required fields. Ensure `bookedEntity` includes valid service and participant information.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MULTIPLE_PRICING_PROVIDERS_FOUND | Description: Multiple pricing providers are installed. Only 1 pricing provider can be active at a time.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ERROR_CONTACTING_PRICING_PROVIDER | Description: Couldn't retrieve pricing from the external pricing provider. The provider may be unavailable or returned an error.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: FAILED_RESOLVING_SERVICE | Description: Couldn't retrieve service information. The service may not exist or is unavailable.


```

### Examples

### Calculate the price of an existing booking
```javascript
import { pricing } from "@wix/bookings";

const booking = {
  bookedEntity: {
    slot: {
      serviceId: "8e8839e1-5f16-4e82-a3bb-a1db594b29ba",
      scheduleId: "8c18b72f-473a-4ee5-916c-0121f11f72d6",
      startDate: "2025-06-01T10:00:00Z",
      endDate: "2025-06-01T11:00:00Z",
    },
  },
  participantsChoices: {
    serviceChoices: [{ numberOfParticipants: 1 }],
  },
};

async function calculatePrice() {
  const response = await pricing.calculatePrice(booking);
}

```

### calculatePrice (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { pricing } from '@wix/bookings';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { pricing },
  // Include the auth strategy and host as relevant
});


async function calculatePrice(options) {
  const response = await myWixClient.pricing.calculatePrice(options);
};
```

---