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