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