@wix/auto_sdk_bookings_bookings 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.
Files changed (73) hide show
  1. package/build/cjs/src/bookings-v2-booking-bookings.context.d.ts +17 -17
  2. package/build/cjs/src/bookings-v2-booking-bookings.context.js +17 -17
  3. package/build/cjs/src/bookings-v2-booking-bookings.context.js.map +1 -1
  4. package/build/cjs/src/bookings-v2-booking-bookings.http.d.ts +137 -134
  5. package/build/cjs/src/bookings-v2-booking-bookings.http.js +861 -858
  6. package/build/cjs/src/bookings-v2-booking-bookings.http.js.map +1 -1
  7. package/build/cjs/src/bookings-v2-booking-bookings.meta.d.ts +24 -24
  8. package/build/cjs/src/bookings-v2-booking-bookings.meta.js +125 -125
  9. package/build/cjs/src/bookings-v2-booking-bookings.meta.js.map +1 -1
  10. package/build/cjs/src/bookings-v2-booking-bookings.public.d.ts +192 -189
  11. package/build/cjs/src/bookings-v2-booking-bookings.public.js +84 -84
  12. package/build/cjs/src/bookings-v2-booking-bookings.public.js.map +1 -1
  13. package/build/cjs/src/bookings-v2-booking-bookings.types.d.ts +1310 -991
  14. package/build/cjs/src/bookings-v2-booking-bookings.types.js +3 -3
  15. package/build/cjs/src/bookings-v2-booking-bookings.types.js.map +1 -1
  16. package/build/cjs/src/bookings-v2-booking-bookings.universal.d.ts +2219 -1839
  17. package/build/cjs/src/bookings-v2-booking-bookings.universal.js +901 -898
  18. package/build/cjs/src/bookings-v2-booking-bookings.universal.js.map +1 -1
  19. package/build/es/src/bookings-v2-booking-bookings.context.d.ts +17 -17
  20. package/build/es/src/bookings-v2-booking-bookings.context.js +16 -16
  21. package/build/es/src/bookings-v2-booking-bookings.context.js.map +1 -1
  22. package/build/es/src/bookings-v2-booking-bookings.http.d.ts +137 -134
  23. package/build/es/src/bookings-v2-booking-bookings.http.js +837 -834
  24. package/build/es/src/bookings-v2-booking-bookings.http.js.map +1 -1
  25. package/build/es/src/bookings-v2-booking-bookings.meta.d.ts +24 -24
  26. package/build/es/src/bookings-v2-booking-bookings.meta.js +103 -103
  27. package/build/es/src/bookings-v2-booking-bookings.meta.js.map +1 -1
  28. package/build/es/src/bookings-v2-booking-bookings.public.d.ts +192 -189
  29. package/build/es/src/bookings-v2-booking-bookings.public.js +65 -65
  30. package/build/es/src/bookings-v2-booking-bookings.public.js.map +1 -1
  31. package/build/es/src/bookings-v2-booking-bookings.types.d.ts +1310 -991
  32. package/build/es/src/bookings-v2-booking-bookings.types.js +3 -3
  33. package/build/es/src/bookings-v2-booking-bookings.types.js.map +1 -1
  34. package/build/es/src/bookings-v2-booking-bookings.universal.d.ts +2219 -1839
  35. package/build/es/src/bookings-v2-booking-bookings.universal.js +855 -852
  36. package/build/es/src/bookings-v2-booking-bookings.universal.js.map +1 -1
  37. package/build/internal/cjs/src/bookings-v2-booking-bookings.context.d.ts +17 -17
  38. package/build/internal/cjs/src/bookings-v2-booking-bookings.context.js +17 -17
  39. package/build/internal/cjs/src/bookings-v2-booking-bookings.context.js.map +1 -1
  40. package/build/internal/cjs/src/bookings-v2-booking-bookings.http.d.ts +137 -134
  41. package/build/internal/cjs/src/bookings-v2-booking-bookings.http.js +861 -858
  42. package/build/internal/cjs/src/bookings-v2-booking-bookings.http.js.map +1 -1
  43. package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.d.ts +24 -24
  44. package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.js +125 -125
  45. package/build/internal/cjs/src/bookings-v2-booking-bookings.meta.js.map +1 -1
  46. package/build/internal/cjs/src/bookings-v2-booking-bookings.public.d.ts +192 -189
  47. package/build/internal/cjs/src/bookings-v2-booking-bookings.public.js +84 -84
  48. package/build/internal/cjs/src/bookings-v2-booking-bookings.public.js.map +1 -1
  49. package/build/internal/cjs/src/bookings-v2-booking-bookings.types.d.ts +1310 -991
  50. package/build/internal/cjs/src/bookings-v2-booking-bookings.types.js +3 -3
  51. package/build/internal/cjs/src/bookings-v2-booking-bookings.types.js.map +1 -1
  52. package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.d.ts +2219 -1839
  53. package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.js +901 -898
  54. package/build/internal/cjs/src/bookings-v2-booking-bookings.universal.js.map +1 -1
  55. package/build/internal/es/src/bookings-v2-booking-bookings.context.d.ts +17 -17
  56. package/build/internal/es/src/bookings-v2-booking-bookings.context.js +16 -16
  57. package/build/internal/es/src/bookings-v2-booking-bookings.context.js.map +1 -1
  58. package/build/internal/es/src/bookings-v2-booking-bookings.http.d.ts +137 -134
  59. package/build/internal/es/src/bookings-v2-booking-bookings.http.js +837 -834
  60. package/build/internal/es/src/bookings-v2-booking-bookings.http.js.map +1 -1
  61. package/build/internal/es/src/bookings-v2-booking-bookings.meta.d.ts +24 -24
  62. package/build/internal/es/src/bookings-v2-booking-bookings.meta.js +103 -103
  63. package/build/internal/es/src/bookings-v2-booking-bookings.meta.js.map +1 -1
  64. package/build/internal/es/src/bookings-v2-booking-bookings.public.d.ts +192 -189
  65. package/build/internal/es/src/bookings-v2-booking-bookings.public.js +65 -65
  66. package/build/internal/es/src/bookings-v2-booking-bookings.public.js.map +1 -1
  67. package/build/internal/es/src/bookings-v2-booking-bookings.types.d.ts +1310 -991
  68. package/build/internal/es/src/bookings-v2-booking-bookings.types.js +3 -3
  69. package/build/internal/es/src/bookings-v2-booking-bookings.types.js.map +1 -1
  70. package/build/internal/es/src/bookings-v2-booking-bookings.universal.d.ts +2219 -1839
  71. package/build/internal/es/src/bookings-v2-booking-bookings.universal.js +855 -852
  72. package/build/internal/es/src/bookings-v2-booking-bookings.universal.js.map +1 -1
  73. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bulkConfirmOrDeclineBooking = exports.confirmOrDeclineBooking = exports.bookingsUpdateNumberOfParticipants = exports.bookingsCancelBooking = exports.bookingsDeclineBooking = exports.updateExtendedFields = exports.bookingsConfirmBooking = exports.rescheduleBooking = exports.bulkCreateBooking = exports.createBooking = exports.removeBookingsFromMultiServiceBooking = exports.addBookingsToMultiServiceBooking = exports.getMultiServiceBooking = exports.bulkGetMultiServiceBookingAllowedActions = exports.declineMultiServiceBooking = exports.confirmMultiServiceBooking = exports.markMultiServiceBookingAsPending = exports.cancelMultiServiceBooking = exports.getMultiServiceBookingAvailability = exports.rescheduleMultiServiceBooking = exports.createMultiServiceBooking = void 0;
3
+ exports.removeBookingsFromMultiServiceBooking = exports.addBookingsToMultiServiceBooking = exports.getMultiServiceBooking = exports.bulkGetMultiServiceBookingAllowedActions = exports.declineMultiServiceBooking = exports.confirmMultiServiceBooking = exports.markMultiServiceBookingAsPending = exports.cancelMultiServiceBooking = exports.getMultiServiceBookingAvailability = exports.rescheduleMultiServiceBooking = exports.createMultiServiceBooking = exports.bookingsUpdateNumberOfParticipants = exports.bookingsCancelBooking = exports.bookingsDeclineBooking = exports.updateExtendedFields = exports.bookingsConfirmBooking = exports.rescheduleBooking = exports.bulkCreateBooking = exports.createBooking = exports.bulkConfirmOrDeclineBooking = exports.confirmOrDeclineBooking = void 0;
4
4
  const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
5
5
  const float_1 = require("@wix/sdk-runtime/transformations/float");
6
6
  const float_2 = require("@wix/sdk-runtime/transformations/float");
@@ -8,38 +8,7 @@ const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
8
8
  const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
9
9
  const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
10
10
  const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
11
- function resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl(opts) {
12
- const domainToMappings = {
13
- 'www.wixapis.com': [
14
- {
15
- srcPath: '/_api/bookings-confirmator/v2/bookings/confirmation',
16
- destPath: '/v2/bookings/confirmation',
17
- },
18
- {
19
- srcPath: '/bookings/v2/confirmation',
20
- destPath: '/v2/confirmation',
21
- },
22
- {
23
- srcPath: '/bookings/v2/bulk/confirmation',
24
- destPath: '/v2/bulk/confirmation',
25
- },
26
- {
27
- srcPath: '/bookings/v2/bulk/bookings/confirmOrDecline',
28
- destPath: '/v2/bulk/bookings/confirmOrDecline',
29
- },
30
- {
31
- srcPath: '/_api/bookings-confirmator/v2/bulk/confirmation',
32
- destPath: '/v2/bulk/confirmation',
33
- },
34
- {
35
- srcPath: '/_api/bookings-confirmator/v2/bulk/bookings/confirmOrDecline',
36
- destPath: '/v2/bulk/bookings/confirmOrDecline',
37
- },
38
- ],
39
- };
40
- return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
41
- }
42
- function resolveComWixpressBookingsBookingsV2BookingsUrl(opts) {
11
+ function resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl(opts) {
43
12
  const domainToMappings = {
44
13
  _: [
45
14
  {
@@ -140,7 +109,7 @@ function resolveComWixpressBookingsBookingsV2BookingsUrl(opts) {
140
109
  };
141
110
  return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
142
111
  }
143
- function resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl(opts) {
112
+ function resolveComWixpressBookingsBookingsV2BookingsUrl(opts) {
144
113
  const domainToMappings = {
145
114
  _: [
146
115
  {
@@ -241,93 +210,89 @@ function resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl(opts) {
241
210
  };
242
211
  return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
243
212
  }
244
- const PACKAGE_NAME = '@wix/auto_sdk_bookings_bookings';
245
- /**
246
- * Creates a multi-service booking.
247
- *
248
- *
249
- * See Create Booking for more information.
250
- */
251
- function createMultiServiceBooking(payload) {
252
- function __createMultiServiceBooking({ host }) {
253
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
213
+ function resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl(opts) {
214
+ const domainToMappings = {
215
+ 'www.wixapis.com': [
254
216
  {
255
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
256
- paths: [
257
- { path: 'bookings.createdDate' },
258
- { path: 'bookings.startDate' },
259
- { path: 'bookings.endDate' },
260
- { path: 'bookings.updatedDate' },
261
- { path: 'bookings.canceledDate' },
262
- ],
217
+ srcPath: '/_api/bookings-confirmator/v2/bookings/confirmation',
218
+ destPath: '/v2/bookings/confirmation',
263
219
  },
264
220
  {
265
- transformFn: float_1.transformSDKFloatToRESTFloat,
266
- paths: [
267
- { path: 'bookings.contactDetails.fullAddress.geocode.latitude' },
268
- { path: 'bookings.contactDetails.fullAddress.geocode.longitude' },
269
- ],
221
+ srcPath: '/bookings/v2/confirmation',
222
+ destPath: '/v2/confirmation',
270
223
  },
271
- ]);
272
- const metadata = {
273
- entityFqdn: 'wix.bookings.v2.booking',
274
- method: 'POST',
275
- methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.CreateMultiServiceBooking',
276
- packageName: PACKAGE_NAME,
277
- url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
278
- protoPath: '/v2/multi_service_bookings',
279
- data: serializedData,
280
- host,
281
- }),
282
- data: serializedData,
283
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
284
- {
285
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
286
- paths: [
287
- { path: 'multiServiceBooking.bookings.booking.createdDate' },
288
- { path: 'multiServiceBooking.bookings.booking.startDate' },
289
- { path: 'multiServiceBooking.bookings.booking.endDate' },
290
- { path: 'multiServiceBooking.bookings.booking.updatedDate' },
291
- { path: 'multiServiceBooking.bookings.booking.canceledDate' },
292
- ],
293
- },
294
- {
295
- transformFn: float_2.transformRESTFloatToSDKFloat,
296
- paths: [
297
- {
298
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
299
- },
300
- {
301
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
302
- },
303
- ],
304
- },
305
- ]),
306
- };
307
- return metadata;
308
- }
309
- return __createMultiServiceBooking;
224
+ {
225
+ srcPath: '/bookings/v2/bulk/confirmation',
226
+ destPath: '/v2/bulk/confirmation',
227
+ },
228
+ {
229
+ srcPath: '/bookings/v2/bulk/bookings/confirmOrDecline',
230
+ destPath: '/v2/bulk/bookings/confirmOrDecline',
231
+ },
232
+ {
233
+ srcPath: '/_api/bookings-confirmator/v2/bulk/confirmation',
234
+ destPath: '/v2/bulk/confirmation',
235
+ },
236
+ {
237
+ srcPath: '/_api/bookings-confirmator/v2/bulk/bookings/confirmOrDecline',
238
+ destPath: '/v2/bulk/bookings/confirmOrDecline',
239
+ },
240
+ ],
241
+ };
242
+ return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
310
243
  }
311
- exports.createMultiServiceBooking = createMultiServiceBooking;
244
+ const PACKAGE_NAME = '@wix/auto_sdk_bookings_bookings';
312
245
  /**
313
- * Reschedules a multi-service booking.
246
+ * Updates the booking `status` to `CONFIRMED`, `PENDING`, or `DECLINED` based
247
+ * on the `paymentStatus` you provide, double booking conflicts, and whether
248
+ * the service requires business approval.
314
249
  *
250
+ * ## eCommerce checkout restriction
315
251
  *
316
- * The call fails if at least 1 individual booking can't be rescheduled due
317
- * the service being unavailable or a rescheduling policy violation.
252
+ * Call this method only when using a custom checkout page. Don't
253
+ * call it when using a *Wix eCommerce checkout*
254
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
255
+ * In such cases, Wix automatically updates the booking status based on
256
+ * the `paymentStatus` of the corresponding *Wix eCommerce order*
257
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
318
258
  *
259
+ * ## New booking status
319
260
  *
320
- * See Reschedule Booking for more information.
261
+ * The booking `status` is set to `DECLINED` if both of the following conditions
262
+ * are met:
263
+ * + You provide `UNDEFINED`, `NOT_PAID`, `REFUNDED`, or `EXEMPT` as payment status.
264
+ * + There is a double booking conflict.
265
+ *
266
+ * If only one or none of these conditions is met, `status` is set to `PENDING`
267
+ * or `CONFIRMED` depending on whether the service requires business approval.
268
+ *
269
+ * ## Double bookings
270
+ *
271
+ * If there is a double booking conflict, but the booking has already been at least
272
+ * partially paid, the method still marks the booking as `PENDING` or `CONFIRMED`.
273
+ * Then, it also sets `doubleBooked` to `true`.
274
+ *
275
+ * ## Admin overwrites
276
+ *
277
+ * There are small but important differences in confirmation behavior if the
278
+ * booking was created with special `flowControlSettings`:
279
+ * + If the booking's `flowControlSettings.skipAvailabilityValidation` was set to
280
+ * `true`, the booking is never declined regardless of double booking conflicts.
281
+ * Instead, it's marked `CONFIRMED` or `PENDING`, depending on whether the
282
+ * service requires business approval.
283
+ * + If the booking's `flowControlSettings.skipBusinessConfirmation` was set to
284
+ * `true`, the booking skips `PENDING` status and is marked `CONFIRMED`
285
+ * immediately.
321
286
  */
322
- function rescheduleMultiServiceBooking(payload) {
323
- function __rescheduleMultiServiceBooking({ host }) {
287
+ function confirmOrDeclineBooking(payload) {
288
+ function __confirmOrDeclineBooking({ host }) {
324
289
  const metadata = {
325
290
  entityFqdn: 'wix.bookings.v2.booking',
326
291
  method: 'POST',
327
- methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.RescheduleMultiServiceBooking',
292
+ methodFqn: 'com.wixpress.bookings.confirmator.v2.Confirmator.ConfirmOrDeclineBooking',
328
293
  packageName: PACKAGE_NAME,
329
- url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
330
- protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/reschedule',
294
+ url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
295
+ protoPath: '/v2/confirmation/{bookingId}:confirmOrDecline',
331
296
  data: payload,
332
297
  host,
333
298
  }),
@@ -336,67 +301,44 @@ function rescheduleMultiServiceBooking(payload) {
336
301
  {
337
302
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
338
303
  paths: [
339
- { path: 'multiServiceBooking.bookings.booking.createdDate' },
340
- { path: 'multiServiceBooking.bookings.booking.startDate' },
341
- { path: 'multiServiceBooking.bookings.booking.endDate' },
342
- { path: 'multiServiceBooking.bookings.booking.updatedDate' },
343
- { path: 'multiServiceBooking.bookings.booking.canceledDate' },
304
+ { path: 'booking.createdDate' },
305
+ { path: 'booking.startDate' },
306
+ { path: 'booking.endDate' },
307
+ { path: 'booking.updatedDate' },
308
+ { path: 'booking.canceledDate' },
344
309
  ],
345
310
  },
346
311
  {
347
312
  transformFn: float_2.transformRESTFloatToSDKFloat,
348
313
  paths: [
349
- {
350
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
351
- },
352
- {
353
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
354
- },
314
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
315
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
355
316
  ],
356
317
  },
357
318
  ]),
358
319
  };
359
320
  return metadata;
360
321
  }
361
- return __rescheduleMultiServiceBooking;
322
+ return __confirmOrDeclineBooking;
362
323
  }
363
- exports.rescheduleMultiServiceBooking = rescheduleMultiServiceBooking;
324
+ exports.confirmOrDeclineBooking = confirmOrDeclineBooking;
364
325
  /**
365
- * Retrieves a multi-service booking's availability.
326
+ * Confirms or declines up to 300 bookings.
366
327
  *
367
328
  *
368
- * Use List Multi Service Availability Time Slots to check availability for a
369
- * `SEQUENTIAL_BOOKINGS` multi-service booking.
329
+ * See *Confirm Or Decline Booking*
330
+ * ([SDK](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking))
331
+ * for details about when a booking is confirmed or declined.
370
332
  */
371
- function getMultiServiceBookingAvailability(payload) {
372
- function __getMultiServiceBookingAvailability({ host }) {
373
- const metadata = {
374
- entityFqdn: 'wix.bookings.v2.booking',
375
- method: 'POST',
376
- methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.GetMultiServiceBookingAvailability',
377
- packageName: PACKAGE_NAME,
378
- url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
379
- protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/get_availability',
380
- data: payload,
381
- host,
382
- }),
383
- data: payload,
384
- };
385
- return metadata;
386
- }
387
- return __getMultiServiceBookingAvailability;
388
- }
389
- exports.getMultiServiceBookingAvailability = getMultiServiceBookingAvailability;
390
- /** Cancels a multi-service booking and thus all its individual bookings. */
391
- function cancelMultiServiceBooking(payload) {
392
- function __cancelMultiServiceBooking({ host }) {
333
+ function bulkConfirmOrDeclineBooking(payload) {
334
+ function __bulkConfirmOrDeclineBooking({ host }) {
393
335
  const metadata = {
394
336
  entityFqdn: 'wix.bookings.v2.booking',
395
337
  method: 'POST',
396
- methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.CancelMultiServiceBooking',
338
+ methodFqn: 'com.wixpress.bookings.confirmator.v2.Confirmator.BulkConfirmOrDeclineBooking',
397
339
  packageName: PACKAGE_NAME,
398
- url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
399
- protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/cancel',
340
+ url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
341
+ protoPath: '/v2/bulk/bookings/confirmOrDecline',
400
342
  data: payload,
401
343
  host,
402
344
  }),
@@ -405,21 +347,21 @@ function cancelMultiServiceBooking(payload) {
405
347
  {
406
348
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
407
349
  paths: [
408
- { path: 'multiServiceBooking.bookings.booking.createdDate' },
409
- { path: 'multiServiceBooking.bookings.booking.startDate' },
410
- { path: 'multiServiceBooking.bookings.booking.endDate' },
411
- { path: 'multiServiceBooking.bookings.booking.updatedDate' },
412
- { path: 'multiServiceBooking.bookings.booking.canceledDate' },
350
+ { path: 'results.item.createdDate' },
351
+ { path: 'results.item.startDate' },
352
+ { path: 'results.item.endDate' },
353
+ { path: 'results.item.updatedDate' },
354
+ { path: 'results.item.canceledDate' },
413
355
  ],
414
356
  },
415
357
  {
416
358
  transformFn: float_2.transformRESTFloatToSDKFloat,
417
359
  paths: [
418
360
  {
419
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
361
+ path: 'results.item.contactDetails.fullAddress.geocode.latitude',
420
362
  },
421
363
  {
422
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
364
+ path: 'results.item.contactDetails.fullAddress.geocode.longitude',
423
365
  },
424
366
  ],
425
367
  },
@@ -427,275 +369,252 @@ function cancelMultiServiceBooking(payload) {
427
369
  };
428
370
  return metadata;
429
371
  }
430
- return __cancelMultiServiceBooking;
372
+ return __bulkConfirmOrDeclineBooking;
431
373
  }
432
- exports.cancelMultiServiceBooking = cancelMultiServiceBooking;
374
+ exports.bulkConfirmOrDeclineBooking = bulkConfirmOrDeclineBooking;
433
375
  /**
434
- * Updates the status of a multi-service booking to `PENDING`.
376
+ * Creates a booking.
435
377
  *
436
378
  *
437
- * Also updates the status of each of individual bookings within the multi-service booking to `PENDING`.
379
+ * ## Appointment booking
438
380
  *
439
- * The call fails if the status for at least a single individual booking can't be updated.
381
+ * For appointment-based services, specify the relevant `slot` in
382
+ * `bookedEntity.slot`. We recommend specifying the complete
383
+ * `availabilityEntries.slot` returned in *Query Availability*
384
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
385
+ * in your call's request to avoid failed calls due to unavailability.
440
386
  *
441
- * See Mark Booking as Pending for more information.
442
- */
443
- function markMultiServiceBookingAsPending(payload) {
444
- function __markMultiServiceBookingAsPending({ host }) {
445
- const metadata = {
446
- entityFqdn: 'wix.bookings.v2.booking',
447
- method: 'POST',
448
- methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.MarkMultiServiceBookingAsPending',
449
- packageName: PACKAGE_NAME,
450
- url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
451
- protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/mark_as_pending',
452
- data: payload,
453
- host,
454
- }),
455
- data: payload,
456
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
457
- {
458
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
459
- paths: [
460
- { path: 'multiServiceBooking.bookings.booking.createdDate' },
461
- { path: 'multiServiceBooking.bookings.booking.startDate' },
462
- { path: 'multiServiceBooking.bookings.booking.endDate' },
463
- { path: 'multiServiceBooking.bookings.booking.updatedDate' },
464
- { path: 'multiServiceBooking.bookings.booking.canceledDate' },
465
- ],
466
- },
467
- {
468
- transformFn: float_2.transformRESTFloatToSDKFloat,
469
- paths: [
470
- {
471
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
472
- },
473
- {
474
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
475
- },
476
- ],
477
- },
478
- ]),
479
- };
480
- return metadata;
481
- }
482
- return __markMultiServiceBookingAsPending;
483
- }
484
- exports.markMultiServiceBookingAsPending = markMultiServiceBookingAsPending;
485
- /**
486
- * Updates the status of a multi-service booking to `CONFIRMED`.
387
+ * ## Class session booking
487
388
  *
389
+ * For class services, specify the relevant *event ID*
390
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/events/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction))
391
+ * as `bookedEntity.slot.eventId`.
392
+ * We recommend retrieving the event ID from *Query Availability's*
393
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
394
+ * `availabilityEntries.slot.eventId` to avoid failed calls due to unavailability.
395
+ * Specifying an event ID leads to automatic calculations of `slot.startDate`, `slot.endDate`,
396
+ * `slot.timezone`, `slot.resource`, and `slot.location`. All manually specified
397
+ * values are overridden.
488
398
  *
489
- * Also updates the status of each of individual bookings within the multi-service booking to `CONFIRMED`.
399
+ * ## Course booking
490
400
  *
491
- * The call fails if the status for at least a single individual booking can't be updated.
401
+ * For course services, specify the course's schedule ID in `bookedEntity.schedule.scheduleId`.
402
+ * We recommend following [this sample flow](https://dev.wix.com/docs/rest/business-solutions/bookings/sample-booking-flows#book-a-course)
403
+ * to minimize failed calls due to unavailability.
492
404
  *
493
- * See Confirm Booking for more information.
494
- */
495
- function confirmMultiServiceBooking(payload) {
496
- function __confirmMultiServiceBooking({ host }) {
497
- const metadata = {
498
- entityFqdn: 'wix.bookings.v2.booking',
499
- method: 'POST',
500
- methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.ConfirmMultiServiceBooking',
501
- packageName: PACKAGE_NAME,
502
- url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
503
- protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/confirm',
504
- data: payload,
505
- host,
506
- }),
507
- data: payload,
508
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
509
- {
510
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
511
- paths: [
512
- { path: 'multiServiceBooking.bookings.booking.createdDate' },
513
- { path: 'multiServiceBooking.bookings.booking.startDate' },
514
- { path: 'multiServiceBooking.bookings.booking.endDate' },
515
- { path: 'multiServiceBooking.bookings.booking.updatedDate' },
516
- { path: 'multiServiceBooking.bookings.booking.canceledDate' },
517
- ],
518
- },
519
- {
520
- transformFn: float_2.transformRESTFloatToSDKFloat,
521
- paths: [
522
- {
523
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
524
- },
525
- {
526
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
527
- },
528
- ],
529
- },
530
- ]),
531
- };
532
- return metadata;
533
- }
534
- return __confirmMultiServiceBooking;
535
- }
536
- exports.confirmMultiServiceBooking = confirmMultiServiceBooking;
537
- /**
538
- * Updates the status of a multi-service booking to `DECLINED`.
405
+ * ## Related resources
406
+ *
407
+ * Specifying a `resource` triggers an availability check, resulting in a failed
408
+ * call if the resource is unavailable. Omitting a resource allows Wix Bookings
409
+ * to assign a resource belonging to the relevant type randomly when the merchant
410
+ * confirms the booking.
539
411
  *
412
+ * ## Participant information
540
413
  *
541
- * Also updates the status of each of individual bookings within the multi-service booking to `DECLINED`.
414
+ * You must specify either `participantsChoices` or `totalParticipants`.
415
+ * The call fails if the specified `participantsChoices` aren't among the supported
416
+ * _service options and variants_
417
+ * ([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)).
542
418
  *
543
- * The call fails if the status for at least a single individual booking can't be updated.
419
+ * ## Notify customers
544
420
  *
545
- * See Decline Booking for more information.
421
+ * You can specify a `participantNotification.message` for the customer that's send
422
+ * immediately. Ensure `participantNotification.notifyParticipants` is set to `true`
423
+ * to send the message.
424
+ *
425
+ * If you specify `{"sendSmsReminder": true}`, the customer receives an SMS 24 hours
426
+ * before the session starts. The phone number is taken from `contactDetails.phone`.
427
+ *
428
+ * ## Booking status
429
+ *
430
+ * Bookings default to the `CREATED` status, not affecting the business calendar
431
+ * or resource availability. You can specify a different status when the calling
432
+ * [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
433
+ * has `Manage Bookings` permissions.
434
+ *
435
+ * ## Payment options
436
+ *
437
+ * The specified `selectedPaymentOption` indicates how the customer intends to
438
+ * pay, allowing for later changes to a different method supported by the service.
439
+ *
440
+ * ## Payment status
441
+ *
442
+ * A booking is initially created with `{"paymentStatus": "UNDEFINED"}` regardless
443
+ * of the payment status specified in Create Booking. If a customer uses an
444
+ * _eCommerce checkout_
445
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)),
446
+ * Wix Bookings automatically syncs the booking's payment status from
447
+ * the corresponding *eCommerce order*
448
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
449
+ *
450
+ * If a booking doesn't have a corresponding eCommerce order, for example, since
451
+ * the customer didn't use the eCommerce checkout, you can update the booking's
452
+ * payment status with *Confirm Or Decline Booking*
453
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
454
+ *
455
+ * ## Booking form data
456
+ *
457
+ * When customers sign up for a service, they must fill out the booking form.
458
+ * To create a booking with a completed booking form, specify the relevant data in
459
+ * `formSubmission`. Ensure the values of the corresponding fields in
460
+ * `booking.contactDetails` and `formSubmission` are identical. If these values
461
+ * don't match, Create Booking fails. Therefore, we recommend specifying
462
+ * only `booking.contactDetails.contactId` when providing `formSubmission`.
463
+ *
464
+ * ## Admin overwrites
465
+ *
466
+ * There are small but important differences when you specify special
467
+ * `flowControlSettings`:
468
+ *
469
+ * - `{"skipAvailabilityValidation": true}`: The call succeeds
470
+ * regardless of availability. If you don't specify any resource, the call
471
+ * succeeds even if no resource of the relevant type is available.
472
+ * - `{"skipBusinessConfirmation": true}`: Automatically confirms `PENDING`
473
+ * bookings that require manual confirmation.
474
+ * - `{"skipSelectedPaymentOptionValidation": true}`: Allows customers to pay
475
+ * with payment methods that aren't supported for the service.
476
+ *
477
+ * When using special `flowControlSettings`, ensure you have sufficient
478
+ * permissions. If you encounter failed calls due to insufficient permissions,
479
+ * consider the following options:
480
+ *
481
+ * - **App developers** can use a higher
482
+ * [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
483
+ * such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
484
+ * - **Site developers** can utilize
485
+ * [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
486
+ *
487
+ * Granting additional permissions and using elevation permits method calls that
488
+ * would typically fail due to authorization checks. Therefore, you should use
489
+ * them intentionally and securely.
546
490
  */
547
- function declineMultiServiceBooking(payload) {
548
- function __declineMultiServiceBooking({ host }) {
491
+ function createBooking(payload) {
492
+ function __createBooking({ host }) {
493
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
494
+ {
495
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
496
+ paths: [
497
+ { path: 'booking.createdDate' },
498
+ { path: 'booking.startDate' },
499
+ { path: 'booking.endDate' },
500
+ { path: 'booking.updatedDate' },
501
+ { path: 'booking.canceledDate' },
502
+ ],
503
+ },
504
+ {
505
+ transformFn: float_1.transformSDKFloatToRESTFloat,
506
+ paths: [
507
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
508
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
509
+ ],
510
+ },
511
+ ]);
549
512
  const metadata = {
550
513
  entityFqdn: 'wix.bookings.v2.booking',
551
514
  method: 'POST',
552
- methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.DeclineMultiServiceBooking',
515
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.CreateBooking',
553
516
  packageName: PACKAGE_NAME,
554
- url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
555
- protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/decline',
556
- data: payload,
517
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
518
+ protoPath: '/v2/bookings',
519
+ data: serializedData,
557
520
  host,
558
521
  }),
559
- data: payload,
522
+ data: serializedData,
560
523
  transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
561
524
  {
562
525
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
563
526
  paths: [
564
- { path: 'multiServiceBooking.bookings.booking.createdDate' },
565
- { path: 'multiServiceBooking.bookings.booking.startDate' },
566
- { path: 'multiServiceBooking.bookings.booking.endDate' },
567
- { path: 'multiServiceBooking.bookings.booking.updatedDate' },
568
- { path: 'multiServiceBooking.bookings.booking.canceledDate' },
527
+ { path: 'booking.createdDate' },
528
+ { path: 'booking.startDate' },
529
+ { path: 'booking.endDate' },
530
+ { path: 'booking.updatedDate' },
531
+ { path: 'booking.canceledDate' },
569
532
  ],
570
533
  },
571
534
  {
572
535
  transformFn: float_2.transformRESTFloatToSDKFloat,
573
536
  paths: [
574
- {
575
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
576
- },
577
- {
578
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
579
- },
537
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
538
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
580
539
  ],
581
540
  },
582
541
  ]),
583
542
  };
584
543
  return metadata;
585
544
  }
586
- return __declineMultiServiceBooking;
587
- }
588
- exports.declineMultiServiceBooking = declineMultiServiceBooking;
589
- /** Retrieves the allowed actions for a list of multi-service bookings. */
590
- function bulkGetMultiServiceBookingAllowedActions(payload) {
591
- function __bulkGetMultiServiceBookingAllowedActions({ host }) {
592
- const metadata = {
593
- entityFqdn: 'wix.bookings.v2.booking',
594
- method: 'POST',
595
- methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.BulkGetMultiServiceBookingAllowedActions',
596
- packageName: PACKAGE_NAME,
597
- url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
598
- protoPath: '/v2/bulk/multi_service_bookings/get_allowed_actions',
599
- data: payload,
600
- host,
601
- }),
602
- data: payload,
603
- };
604
- return metadata;
605
- }
606
- return __bulkGetMultiServiceBookingAllowedActions;
545
+ return __createBooking;
607
546
  }
608
- exports.bulkGetMultiServiceBookingAllowedActions = bulkGetMultiServiceBookingAllowedActions;
547
+ exports.createBooking = createBooking;
609
548
  /**
610
- * Retrieves all single-service bookings belonging to a multi-service booking.
549
+ * Creates up to 8 bookings.
611
550
  *
612
551
  *
613
- * If you call as an [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
614
- * who has permissions to read only part of the bookings,
615
- * only the permitted bookings are retrieved. The returned total number of
616
- * bookings includes also the bookings for which you don't have permissions.
617
- */
618
- function getMultiServiceBooking(payload) {
619
- function __getMultiServiceBooking({ host }) {
620
- const metadata = {
621
- entityFqdn: 'wix.bookings.v2.booking',
622
- method: 'GET',
623
- methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.GetMultiServiceBooking',
624
- packageName: PACKAGE_NAME,
625
- url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
626
- protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}',
627
- data: payload,
628
- host,
629
- }),
630
- params: (0, rest_modules_1.toURLSearchParams)(payload),
631
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
632
- {
633
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
634
- paths: [
635
- { path: 'multiServiceBooking.bookings.booking.createdDate' },
636
- { path: 'multiServiceBooking.bookings.booking.startDate' },
637
- { path: 'multiServiceBooking.bookings.booking.endDate' },
638
- { path: 'multiServiceBooking.bookings.booking.updatedDate' },
639
- { path: 'multiServiceBooking.bookings.booking.canceledDate' },
640
- ],
641
- },
642
- {
643
- transformFn: float_2.transformRESTFloatToSDKFloat,
644
- paths: [
645
- {
646
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
647
- },
648
- {
649
- path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
650
- },
651
- ],
652
- },
653
- ]),
654
- };
655
- return metadata;
656
- }
657
- return __getMultiServiceBooking;
658
- }
659
- exports.getMultiServiceBooking = getMultiServiceBooking;
660
- /**
661
- * Adds a list of single-service bookings to a multi-service booking.
552
+ * See *Create Booking*
553
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/create-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/create-booking))
554
+ * for more information.
662
555
  *
556
+ * If any of the specified bookings is missing a required field the entire call
557
+ * fails.
663
558
  *
664
- * The call fails, if at least 1 of the specified booking is already part of a
665
- * multi-service booking.
559
+ * If you specify 1 or more unavailable bookings, the call succeeds
560
+ * while the unavailable bookings aren't created. Instead, they're counted as
561
+ * failures in the returned `bulkActionMetadata`.
666
562
  */
667
- function addBookingsToMultiServiceBooking(payload) {
668
- function __addBookingsToMultiServiceBooking({ host }) {
563
+ function bulkCreateBooking(payload) {
564
+ function __bulkCreateBooking({ host }) {
565
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
566
+ {
567
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
568
+ paths: [
569
+ { path: 'createBookingsInfo.booking.createdDate' },
570
+ { path: 'createBookingsInfo.booking.startDate' },
571
+ { path: 'createBookingsInfo.booking.endDate' },
572
+ { path: 'createBookingsInfo.booking.updatedDate' },
573
+ { path: 'createBookingsInfo.booking.canceledDate' },
574
+ ],
575
+ },
576
+ {
577
+ transformFn: float_1.transformSDKFloatToRESTFloat,
578
+ paths: [
579
+ {
580
+ path: 'createBookingsInfo.booking.contactDetails.fullAddress.geocode.latitude',
581
+ },
582
+ {
583
+ path: 'createBookingsInfo.booking.contactDetails.fullAddress.geocode.longitude',
584
+ },
585
+ ],
586
+ },
587
+ ]);
669
588
  const metadata = {
670
589
  entityFqdn: 'wix.bookings.v2.booking',
671
590
  method: 'POST',
672
- methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.AddBookingsToMultiServiceBooking',
591
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.BulkCreateBooking',
673
592
  packageName: PACKAGE_NAME,
674
- url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
675
- protoPath: '/v2/multi_service_bookings/add_bookings_to_multi_service_booking',
676
- data: payload,
593
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
594
+ protoPath: '/v2/bulk/bookings/create',
595
+ data: serializedData,
677
596
  host,
678
597
  }),
679
- data: payload,
598
+ data: serializedData,
680
599
  transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
681
600
  {
682
601
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
683
602
  paths: [
684
- { path: 'bookings.booking.createdDate' },
685
- { path: 'bookings.booking.startDate' },
686
- { path: 'bookings.booking.endDate' },
687
- { path: 'bookings.booking.updatedDate' },
688
- { path: 'bookings.booking.canceledDate' },
603
+ { path: 'results.item.createdDate' },
604
+ { path: 'results.item.startDate' },
605
+ { path: 'results.item.endDate' },
606
+ { path: 'results.item.updatedDate' },
607
+ { path: 'results.item.canceledDate' },
689
608
  ],
690
609
  },
691
610
  {
692
611
  transformFn: float_2.transformRESTFloatToSDKFloat,
693
612
  paths: [
694
613
  {
695
- path: 'bookings.booking.contactDetails.fullAddress.geocode.latitude',
614
+ path: 'results.item.contactDetails.fullAddress.geocode.latitude',
696
615
  },
697
616
  {
698
- path: 'bookings.booking.contactDetails.fullAddress.geocode.longitude',
617
+ path: 'results.item.contactDetails.fullAddress.geocode.longitude',
699
618
  },
700
619
  ],
701
620
  },
@@ -703,30 +622,78 @@ function addBookingsToMultiServiceBooking(payload) {
703
622
  };
704
623
  return metadata;
705
624
  }
706
- return __addBookingsToMultiServiceBooking;
625
+ return __bulkCreateBooking;
707
626
  }
708
- exports.addBookingsToMultiServiceBooking = addBookingsToMultiServiceBooking;
627
+ exports.bulkCreateBooking = bulkCreateBooking;
709
628
  /**
710
- * Removes single-service bookings from a multi-service booking and returns the
711
- * removed bookings.
629
+ * Reschedules an appointment booking to a different slot or a class booking to
630
+ * a different session.
631
+ *
632
+ *
633
+ * ## Course booking limitation
634
+ *
635
+ * You can't reschedule course bookings.
636
+ *
637
+ * ## Appointment sessions
638
+ *
639
+ * For appointments, the old session is removed from the business calendar
640
+ * while a new session is added. We recommend calling *Query Availability*
641
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
642
+ * first and specifying the entire retrieved `slot`.
643
+ *
644
+ * ## Class sessions
645
+ *
646
+ * For classes, the new session must be an existing session belonging to the
647
+ * same class. We recommend retrieving `availabilityEntries.slot.eventId`
648
+ * from *Query Availability*
649
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
650
+ * to avoid failed Reschedule Booking calls due to unavailability. Specify
651
+ * only `slot.eventId` instead of the entire `slot` object.
652
+ *
653
+ * ## Notify customers
712
654
  *
655
+ * You can specify a `participantNotification.message` for the customer. To send
656
+ * the message, you must also specify `participantNotification.notifyParticipants`
657
+ * as `true`.
713
658
  *
714
- * If you specify an empty `bookings` array, all single-service bookings for which
715
- * the call's [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
716
- * has read permissions are removed from the multi-service booking.
659
+ * ## Admin overwrites
717
660
  *
718
- * If the call would create a multi-service booking including only 1 single-service
719
- * booking, the multi-service booking is also deleted.
661
+ * There are small but important differences when you specify special
662
+ * `flowControlSettings`:
663
+ *
664
+ * - `{"ignoreReschedulePolicy": true}`: The call succeeds even if the
665
+ * service's `reschedulePolicy` doesn't allow it.
666
+ * - `{"skipAvailabilityValidation": true}`: The call succeeds even if
667
+ * the specified session, slot, or resource isn't available. If you don't
668
+ * specify any resource, the call succeeds even if no resource of the relevant
669
+ * type is available.
670
+ * - `{"skipBusinessConfirmation": true}`: Any `PENDING` booking is
671
+ * automatically confirmed even if the services requires the merchants's
672
+ * manual confirmation.
673
+ *
674
+ * When using special `flowControlSettings`, ensure you have sufficient
675
+ * permissions. If you encounter failed calls due to insufficient permissions,
676
+ * consider the following options:
677
+ *
678
+ * - **App developers** can use a higher
679
+ * [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
680
+ * such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
681
+ * - **Site developers** can utilize
682
+ * [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
683
+ *
684
+ * Granting additional permissions and using elevation permits method calls that
685
+ * would typically fail due to authorization checks. Therefore, you should use
686
+ * them intentionally and securely.
720
687
  */
721
- function removeBookingsFromMultiServiceBooking(payload) {
722
- function __removeBookingsFromMultiServiceBooking({ host }) {
688
+ function rescheduleBooking(payload) {
689
+ function __rescheduleBooking({ host }) {
723
690
  const metadata = {
724
691
  entityFqdn: 'wix.bookings.v2.booking',
725
692
  method: 'POST',
726
- methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.RemoveBookingsFromMultiServiceBooking',
693
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.RescheduleBooking',
727
694
  packageName: PACKAGE_NAME,
728
- url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
729
- protoPath: '/v2/multi_service_bookings/remove_bookings_from_multi_service_booking',
695
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
696
+ protoPath: '/v2/bookings/{bookingId}/reschedule',
730
697
  data: payload,
731
698
  host,
732
699
  }),
@@ -735,177 +702,95 @@ function removeBookingsFromMultiServiceBooking(payload) {
735
702
  {
736
703
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
737
704
  paths: [
738
- { path: 'bookings.booking.createdDate' },
739
- { path: 'bookings.booking.startDate' },
740
- { path: 'bookings.booking.endDate' },
741
- { path: 'bookings.booking.updatedDate' },
742
- { path: 'bookings.booking.canceledDate' },
705
+ { path: 'booking.createdDate' },
706
+ { path: 'booking.startDate' },
707
+ { path: 'booking.endDate' },
708
+ { path: 'booking.updatedDate' },
709
+ { path: 'booking.canceledDate' },
743
710
  ],
744
711
  },
745
712
  {
746
713
  transformFn: float_2.transformRESTFloatToSDKFloat,
747
714
  paths: [
748
- {
749
- path: 'bookings.booking.contactDetails.fullAddress.geocode.latitude',
750
- },
751
- {
752
- path: 'bookings.booking.contactDetails.fullAddress.geocode.longitude',
753
- },
715
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
716
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
754
717
  ],
755
718
  },
756
719
  ]),
757
720
  };
758
721
  return metadata;
759
722
  }
760
- return __removeBookingsFromMultiServiceBooking;
723
+ return __rescheduleBooking;
761
724
  }
762
- exports.removeBookingsFromMultiServiceBooking = removeBookingsFromMultiServiceBooking;
725
+ exports.rescheduleBooking = rescheduleBooking;
763
726
  /**
764
- * Creates a booking.
765
- *
766
- *
767
- * ## Appointment booking
768
- *
769
- * For appointment-based services, specify the relevant `slot` in
770
- * `bookedEntity.slot`. We recommend specifying the complete
771
- * `availabilityEntries.slot` returned in Query Availability
772
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
773
- * in your call's request to avoid failed calls due to unavailability.
774
- *
775
- * ## Class session booking
776
- *
777
- * For class services, specify the relevant event ID
778
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/events/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction))
779
- * as `bookedEntity.slot.eventId`.
780
- * We recommend retrieving the event ID from Query Availability's
781
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
782
- * `availabilityEntries.slot.eventId` to avoid failed calls due to unavailability.
783
- * Specifying an event ID leads to automatic calculations of `slot.startDate`, `slot.endDate`,
784
- * `slot.timezone`, `slot.resource`, and `slot.location`. All manually specified
785
- * values are overridden.
786
- *
787
- * ## Course booking
788
- *
789
- * For course services, specify the course's schedule ID in `bookedEntity.schedule.scheduleId`.
790
- * We recommend following [this sample flow](https://dev.wix.com/docs/rest/business-solutions/bookings/sample-booking-flows#book-a-course)
791
- * to minimize failed calls due to unavailability.
792
- *
793
- * ## Related resources
794
- *
795
- * Specifying a `resource` triggers an availability check, resulting in a failed
796
- * call if the resource is unavailable. Omitting a resource allows Wix Bookings
797
- * to assign a resource belonging to the relevant type randomly when the merchant
798
- * confirms the booking.
727
+ * Updates the booking status to `CONFIRMED` and updates the relevant session's
728
+ * `participants.approvalStatus` to `APPROVED` without checking whether the relevant
729
+ * slot or schedule is still available.
799
730
  *
800
- * ## Participant information
731
+ * ## eCommerce checkout restriction
801
732
  *
802
- * You must specify either `participantsChoices` or `totalParticipants`.
803
- * The call fails if the specified `participantsChoices` aren't among the supported
804
- * service options and variants
805
- * ([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)).
733
+ * Call this method only when using a custom checkout page. Don't
734
+ * call it when using a *Wix eCommerce checkout*
735
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
736
+ * In such cases, Wix automatically updates the booking status based on
737
+ * the `paymentStatus` of the corresponding *Wix eCommerce order*
738
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
806
739
  *
807
- * ## Notify customers
740
+ * ## When to call Confirm Or Decline Booking instead
808
741
  *
809
- * You can specify a `participantNotification.message` for the customer that's send
810
- * immediately. Ensure `participantNotification.notifyParticipants` is set to `true`
811
- * to send the message.
742
+ * Confirm Booking doesn't check whether a slot or schedule is still available. For
743
+ * these checks you can call *Confirm or Decline Booking*
744
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
812
745
  *
813
- * If you specify `{"sendSmsReminder": true}`, the customer receives an SMS 24 hours
814
- * before the session starts. The phone number is taken from `contactDetails.phone`.
746
+ * ## Original status validation
815
747
  *
816
- * ## Booking status
748
+ * You can only confirm bookings with a status of `PENDING`, `CREATED`, or
749
+ * `WAITING_LIST`.
817
750
  *
818
- * Bookings default to the `CREATED` status, not affecting the business calendar
819
- * or resource availability. You can specify a different status when the calling
820
- * [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
821
- * has `Manage Bookings` permissions.
751
+ * ## Double bookings
822
752
  *
823
- * ## Payment options
753
+ * Confirm Booking doesn't check whether a slot or schedule is still available.
754
+ * You can specify
824
755
  *
825
- * The specified `selectedPaymentOption` indicates how the customer intends to
826
- * pay, allowing for later changes to a different method supported by the service.
756
+ * ```json
757
+ * {
758
+ * "flowControlSettings": {
759
+ * "checkAvailabilityValidation": true
760
+ * },
761
+ * "doubleBooked": true
762
+ * }
763
+ * ```
764
+ * to forcefully set the booking's `doubleBooked` flag to `true`, regardless of
765
+ * a potential double booking conflict. You must call with `Manage Bookings`
766
+ * permissions to do so. For the default flow control settings
767
+ * `{"checkAvailabilityValidation": false}`, the specified `doubleBooked` value
768
+ * is ignored.
827
769
  *
828
770
  * ## Payment status
829
771
  *
830
- * A booking is initially created with `{"paymentStatus": "UNDEFINED"}` regardless
831
- * of the payment status specified in Create Booking. If a customer uses an eCommerce
832
- * checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)),
833
- * Wix Bookings automatically syncs the booking's payment status from
834
- * the corresponding eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
835
- *
836
- * If a booking doesn't have a corresponding eCommerce order, for example, since
837
- * the customer didn't use the eCommerce checkout, you can update the booking's
838
- * payment status with Confirm Or Decline Booking
839
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
840
- *
841
- * ## Booking form data
842
- *
843
- * When customers sign up for a service, they must fill out the booking form.
844
- * To create a booking with a completed booking form, specify the relevant data in
845
- * `formSubmission`. Ensure the values of the corresponding fields in
846
- * `booking.contactDetails` and `formSubmission` are identical. If these values
847
- * don't match, Create Booking fails. Therefore, we recommend specifying
848
- * only `booking.contactDetails.contactId` when providing `formSubmission`.
849
- *
850
- * ## Admin overwrites
851
- *
852
- * There are small but important differences when you specify special
853
- * `flowControlSettings`:
854
- *
855
- * - `{"skipAvailabilityValidation": true}`: The call succeeds
856
- * regardless of availability. If you don't specify any resource, the call
857
- * succeeds even if no resource of the relevant type is available.
858
- * - `{"skipBusinessConfirmation": true}`: Automatically confirms `PENDING`
859
- * bookings that require manual confirmation.
860
- * - `{"skipSelectedPaymentOptionValidation": true}`: Allows customers to pay
861
- * with payment methods that aren't supported for the service.
862
- *
863
- * When using special `flowControlSettings`, ensure you have sufficient
864
- * permissions. If you encounter failed calls due to insufficient permissions,
865
- * consider the following options:
772
+ * Also updates the booking's `paymentStatus`, if you specify a new payment
773
+ * status.
866
774
  *
867
- * - **App developers** can use a higher
868
- * [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
869
- * such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
870
- * - **Site developers** can utilize
871
- * [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
775
+ * ## Notify customers
872
776
  *
873
- * Granting additional permissions and using elevation permits method calls that
874
- * would typically fail due to authorization checks. Therefore, you should use
875
- * them intentionally and securely.
777
+ * You can specify a `participantNotification.message` for the customer. To send
778
+ * the message, you must also specify `participantNotification.notifyParticipants`
779
+ * as `true`.
876
780
  */
877
- function createBooking(payload) {
878
- function __createBooking({ host }) {
879
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
880
- {
881
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
882
- paths: [
883
- { path: 'booking.createdDate' },
884
- { path: 'booking.startDate' },
885
- { path: 'booking.endDate' },
886
- { path: 'booking.updatedDate' },
887
- { path: 'booking.canceledDate' },
888
- ],
889
- },
890
- {
891
- transformFn: float_1.transformSDKFloatToRESTFloat,
892
- paths: [
893
- { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
894
- { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
895
- ],
896
- },
897
- ]);
781
+ function bookingsConfirmBooking(payload) {
782
+ function __bookingsConfirmBooking({ host }) {
898
783
  const metadata = {
899
784
  entityFqdn: 'wix.bookings.v2.booking',
900
785
  method: 'POST',
901
- methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.CreateBooking',
786
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.ConfirmBooking',
902
787
  packageName: PACKAGE_NAME,
903
788
  url: resolveComWixpressBookingsBookingsV2BookingsUrl({
904
- protoPath: '/v2/bookings',
905
- data: serializedData,
789
+ protoPath: '/v2/bookings/{bookingId}/confirm',
790
+ data: payload,
906
791
  host,
907
792
  }),
908
- data: serializedData,
793
+ data: payload,
909
794
  transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
910
795
  {
911
796
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
@@ -928,112 +813,126 @@ function createBooking(payload) {
928
813
  };
929
814
  return metadata;
930
815
  }
931
- return __createBooking;
816
+ return __bookingsConfirmBooking;
817
+ }
818
+ exports.bookingsConfirmBooking = bookingsConfirmBooking;
819
+ /**
820
+ * Updates the extended fields for a booking.
821
+ *
822
+ *
823
+ * If you specify an extended field `namespace` that doesn't exist yet, it's
824
+ * created.
825
+ *
826
+ * Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/about-backend-extensions#schema-plugin-extensions).
827
+ */
828
+ function updateExtendedFields(payload) {
829
+ function __updateExtendedFields({ host }) {
830
+ const metadata = {
831
+ entityFqdn: 'wix.bookings.v2.booking',
832
+ method: 'POST',
833
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.UpdateExtendedFields',
834
+ packageName: PACKAGE_NAME,
835
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
836
+ protoPath: '/v2/bookings/{id}/update_extended_fields',
837
+ data: payload,
838
+ host,
839
+ }),
840
+ data: payload,
841
+ };
842
+ return metadata;
843
+ }
844
+ return __updateExtendedFields;
932
845
  }
933
- exports.createBooking = createBooking;
846
+ exports.updateExtendedFields = updateExtendedFields;
934
847
  /**
935
- * Creates up to 8 bookings.
848
+ * Updates the booking status to `DECLINED` and updates the relevant session's
849
+ * `participants.approvalStatus` to `DECLINED` without checking whether the relevant
850
+ * slot or schedule is still available.
936
851
  *
937
852
  *
938
- * See Create Booking ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/create-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/create-booking))
939
- * for more information.
853
+ * ## eCommerce checkout restriction
940
854
  *
941
- * If any of the specified bookings is missing a required field the entire call
942
- * fails.
855
+ * Call this method only when using a custom checkout page. Don't
856
+ * call it when using a *Wix eCommerce checkout*
857
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
858
+ * In such cases, Wix automatically updates the booking status based on
859
+ * the `paymentStatus` of the corresponding *Wix eCommerce order*
860
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
943
861
  *
944
- * If you specify 1 or more unavailable bookings, the call succeeds
945
- * while the unavailable bookings aren't created. Instead, they're counted as
946
- * failures in the returned `bulkActionMetadata`.
862
+ * ## When to call Confirm Or Decline Booking instead
863
+ *
864
+ * The method doesn't check whether a slot or schedule is still available. For
865
+ * these checks you can call *Confirm or Decline Booking*
866
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
867
+ *
868
+ * ## Original status validation
869
+ *
870
+ * You can only decline bookings with a `status` of `PENDING`, `CREATED`, or
871
+ * `WAITING_LIST`.
872
+ *
873
+ * ## Payment status
874
+ *
875
+ * Also updates the booking's `paymentStatus`, if you specify a new payment
876
+ * status.
877
+ *
878
+ * ## Notify customers
879
+ *
880
+ * You can specify a `participantNotification.message` for the customer. To send
881
+ * the message, you must also specify `participantNotification.notifyParticipants`
882
+ * as `true`.
947
883
  */
948
- function bulkCreateBooking(payload) {
949
- function __bulkCreateBooking({ host }) {
950
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
951
- {
952
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
953
- paths: [
954
- { path: 'createBookingsInfo.booking.createdDate' },
955
- { path: 'createBookingsInfo.booking.startDate' },
956
- { path: 'createBookingsInfo.booking.endDate' },
957
- { path: 'createBookingsInfo.booking.updatedDate' },
958
- { path: 'createBookingsInfo.booking.canceledDate' },
959
- ],
960
- },
961
- {
962
- transformFn: float_1.transformSDKFloatToRESTFloat,
963
- paths: [
964
- {
965
- path: 'createBookingsInfo.booking.contactDetails.fullAddress.geocode.latitude',
966
- },
967
- {
968
- path: 'createBookingsInfo.booking.contactDetails.fullAddress.geocode.longitude',
969
- },
970
- ],
971
- },
972
- ]);
884
+ function bookingsDeclineBooking(payload) {
885
+ function __bookingsDeclineBooking({ host }) {
973
886
  const metadata = {
974
887
  entityFqdn: 'wix.bookings.v2.booking',
975
888
  method: 'POST',
976
- methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.BulkCreateBooking',
889
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.DeclineBooking',
977
890
  packageName: PACKAGE_NAME,
978
891
  url: resolveComWixpressBookingsBookingsV2BookingsUrl({
979
- protoPath: '/v2/bulk/bookings/create',
980
- data: serializedData,
892
+ protoPath: '/v2/bookings/{bookingId}/decline',
893
+ data: payload,
981
894
  host,
982
895
  }),
983
- data: serializedData,
896
+ data: payload,
984
897
  transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
985
898
  {
986
899
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
987
900
  paths: [
988
- { path: 'results.item.createdDate' },
989
- { path: 'results.item.startDate' },
990
- { path: 'results.item.endDate' },
991
- { path: 'results.item.updatedDate' },
992
- { path: 'results.item.canceledDate' },
901
+ { path: 'booking.createdDate' },
902
+ { path: 'booking.startDate' },
903
+ { path: 'booking.endDate' },
904
+ { path: 'booking.updatedDate' },
905
+ { path: 'booking.canceledDate' },
993
906
  ],
994
907
  },
995
908
  {
996
909
  transformFn: float_2.transformRESTFloatToSDKFloat,
997
910
  paths: [
998
- {
999
- path: 'results.item.contactDetails.fullAddress.geocode.latitude',
1000
- },
1001
- {
1002
- path: 'results.item.contactDetails.fullAddress.geocode.longitude',
1003
- },
911
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
912
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1004
913
  ],
1005
914
  },
1006
915
  ]),
1007
916
  };
1008
917
  return metadata;
1009
918
  }
1010
- return __bulkCreateBooking;
919
+ return __bookingsDeclineBooking;
1011
920
  }
1012
- exports.bulkCreateBooking = bulkCreateBooking;
921
+ exports.bookingsDeclineBooking = bookingsDeclineBooking;
1013
922
  /**
1014
- * Reschedules an appointment booking to a different slot or a class booking to
1015
- * a different session.
1016
- *
1017
- *
1018
- * ## Course booking limitation
923
+ * Updates the booking status to `CANCELED`.
1019
924
  *
1020
- * You can't reschedule course bookings.
1021
925
  *
1022
- * ## Appointment sessions
926
+ * ## Appointments
1023
927
  *
1024
- * For appointments, the old session is removed from the business calendar
1025
- * while a new session is added. We recommend calling Query Availability
1026
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
1027
- * first and specifying the entire retrieved `slot`.
928
+ * For appointments, the corresponding event is removed from the Bookings
929
+ * calendar.
1028
930
  *
1029
- * ## Class sessions
931
+ * ## Class and course bookings
1030
932
  *
1031
- * For classes, the new session must be an existing session belonging to the
1032
- * same class. We recommend retrieving `availabilityEntries.slot.eventId`
1033
- * from Query Availability
1034
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/query-availability))
1035
- * to avoid failed Reschedule Booking calls due to unavailability. Specify
1036
- * only `slot.eventId` instead of the entire `slot` object.
933
+ * For class or course bookings, the relevant participants are removed
934
+ * from the class session or the course. However, the class session or course
935
+ * remain on the business calendar.
1037
936
  *
1038
937
  * ## Notify customers
1039
938
  *
@@ -1046,15 +945,12 @@ exports.bulkCreateBooking = bulkCreateBooking;
1046
945
  * There are small but important differences when you specify special
1047
946
  * `flowControlSettings`:
1048
947
  *
1049
- * - `{"ignoreReschedulePolicy": true}`: The call succeeds even if the
1050
- * service's `reschedulePolicy` doesn't allow it.
1051
- * - `{"skipAvailabilityValidation": true}`: The call succeeds even if
1052
- * the specified session, slot, or resource isn't available. If you don't
1053
- * specify any resource, the call succeeds even if no resource of the relevant
1054
- * type is available.
1055
- * - `{"skipBusinessConfirmation": true}`: Any `PENDING` booking is
1056
- * automatically confirmed even if the services requires the merchants's
1057
- * manual confirmation.
948
+ * - `{"ignoreCancellationPolicy": true}`: The call succeeds even if the
949
+ * service's `cancellationPolicy` doesn't allow it.
950
+ * - `{"withRefund": true}`: The customer is refunded even if the service's
951
+ * `refundPolicy` doesn't allow it.
952
+ * - `{"waiveCancellationFee": true}`: The customer doesn't have to pay
953
+ * the cancellation fee, even if the service's `cancellationPolicy` requires it.
1058
954
  *
1059
955
  * When using special `flowControlSettings`, ensure you have sufficient
1060
956
  * permissions. If you encounter failed calls due to insufficient permissions,
@@ -1070,15 +966,15 @@ exports.bulkCreateBooking = bulkCreateBooking;
1070
966
  * would typically fail due to authorization checks. Therefore, you should use
1071
967
  * them intentionally and securely.
1072
968
  */
1073
- function rescheduleBooking(payload) {
1074
- function __rescheduleBooking({ host }) {
969
+ function bookingsCancelBooking(payload) {
970
+ function __bookingsCancelBooking({ host }) {
1075
971
  const metadata = {
1076
972
  entityFqdn: 'wix.bookings.v2.booking',
1077
973
  method: 'POST',
1078
- methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.RescheduleBooking',
974
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.CancelBooking',
1079
975
  packageName: PACKAGE_NAME,
1080
976
  url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1081
- protoPath: '/v2/bookings/{bookingId}/reschedule',
977
+ protoPath: '/v2/bookings/{bookingId}/cancel',
1082
978
  data: payload,
1083
979
  host,
1084
980
  }),
@@ -1105,73 +1001,149 @@ function rescheduleBooking(payload) {
1105
1001
  };
1106
1002
  return metadata;
1107
1003
  }
1108
- return __rescheduleBooking;
1004
+ return __bookingsCancelBooking;
1109
1005
  }
1110
- exports.rescheduleBooking = rescheduleBooking;
1006
+ exports.bookingsCancelBooking = bookingsCancelBooking;
1111
1007
  /**
1112
- * Updates the booking status to `CONFIRMED` and updates the relevant session's
1113
- * `participants.approvalStatus` to `APPROVED` without checking whether the relevant
1114
- * slot or schedule is still available.
1115
- *
1116
- * ## eCommerce checkout restriction
1117
- *
1118
- * Call this method only when using a custom checkout page. Don't
1119
- * call it when using a Wix eCommerce checkout
1120
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
1121
- * In such cases, Wix automatically updates the booking status based on
1122
- * the `paymentStatus` of the corresponding Wix eCommerce order
1123
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
1008
+ * Updates the number of participants for a class or course booking and changes
1009
+ * the `totalNumberOfParticipants` for the relevant sessions.
1124
1010
  *
1125
- * ## When to call Confirm Or Decline Booking instead
1126
1011
  *
1127
- * Confirm Booking doesn't check whether a slot or schedule is still available. For
1128
- * these checks you can call Confirm or Decline Booking
1129
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
1012
+ * ## Appointment limitation
1130
1013
  *
1131
- * ## Original status validation
1014
+ * You can't update the number of participants for appointment bookings.
1132
1015
  *
1133
- * You can only confirm bookings with a status of `PENDING`, `CREATED`, or
1134
- * `WAITING_LIST`.
1016
+ * ## Participant information
1135
1017
  *
1136
- * ## Double bookings
1018
+ * You must specify either `participantsChoices` or `totalParticipants`.
1019
+ * The call fails if the specified `participantsChoices` aren't among the
1020
+ * supported *service options and variants*
1021
+ * ([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)).
1022
+ */
1023
+ function bookingsUpdateNumberOfParticipants(payload) {
1024
+ function __bookingsUpdateNumberOfParticipants({ host }) {
1025
+ const metadata = {
1026
+ entityFqdn: 'wix.bookings.v2.booking',
1027
+ method: 'POST',
1028
+ methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.UpdateNumberOfParticipants',
1029
+ packageName: PACKAGE_NAME,
1030
+ url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1031
+ protoPath: '/v2/bookings/{bookingId}/update_number_of_participants',
1032
+ data: payload,
1033
+ host,
1034
+ }),
1035
+ data: payload,
1036
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1037
+ {
1038
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1039
+ paths: [
1040
+ { path: 'booking.createdDate' },
1041
+ { path: 'booking.startDate' },
1042
+ { path: 'booking.endDate' },
1043
+ { path: 'booking.updatedDate' },
1044
+ { path: 'booking.canceledDate' },
1045
+ ],
1046
+ },
1047
+ {
1048
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1049
+ paths: [
1050
+ { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1051
+ { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1052
+ ],
1053
+ },
1054
+ ]),
1055
+ };
1056
+ return metadata;
1057
+ }
1058
+ return __bookingsUpdateNumberOfParticipants;
1059
+ }
1060
+ exports.bookingsUpdateNumberOfParticipants = bookingsUpdateNumberOfParticipants;
1061
+ /**
1062
+ * Creates a multi-service booking.
1137
1063
  *
1138
- * Confirm Booking doesn't check whether a slot or schedule is still available.
1139
- * You can specify
1140
1064
  *
1141
- * ```json
1142
- * {
1143
- * "flowControlSettings": {
1144
- * "checkAvailabilityValidation": true
1145
- * },
1146
- * "doubleBooked": true
1147
- * }
1148
- * ```
1149
- * to forcefully set the booking's `doubleBooked` flag to `true`, regardless of
1150
- * a potential double booking conflict. You must call with `Manage Bookings`
1151
- * permissions to do so. For the default flow control settings
1152
- * `{"checkAvailabilityValidation": false}`, the specified `doubleBooked` value
1153
- * is ignored.
1065
+ * See Create Booking for more information.
1066
+ */
1067
+ function createMultiServiceBooking(payload) {
1068
+ function __createMultiServiceBooking({ host }) {
1069
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
1070
+ {
1071
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
1072
+ paths: [
1073
+ { path: 'bookings.createdDate' },
1074
+ { path: 'bookings.startDate' },
1075
+ { path: 'bookings.endDate' },
1076
+ { path: 'bookings.updatedDate' },
1077
+ { path: 'bookings.canceledDate' },
1078
+ ],
1079
+ },
1080
+ {
1081
+ transformFn: float_1.transformSDKFloatToRESTFloat,
1082
+ paths: [
1083
+ { path: 'bookings.contactDetails.fullAddress.geocode.latitude' },
1084
+ { path: 'bookings.contactDetails.fullAddress.geocode.longitude' },
1085
+ ],
1086
+ },
1087
+ ]);
1088
+ const metadata = {
1089
+ entityFqdn: 'wix.bookings.v2.booking',
1090
+ method: 'POST',
1091
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.CreateMultiServiceBooking',
1092
+ packageName: PACKAGE_NAME,
1093
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
1094
+ protoPath: '/v2/multi_service_bookings',
1095
+ data: serializedData,
1096
+ host,
1097
+ }),
1098
+ data: serializedData,
1099
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1100
+ {
1101
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1102
+ paths: [
1103
+ { path: 'multiServiceBooking.bookings.booking.createdDate' },
1104
+ { path: 'multiServiceBooking.bookings.booking.startDate' },
1105
+ { path: 'multiServiceBooking.bookings.booking.endDate' },
1106
+ { path: 'multiServiceBooking.bookings.booking.updatedDate' },
1107
+ { path: 'multiServiceBooking.bookings.booking.canceledDate' },
1108
+ ],
1109
+ },
1110
+ {
1111
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1112
+ paths: [
1113
+ {
1114
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
1115
+ },
1116
+ {
1117
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
1118
+ },
1119
+ ],
1120
+ },
1121
+ ]),
1122
+ };
1123
+ return metadata;
1124
+ }
1125
+ return __createMultiServiceBooking;
1126
+ }
1127
+ exports.createMultiServiceBooking = createMultiServiceBooking;
1128
+ /**
1129
+ * Reschedules a multi-service booking.
1154
1130
  *
1155
- * ## Payment status
1156
1131
  *
1157
- * Also updates the booking's `paymentStatus`, if you specify a new payment
1158
- * status.
1132
+ * The call fails if at least 1 individual booking can't be rescheduled due
1133
+ * the service being unavailable or a rescheduling policy violation.
1159
1134
  *
1160
- * ## Notify customers
1161
1135
  *
1162
- * You can specify a `participantNotification.message` for the customer. To send
1163
- * the message, you must also specify `participantNotification.notifyParticipants`
1164
- * as `true`.
1136
+ * See Reschedule Booking for more information.
1165
1137
  */
1166
- function bookingsConfirmBooking(payload) {
1167
- function __bookingsConfirmBooking({ host }) {
1138
+ function rescheduleMultiServiceBooking(payload) {
1139
+ function __rescheduleMultiServiceBooking({ host }) {
1168
1140
  const metadata = {
1169
1141
  entityFqdn: 'wix.bookings.v2.booking',
1170
1142
  method: 'POST',
1171
- methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.ConfirmBooking',
1143
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.RescheduleMultiServiceBooking',
1172
1144
  packageName: PACKAGE_NAME,
1173
- url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1174
- protoPath: '/v2/bookings/{bookingId}/confirm',
1145
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
1146
+ protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/reschedule',
1175
1147
  data: payload,
1176
1148
  host,
1177
1149
  }),
@@ -1180,45 +1152,47 @@ function bookingsConfirmBooking(payload) {
1180
1152
  {
1181
1153
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1182
1154
  paths: [
1183
- { path: 'booking.createdDate' },
1184
- { path: 'booking.startDate' },
1185
- { path: 'booking.endDate' },
1186
- { path: 'booking.updatedDate' },
1187
- { path: 'booking.canceledDate' },
1155
+ { path: 'multiServiceBooking.bookings.booking.createdDate' },
1156
+ { path: 'multiServiceBooking.bookings.booking.startDate' },
1157
+ { path: 'multiServiceBooking.bookings.booking.endDate' },
1158
+ { path: 'multiServiceBooking.bookings.booking.updatedDate' },
1159
+ { path: 'multiServiceBooking.bookings.booking.canceledDate' },
1188
1160
  ],
1189
1161
  },
1190
1162
  {
1191
1163
  transformFn: float_2.transformRESTFloatToSDKFloat,
1192
1164
  paths: [
1193
- { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1194
- { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1165
+ {
1166
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
1167
+ },
1168
+ {
1169
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
1170
+ },
1195
1171
  ],
1196
1172
  },
1197
1173
  ]),
1198
1174
  };
1199
1175
  return metadata;
1200
1176
  }
1201
- return __bookingsConfirmBooking;
1177
+ return __rescheduleMultiServiceBooking;
1202
1178
  }
1203
- exports.bookingsConfirmBooking = bookingsConfirmBooking;
1179
+ exports.rescheduleMultiServiceBooking = rescheduleMultiServiceBooking;
1204
1180
  /**
1205
- * Updates the extended fields for a booking.
1206
- *
1181
+ * Retrieves a multi-service booking's availability.
1207
1182
  *
1208
- * If you specify an extended field `namespace` that doesn't exist yet, it's
1209
- * created.
1210
1183
  *
1211
- * Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/about-backend-extensions#schema-plugin-extensions).
1184
+ * Use List Multi Service Availability Time Slots to check availability for a
1185
+ * `SEQUENTIAL_BOOKINGS` multi-service booking.
1212
1186
  */
1213
- function updateExtendedFields(payload) {
1214
- function __updateExtendedFields({ host }) {
1187
+ function getMultiServiceBookingAvailability(payload) {
1188
+ function __getMultiServiceBookingAvailability({ host }) {
1215
1189
  const metadata = {
1216
1190
  entityFqdn: 'wix.bookings.v2.booking',
1217
1191
  method: 'POST',
1218
- methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.UpdateExtendedFields',
1192
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.GetMultiServiceBookingAvailability',
1219
1193
  packageName: PACKAGE_NAME,
1220
- url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1221
- protoPath: '/v2/bookings/{id}/update_extended_fields',
1194
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
1195
+ protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/get_availability',
1222
1196
  data: payload,
1223
1197
  host,
1224
1198
  }),
@@ -1226,55 +1200,71 @@ function updateExtendedFields(payload) {
1226
1200
  };
1227
1201
  return metadata;
1228
1202
  }
1229
- return __updateExtendedFields;
1203
+ return __getMultiServiceBookingAvailability;
1230
1204
  }
1231
- exports.updateExtendedFields = updateExtendedFields;
1205
+ exports.getMultiServiceBookingAvailability = getMultiServiceBookingAvailability;
1206
+ /** Cancels a multi-service booking and thus all its individual bookings. */
1207
+ function cancelMultiServiceBooking(payload) {
1208
+ function __cancelMultiServiceBooking({ host }) {
1209
+ const metadata = {
1210
+ entityFqdn: 'wix.bookings.v2.booking',
1211
+ method: 'POST',
1212
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.CancelMultiServiceBooking',
1213
+ packageName: PACKAGE_NAME,
1214
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
1215
+ protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/cancel',
1216
+ data: payload,
1217
+ host,
1218
+ }),
1219
+ data: payload,
1220
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1221
+ {
1222
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1223
+ paths: [
1224
+ { path: 'multiServiceBooking.bookings.booking.createdDate' },
1225
+ { path: 'multiServiceBooking.bookings.booking.startDate' },
1226
+ { path: 'multiServiceBooking.bookings.booking.endDate' },
1227
+ { path: 'multiServiceBooking.bookings.booking.updatedDate' },
1228
+ { path: 'multiServiceBooking.bookings.booking.canceledDate' },
1229
+ ],
1230
+ },
1231
+ {
1232
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1233
+ paths: [
1234
+ {
1235
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
1236
+ },
1237
+ {
1238
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
1239
+ },
1240
+ ],
1241
+ },
1242
+ ]),
1243
+ };
1244
+ return metadata;
1245
+ }
1246
+ return __cancelMultiServiceBooking;
1247
+ }
1248
+ exports.cancelMultiServiceBooking = cancelMultiServiceBooking;
1232
1249
  /**
1233
- * Updates the booking status to `DECLINED` and updates the relevant session's
1234
- * `participants.approvalStatus` to `DECLINED` without checking whether the relevant
1235
- * slot or schedule is still available.
1236
- *
1237
- *
1238
- * ## eCommerce checkout restriction
1239
- *
1240
- * Call this method only when using a custom checkout page. Don't
1241
- * call it when using a Wix eCommerce checkout
1242
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
1243
- * In such cases, Wix automatically updates the booking status based on
1244
- * the `paymentStatus` of the corresponding Wix eCommerce order
1245
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
1246
- *
1247
- * ## When to call Confirm Or Decline Booking instead
1248
- *
1249
- * The method doesn't check whether a slot or schedule is still available. For
1250
- * these checks you can call Confirm or Decline Booking
1251
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking)).
1252
- *
1253
- * ## Original status validation
1254
- *
1255
- * You can only decline bookings with a `status` of `PENDING`, `CREATED`, or
1256
- * `WAITING_LIST`.
1250
+ * Updates the status of a multi-service booking to `PENDING`.
1257
1251
  *
1258
- * ## Payment status
1259
1252
  *
1260
- * Also updates the booking's `paymentStatus`, if you specify a new payment
1261
- * status.
1253
+ * Also updates the status of each of individual bookings within the multi-service booking to `PENDING`.
1262
1254
  *
1263
- * ## Notify customers
1255
+ * The call fails if the status for at least a single individual booking can't be updated.
1264
1256
  *
1265
- * You can specify a `participantNotification.message` for the customer. To send
1266
- * the message, you must also specify `participantNotification.notifyParticipants`
1267
- * as `true`.
1257
+ * See Mark Booking as Pending for more information.
1268
1258
  */
1269
- function bookingsDeclineBooking(payload) {
1270
- function __bookingsDeclineBooking({ host }) {
1259
+ function markMultiServiceBookingAsPending(payload) {
1260
+ function __markMultiServiceBookingAsPending({ host }) {
1271
1261
  const metadata = {
1272
1262
  entityFqdn: 'wix.bookings.v2.booking',
1273
1263
  method: 'POST',
1274
- methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.DeclineBooking',
1264
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.MarkMultiServiceBookingAsPending',
1275
1265
  packageName: PACKAGE_NAME,
1276
- url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1277
- protoPath: '/v2/bookings/{bookingId}/decline',
1266
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
1267
+ protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/mark_as_pending',
1278
1268
  data: payload,
1279
1269
  host,
1280
1270
  }),
@@ -1283,83 +1273,50 @@ function bookingsDeclineBooking(payload) {
1283
1273
  {
1284
1274
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1285
1275
  paths: [
1286
- { path: 'booking.createdDate' },
1287
- { path: 'booking.startDate' },
1288
- { path: 'booking.endDate' },
1289
- { path: 'booking.updatedDate' },
1290
- { path: 'booking.canceledDate' },
1276
+ { path: 'multiServiceBooking.bookings.booking.createdDate' },
1277
+ { path: 'multiServiceBooking.bookings.booking.startDate' },
1278
+ { path: 'multiServiceBooking.bookings.booking.endDate' },
1279
+ { path: 'multiServiceBooking.bookings.booking.updatedDate' },
1280
+ { path: 'multiServiceBooking.bookings.booking.canceledDate' },
1291
1281
  ],
1292
1282
  },
1293
1283
  {
1294
1284
  transformFn: float_2.transformRESTFloatToSDKFloat,
1295
1285
  paths: [
1296
- { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1297
- { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1286
+ {
1287
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
1288
+ },
1289
+ {
1290
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
1291
+ },
1298
1292
  ],
1299
1293
  },
1300
1294
  ]),
1301
1295
  };
1302
1296
  return metadata;
1303
1297
  }
1304
- return __bookingsDeclineBooking;
1298
+ return __markMultiServiceBookingAsPending;
1305
1299
  }
1306
- exports.bookingsDeclineBooking = bookingsDeclineBooking;
1300
+ exports.markMultiServiceBookingAsPending = markMultiServiceBookingAsPending;
1307
1301
  /**
1308
- * Updates the booking status to `CANCELED`.
1309
- *
1310
- *
1311
- * ## Appointments
1312
- *
1313
- * For appointments, the corresponding event is removed from the Bookings
1314
- * calendar.
1315
- *
1316
- * ## Class and course bookings
1317
- *
1318
- * For class or course bookings, the relevant participants are removed
1319
- * from the class session or the course. However, the class session or course
1320
- * remain on the business calendar.
1321
- *
1322
- * ## Notify customers
1323
- *
1324
- * You can specify a `participantNotification.message` for the customer. To send
1325
- * the message, you must also specify `participantNotification.notifyParticipants`
1326
- * as `true`.
1327
- *
1328
- * ## Admin overwrites
1329
- *
1330
- * There are small but important differences when you specify special
1331
- * `flowControlSettings`:
1302
+ * Updates the status of a multi-service booking to `CONFIRMED`.
1332
1303
  *
1333
- * - `{"ignoreCancellationPolicy": true}`: The call succeeds even if the
1334
- * service's `cancellationPolicy` doesn't allow it.
1335
- * - `{"withRefund": true}`: The customer is refunded even if the service's
1336
- * `refundPolicy` doesn't allow it.
1337
- * - `{"waiveCancellationFee": true}`: The customer doesn't have to pay
1338
- * the cancellation fee, even if the service's `cancellationPolicy` requires it.
1339
1304
  *
1340
- * When using special `flowControlSettings`, ensure you have sufficient
1341
- * permissions. If you encounter failed calls due to insufficient permissions,
1342
- * consider the following options:
1305
+ * Also updates the status of each of individual bookings within the multi-service booking to `CONFIRMED`.
1343
1306
  *
1344
- * - **App developers** can use a higher
1345
- * [permission](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions),
1346
- * such as `MANAGE BOOKINGS - ALL PERMISSIONS`.
1347
- * - **Site developers** can utilize
1348
- * [elevation](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/authorization/elevation).
1307
+ * The call fails if the status for at least a single individual booking can't be updated.
1349
1308
  *
1350
- * Granting additional permissions and using elevation permits method calls that
1351
- * would typically fail due to authorization checks. Therefore, you should use
1352
- * them intentionally and securely.
1353
- */
1354
- function bookingsCancelBooking(payload) {
1355
- function __bookingsCancelBooking({ host }) {
1309
+ * See Confirm Booking for more information.
1310
+ */
1311
+ function confirmMultiServiceBooking(payload) {
1312
+ function __confirmMultiServiceBooking({ host }) {
1356
1313
  const metadata = {
1357
1314
  entityFqdn: 'wix.bookings.v2.booking',
1358
1315
  method: 'POST',
1359
- methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.CancelBooking',
1316
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.ConfirmMultiServiceBooking',
1360
1317
  packageName: PACKAGE_NAME,
1361
- url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1362
- protoPath: '/v2/bookings/{bookingId}/cancel',
1318
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
1319
+ protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/confirm',
1363
1320
  data: payload,
1364
1321
  host,
1365
1322
  }),
@@ -1368,52 +1325,50 @@ function bookingsCancelBooking(payload) {
1368
1325
  {
1369
1326
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1370
1327
  paths: [
1371
- { path: 'booking.createdDate' },
1372
- { path: 'booking.startDate' },
1373
- { path: 'booking.endDate' },
1374
- { path: 'booking.updatedDate' },
1375
- { path: 'booking.canceledDate' },
1328
+ { path: 'multiServiceBooking.bookings.booking.createdDate' },
1329
+ { path: 'multiServiceBooking.bookings.booking.startDate' },
1330
+ { path: 'multiServiceBooking.bookings.booking.endDate' },
1331
+ { path: 'multiServiceBooking.bookings.booking.updatedDate' },
1332
+ { path: 'multiServiceBooking.bookings.booking.canceledDate' },
1376
1333
  ],
1377
1334
  },
1378
1335
  {
1379
1336
  transformFn: float_2.transformRESTFloatToSDKFloat,
1380
1337
  paths: [
1381
- { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1382
- { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1338
+ {
1339
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
1340
+ },
1341
+ {
1342
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
1343
+ },
1383
1344
  ],
1384
1345
  },
1385
1346
  ]),
1386
1347
  };
1387
1348
  return metadata;
1388
1349
  }
1389
- return __bookingsCancelBooking;
1350
+ return __confirmMultiServiceBooking;
1390
1351
  }
1391
- exports.bookingsCancelBooking = bookingsCancelBooking;
1352
+ exports.confirmMultiServiceBooking = confirmMultiServiceBooking;
1392
1353
  /**
1393
- * Updates the number of participants for a class or course booking and changes
1394
- * the `totalNumberOfParticipants` for the relevant sessions.
1395
- *
1354
+ * Updates the status of a multi-service booking to `DECLINED`.
1396
1355
  *
1397
- * ## Appointment limitation
1398
1356
  *
1399
- * You can't update the number of participants for appointment bookings.
1357
+ * Also updates the status of each of individual bookings within the multi-service booking to `DECLINED`.
1400
1358
  *
1401
- * ## Participant information
1359
+ * The call fails if the status for at least a single individual booking can't be updated.
1402
1360
  *
1403
- * You must specify either `participantsChoices` or `totalParticipants`.
1404
- * The call fails if the specified `participantsChoices` aren't among the
1405
- * supported service options and variants
1406
- * ([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)).
1361
+ * See Decline Booking for more information.
1407
1362
  */
1408
- function bookingsUpdateNumberOfParticipants(payload) {
1409
- function __bookingsUpdateNumberOfParticipants({ host }) {
1363
+ function declineMultiServiceBooking(payload) {
1364
+ function __declineMultiServiceBooking({ host }) {
1410
1365
  const metadata = {
1411
1366
  entityFqdn: 'wix.bookings.v2.booking',
1412
1367
  method: 'POST',
1413
- methodFqn: 'com.wixpress.bookings.bookings.v2.Bookings.UpdateNumberOfParticipants',
1368
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.DeclineMultiServiceBooking',
1414
1369
  packageName: PACKAGE_NAME,
1415
- url: resolveComWixpressBookingsBookingsV2BookingsUrl({
1416
- protoPath: '/v2/bookings/{bookingId}/update_number_of_participants',
1370
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
1371
+ protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}/decline',
1417
1372
  data: payload,
1418
1373
  host,
1419
1374
  }),
@@ -1422,78 +1377,118 @@ function bookingsUpdateNumberOfParticipants(payload) {
1422
1377
  {
1423
1378
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1424
1379
  paths: [
1425
- { path: 'booking.createdDate' },
1426
- { path: 'booking.startDate' },
1427
- { path: 'booking.endDate' },
1428
- { path: 'booking.updatedDate' },
1429
- { path: 'booking.canceledDate' },
1380
+ { path: 'multiServiceBooking.bookings.booking.createdDate' },
1381
+ { path: 'multiServiceBooking.bookings.booking.startDate' },
1382
+ { path: 'multiServiceBooking.bookings.booking.endDate' },
1383
+ { path: 'multiServiceBooking.bookings.booking.updatedDate' },
1384
+ { path: 'multiServiceBooking.bookings.booking.canceledDate' },
1430
1385
  ],
1431
1386
  },
1432
1387
  {
1433
1388
  transformFn: float_2.transformRESTFloatToSDKFloat,
1434
1389
  paths: [
1435
- { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1436
- { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1390
+ {
1391
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
1392
+ },
1393
+ {
1394
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
1395
+ },
1437
1396
  ],
1438
1397
  },
1439
1398
  ]),
1440
1399
  };
1441
1400
  return metadata;
1442
1401
  }
1443
- return __bookingsUpdateNumberOfParticipants;
1402
+ return __declineMultiServiceBooking;
1444
1403
  }
1445
- exports.bookingsUpdateNumberOfParticipants = bookingsUpdateNumberOfParticipants;
1404
+ exports.declineMultiServiceBooking = declineMultiServiceBooking;
1405
+ /** Retrieves the allowed actions for a list of multi-service bookings. */
1406
+ function bulkGetMultiServiceBookingAllowedActions(payload) {
1407
+ function __bulkGetMultiServiceBookingAllowedActions({ host }) {
1408
+ const metadata = {
1409
+ entityFqdn: 'wix.bookings.v2.booking',
1410
+ method: 'POST',
1411
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.BulkGetMultiServiceBookingAllowedActions',
1412
+ packageName: PACKAGE_NAME,
1413
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
1414
+ protoPath: '/v2/bulk/multi_service_bookings/get_allowed_actions',
1415
+ data: payload,
1416
+ host,
1417
+ }),
1418
+ data: payload,
1419
+ };
1420
+ return metadata;
1421
+ }
1422
+ return __bulkGetMultiServiceBookingAllowedActions;
1423
+ }
1424
+ exports.bulkGetMultiServiceBookingAllowedActions = bulkGetMultiServiceBookingAllowedActions;
1446
1425
  /**
1447
- * Updates the booking `status` to `CONFIRMED`, `PENDING`, or `DECLINED` based
1448
- * on the `paymentStatus` you provide, double booking conflicts, and whether
1449
- * the service requires business approval.
1450
- *
1451
- * ## eCommerce checkout restriction
1452
- *
1453
- * Call this method only when using a custom checkout page. Don't
1454
- * call it when using a *Wix eCommerce checkout*
1455
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
1456
- * In such cases, Wix automatically updates the booking status based on
1457
- * the `paymentStatus` of the corresponding *Wix eCommerce order*
1458
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction)).
1459
- *
1460
- * ## New booking status
1461
- *
1462
- * The booking `status` is set to `DECLINED` if both of the following conditions
1463
- * are met:
1464
- * + You provide `UNDEFINED`, `NOT_PAID`, `REFUNDED`, or `EXEMPT` as payment status.
1465
- * + There is a double booking conflict.
1466
- *
1467
- * If only one or none of these conditions is met, `status` is set to `PENDING`
1468
- * or `CONFIRMED` depending on whether the service requires business approval.
1426
+ * Retrieves all single-service bookings belonging to a multi-service booking.
1469
1427
  *
1470
- * ## Double bookings
1471
1428
  *
1472
- * If there is a double booking conflict, but the booking has already been at least
1473
- * partially paid, the method still marks the booking as `PENDING` or `CONFIRMED`.
1474
- * Then, it also sets `doubleBooked` to `true`.
1429
+ * If you call as an [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
1430
+ * who has permissions to read only part of the bookings,
1431
+ * only the permitted bookings are retrieved. The returned total number of
1432
+ * bookings includes also the bookings for which you don't have permissions.
1433
+ */
1434
+ function getMultiServiceBooking(payload) {
1435
+ function __getMultiServiceBooking({ host }) {
1436
+ const metadata = {
1437
+ entityFqdn: 'wix.bookings.v2.booking',
1438
+ method: 'GET',
1439
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.GetMultiServiceBooking',
1440
+ packageName: PACKAGE_NAME,
1441
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
1442
+ protoPath: '/v2/multi_service_bookings/{multiServiceBookingId}',
1443
+ data: payload,
1444
+ host,
1445
+ }),
1446
+ params: (0, rest_modules_1.toURLSearchParams)(payload),
1447
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1448
+ {
1449
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1450
+ paths: [
1451
+ { path: 'multiServiceBooking.bookings.booking.createdDate' },
1452
+ { path: 'multiServiceBooking.bookings.booking.startDate' },
1453
+ { path: 'multiServiceBooking.bookings.booking.endDate' },
1454
+ { path: 'multiServiceBooking.bookings.booking.updatedDate' },
1455
+ { path: 'multiServiceBooking.bookings.booking.canceledDate' },
1456
+ ],
1457
+ },
1458
+ {
1459
+ transformFn: float_2.transformRESTFloatToSDKFloat,
1460
+ paths: [
1461
+ {
1462
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.latitude',
1463
+ },
1464
+ {
1465
+ path: 'multiServiceBooking.bookings.booking.contactDetails.fullAddress.geocode.longitude',
1466
+ },
1467
+ ],
1468
+ },
1469
+ ]),
1470
+ };
1471
+ return metadata;
1472
+ }
1473
+ return __getMultiServiceBooking;
1474
+ }
1475
+ exports.getMultiServiceBooking = getMultiServiceBooking;
1476
+ /**
1477
+ * Adds a list of single-service bookings to a multi-service booking.
1475
1478
  *
1476
- * ## Admin overwrites
1477
1479
  *
1478
- * There are small but important differences in confirmation behavior if the
1479
- * booking was created with special `flowControlSettings`:
1480
- * + If the booking's `flowControlSettings.skipAvailabilityValidation` was set to
1481
- * `true`, the booking is never declined regardless of double booking conflicts.
1482
- * Instead, it's marked `CONFIRMED` or `PENDING`, depending on whether the
1483
- * service requires business approval.
1484
- * + If the booking's `flowControlSettings.skipBusinessConfirmation` was set to
1485
- * `true`, the booking skips `PENDING` status and is marked `CONFIRMED`
1486
- * immediately.
1480
+ * The call fails, if at least 1 of the specified booking is already part of a
1481
+ * multi-service booking.
1487
1482
  */
1488
- function confirmOrDeclineBooking(payload) {
1489
- function __confirmOrDeclineBooking({ host }) {
1483
+ function addBookingsToMultiServiceBooking(payload) {
1484
+ function __addBookingsToMultiServiceBooking({ host }) {
1490
1485
  const metadata = {
1491
1486
  entityFqdn: 'wix.bookings.v2.booking',
1492
1487
  method: 'POST',
1493
- methodFqn: 'com.wixpress.bookings.confirmator.v2.Confirmator.ConfirmOrDeclineBooking',
1488
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.AddBookingsToMultiServiceBooking',
1494
1489
  packageName: PACKAGE_NAME,
1495
- url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
1496
- protoPath: '/v2/confirmation/{bookingId}:confirmOrDecline',
1490
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
1491
+ protoPath: '/v2/multi_service_bookings/add_bookings_to_multi_service_booking',
1497
1492
  data: payload,
1498
1493
  host,
1499
1494
  }),
@@ -1502,44 +1497,52 @@ function confirmOrDeclineBooking(payload) {
1502
1497
  {
1503
1498
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1504
1499
  paths: [
1505
- { path: 'booking.createdDate' },
1506
- { path: 'booking.startDate' },
1507
- { path: 'booking.endDate' },
1508
- { path: 'booking.updatedDate' },
1509
- { path: 'booking.canceledDate' },
1500
+ { path: 'bookings.booking.createdDate' },
1501
+ { path: 'bookings.booking.startDate' },
1502
+ { path: 'bookings.booking.endDate' },
1503
+ { path: 'bookings.booking.updatedDate' },
1504
+ { path: 'bookings.booking.canceledDate' },
1510
1505
  ],
1511
1506
  },
1512
1507
  {
1513
1508
  transformFn: float_2.transformRESTFloatToSDKFloat,
1514
1509
  paths: [
1515
- { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
1516
- { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
1510
+ {
1511
+ path: 'bookings.booking.contactDetails.fullAddress.geocode.latitude',
1512
+ },
1513
+ {
1514
+ path: 'bookings.booking.contactDetails.fullAddress.geocode.longitude',
1515
+ },
1517
1516
  ],
1518
1517
  },
1519
1518
  ]),
1520
1519
  };
1521
1520
  return metadata;
1522
1521
  }
1523
- return __confirmOrDeclineBooking;
1522
+ return __addBookingsToMultiServiceBooking;
1524
1523
  }
1525
- exports.confirmOrDeclineBooking = confirmOrDeclineBooking;
1524
+ exports.addBookingsToMultiServiceBooking = addBookingsToMultiServiceBooking;
1526
1525
  /**
1527
- * Confirms or declines up to 300 bookings.
1526
+ * Removes single-service bookings from a multi-service booking and returns the
1527
+ * removed bookings.
1528
1528
  *
1529
1529
  *
1530
- * See *Confirm Or Decline Booking*
1531
- * ([SDK](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/bookings/confirm-or-decline-booking) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/confirm-or-decline-booking))
1532
- * for details about when a booking is confirmed or declined.
1530
+ * If you specify an empty `bookings` array, all single-service bookings for which
1531
+ * the call's [identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities)
1532
+ * has read permissions are removed from the multi-service booking.
1533
+ *
1534
+ * If the call would create a multi-service booking including only 1 single-service
1535
+ * booking, the multi-service booking is also deleted.
1533
1536
  */
1534
- function bulkConfirmOrDeclineBooking(payload) {
1535
- function __bulkConfirmOrDeclineBooking({ host }) {
1537
+ function removeBookingsFromMultiServiceBooking(payload) {
1538
+ function __removeBookingsFromMultiServiceBooking({ host }) {
1536
1539
  const metadata = {
1537
1540
  entityFqdn: 'wix.bookings.v2.booking',
1538
1541
  method: 'POST',
1539
- methodFqn: 'com.wixpress.bookings.confirmator.v2.Confirmator.BulkConfirmOrDeclineBooking',
1542
+ methodFqn: 'com.wixpress.bookings.bookings.v2.MultiServiceBookings.RemoveBookingsFromMultiServiceBooking',
1540
1543
  packageName: PACKAGE_NAME,
1541
- url: resolveComWixpressBookingsConfirmatorV2ConfirmatorUrl({
1542
- protoPath: '/v2/bulk/bookings/confirmOrDecline',
1544
+ url: resolveComWixpressBookingsBookingsV2MultiServiceBookingsUrl({
1545
+ protoPath: '/v2/multi_service_bookings/remove_bookings_from_multi_service_booking',
1543
1546
  data: payload,
1544
1547
  host,
1545
1548
  }),
@@ -1548,21 +1551,21 @@ function bulkConfirmOrDeclineBooking(payload) {
1548
1551
  {
1549
1552
  transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1550
1553
  paths: [
1551
- { path: 'results.item.createdDate' },
1552
- { path: 'results.item.startDate' },
1553
- { path: 'results.item.endDate' },
1554
- { path: 'results.item.updatedDate' },
1555
- { path: 'results.item.canceledDate' },
1554
+ { path: 'bookings.booking.createdDate' },
1555
+ { path: 'bookings.booking.startDate' },
1556
+ { path: 'bookings.booking.endDate' },
1557
+ { path: 'bookings.booking.updatedDate' },
1558
+ { path: 'bookings.booking.canceledDate' },
1556
1559
  ],
1557
1560
  },
1558
1561
  {
1559
1562
  transformFn: float_2.transformRESTFloatToSDKFloat,
1560
1563
  paths: [
1561
1564
  {
1562
- path: 'results.item.contactDetails.fullAddress.geocode.latitude',
1565
+ path: 'bookings.booking.contactDetails.fullAddress.geocode.latitude',
1563
1566
  },
1564
1567
  {
1565
- path: 'results.item.contactDetails.fullAddress.geocode.longitude',
1568
+ path: 'bookings.booking.contactDetails.fullAddress.geocode.longitude',
1566
1569
  },
1567
1570
  ],
1568
1571
  },
@@ -1570,7 +1573,7 @@ function bulkConfirmOrDeclineBooking(payload) {
1570
1573
  };
1571
1574
  return metadata;
1572
1575
  }
1573
- return __bulkConfirmOrDeclineBooking;
1576
+ return __removeBookingsFromMultiServiceBooking;
1574
1577
  }
1575
- exports.bulkConfirmOrDeclineBooking = bulkConfirmOrDeclineBooking;
1578
+ exports.removeBookingsFromMultiServiceBooking = removeBookingsFromMultiServiceBooking;
1576
1579
  //# sourceMappingURL=bookings-v2-booking-bookings.http.js.map