@wix/auto_sdk_bookings_pricing 1.0.39 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +23 -45
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +67 -118
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +37 -66
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +23 -45
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +67 -118
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +37 -66
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +23 -45
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +67 -118
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +37 -66
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +23 -45
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +67 -118
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +37 -66
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
2
|
|
|
3
3
|
interface PriceInfo extends PriceInfoTotalPriceOneOf {
|
|
4
|
-
/**
|
|
5
|
-
* Calculated total price. Available if the _service's_
|
|
6
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
|
|
7
|
-
* `payment.rateType` is `FIXED`, `VARIED`, or `NO_FEE`.
|
|
8
|
-
*/
|
|
4
|
+
/** Calculated total price. Available if the service's ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)) `payment.rateType` is `FIXED`, `VARIED`, or `NO_FEE`. */
|
|
9
5
|
calculatedPrice?: number;
|
|
10
6
|
/**
|
|
11
|
-
* Description of the total price.
|
|
12
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
|
|
16
|
-
* `payment.rateType` is `CUSTOM`.
|
|
7
|
+
* Description of the total price.
|
|
8
|
+
* Available if the service's ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)) `payment.rateType` is `CUSTOM`.
|
|
9
|
+
* @deprecated Description of the total price.
|
|
10
|
+
* Available if the service's ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)) `payment.rateType` is `CUSTOM`.
|
|
17
11
|
* @replacedBy price_description_info.original
|
|
18
12
|
* @targetRemovalDate 2025-01-10
|
|
19
13
|
*/
|
|
20
14
|
priceDescription?: string;
|
|
21
15
|
/**
|
|
22
|
-
* Description of the total price.
|
|
23
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
|
|
24
|
-
* `payment.rateType` is `CUSTOM`.
|
|
16
|
+
* Description of the total price.
|
|
17
|
+
* Available if the service's ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)) `payment.rateType` is `CUSTOM`.
|
|
25
18
|
*/
|
|
26
19
|
priceDescriptionInfo?: PriceDescriptionInfo;
|
|
27
20
|
/**
|
|
@@ -30,74 +23,53 @@ interface PriceInfo extends PriceInfoTotalPriceOneOf {
|
|
|
30
23
|
*/
|
|
31
24
|
bookingLineItems?: BookingLineItem[];
|
|
32
25
|
/**
|
|
33
|
-
* Total deposit the customer must pay when booking the service.
|
|
34
|
-
* the
|
|
35
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
|
|
36
|
-
* `payment.options.deposit` is set to `true`.
|
|
26
|
+
* Total deposit the customer must pay when booking the service.
|
|
27
|
+
* Available if the service's ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)) `payment.options.deposit` is set to `true`.
|
|
37
28
|
*/
|
|
38
29
|
deposit?: number | null;
|
|
39
30
|
}
|
|
40
31
|
/** @oneof */
|
|
41
32
|
interface PriceInfoTotalPriceOneOf {
|
|
42
|
-
/**
|
|
43
|
-
* Calculated total price. Available if the _service's_
|
|
44
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
|
|
45
|
-
* `payment.rateType` is `FIXED`, `VARIED`, or `NO_FEE`.
|
|
46
|
-
*/
|
|
33
|
+
/** Calculated total price. Available if the service's ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)) `payment.rateType` is `FIXED`, `VARIED`, or `NO_FEE`. */
|
|
47
34
|
calculatedPrice?: number;
|
|
48
35
|
/**
|
|
49
|
-
* Description of the total price.
|
|
50
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
|
|
54
|
-
* `payment.rateType` is `CUSTOM`.
|
|
36
|
+
* Description of the total price.
|
|
37
|
+
* Available if the service's ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)) `payment.rateType` is `CUSTOM`.
|
|
38
|
+
* @deprecated Description of the total price.
|
|
39
|
+
* Available if the service's ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)) `payment.rateType` is `CUSTOM`.
|
|
55
40
|
* @replacedBy price_description_info.original
|
|
56
41
|
* @targetRemovalDate 2025-01-10
|
|
57
42
|
*/
|
|
58
43
|
priceDescription?: string;
|
|
59
44
|
/**
|
|
60
|
-
* Description of the total price.
|
|
61
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
|
|
62
|
-
* `payment.rateType` is `CUSTOM`.
|
|
45
|
+
* Description of the total price.
|
|
46
|
+
* Available if the service's ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)) `payment.rateType` is `CUSTOM`.
|
|
63
47
|
*/
|
|
64
48
|
priceDescriptionInfo?: PriceDescriptionInfo;
|
|
65
49
|
}
|
|
66
50
|
interface BookingLineItem {
|
|
67
51
|
/**
|
|
68
|
-
*
|
|
69
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)).
|
|
70
|
-
*
|
|
71
|
-
* Required in *Calculate Price*
|
|
72
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/calculate-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/calculate-price))
|
|
73
|
-
* if the site uses Wix Bookings' default pricing logic.
|
|
52
|
+
* Service ID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)).
|
|
74
53
|
*
|
|
75
|
-
*
|
|
76
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/
|
|
77
|
-
*
|
|
78
|
-
* Wix Bookings Pricing Integration service plugin*
|
|
79
|
-
* ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction))
|
|
80
|
-
* integration.
|
|
54
|
+
* Required parameter in:
|
|
55
|
+
* - Preview Price ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/preview-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/preview-price)) for all service types. All line items must have the same service ID.
|
|
56
|
+
* - Calculate Price ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/calculate-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/calculate-price)) when using Wix Bookings' default pricing logic. Optional in Calculate Price when using a Pricing Service Provider Plugin.
|
|
81
57
|
* @format GUID
|
|
82
58
|
*/
|
|
83
59
|
serviceId?: string | null;
|
|
84
60
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* Required in
|
|
88
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/calculate-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/calculate-price))
|
|
89
|
-
* and
|
|
90
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/preview-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/preview-price))
|
|
91
|
-
* for appointment-based services and classes.
|
|
61
|
+
* Resource ID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/resources/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/resources/resources-v2/introduction)).
|
|
62
|
+
*
|
|
63
|
+
* Required parameter in:
|
|
64
|
+
* - Calculate Price ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/calculate-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/calculate-price)) for all service types ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/about-service-types) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-types)).
|
|
65
|
+
* - Preview Price ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/preview-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/preview-price)) for appointment-based services and classes. Optional in Preview Price for courses.
|
|
92
66
|
* @format GUID
|
|
93
67
|
*/
|
|
94
68
|
resourceId?: string | null;
|
|
95
69
|
/**
|
|
96
|
-
*
|
|
97
|
-
* For example, the option `ageGroup` may have
|
|
98
|
-
*
|
|
99
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction))
|
|
100
|
-
* for more details.
|
|
70
|
+
* Service choices selected by the customer when booking.
|
|
71
|
+
* 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.
|
|
72
|
+
* Refer to the Service Options and Variants API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)) for more details.
|
|
101
73
|
*/
|
|
102
74
|
choices?: ServiceChoice[];
|
|
103
75
|
/**
|
|
@@ -156,53 +128,54 @@ interface Duration {
|
|
|
156
128
|
}
|
|
157
129
|
interface PricingServiceChoices {
|
|
158
130
|
/**
|
|
159
|
-
* Number of participants for this variant
|
|
131
|
+
* Number of participants for this service variant.
|
|
160
132
|
* @min 1
|
|
161
133
|
*/
|
|
162
134
|
numberOfParticipants?: number | null;
|
|
163
135
|
/**
|
|
164
|
-
* Service choices
|
|
136
|
+
* Service choices selected by these participants.
|
|
137
|
+
* Each choice represents a specific value for a service option.
|
|
138
|
+
* For example, age group, duration, or equipment type.
|
|
165
139
|
* @maxSize 5
|
|
166
140
|
*/
|
|
167
141
|
choices?: ServiceChoice[];
|
|
168
142
|
/**
|
|
169
|
-
* Price per participant for
|
|
143
|
+
* Price per participant for this service variant.
|
|
170
144
|
* @readonly
|
|
171
145
|
*/
|
|
172
146
|
pricePerParticipant?: number | null;
|
|
173
147
|
}
|
|
174
148
|
interface PriceDescriptionInfo {
|
|
175
149
|
/**
|
|
176
|
-
* Price description in the site's main language.
|
|
177
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/site-properties/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/site-properties/properties/introduction))
|
|
178
|
-
* for more details.
|
|
150
|
+
* Price description in the site's main language.
|
|
151
|
+
* Refer to the Site Properties API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/site-properties/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/site-properties/properties/introduction)) for more details.
|
|
179
152
|
* @maxLength 50
|
|
180
153
|
*/
|
|
181
154
|
original?: string;
|
|
182
155
|
/**
|
|
183
|
-
* Translated price description.
|
|
184
|
-
* secondary language.
|
|
156
|
+
* Translated price description.
|
|
157
|
+
* Available if the booking was made in a secondary language.
|
|
185
158
|
* @maxLength 50
|
|
186
159
|
*/
|
|
187
160
|
translated?: string | null;
|
|
188
161
|
}
|
|
189
162
|
interface PreviewPriceRequest {
|
|
190
163
|
/**
|
|
191
|
-
*
|
|
164
|
+
* Booking line items to preview pricing for.
|
|
165
|
+
* All line items must belong to the same service ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)).
|
|
192
166
|
* @minSize 1
|
|
193
167
|
* @maxSize 20
|
|
194
168
|
*/
|
|
195
169
|
bookingLineItems: BookingLineItem[];
|
|
196
170
|
}
|
|
197
171
|
interface PreviewPriceResponse {
|
|
198
|
-
/**
|
|
172
|
+
/** Pricing information including individual line item costs and total estimated price. */
|
|
199
173
|
priceInfo?: PriceInfo;
|
|
200
174
|
}
|
|
201
175
|
interface CalculatePriceRequest {
|
|
202
176
|
/**
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* to calculate the base price for.
|
|
177
|
+
* Existing booking ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/introduction)) to calculate the base price for.
|
|
178
|
+
* Must include `bookedEntity` details and participant information.
|
|
206
179
|
*/
|
|
207
180
|
booking: Booking;
|
|
208
181
|
}
|
|
@@ -957,6 +930,7 @@ interface CalculatePriceResponse {
|
|
|
957
930
|
/** Information about each line item's base price and the total base price. */
|
|
958
931
|
priceInfo?: PriceInfo;
|
|
959
932
|
}
|
|
933
|
+
/** @docsIgnore */
|
|
960
934
|
type PreviewPriceApplicationErrors = {
|
|
961
935
|
code?: 'INVALID_SERVICE_ID';
|
|
962
936
|
description?: string;
|
|
@@ -970,6 +944,7 @@ type PreviewPriceApplicationErrors = {
|
|
|
970
944
|
description?: string;
|
|
971
945
|
data?: Record<string, any>;
|
|
972
946
|
};
|
|
947
|
+
/** @docsIgnore */
|
|
973
948
|
type CalculatePriceApplicationErrors = {
|
|
974
949
|
code?: 'INVALID_BOOKING';
|
|
975
950
|
description?: string;
|
|
@@ -992,80 +967,54 @@ type CalculatePriceApplicationErrors = {
|
|
|
992
967
|
data?: Record<string, any>;
|
|
993
968
|
};
|
|
994
969
|
/**
|
|
995
|
-
* Previews the base price for a set of line items belonging to the same
|
|
996
|
-
* service, before a booking is created. During the booking flow, additional
|
|
997
|
-
* taxes and fees may be added to the base price.
|
|
998
|
-
*
|
|
999
|
-
*
|
|
1000
|
-
* ## Response
|
|
1001
|
-
*
|
|
1002
|
-
* The response includes each line item's individual preview price and the
|
|
1003
|
-
* total of all line item preview prices. Note that the final price upon
|
|
1004
|
-
* booking creation may differ from the preview price.
|
|
1005
|
-
*
|
|
1006
|
-
* ## Errors
|
|
970
|
+
* Previews the base price for a set of line items belonging to the same service, before a booking is created.
|
|
1007
971
|
*
|
|
1008
|
-
*
|
|
972
|
+
* The response includes each line item's individual preview price and the total of all line item preview prices.
|
|
973
|
+
* In most situations, the preview price matches the final booking price when using the same parameters.
|
|
974
|
+
* The final amount may differ due to discounts, booking fees, payment processing charges, or service price changes made by the business between preview and booking creation.
|
|
1009
975
|
*
|
|
1010
|
-
*
|
|
1011
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)).
|
|
1012
|
-
* - The site is using the *Bookings Pricing Integration SPI*
|
|
1013
|
-
* ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).
|
|
976
|
+
* Preview Price fails if:
|
|
1014
977
|
*
|
|
1015
|
-
*
|
|
978
|
+
* - You specify line items that belong to different services ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)).
|
|
979
|
+
* - The site is using a Bookings Pricing Integration Service Plugin ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)). Note that external apps can't currently check whether a plugin is installed on the site before calling Preview Price.
|
|
1016
980
|
*
|
|
1017
|
-
* To retrieve the price of an existing booking, call
|
|
1018
|
-
*
|
|
1019
|
-
*
|
|
981
|
+
* To retrieve the price of an existing booking, call Calculate Price ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/calculate-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/calculate-price)) instead.
|
|
982
|
+
* @param bookingLineItems - Booking line items to preview pricing for.
|
|
983
|
+
* All line items must belong to the same service ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)).
|
|
1020
984
|
* @public
|
|
1021
|
-
* @documentationMaturity preview
|
|
1022
985
|
* @requiredField bookingLineItems
|
|
1023
986
|
* @permissionId BOOKINGS.PRICE_PREVIEW
|
|
1024
987
|
* @applicableIdentity APP
|
|
1025
|
-
* @applicableIdentity VISITOR
|
|
1026
988
|
* @fqn com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice
|
|
1027
989
|
*/
|
|
1028
990
|
declare function previewPrice(bookingLineItems: BookingLineItem[]): Promise<NonNullablePaths<PreviewPriceResponse, `priceInfo.calculatedPrice` | `priceInfo.priceDescription` | `priceInfo.priceDescriptionInfo.original` | `priceInfo.bookingLineItems`, 4> & {
|
|
1029
991
|
__applicationErrorsType?: PreviewPriceApplicationErrors;
|
|
1030
992
|
}>;
|
|
1031
993
|
/**
|
|
1032
|
-
* Calculates the base price
|
|
994
|
+
* Calculates the current base price for an existing booking.
|
|
1033
995
|
*
|
|
1034
996
|
*
|
|
1035
|
-
*
|
|
1036
|
-
* _eCommerce checkout_
|
|
1037
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),
|
|
1038
|
-
* additional taxes and fees may be added to this base price.
|
|
997
|
+
* Use this method to display booking costs in external apps or dashboards, or to retrieve accurate pricing for bookings created through other channels.
|
|
1039
998
|
*
|
|
1040
|
-
*
|
|
999
|
+
* The returned price represents the fundamental booking cost before additional charges during eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/
|
|
1000
|
+
* business-solutions/e-commerce/introduction)). 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.
|
|
1041
1001
|
*
|
|
1042
|
-
*
|
|
1043
|
-
* `serviceOptionsAndVariants.variants.values.price`
|
|
1044
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
|
|
1045
|
-
* You must then specify either `booking.bookedEntity.slot.serviceId` or
|
|
1046
|
-
* `booking.bookedEntity.schedule.scheduleId`.
|
|
1002
|
+
* ## Price calculation methods
|
|
1047
1003
|
*
|
|
1048
|
-
*
|
|
1049
|
-
*
|
|
1050
|
-
*
|
|
1051
|
-
* _Calculate Price_
|
|
1052
|
-
* ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).
|
|
1053
|
-
* In this case, it suffices to specify `booking.bookedEntity`.
|
|
1004
|
+
* *Standard pricing**: Wix Bookings calculates prices based on the number of participants for each service variant ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://
|
|
1005
|
+
* dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
|
|
1006
|
+
* Specify `booking.bookedEntity.slot.serviceId` for appointment-based services and classes, or `booking.bookedEntity.schedule.serviceId` for courses.
|
|
1054
1007
|
*
|
|
1055
|
-
*
|
|
1008
|
+
* *Custom pricing**: When a [Pricing Service Provider Plugin](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction) is installed, Calculate Price gets responses directly from the external provider instead of using standard Wix pricing logic.
|
|
1009
|
+
* 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.
|
|
1056
1010
|
*
|
|
1057
|
-
* To estimate the price for multiple booking line items before the booking exists,
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
* @param booking - _Booking_
|
|
1061
|
-
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/introduction))
|
|
1062
|
-
* to calculate the base price for.
|
|
1011
|
+
* To estimate the price for multiple booking line items before the booking exists, call Preview Price ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/preview-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/preview-price)) instead.
|
|
1012
|
+
* @param booking - Existing booking ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/introduction)) to calculate the base price for.
|
|
1013
|
+
* Must include `bookedEntity` details and participant information.
|
|
1063
1014
|
* @public
|
|
1064
|
-
* @documentationMaturity preview
|
|
1065
1015
|
* @requiredField booking
|
|
1066
1016
|
* @permissionId BOOKINGS.PRICE_CALCULATE
|
|
1067
1017
|
* @applicableIdentity APP
|
|
1068
|
-
* @applicableIdentity VISITOR
|
|
1069
1018
|
* @fqn com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice
|
|
1070
1019
|
*/
|
|
1071
1020
|
declare function calculatePrice(booking: Booking): Promise<NonNullablePaths<CalculatePriceResponse, `priceInfo.calculatedPrice` | `priceInfo.priceDescription` | `priceInfo.priceDescriptionInfo.original` | `priceInfo.bookingLineItems`, 4> & {
|