@wix/auto_sdk_bookings_pricing 1.0.3 → 1.0.5
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/src/bookings-v2-price-info-pricing.http.d.ts +36 -37
- package/build/cjs/src/bookings-v2-price-info-pricing.http.js +36 -37
- package/build/cjs/src/bookings-v2-price-info-pricing.http.js.map +1 -1
- package/build/cjs/src/bookings-v2-price-info-pricing.public.d.ts +39 -38
- package/build/cjs/src/bookings-v2-price-info-pricing.public.js.map +1 -1
- package/build/cjs/src/bookings-v2-price-info-pricing.types.d.ts +61 -42
- package/build/cjs/src/bookings-v2-price-info-pricing.types.js.map +1 -1
- package/build/cjs/src/bookings-v2-price-info-pricing.universal.d.ts +129 -112
- package/build/cjs/src/bookings-v2-price-info-pricing.universal.js +39 -38
- package/build/cjs/src/bookings-v2-price-info-pricing.universal.js.map +1 -1
- package/build/es/src/bookings-v2-price-info-pricing.http.d.ts +36 -37
- package/build/es/src/bookings-v2-price-info-pricing.http.js +36 -37
- package/build/es/src/bookings-v2-price-info-pricing.http.js.map +1 -1
- package/build/es/src/bookings-v2-price-info-pricing.public.d.ts +39 -38
- package/build/es/src/bookings-v2-price-info-pricing.public.js.map +1 -1
- package/build/es/src/bookings-v2-price-info-pricing.types.d.ts +61 -42
- package/build/es/src/bookings-v2-price-info-pricing.types.js.map +1 -1
- package/build/es/src/bookings-v2-price-info-pricing.universal.d.ts +129 -112
- package/build/es/src/bookings-v2-price-info-pricing.universal.js +39 -38
- package/build/es/src/bookings-v2-price-info-pricing.universal.js.map +1 -1
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.d.ts +36 -37
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.js +36 -37
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.js.map +1 -1
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.public.d.ts +39 -38
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.public.js.map +1 -1
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.types.d.ts +61 -42
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.types.js.map +1 -1
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.d.ts +129 -112
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.js +39 -38
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.js.map +1 -1
- package/build/internal/es/src/bookings-v2-price-info-pricing.http.d.ts +36 -37
- package/build/internal/es/src/bookings-v2-price-info-pricing.http.js +36 -37
- package/build/internal/es/src/bookings-v2-price-info-pricing.http.js.map +1 -1
- package/build/internal/es/src/bookings-v2-price-info-pricing.public.d.ts +39 -38
- package/build/internal/es/src/bookings-v2-price-info-pricing.public.js.map +1 -1
- package/build/internal/es/src/bookings-v2-price-info-pricing.types.d.ts +61 -42
- package/build/internal/es/src/bookings-v2-price-info-pricing.types.js.map +1 -1
- package/build/internal/es/src/bookings-v2-price-info-pricing.universal.d.ts +129 -112
- package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js +39 -38
- package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export interface PriceInfo extends PriceInfoTotalPriceOneOf {
|
|
2
2
|
/**
|
|
3
|
-
* Calculated total price. Available
|
|
4
|
-
* [
|
|
5
|
-
*
|
|
6
|
-
* `schedule.rate.labeledPriceOptions` object.
|
|
3
|
+
* Calculated total price. Available if the _service's_
|
|
4
|
+
* ([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))
|
|
5
|
+
* `payment.rateType` is `FIXED`, `VARIED`, or `NO_FEE`.
|
|
7
6
|
*/
|
|
8
7
|
calculatedPrice?: number;
|
|
9
8
|
/**
|
|
10
|
-
* Description of the total price.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
9
|
+
* Description of the total price. Available if the _service's_
|
|
10
|
+
* ([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))
|
|
11
|
+
* `payment.rateType` is `CUSTOM`.
|
|
12
|
+
* @deprecated Description of the total price. Available if the _service's_
|
|
13
|
+
* ([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))
|
|
14
|
+
* `payment.rateType` is `CUSTOM`.
|
|
16
15
|
* @replacedBy price_description_info.original
|
|
17
16
|
* @targetRemovalDate 2025-01-10
|
|
18
17
|
*/
|
|
19
18
|
priceDescription?: string;
|
|
20
19
|
/**
|
|
21
|
-
* Description of the total price. Available
|
|
22
|
-
*
|
|
20
|
+
* Description of the total price. Available if the _service's_
|
|
21
|
+
* ([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))
|
|
22
|
+
* `payment.rateType` is `CUSTOM`.
|
|
23
23
|
*/
|
|
24
24
|
priceDescriptionInfo?: PriceDescriptionInfo;
|
|
25
25
|
/**
|
|
@@ -28,56 +28,74 @@ export interface PriceInfo extends PriceInfoTotalPriceOneOf {
|
|
|
28
28
|
*/
|
|
29
29
|
bookingLineItems?: BookingLineItem[];
|
|
30
30
|
/**
|
|
31
|
-
* Total deposit the customer must pay when booking the service.
|
|
32
|
-
*
|
|
33
|
-
*
|
|
31
|
+
* Total deposit the customer must pay when booking the service. Available if
|
|
32
|
+
* the _service's_
|
|
33
|
+
* ([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))
|
|
34
|
+
* `payment.options.deposit` is set to `true`.
|
|
34
35
|
*/
|
|
35
36
|
deposit?: number | null;
|
|
36
37
|
}
|
|
37
38
|
/** @oneof */
|
|
38
39
|
export interface PriceInfoTotalPriceOneOf {
|
|
39
40
|
/**
|
|
40
|
-
* Calculated total price. Available
|
|
41
|
-
* [
|
|
42
|
-
*
|
|
43
|
-
* `schedule.rate.labeledPriceOptions`.
|
|
44
|
-
*
|
|
41
|
+
* Calculated total price. Available if the _service's_
|
|
42
|
+
* ([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))
|
|
43
|
+
* `payment.rateType` is `FIXED`, `VARIED`, or `NO_FEE`.
|
|
45
44
|
*/
|
|
46
45
|
calculatedPrice?: number;
|
|
47
46
|
/**
|
|
48
|
-
* Description of the total price.
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
47
|
+
* Description of the total price. Available if the _service's_
|
|
48
|
+
* ([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))
|
|
49
|
+
* `payment.rateType` is `CUSTOM`.
|
|
50
|
+
* @deprecated Description of the total price. Available if the _service's_
|
|
51
|
+
* ([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))
|
|
52
|
+
* `payment.rateType` is `CUSTOM`.
|
|
54
53
|
* @replacedBy price_description_info.original
|
|
55
54
|
* @targetRemovalDate 2025-01-10
|
|
56
55
|
*/
|
|
57
56
|
priceDescription?: string;
|
|
58
57
|
/**
|
|
59
|
-
* Description of the total price. Available
|
|
60
|
-
*
|
|
58
|
+
* Description of the total price. Available if the _service's_
|
|
59
|
+
* ([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))
|
|
60
|
+
* `payment.rateType` is `CUSTOM`.
|
|
61
61
|
*/
|
|
62
62
|
priceDescriptionInfo?: PriceDescriptionInfo;
|
|
63
63
|
}
|
|
64
64
|
export interface BookingLineItem {
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* _Service ID_
|
|
67
|
+
* ([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)).
|
|
68
|
+
*
|
|
69
|
+
* Required in *Calculate Price*
|
|
70
|
+
* ([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))
|
|
71
|
+
* if the site uses Wix Bookings' default pricing logic.
|
|
67
72
|
*
|
|
68
|
-
*
|
|
73
|
+
* Optional in *Calculate Price*
|
|
74
|
+
* ([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))
|
|
75
|
+
* if the site use pricing logic defined by a
|
|
76
|
+
* Wix Bookings Pricing Integration service plugin*
|
|
77
|
+
* ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction))
|
|
78
|
+
* integration.
|
|
69
79
|
* @format GUID
|
|
70
80
|
*/
|
|
71
81
|
serviceId?: string | null;
|
|
72
82
|
/**
|
|
73
|
-
*
|
|
83
|
+
* _Resource ID_
|
|
84
|
+
* ([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)).
|
|
85
|
+
* Required in *Calculate Price*
|
|
86
|
+
* ([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))
|
|
87
|
+
* and *Preview Price*
|
|
88
|
+
* ([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))
|
|
89
|
+
* for appointment-based services and classes.
|
|
74
90
|
* @format GUID
|
|
75
91
|
*/
|
|
76
92
|
resourceId?: string | null;
|
|
77
93
|
/**
|
|
78
94
|
* Custom choices. Choices are specific values for an option the customer can choose to book.
|
|
79
95
|
* For example, the option `ageGroup` may have these choices: `child`, `student`, `adult`, and `senior`.
|
|
80
|
-
* Each choice may have a different price.
|
|
96
|
+
* Each choice may have a different price. Refer to the *Service Options And Variants API*
|
|
97
|
+
* ([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))
|
|
98
|
+
* for more details.
|
|
81
99
|
*/
|
|
82
100
|
choices?: ServiceChoice[];
|
|
83
101
|
/**
|
|
@@ -93,7 +111,7 @@ export interface BookingLineItem {
|
|
|
93
111
|
}
|
|
94
112
|
export interface ServiceChoice extends ServiceChoiceChoiceOneOf {
|
|
95
113
|
/**
|
|
96
|
-
* Value for one of the choices in the `CustomServiceOption.choices` list.
|
|
114
|
+
* Value for one of the choices in the [`CustomServiceOption.choices`](https://example.com) list.
|
|
97
115
|
* Choices are specific values for an option the customer can choose to book. For example,
|
|
98
116
|
* the option `ageGroup` may have these choices: `child`, `student`, `adult`, and `senior`.
|
|
99
117
|
* Each choice may have a different price.
|
|
@@ -111,7 +129,7 @@ export interface ServiceChoice extends ServiceChoiceChoiceOneOf {
|
|
|
111
129
|
/** @oneof */
|
|
112
130
|
export interface ServiceChoiceChoiceOneOf {
|
|
113
131
|
/**
|
|
114
|
-
* Value for one of the choices in the `CustomServiceOption.choices` list.
|
|
132
|
+
* Value for one of the choices in the [`CustomServiceOption.choices`](https://example.com) list.
|
|
115
133
|
* Choices are specific values for an option the customer can choose to book. For example,
|
|
116
134
|
* the option `ageGroup` may have these choices: `child`, `student`, `adult`, and `senior`.
|
|
117
135
|
* Each choice may have a different price.
|
|
@@ -136,12 +154,15 @@ export interface Duration {
|
|
|
136
154
|
}
|
|
137
155
|
export interface PriceDescriptionInfo {
|
|
138
156
|
/**
|
|
139
|
-
* Price description in the site's
|
|
157
|
+
* Price description in the site's main language. Refer to the *Site Properties API*
|
|
158
|
+
* ([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))
|
|
159
|
+
* for more details.
|
|
140
160
|
* @maxLength 50
|
|
141
161
|
*/
|
|
142
162
|
original?: string;
|
|
143
163
|
/**
|
|
144
|
-
* Translated price description. Available if the
|
|
164
|
+
* Translated price description. Available if the booking was made in a
|
|
165
|
+
* secondary language.
|
|
145
166
|
* @maxLength 50
|
|
146
167
|
*/
|
|
147
168
|
translated?: string | null;
|
|
@@ -159,7 +180,11 @@ export interface PreviewPriceResponse {
|
|
|
159
180
|
priceInfo?: PriceInfo;
|
|
160
181
|
}
|
|
161
182
|
export interface CalculatePriceRequest {
|
|
162
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* _Booking_
|
|
185
|
+
* ([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))
|
|
186
|
+
* to calculate the base price for.
|
|
187
|
+
*/
|
|
163
188
|
booking: Booking;
|
|
164
189
|
}
|
|
165
190
|
/** An entity representing a scheduled appointment, class session, or course. */
|
|
@@ -200,24 +225,10 @@ export interface Booking extends BookingParticipantsInfoOneOf {
|
|
|
200
225
|
/** Additional custom fields submitted with the booking form. */
|
|
201
226
|
additionalFields?: CustomFormField[];
|
|
202
227
|
/**
|
|
203
|
-
* Booking status.
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
* - `"CONFIRMED"` - The booking was confirmed and appears on the bookings calendar. A booking can be manually confirmed using the [`confirmOrDecline()`](https://www.wix.com/velo/reference/wix-bookings-v2/bookings/confirmordeclinebooking) API. A booking can be automatically confirmed when the following requirements are met:
|
|
208
|
-
* + The service is configured as automatically confirmed.
|
|
209
|
-
* + The system invoked the eCommerce checkout API and created an order.
|
|
210
|
-
* - `"CANCELED"` - The booking has been canceled and synced to the bookings calendar.
|
|
211
|
-
* The booking can be canceled using [`cancelBooking()`](https://www.wix.com/velo/reference/wix-bookings-v2/bookings/cancelbooking) API.
|
|
212
|
-
* - `"PENDING"` - The booking is waiting to be confirmed or declined by the owner and the booking is synced to the bookings calendar.
|
|
213
|
-
* Bookings can be manually set as `PENDING` using the `setAsPending()` API, by those with Manage Booking Status permissions scopes.
|
|
214
|
-
* Bookings can be automatically set as `PENDING` when the following requirements are met:
|
|
215
|
-
* + The service is configured as manually confirmed.
|
|
216
|
-
* + Invoking the eCommerce checkout API and an order has been created.
|
|
217
|
-
* - `"WAITING_LIST"` - The booking is on a waiting list.
|
|
218
|
-
* - `"DECLINED"` - The booking was declined by the owner and synced to the Bookings calendar. Bookings can be manually declined using the [`declineBooking()`](https://www.wix.com/velo/reference/wix-bookings-v2/bookings/declinebooking) API by those with Manage Booking Status permission scopes. Bookings can be automatically declined when one of the following requirements are met:
|
|
219
|
-
* + Invoking the `eCommerce checkout` API and the order declined event has been sent.
|
|
220
|
-
* + Invoking the `eCommerce checkout` API and order approved event has been sent, but the booking is offline and the booking causes a double booking.
|
|
228
|
+
* Booking status. A booking is automatically confirmed if the service allows it
|
|
229
|
+
* and an eCommerce order is created. It is automatically declined if there is a
|
|
230
|
+
* double booking and the customer hasn't paid or is eligible for an automatic
|
|
231
|
+
* refund. Currently, only payments with pricing plans are automatically refundable.
|
|
221
232
|
*/
|
|
222
233
|
status?: BookingStatus;
|
|
223
234
|
/**
|
|
@@ -228,12 +239,13 @@ export interface Booking extends BookingParticipantsInfoOneOf {
|
|
|
228
239
|
*/
|
|
229
240
|
paymentStatus?: PaymentStatus;
|
|
230
241
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
242
|
+
* Payment option selected by the customer. If the customer hasn't completed their
|
|
243
|
+
* checkout, they may still change the payment method. Must be one of the payment
|
|
244
|
+
* options offered by the service ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)),
|
|
245
|
+
* unless `skipSelectedPaymentOptionValidation` is `true`.
|
|
246
|
+
* When undefined during an *eCommerce checkout*
|
|
247
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)),
|
|
248
|
+
* Wix Bookings uses the service's default payment option
|
|
237
249
|
*/
|
|
238
250
|
selectedPaymentOption?: SelectedPaymentOption;
|
|
239
251
|
/**
|
|
@@ -243,7 +255,12 @@ export interface Booking extends BookingParticipantsInfoOneOf {
|
|
|
243
255
|
_createdDate?: Date | null;
|
|
244
256
|
/** External user ID that you can provide. */
|
|
245
257
|
externalUserId?: string | null;
|
|
246
|
-
/**
|
|
258
|
+
/**
|
|
259
|
+
* Revision number to be used when updating, rescheduling, or cancelling the
|
|
260
|
+
* booking. Increments by 1 each time the booking is updated, rescheduled, or
|
|
261
|
+
* canceled. To prevent conflicting changes, the current revision must be
|
|
262
|
+
* specified when updating the booking.
|
|
263
|
+
*/
|
|
247
264
|
revision?: string | null;
|
|
248
265
|
/**
|
|
249
266
|
* ID of the creator of the booking.
|
|
@@ -500,7 +517,11 @@ export interface ContactDetails {
|
|
|
500
517
|
/** Contact's last name. */
|
|
501
518
|
lastName?: string | null;
|
|
502
519
|
/**
|
|
503
|
-
* Contact's email
|
|
520
|
+
* Contact's email. If no [contact](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/contact-v4/contact-object)
|
|
521
|
+
* with this email exist, a new contact is created.
|
|
522
|
+
* Used to validate coupon usage limitations per contact. If not specified,
|
|
523
|
+
* the coupon usage limitation will not be enforced. (Coupon usage limitation
|
|
524
|
+
* validation is not supported yet).
|
|
504
525
|
* @format EMAIL
|
|
505
526
|
*/
|
|
506
527
|
email?: string | null;
|
|
@@ -590,11 +611,6 @@ export interface CustomFormField {
|
|
|
590
611
|
* @readonly
|
|
591
612
|
*/
|
|
592
613
|
label?: string | null;
|
|
593
|
-
/**
|
|
594
|
-
* Form field value's type at the time of submission.
|
|
595
|
-
*
|
|
596
|
-
* Supported values: `"SHORT_TEXT"`, `"LONG_TEXT"`, `"CHECK_BOX"`
|
|
597
|
-
*/
|
|
598
614
|
valueType?: ValueType;
|
|
599
615
|
}
|
|
600
616
|
export declare enum ValueType {
|
|
@@ -801,12 +817,12 @@ export interface FlowControlSettings {
|
|
|
801
817
|
}
|
|
802
818
|
export interface ExtendedFields {
|
|
803
819
|
/**
|
|
804
|
-
*
|
|
820
|
+
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
821
|
+
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
805
822
|
*
|
|
806
|
-
*
|
|
823
|
+
* You can only access fields for which you have the appropriate permissions.
|
|
807
824
|
*
|
|
808
|
-
*
|
|
809
|
-
* + `value` is the data of the extended fields data, type `struct`.
|
|
825
|
+
* Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
|
|
810
826
|
*/
|
|
811
827
|
namespaces?: Record<string, Record<string, any>>;
|
|
812
828
|
}
|
|
@@ -814,7 +830,7 @@ export interface ParticipantChoices {
|
|
|
814
830
|
/**
|
|
815
831
|
* Information about the booked service choices. Includes the number of participants.
|
|
816
832
|
* @minSize 1
|
|
817
|
-
* @maxSize
|
|
833
|
+
* @maxSize 20
|
|
818
834
|
*/
|
|
819
835
|
serviceChoices?: ServiceChoices[];
|
|
820
836
|
}
|
|
@@ -842,7 +858,7 @@ export interface MultiServiceBookingInfo {
|
|
|
842
858
|
type?: MultiServiceBookingType;
|
|
843
859
|
}
|
|
844
860
|
export interface CalculatePriceResponse {
|
|
845
|
-
/** Information about each line item's price and the
|
|
861
|
+
/** Information about each line item's base price and the total base price. */
|
|
846
862
|
priceInfo?: PriceInfo;
|
|
847
863
|
}
|
|
848
864
|
interface PriceDescriptionInfoNonNullableFields {
|
|
@@ -872,33 +888,30 @@ export interface CalculatePriceResponseNonNullableFields {
|
|
|
872
888
|
priceInfo?: PriceInfoNonNullableFields;
|
|
873
889
|
}
|
|
874
890
|
/**
|
|
875
|
-
* Previews the base price for a set of line items belonging to the same
|
|
876
|
-
* before a
|
|
891
|
+
* Previews the base price for a set of line items belonging to the same
|
|
892
|
+
* service, before a booking is created. During the booking flow, additional
|
|
893
|
+
* taxes and fees may be added to the base price.
|
|
877
894
|
*
|
|
878
895
|
*
|
|
896
|
+
* ## Response
|
|
879
897
|
*
|
|
880
|
-
* The
|
|
881
|
-
* item
|
|
898
|
+
* The response includes each line item's individual preview price and the
|
|
899
|
+
* total of all line item preview prices. Note that the final price upon
|
|
900
|
+
* booking creation may differ from the preview price.
|
|
882
901
|
*
|
|
883
|
-
*
|
|
884
|
-
* `Preview Price` only estimates the base price by adding up the price
|
|
885
|
-
* of each line item before
|
|
886
|
-
* the booking is actually created.
|
|
902
|
+
* ## Errors
|
|
887
903
|
*
|
|
888
|
-
*
|
|
889
|
-
* after the booking is created.
|
|
904
|
+
* _Preview Price_ fails if:
|
|
890
905
|
*
|
|
891
|
-
*
|
|
906
|
+
* - You specify line items that belong to different *services*
|
|
907
|
+
* ([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)).
|
|
908
|
+
* - The site is using the *Bookings Pricing Integration SPI*
|
|
909
|
+
* ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).
|
|
892
910
|
*
|
|
893
|
-
* ##
|
|
911
|
+
* ## When to call Calculate Price instead
|
|
894
912
|
*
|
|
895
|
-
*
|
|
896
|
-
*
|
|
897
|
-
* or `schedule` object to `previewPrice()`.
|
|
898
|
-
*
|
|
899
|
-
* You cannot call `previewPrice()` if you have customized Bookings pricing logic using the
|
|
900
|
-
* [BookingsCustomPricing](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/service-plugins-spis/bookings-custom-pricing/introduction) service plugin. Calling `previewPrice` if custom pricing
|
|
901
|
-
* logic has been implemented for the site results in an error.
|
|
913
|
+
* To retrieve the price of an existing booking, call *Calculate Price*
|
|
914
|
+
* ([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)).
|
|
902
915
|
* @param bookingLineItems - List of line items to preview the price for.
|
|
903
916
|
* @public
|
|
904
917
|
* @documentationMaturity preview
|
|
@@ -923,30 +936,34 @@ export declare function previewPrice(bookingLineItems: BookingLineItem[]): Promi
|
|
|
923
936
|
* Calculates the base price of a booking.
|
|
924
937
|
*
|
|
925
938
|
*
|
|
939
|
+
* The returned price serves as the foundation for charging the customer. During the
|
|
940
|
+
* _eCommerce checkout_
|
|
941
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),
|
|
942
|
+
* additional taxes and fees may be added to this base price.
|
|
926
943
|
*
|
|
927
|
-
*
|
|
928
|
-
* item's price and the booking's total price.
|
|
929
|
-
*
|
|
930
|
-
* You can use `previewPrice()` to get the base price
|
|
931
|
-
* before a booking is created.
|
|
944
|
+
* ## Price calculation method
|
|
932
945
|
*
|
|
933
|
-
*
|
|
934
|
-
*
|
|
935
|
-
* and
|
|
946
|
+
* By default, Wix Bookings calculates a booking's price based on the relevant
|
|
947
|
+
* `serviceOptionsAndVariants.variants.values.price`
|
|
948
|
+
* ([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)).
|
|
949
|
+
* You must then specify either `booking.bookedEntity.slot.serviceId` or
|
|
950
|
+
* `booking.bookedEntity.schedule.scheduleId`.
|
|
936
951
|
*
|
|
937
|
-
*
|
|
952
|
+
* If the business uses the *Wix Bookings Pricing Integration service plugin*
|
|
953
|
+
* ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)),
|
|
954
|
+
* the returned `priceInfo` object reflects values received from the SPI implementor in
|
|
955
|
+
* _Calculate Price_
|
|
956
|
+
* ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).
|
|
957
|
+
* In this case, it suffices to specify `booking.bookedEntity`.
|
|
938
958
|
*
|
|
939
|
-
*
|
|
940
|
-
* using Wix Bookings' default pricing logic, you must pass the `serviceId` in the `slot`
|
|
941
|
-
* or `schedule` object to `calculatePrice()`.
|
|
959
|
+
* ## When to call Preview Price instead
|
|
942
960
|
*
|
|
943
|
-
*
|
|
944
|
-
*
|
|
945
|
-
*
|
|
946
|
-
*
|
|
947
|
-
*
|
|
948
|
-
*
|
|
949
|
-
* @param booking - Booking to calculate the price for.
|
|
961
|
+
* To estimate the price for multiple booking line items before the booking exists,
|
|
962
|
+
* call *Preview Price*
|
|
963
|
+
* ([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)).
|
|
964
|
+
* @param booking - _Booking_
|
|
965
|
+
* ([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))
|
|
966
|
+
* to calculate the base price for.
|
|
950
967
|
* @public
|
|
951
968
|
* @documentationMaturity preview
|
|
952
969
|
* @requiredField booking
|
|
@@ -157,33 +157,30 @@ var IdentityType;
|
|
|
157
157
|
IdentityType["APP"] = "APP";
|
|
158
158
|
})(IdentityType || (exports.IdentityType = IdentityType = {}));
|
|
159
159
|
/**
|
|
160
|
-
* Previews the base price for a set of line items belonging to the same
|
|
161
|
-
* before a
|
|
160
|
+
* Previews the base price for a set of line items belonging to the same
|
|
161
|
+
* service, before a booking is created. During the booking flow, additional
|
|
162
|
+
* taxes and fees may be added to the base price.
|
|
162
163
|
*
|
|
163
164
|
*
|
|
165
|
+
* ## Response
|
|
164
166
|
*
|
|
165
|
-
* The
|
|
166
|
-
* item
|
|
167
|
+
* The response includes each line item's individual preview price and the
|
|
168
|
+
* total of all line item preview prices. Note that the final price upon
|
|
169
|
+
* booking creation may differ from the preview price.
|
|
167
170
|
*
|
|
168
|
-
*
|
|
169
|
-
* `Preview Price` only estimates the base price by adding up the price
|
|
170
|
-
* of each line item before
|
|
171
|
-
* the booking is actually created.
|
|
171
|
+
* ## Errors
|
|
172
172
|
*
|
|
173
|
-
*
|
|
174
|
-
* after the booking is created.
|
|
173
|
+
* _Preview Price_ fails if:
|
|
175
174
|
*
|
|
176
|
-
*
|
|
175
|
+
* - You specify line items that belong to different *services*
|
|
176
|
+
* ([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)).
|
|
177
|
+
* - The site is using the *Bookings Pricing Integration SPI*
|
|
178
|
+
* ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).
|
|
177
179
|
*
|
|
178
|
-
* ##
|
|
180
|
+
* ## When to call Calculate Price instead
|
|
179
181
|
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* or `schedule` object to `previewPrice()`.
|
|
183
|
-
*
|
|
184
|
-
* You cannot call `previewPrice()` if you have customized Bookings pricing logic using the
|
|
185
|
-
* [BookingsCustomPricing](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/service-plugins-spis/bookings-custom-pricing/introduction) service plugin. Calling `previewPrice` if custom pricing
|
|
186
|
-
* logic has been implemented for the site results in an error.
|
|
182
|
+
* To retrieve the price of an existing booking, call *Calculate Price*
|
|
183
|
+
* ([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)).
|
|
187
184
|
* @param bookingLineItems - List of line items to preview the price for.
|
|
188
185
|
* @public
|
|
189
186
|
* @documentationMaturity preview
|
|
@@ -231,30 +228,34 @@ exports.previewPrice = previewPrice;
|
|
|
231
228
|
* Calculates the base price of a booking.
|
|
232
229
|
*
|
|
233
230
|
*
|
|
231
|
+
* The returned price serves as the foundation for charging the customer. During the
|
|
232
|
+
* _eCommerce checkout_
|
|
233
|
+
* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),
|
|
234
|
+
* additional taxes and fees may be added to this base price.
|
|
234
235
|
*
|
|
235
|
-
*
|
|
236
|
-
* item's price and the booking's total price.
|
|
237
|
-
*
|
|
238
|
-
* You can use `previewPrice()` to get the base price
|
|
239
|
-
* before a booking is created.
|
|
236
|
+
* ## Price calculation method
|
|
240
237
|
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
* and
|
|
238
|
+
* By default, Wix Bookings calculates a booking's price based on the relevant
|
|
239
|
+
* `serviceOptionsAndVariants.variants.values.price`
|
|
240
|
+
* ([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)).
|
|
241
|
+
* You must then specify either `booking.bookedEntity.slot.serviceId` or
|
|
242
|
+
* `booking.bookedEntity.schedule.scheduleId`.
|
|
244
243
|
*
|
|
245
|
-
*
|
|
244
|
+
* If the business uses the *Wix Bookings Pricing Integration service plugin*
|
|
245
|
+
* ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)),
|
|
246
|
+
* the returned `priceInfo` object reflects values received from the SPI implementor in
|
|
247
|
+
* _Calculate Price_
|
|
248
|
+
* ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).
|
|
249
|
+
* In this case, it suffices to specify `booking.bookedEntity`.
|
|
246
250
|
*
|
|
247
|
-
*
|
|
248
|
-
* using Wix Bookings' default pricing logic, you must pass the `serviceId` in the `slot`
|
|
249
|
-
* or `schedule` object to `calculatePrice()`.
|
|
251
|
+
* ## When to call Preview Price instead
|
|
250
252
|
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
* @param booking - Booking to calculate the price for.
|
|
253
|
+
* To estimate the price for multiple booking line items before the booking exists,
|
|
254
|
+
* call *Preview Price*
|
|
255
|
+
* ([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)).
|
|
256
|
+
* @param booking - _Booking_
|
|
257
|
+
* ([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))
|
|
258
|
+
* to calculate the base price for.
|
|
258
259
|
* @public
|
|
259
260
|
* @documentationMaturity preview
|
|
260
261
|
* @requiredField booking
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookings-v2-price-info-pricing.universal.js","sourceRoot":"","sources":["../../../src/bookings-v2-price-info-pricing.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAuF;AACvF,oFAGiD;AAEjD,2GAA6F;
|
|
1
|
+
{"version":3,"file":"bookings-v2-price-info-pricing.universal.js","sourceRoot":"","sources":["../../../src/bookings-v2-price-info-pricing.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAuF;AACvF,oFAGiD;AAEjD,2GAA6F;AAyU7F;;;;;GAKG;AACH,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,sEAA2C,CAAA;IAC3C,kEAAuC,CAAA;IACvC,kEAAuC,CAAA;AACzC,CAAC,EAJW,uBAAuB,uCAAvB,uBAAuB,QAIlC;AAgJD,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AA4JD,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,kDAAkD;IAClD,sCAAyB,CAAA;IACzB,iBAAiB;IACjB,oCAAuB,CAAA;IACvB,sGAAsG;IACtG,oCAAuB,CAAA;AACzB,CAAC,EAPW,SAAS,yBAAT,SAAS,QAOpB;AAED,sBAAsB;AACtB,IAAY,aAoCX;AApCD,WAAY,aAAa;IACvB;;;OAGG;IACH,oCAAmB,CAAA;IACnB;;;;;OAKG;IACH,wCAAuB,CAAA;IACvB;;;;;;OAMG;IACH,sCAAqB,CAAA;IACrB;;;OAGG;IACH,oCAAmB,CAAA;IACnB,6EAA6E;IAC7E,sCAAqB,CAAA;IACrB;;;;;;OAMG;IACH,8CAA6B,CAAA;AAC/B,CAAC,EApCW,aAAa,6BAAb,aAAa,QAoCxB;AAED;;;GAGG;AACH,IAAY,aAaX;AAbD,WAAY,aAAa;IACvB,gCAAgC;IAChC,wCAAuB,CAAA;IACvB,8BAA8B;IAC9B,sCAAqB,CAAA;IACrB,iCAAiC;IACjC,8BAAa,CAAA;IACb,qCAAqC;IACrC,kDAAiC,CAAA;IACjC,+BAA+B;IAC/B,sCAAqB,CAAA;IACrB,qC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