@wix/auto_sdk_bookings_pricing 1.0.40 → 1.0.42

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.
@@ -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. Available if the _service's_
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
- * `payment.rateType` is `CUSTOM`.
14
- * @deprecated Description of the total price. Available if the _service's_
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. Available if the _service's_
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. Available if
34
- * the _service's_
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. Available if the _service's_
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
- * `payment.rateType` is `CUSTOM`.
52
- * @deprecated Description of the total price. Available if the _service's_
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. Available if the _service's_
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
- * _Service ID_
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
- * Optional in *Calculate Price*
76
- * ([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))
77
- * if the site use pricing logic defined by a
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
- * _Resource ID_
86
- * ([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)).
87
- * Required in *Calculate Price*
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 *Preview Price*
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
- * Custom choices. Choices are specific values for an option the customer can choose to book.
97
- * For example, the option `ageGroup` may have these choices: `child`, `student`, `adult`, and `senior`.
98
- * Each choice may have a different price. Refer to the *Service Options And Variants API*
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 for these participants.
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 the line item.
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. Refer to the *Site Properties API*
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. Available if the booking was made in a
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
- * List of line items to preview the price for.
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
- /** Information about each line item's price and the estimated total price based on the line items. */
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
- * _Booking_
204
- * ([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))
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
  }
@@ -994,33 +967,21 @@ type CalculatePriceApplicationErrors = {
994
967
  data?: Record<string, any>;
995
968
  };
996
969
  /**
997
- * Previews the base price for a set of line items belonging to the same
998
- * service, before a booking is created. During the booking flow, additional
999
- * taxes and fees may be added to the base price.
1000
- *
1001
- *
1002
- * ## Response
1003
- *
1004
- * The response includes each line item's individual preview price and the
1005
- * total of all line item preview prices. Note that the final price upon
1006
- * booking creation may differ from the preview price.
1007
- *
1008
- * ## Errors
970
+ * Previews the base price for a set of line items belonging to the same service, before a booking is created.
1009
971
  *
1010
- * _Preview Price_ fails if:
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.
1011
975
  *
1012
- * - You specify line items that belong to different *services*
1013
- * ([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)).
1014
- * - The site is using the *Bookings Pricing Integration SPI*
1015
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).
976
+ * Preview Price fails if:
1016
977
  *
1017
- * ## When to call Calculate Price instead
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.
1018
980
  *
1019
- * To retrieve the price of an existing booking, call *Calculate Price*
1020
- * ([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)).
1021
- * @param bookingLineItems - List of line items to preview the price for.
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)).
1022
984
  * @public
1023
- * @documentationMaturity preview
1024
985
  * @requiredField bookingLineItems
1025
986
  * @permissionId BOOKINGS.PRICE_PREVIEW
1026
987
  * @applicableIdentity APP
@@ -1030,39 +991,25 @@ declare function previewPrice(bookingLineItems: BookingLineItem[]): Promise<NonN
1030
991
  __applicationErrorsType?: PreviewPriceApplicationErrors;
1031
992
  }>;
1032
993
  /**
1033
- * Calculates the base price of a booking.
994
+ * Calculates the current base price for an existing booking.
1034
995
  *
1035
996
  *
1036
- * The returned price serves as the foundation for charging the customer. During the
1037
- * _eCommerce checkout_
1038
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),
1039
- * 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.
1040
998
  *
1041
- * ## Price calculation method
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/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.
1042
1000
  *
1043
- * By default, Wix Bookings calculates a booking's price based on the relevant
1044
- * `serviceOptionsAndVariants.variants.values.price`
1045
- * ([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)).
1046
- * You must then specify either `booking.bookedEntity.slot.serviceId` or
1047
- * `booking.bookedEntity.schedule.scheduleId`.
1001
+ * ## Price calculation methods
1048
1002
  *
1049
- * If the business uses the *Wix Bookings Pricing Integration service plugin*
1050
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)),
1051
- * the returned `priceInfo` object reflects values received from the SPI implementor in
1052
- * _Calculate Price_
1053
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).
1054
- * In this case, it suffices to specify `booking.bookedEntity`.
1003
+ * __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://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).
1004
+ * Specify `booking.bookedEntity.slot.serviceId` for appointment-based services and classes, or `booking.bookedEntity.schedule.serviceId` for courses.
1055
1005
  *
1056
- * ## When to call Preview Price instead
1006
+ * __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.
1007
+ * 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.
1057
1008
  *
1058
- * To estimate the price for multiple booking line items before the booking exists,
1059
- * call *Preview Price*
1060
- * ([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)).
1061
- * @param booking - _Booking_
1062
- * ([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))
1063
- * to calculate the base price for.
1009
+ * 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.
1010
+ * @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.
1011
+ * Must include `bookedEntity` details and participant information.
1064
1012
  * @public
1065
- * @documentationMaturity preview
1066
1013
  * @requiredField booking
1067
1014
  * @permissionId BOOKINGS.PRICE_CALCULATE
1068
1015
  * @applicableIdentity APP