previewPrice( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Previews the base price for a set of line items belonging to the same service, before a booking is created. During the booking flow, additional taxes and fees may be added to the base price.

Response

The response includes each line item's individual preview price and the total of all line item preview prices. Note that the final price upon booking creation may differ from the preview price.

Errors

Preview Price fails if:

  • You specify line items that belong to different services (SDK | REST).
  • The site is using the Bookings Pricing Integration SPI (REST).

When to call Calculate Price instead

To retrieve the price of an existing booking, call Calculate 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
bookingLineItemsArray<BookingLineItem>Required

List of line items to preview the price for.

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

There are 2 errors with this status code.

428Failed Precondition

There is 1 error with this status code.

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

Did this help?