@wix/bookings 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/build/cjs/index.d.ts +3 -0
  2. package/build/cjs/index.js +4 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/src/bookings-availability-v1-slot-availability.http.d.ts +6 -6
  5. package/build/cjs/src/bookings-availability-v1-slot-availability.http.js +6 -6
  6. package/build/cjs/src/bookings-availability-v1-slot-availability.universal.d.ts +14 -29
  7. package/build/cjs/src/bookings-availability-v1-slot-availability.universal.js +7 -6
  8. package/build/cjs/src/bookings-availability-v1-slot-availability.universal.js.map +1 -1
  9. package/build/cjs/src/bookings-reader-v2-extended-booking.http.d.ts +38 -0
  10. package/build/cjs/src/bookings-reader-v2-extended-booking.http.js +117 -0
  11. package/build/cjs/src/bookings-reader-v2-extended-booking.http.js.map +1 -0
  12. package/build/cjs/src/bookings-reader-v2-extended-booking.public.d.ts +5 -0
  13. package/build/cjs/src/bookings-reader-v2-extended-booking.public.js +22 -0
  14. package/build/cjs/src/bookings-reader-v2-extended-booking.public.js.map +1 -0
  15. package/build/cjs/src/bookings-reader-v2-extended-booking.types.d.ts +730 -0
  16. package/build/cjs/src/bookings-reader-v2-extended-booking.types.js +90 -0
  17. package/build/cjs/src/bookings-reader-v2-extended-booking.types.js.map +1 -0
  18. package/build/cjs/src/bookings-reader-v2-extended-booking.universal.d.ts +786 -0
  19. package/build/cjs/src/bookings-reader-v2-extended-booking.universal.js +226 -0
  20. package/build/cjs/src/bookings-reader-v2-extended-booking.universal.js.map +1 -0
  21. package/build/cjs/src/bookings-v2-booking.http.d.ts +123 -0
  22. package/build/cjs/src/bookings-v2-booking.http.js +305 -0
  23. package/build/cjs/src/bookings-v2-booking.http.js.map +1 -0
  24. package/build/cjs/src/bookings-v2-booking.public.d.ts +9 -0
  25. package/build/cjs/src/bookings-v2-booking.public.js +47 -0
  26. package/build/cjs/src/bookings-v2-booking.public.js.map +1 -0
  27. package/build/cjs/src/bookings-v2-booking.types.d.ts +1594 -0
  28. package/build/cjs/src/bookings-v2-booking.types.js +99 -0
  29. package/build/cjs/src/bookings-v2-booking.types.js.map +1 -0
  30. package/build/cjs/src/bookings-v2-booking.universal.d.ts +1840 -0
  31. package/build/cjs/src/bookings-v2-booking.universal.js +561 -0
  32. package/build/cjs/src/bookings-v2-booking.universal.js.map +1 -0
  33. package/build/cjs/src/bookings-v2-price-info.http.d.ts +56 -0
  34. package/build/cjs/src/bookings-v2-price-info.http.js +164 -0
  35. package/build/cjs/src/bookings-v2-price-info.http.js.map +1 -0
  36. package/build/cjs/src/bookings-v2-price-info.public.d.ts +6 -0
  37. package/build/cjs/src/bookings-v2-price-info.public.js +26 -0
  38. package/build/cjs/src/bookings-v2-price-info.public.js.map +1 -0
  39. package/build/cjs/src/bookings-v2-price-info.types.d.ts +594 -0
  40. package/build/cjs/src/bookings-v2-price-info.types.js +79 -0
  41. package/build/cjs/src/bookings-v2-price-info.types.js.map +1 -0
  42. package/build/cjs/src/bookings-v2-price-info.universal.d.ts +664 -0
  43. package/build/cjs/src/bookings-v2-price-info.universal.js +274 -0
  44. package/build/cjs/src/bookings-v2-price-info.universal.js.map +1 -0
  45. package/build/es/index.d.ts +3 -0
  46. package/build/es/index.js +3 -0
  47. package/build/es/index.js.map +1 -1
  48. package/build/es/src/bookings-availability-v1-slot-availability.http.d.ts +6 -6
  49. package/build/es/src/bookings-availability-v1-slot-availability.http.js +6 -6
  50. package/build/es/src/bookings-availability-v1-slot-availability.universal.d.ts +14 -29
  51. package/build/es/src/bookings-availability-v1-slot-availability.universal.js +7 -6
  52. package/build/es/src/bookings-availability-v1-slot-availability.universal.js.map +1 -1
  53. package/build/es/src/bookings-reader-v2-extended-booking.http.d.ts +38 -0
  54. package/build/es/src/bookings-reader-v2-extended-booking.http.js +113 -0
  55. package/build/es/src/bookings-reader-v2-extended-booking.http.js.map +1 -0
  56. package/build/es/src/bookings-reader-v2-extended-booking.public.d.ts +5 -0
  57. package/build/es/src/bookings-reader-v2-extended-booking.public.js +8 -0
  58. package/build/es/src/bookings-reader-v2-extended-booking.public.js.map +1 -0
  59. package/build/es/src/bookings-reader-v2-extended-booking.types.d.ts +730 -0
  60. package/build/es/src/bookings-reader-v2-extended-booking.types.js +87 -0
  61. package/build/es/src/bookings-reader-v2-extended-booking.types.js.map +1 -0
  62. package/build/es/src/bookings-reader-v2-extended-booking.universal.d.ts +786 -0
  63. package/build/es/src/bookings-reader-v2-extended-booking.universal.js +203 -0
  64. package/build/es/src/bookings-reader-v2-extended-booking.universal.js.map +1 -0
  65. package/build/es/src/bookings-v2-booking.http.d.ts +123 -0
  66. package/build/es/src/bookings-v2-booking.http.js +297 -0
  67. package/build/es/src/bookings-v2-booking.http.js.map +1 -0
  68. package/build/es/src/bookings-v2-booking.public.d.ts +9 -0
  69. package/build/es/src/bookings-v2-booking.public.js +28 -0
  70. package/build/es/src/bookings-v2-booking.public.js.map +1 -0
  71. package/build/es/src/bookings-v2-booking.types.d.ts +1594 -0
  72. package/build/es/src/bookings-v2-booking.types.js +96 -0
  73. package/build/es/src/bookings-v2-booking.types.js.map +1 -0
  74. package/build/es/src/bookings-v2-booking.universal.d.ts +1840 -0
  75. package/build/es/src/bookings-v2-booking.universal.js +534 -0
  76. package/build/es/src/bookings-v2-booking.universal.js.map +1 -0
  77. package/build/es/src/bookings-v2-price-info.http.d.ts +56 -0
  78. package/build/es/src/bookings-v2-price-info.http.js +159 -0
  79. package/build/es/src/bookings-v2-price-info.http.js.map +1 -0
  80. package/build/es/src/bookings-v2-price-info.public.d.ts +6 -0
  81. package/build/es/src/bookings-v2-price-info.public.js +13 -0
  82. package/build/es/src/bookings-v2-price-info.public.js.map +1 -0
  83. package/build/es/src/bookings-v2-price-info.types.d.ts +594 -0
  84. package/build/es/src/bookings-v2-price-info.types.js +76 -0
  85. package/build/es/src/bookings-v2-price-info.types.js.map +1 -0
  86. package/build/es/src/bookings-v2-price-info.universal.d.ts +664 -0
  87. package/build/es/src/bookings-v2-price-info.universal.js +250 -0
  88. package/build/es/src/bookings-v2-price-info.universal.js.map +1 -0
  89. package/package.json +2 -2
@@ -0,0 +1,1840 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ /** The booking object, version 2. */
8
+ export interface Booking extends BookingParticipantsInfoOneOf {
9
+ /**
10
+ * Booking ID.
11
+ * @readonly
12
+ */
13
+ _id?: string | null;
14
+ /** An object describing the slot or schedule that was booked. */
15
+ bookedEntity?: BookedEntity;
16
+ /** Contact details of the site visitor or member making the booking. */
17
+ contactDetails?: ContactDetails;
18
+ /** Additional custom fields submitted with the booking form. */
19
+ additionalFields?: CustomFormField[];
20
+ /**
21
+ * Booking status.
22
+ * One of:
23
+ * - `"CREATED"` - The booking was created.
24
+ * - `"UPDATED"` - The booking was updated.
25
+ * - `"CONFIRMED"` - The booking has been confirmed and appears on the bookings calendar.
26
+ * Booking can be automatically confirmed when the following requirements are met:
27
+ * + The service is configured as automatically confirmed.
28
+ * + Invoking eCommerce checkout API and an order has been created.
29
+ * - `"CANCELED"` - The booking has been canceled and synced to bookings calendar.
30
+ * The booking can be canceled using cancel cancelBooking().
31
+ * - `"PENDING"` - The booking waiting to be confirmed or declined buy the owner and is synced to bookings calendar.
32
+ * Booking can be automatically set as pending when the following requirements are met:
33
+ * + The Service is configured as manually confirmed.
34
+ * + Invoking the eCommerce checkout API and an order has been created.
35
+ * - `"WAITING_LIST"` - The booking is pending on a waiting list.
36
+ * - `"DECLINED"` - The booking was declined by the owner and synced to bookings calendar.
37
+ * Booking can be manually declined using declineBooking() and requires manage booking permissions.
38
+ * Booking can be automatically declined when the following requirements are met:
39
+ * + Invoking eCommerce checkout API and the order declined event has been sent.
40
+ * + Invoking eCommerce checkout API and order approved event has been sent, but the booking is offline and the booking causes a double booking.
41
+ */
42
+ status?: BookingStatus;
43
+ /**
44
+ * Payment status.
45
+ * One of:
46
+ * - `"NOT_PAID"` The booking is not paid for.
47
+ * - `"PAID"` The booking is fully paid.
48
+ * - `"PARTIALLY_PAID"` The booking is partially paid.
49
+ * - `"REFUNDED"` The booking is refunded.
50
+ * @readonly
51
+ */
52
+ paymentStatus?: PaymentStatus;
53
+ /**
54
+ * Selected payment option.
55
+ * One of the payment options offered by the service, or another option if `skipSelectedPaymentOptionValidation` is `true`.
56
+ * When undefined, the payment option is resolved by the service configuration on checkout.
57
+ */
58
+ selectedPaymentOption?: SelectedPaymentOption;
59
+ /**
60
+ * Date and time the booking was created.
61
+ * @readonly
62
+ */
63
+ _createdDate?: Date;
64
+ /** External ID provided by the client app on creation. */
65
+ externalUserId?: string | null;
66
+ /** Revision number to be used when updating, rescheduling, or cancelling the booking. The revision number is automatically incremented when the booing is updated. */
67
+ revision?: string | null;
68
+ /**
69
+ * ID of the creator of the Booking
70
+ * If `appId` and another ID are present, the other ID takes precedence.
71
+ * @readonly
72
+ */
73
+ createdBy?: CommonIdentificationData;
74
+ /**
75
+ * The start date of this booking. For a slot, this is the start date of the slot. For a schedule, the start date of the first session.
76
+ * @readonly
77
+ */
78
+ startDate?: Date;
79
+ /**
80
+ * The end date of this booking. For a slot, this is the end date of the slot. For a schedule, the end date of the last session.
81
+ * @readonly
82
+ */
83
+ endDate?: Date;
84
+ /**
85
+ * Date and time the booking was updated.
86
+ * @readonly
87
+ */
88
+ _updatedDate?: Date;
89
+ /**
90
+ * Additional custom fields. This includes fields managed by Wix, by 3rd-party apps, and by the site.
91
+ *
92
+ * Empty fields are not returned.
93
+ */
94
+ extendedFields?: ExtendedFields;
95
+ /**
96
+ * Indicating if this booking overlaps another existing confirmed booking
97
+ * @readonly
98
+ */
99
+ doubleBooked?: boolean | null;
100
+ /** Total number of participants. Available only when the booking includes a single service variant. */
101
+ totalParticipants?: number;
102
+ /**
103
+ * Information about the booked service choices and participants.
104
+ * Available only when the booking includes multiple service variants.
105
+ */
106
+ participantsChoices?: ParticipantChoices;
107
+ }
108
+ /** @oneof */
109
+ export interface BookingParticipantsInfoOneOf {
110
+ /** Total number of participants. Available only when the booking includes a single service variant. */
111
+ totalParticipants?: number;
112
+ /**
113
+ * Information about the booked service choices and participants.
114
+ * Available only when the booking includes multiple service variants.
115
+ */
116
+ participantsChoices?: ParticipantChoices;
117
+ }
118
+ export interface BookedEntity extends BookedEntityItemOneOf {
119
+ /** Session title at the time of booking. */
120
+ title?: string | null;
121
+ /**
122
+ * List of tags for the booking.
123
+ * System-assigned tags for sessions and schedules are:
124
+ * + "INDIVIDUAL" Appointments, including appointments with more than 1 participant.
125
+ * + "GROUP" Individual classes.
126
+ * + "COURSE" Courses.
127
+ */
128
+ tags?: string[] | null;
129
+ /** The booked slot, which once booked becomes a session. The booking is automatically assigned to the session if given, or a session is be created if one doesn't already exist. */
130
+ slot?: BookedSlot;
131
+ /** The booked schedule. The booking is automatically assigned to the schedule's sessions. */
132
+ schedule?: BookedSchedule;
133
+ }
134
+ /** @oneof */
135
+ export interface BookedEntityItemOneOf {
136
+ /** The booked slot, which once booked becomes a session. The booking is automatically assigned to the session if given, or a session is be created if one doesn't already exist. */
137
+ slot?: BookedSlot;
138
+ /** The booked schedule. The booking is automatically assigned to the schedule's sessions. */
139
+ schedule?: BookedSchedule;
140
+ }
141
+ export interface BookedSlot {
142
+ /**
143
+ * ID of the underlying session when session is a single session or generated from a recurring session.
144
+ * If `sessionId` is defined in the Create Booking request, the `startDate`, `endDate`, timezone, resource, and location fields from the request are ignored and populated from the session's information.
145
+ */
146
+ sessionId?: string | null;
147
+ /** Service ID. */
148
+ serviceId?: string;
149
+ /** Schedule ID. Required. */
150
+ scheduleId?: string;
151
+ /**
152
+ * The start time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
153
+ * format. Required.
154
+ */
155
+ startDate?: string | null;
156
+ /**
157
+ * The end time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
158
+ * format. Required.
159
+ */
160
+ endDate?: string | null;
161
+ /** The timezone according to which the slot was shown to the user when booking, and should be shown in future. */
162
+ timezone?: string | null;
163
+ /** The resource used on the slot. */
164
+ resource?: BookedResource;
165
+ /** Location where the slot's session takes place. */
166
+ location?: Location;
167
+ }
168
+ export interface BookedResource {
169
+ /** Booked resource ID. */
170
+ _id?: string;
171
+ /** Resource's name at the time of booking. */
172
+ name?: string | null;
173
+ /** Resource's email at the time of booking. */
174
+ email?: string | null;
175
+ /** Resources schedule ID. */
176
+ scheduleId?: string | null;
177
+ }
178
+ export interface Location {
179
+ /**
180
+ * Business location ID. Available only for locations that are business locations,
181
+ * meaning the `location_type` is `"OWNER_BUSINESS"`.
182
+ */
183
+ _id?: string | null;
184
+ /** Location name. */
185
+ name?: string | null;
186
+ /** The full address of this location. */
187
+ formattedAddress?: string | null;
188
+ /**
189
+ * Location type.
190
+ *
191
+ * - `"OWNER_BUSINESS"`: The business address, as set in the site’s general settings.
192
+ * - `"OWNER_CUSTOM"`: The address as set when creating the service.
193
+ * - `"CUSTOM"`: The address as set for the individual session.
194
+ */
195
+ locationType?: LocationType;
196
+ }
197
+ export declare enum LocationType {
198
+ UNDEFINED = "UNDEFINED",
199
+ OWNER_BUSINESS = "OWNER_BUSINESS",
200
+ OWNER_CUSTOM = "OWNER_CUSTOM",
201
+ CUSTOM = "CUSTOM"
202
+ }
203
+ export interface BookedSchedule {
204
+ /** Schedule ID. */
205
+ scheduleId?: string;
206
+ /** ID of the booked service. */
207
+ serviceId?: string | null;
208
+ /**
209
+ * Location where the schedule's sessions take place. Read only.
210
+ * @readonly
211
+ */
212
+ location?: Location;
213
+ /** The timezone according to which the slot was shown to the user when booking, and should be shown in future. */
214
+ timezone?: string | null;
215
+ /**
216
+ * The start time of the first session in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
217
+ * format. Required.
218
+ * @readonly
219
+ */
220
+ firstSessionStart?: string | null;
221
+ /**
222
+ * The end time of the last session in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
223
+ * format. Required.
224
+ * @readonly
225
+ */
226
+ lastSessionEnd?: string | null;
227
+ }
228
+ export interface ContactDetails {
229
+ /** Contact's ID. */
230
+ contactId?: string | null;
231
+ /** Contact's first name. When populated from a standard booking form, this property corresponds to the **Name** field. */
232
+ firstName?: string | null;
233
+ /** Contact's last name. */
234
+ lastName?: string | null;
235
+ /** Contact's email, used to create a new contact or get existing one from the [Contacts API](https://www.wix.com/velo/reference/wix-crm/contacts/introduction). Used to validate coupon usage limitations per contact. If not passed, the coupon usage limitation will not be enforced. (Coupon usage limitation validation is not supported yet). */
236
+ email?: string | null;
237
+ /** Contact's phone number. */
238
+ phone?: string | null;
239
+ /** Contact's full address. */
240
+ fullAddress?: Address;
241
+ /** Contact's time zone. */
242
+ timeZone?: string | null;
243
+ /** Contact's country in [ISO 3166-1 alpha-2 code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. */
244
+ countryCode?: string | null;
245
+ }
246
+ /** Physical address */
247
+ export interface Address extends AddressStreetOneOf {
248
+ /** Country code. */
249
+ country?: string | null;
250
+ /** Subdivision. Usually state, region, prefecture or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */
251
+ subdivision?: string | null;
252
+ /** City name. */
253
+ city?: string | null;
254
+ /** Zip/postal code. */
255
+ postalCode?: string | null;
256
+ /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */
257
+ addressLine2?: string | null;
258
+ /** A string containing the full address of this location. */
259
+ formattedAddress?: string | null;
260
+ /** Free text to help find the address. */
261
+ hint?: string | null;
262
+ /** Coordinates of the physical address. */
263
+ geocode?: AddressLocation;
264
+ /** Country full name. */
265
+ countryFullname?: string | null;
266
+ /** Multi-level subdivisions from top to bottom. */
267
+ subdivisions?: Subdivision[];
268
+ /** Street name, number and apartment number. */
269
+ streetAddress?: StreetAddress;
270
+ /** Main address line, usually street and number, as free text. */
271
+ addressLine?: string | null;
272
+ }
273
+ /** @oneof */
274
+ export interface AddressStreetOneOf {
275
+ /** Street name, number and apartment number. */
276
+ streetAddress?: StreetAddress;
277
+ /** Main address line, usually street and number, as free text. */
278
+ addressLine?: string | null;
279
+ }
280
+ export interface StreetAddress {
281
+ /** Street number. */
282
+ number?: string;
283
+ /** Street name. */
284
+ name?: string;
285
+ /** Apartment number. */
286
+ apt?: string;
287
+ }
288
+ export interface AddressLocation {
289
+ /** Address latitude. */
290
+ latitude?: number | null;
291
+ /** Address longitude. */
292
+ longitude?: number | null;
293
+ }
294
+ export interface Subdivision {
295
+ /** Subdivision code. Usually state, region, prefecture or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */
296
+ code?: string;
297
+ /** Subdivision full name. */
298
+ name?: string;
299
+ }
300
+ export interface CustomFormField {
301
+ /** ID of the form field as defined in the form. */
302
+ _id?: string;
303
+ /** Value that was submitted for this field. */
304
+ value?: string | null;
305
+ /**
306
+ * Form field's label at the time of submission.
307
+ * @readonly
308
+ */
309
+ label?: string | null;
310
+ /**
311
+ * One of:
312
+ * - `"SHORT_TEXT"`
313
+ * - `"LONG_TEXT"`
314
+ * - `"CHECK_BOX"`
315
+ */
316
+ valueType?: ValueType;
317
+ }
318
+ export declare enum ValueType {
319
+ /** Short text. This is the default value type. */
320
+ SHORT_TEXT = "SHORT_TEXT",
321
+ /** Long text */
322
+ LONG_TEXT = "LONG_TEXT",
323
+ /** a text that represent the check box value: if selected the value is "true", otherwise "false". */
324
+ CHECK_BOX = "CHECK_BOX"
325
+ }
326
+ /** Booking status. */
327
+ export declare enum BookingStatus {
328
+ CREATED = "CREATED",
329
+ CONFIRMED = "CONFIRMED",
330
+ CANCELED = "CANCELED",
331
+ PENDING = "PENDING",
332
+ DECLINED = "DECLINED",
333
+ WAITING_LIST = "WAITING_LIST"
334
+ }
335
+ /**
336
+ * Payment status.
337
+ * Automatically updated when using eCom checkout APIs.
338
+ */
339
+ export declare enum PaymentStatus {
340
+ UNDEFINED = "UNDEFINED",
341
+ NOT_PAID = "NOT_PAID",
342
+ PAID = "PAID",
343
+ /** not supported yet. */
344
+ PARTIALLY_PAID = "PARTIALLY_PAID",
345
+ /** not supported yet */
346
+ REFUNDED = "REFUNDED"
347
+ }
348
+ /**
349
+ * The selected payment option.
350
+ * One of the payment options offered by the service.
351
+ * This field is be set when the user selects an option during booking.
352
+ * If left undefined, the payment option is resolved by the service configuration on checkout.
353
+ */
354
+ export declare enum SelectedPaymentOption {
355
+ UNDEFINED = "UNDEFINED",
356
+ OFFLINE = "OFFLINE",
357
+ ONLINE = "ONLINE",
358
+ MEMBERSHIP = "MEMBERSHIP",
359
+ /** Payment can only be done using a membership and must be manually redeemed in the dashboard by the site owner. */
360
+ MEMBERSHIP_OFFLINE = "MEMBERSHIP_OFFLINE"
361
+ }
362
+ export interface BookingSource {
363
+ /**
364
+ * Platform from which a booking was created
365
+ * <!--ONLY:VELO
366
+ * One of:
367
+ * - `"WEB"` Desktop browser.
368
+ * - `"MOBILE_APP"` Mobile application.
369
+ * <!--END:ONLY:VELO-->
370
+ */
371
+ platform?: Platform;
372
+ /**
373
+ * Actor that created this booking.
374
+ * <!--ONLY:VELO
375
+ * One of:
376
+ * - `"BUSINESS"`
377
+ * - `"CUSTOMER"`
378
+ * <!--END:ONLY:VELO-->
379
+ */
380
+ actor?: Actor;
381
+ /**
382
+ * Wix site ID of the application that created the booking.
383
+ * @readonly
384
+ */
385
+ appDefId?: string | null;
386
+ /**
387
+ * Name of the application that created the booking, as saved in Wix Developers Center at the time of booking.
388
+ * @readonly
389
+ */
390
+ appName?: string | null;
391
+ }
392
+ export declare enum Platform {
393
+ UNDEFINED_PLATFORM = "UNDEFINED_PLATFORM",
394
+ WEB = "WEB",
395
+ MOBILE_APP = "MOBILE_APP"
396
+ }
397
+ export declare enum Actor {
398
+ UNDEFINED_ACTOR = "UNDEFINED_ACTOR",
399
+ BUSINESS = "BUSINESS",
400
+ CUSTOMER = "CUSTOMER"
401
+ }
402
+ export interface ParticipantNotification {
403
+ /**
404
+ * Whether to send the message about the changes to the customer.
405
+ *
406
+ * Default: `false`
407
+ */
408
+ notifyParticipants?: boolean;
409
+ /** Custom message to send to the participants about the changes to the booking. */
410
+ message?: string | null;
411
+ }
412
+ export interface CommonIdentificationData extends CommonIdentificationDataIdOneOf {
413
+ /**
414
+ * ID of of a contact in the site's [CRM by Ascend](https://www.wix.com/ascend/crm) system.
415
+ * @readonly
416
+ */
417
+ contactId?: string | null;
418
+ /** ID of a site visitor that has not logged in to the site. */
419
+ anonymousVisitorId?: string;
420
+ /** ID of a site visitor that has logged in to the site. */
421
+ memberId?: string;
422
+ /** ID of a Wix user (site owner, contributor, etc.). */
423
+ wixUserId?: string;
424
+ /** ID of an app. */
425
+ appId?: string;
426
+ }
427
+ /** @oneof */
428
+ export interface CommonIdentificationDataIdOneOf {
429
+ /** ID of a site visitor that has not logged in to the site. */
430
+ anonymousVisitorId?: string;
431
+ /** ID of a site visitor that has logged in to the site. */
432
+ memberId?: string;
433
+ /** ID of a Wix user (site owner, contributor, etc.). */
434
+ wixUserId?: string;
435
+ /** ID of an app. */
436
+ appId?: string;
437
+ }
438
+ export declare enum IdentificationDataIdentityType {
439
+ UNKNOWN = "UNKNOWN",
440
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
441
+ MEMBER = "MEMBER",
442
+ WIX_USER = "WIX_USER",
443
+ APP = "APP"
444
+ }
445
+ export interface FlowControlSettings {
446
+ /**
447
+ * When true, skips availability checking and allows booking.
448
+ * Requires BOOKINGS.OVERRIDE_AVAILABILITY permissions.
449
+ */
450
+ skipAvailabilityValidation?: boolean;
451
+ /**
452
+ * When true, allows booking a confirmation-required service without requiring confirmation.
453
+ * Requires BOOKINGS.IGNORE_BOOKING_POLICY permissions.
454
+ */
455
+ skipBusinessConfirmation?: boolean;
456
+ /**
457
+ * When true, skips selected payment option checking as defined in `selectedPaymentOption` field
458
+ * and allows booking.
459
+ * Requires BOOKINGS.MANAGE_PAYMENTS permissions.
460
+ */
461
+ skipSelectedPaymentOptionValidation?: boolean;
462
+ /** When true, refunds the booking's payment when the booking is canceled. */
463
+ withRefund?: boolean | null;
464
+ }
465
+ export interface ExtendedFields {
466
+ /**
467
+ * Data Extensions extended fields
468
+ * Key: Namespace
469
+ * Value: extended fields data in Struct format
470
+ */
471
+ namespaces?: Record<string, Record<string, any>>;
472
+ }
473
+ export interface ParticipantChoices {
474
+ /** Information about the booked service choices. Includes the number of participants. */
475
+ serviceChoices?: ServiceChoices[];
476
+ }
477
+ export interface ServiceChoices {
478
+ /** Number of participants for this variant. */
479
+ numberOfParticipants?: number | null;
480
+ /** Service choices for these participants. */
481
+ choices?: ServiceChoice[];
482
+ }
483
+ export interface ServiceChoice extends ServiceChoiceChoiceOneOf {
484
+ /**
485
+ * ID of the corresponding option for the choice. For example, the choice `child`
486
+ * could correspond to the option `ageGroup`. In this case, `optionId` is the ID
487
+ * for the `ageGroup` option.
488
+ */
489
+ optionId?: string;
490
+ /**
491
+ * Value for one of the choices in the `CustomServiceOption.choices` list.
492
+ * Choices are specific values for an option the customer can choose to book. For example,
493
+ * the option `ageGroup` may have these choices: `child`, `student`, `adult`, and `senior`.
494
+ * Each choice may have a different price.
495
+ */
496
+ custom?: string;
497
+ }
498
+ /** @oneof */
499
+ export interface ServiceChoiceChoiceOneOf {
500
+ /**
501
+ * Value for one of the choices in the [`CustomServiceOption.choices`](https://example.com) list.
502
+ * Choices are specific values for an option the customer can choose to book. For example,
503
+ * the option `ageGroup` may have these choices: `child`, `student`, `adult`, and `senior`.
504
+ * Each choice may have a different price.
505
+ */
506
+ custom?: string;
507
+ }
508
+ export interface BookingChanged {
509
+ /** The booking before the changes. */
510
+ previousBooking?: Booking;
511
+ /** The booking after the changes. */
512
+ currentBooking?: Booking;
513
+ }
514
+ export interface CreateBookingRequest {
515
+ /** The booking to create. */
516
+ booking?: Booking;
517
+ /** Information about a message to send to the customer. */
518
+ participantNotification?: ParticipantNotification;
519
+ /**
520
+ * Whether to send an SMS reminder to the customer 24 hours before the
521
+ * session starts. The phone number is taken from `contactDetails.phone`.
522
+ * Default: `true`.
523
+ */
524
+ sendSmsReminder?: boolean | null;
525
+ /**
526
+ * Information about whether specific procedures of the standard Wix Bookings
527
+ * creation flow are changed. For example, whether the availability is
528
+ * checked before creating the booking or if additional payment options are
529
+ * accepted.
530
+ */
531
+ flowControlSettings?: CreateBookingFlowControlSettings;
532
+ }
533
+ export interface CreateBookingFlowControlSettings {
534
+ /**
535
+ * Whether the availability is checked before creating the booking. When
536
+ * passing `false` a booking is only created when the slot or schedule is
537
+ * available. Your app must have the `BOOKINGS.OVERRIDE_AVAILABILITY`
538
+ * permission scope when passing `true`.
539
+ * Default: `false`.
540
+ */
541
+ skipAvailabilityValidation?: boolean;
542
+ /**
543
+ * Whether `PENDING` bookings are automatically set to `CONFIRMED` for
544
+ * services that normally require the owner's manual confirmation. Your
545
+ * app must have the `BOOKINGS.OVERRIDE_AVAILABILITY` permission scope
546
+ * when passing `true`.
547
+ * Default: `false`.
548
+ */
549
+ skipBusinessConfirmation?: boolean;
550
+ /**
551
+ * Whether customers can pay using a payment method that isn't supported
552
+ * for the service, but that's supported for other services. Your app
553
+ * must have the `BOOKINGS.MANAGE_PAYMENTS` permission scope when passing
554
+ * `true`.
555
+ * Default: `false`.
556
+ */
557
+ skipSelectedPaymentOptionValidation?: boolean;
558
+ }
559
+ export interface CreateBookingResponse {
560
+ /** Created booking. */
561
+ booking?: Booking;
562
+ }
563
+ /**
564
+ * The fieldMask should not include both the "numberOfParticipants" and "participantsInfo" paths, doing so will result
565
+ * in an error. "participantsInfo" should be preferred over "numberOfParticipants"
566
+ */
567
+ export interface UpdateBookingRequest {
568
+ booking?: Booking;
569
+ mask?: string[];
570
+ }
571
+ export interface UpdateBookingResponse {
572
+ booking?: Booking;
573
+ }
574
+ export interface LegacyCreateBookingRequest {
575
+ booking?: Booking;
576
+ }
577
+ export interface LegacyCreateBookingResponse {
578
+ booking?: Booking;
579
+ }
580
+ /**
581
+ * The fieldMask for each booking should not include both the "numberOfParticipants" and "participantsInfo" paths, doing so will result
582
+ * in an error. "participantsInfo" should be preferred over "numberOfParticipants"
583
+ */
584
+ export interface BulkUpdateBookingRequest {
585
+ bookings?: MaskedBooking[];
586
+ }
587
+ export interface MaskedBooking {
588
+ booking?: Booking;
589
+ mask?: string[];
590
+ }
591
+ export interface BulkUpdateBookingResponse {
592
+ results?: ItemMetadata[];
593
+ bulkActionMetadata?: BulkActionMetadata;
594
+ }
595
+ export interface ItemMetadata {
596
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
597
+ _id?: string | null;
598
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
599
+ originalIndex?: number;
600
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
601
+ success?: boolean;
602
+ /** Details about the error in case of failure. */
603
+ error?: ApplicationError;
604
+ }
605
+ export interface ApplicationError {
606
+ /** Error code. */
607
+ code?: string;
608
+ /** Description of the error. */
609
+ description?: string;
610
+ /** Data related to the error. */
611
+ data?: Record<string, any> | null;
612
+ }
613
+ export interface BulkActionMetadata {
614
+ /** Number of items that were successfully processed. */
615
+ totalSuccesses?: number;
616
+ /** Number of items that couldn't be processed. */
617
+ totalFailures?: number;
618
+ /** Number of failures without details because detailed failure threshold was exceeded. */
619
+ undetailedFailures?: number;
620
+ }
621
+ export interface BulkCreateBookingRequest {
622
+ /**
623
+ * Bookings to create.
624
+ * Max: 8 bookings.
625
+ */
626
+ createBookingsInfo?: CreateBookingInfo[];
627
+ /** Whether to return the created bookings entities. */
628
+ returnFullEntity?: boolean;
629
+ }
630
+ export interface CreateBookingInfo {
631
+ /** The booking to create */
632
+ booking?: Booking;
633
+ /** Information about a message to send to the customer. */
634
+ participantNotification?: ParticipantNotification;
635
+ /**
636
+ * Whether to send an SMS reminder to the customer 24 hours before the
637
+ * session starts. The phone number is taken from `contactDetails.phone`.
638
+ * Default: `true`.
639
+ */
640
+ sendSmsReminder?: boolean | null;
641
+ /**
642
+ * Information about whether specific procedures of the standard Wix Bookings
643
+ * creation flow are changed. For example, whether the availability is
644
+ * checked before creating the booking or if additional payment options are
645
+ * accepted.
646
+ */
647
+ flowControlSettings?: CreateBookingFlowControlSettings;
648
+ }
649
+ export interface BulkCreateBookingResponse {
650
+ /**
651
+ * Bulk create booking results.
652
+ * For each booking includes whether its creation succeeded along with proper error if such occurred, and the created booking entity if `returnFullEntity` was passed as true.
653
+ */
654
+ results?: BulkBookingResult[];
655
+ /** Total successes and failures of the bulk create booking action. */
656
+ bulkActionMetadata?: BulkActionMetadata;
657
+ }
658
+ export interface BulkBookingResult {
659
+ itemMetadata?: ItemMetadata;
660
+ item?: Booking;
661
+ }
662
+ export interface RescheduleBookingRequest extends RescheduleBookingRequestParticipantsInfoOneOf {
663
+ /** Id of the booking to reschedule. */
664
+ bookingId: string;
665
+ /** Information about the new slot. */
666
+ slot: V2Slot;
667
+ /**
668
+ * Revision number, which increments by 1 each time the booking is updated.
669
+ * To prevent conflicting changes, the current revision must be passed when
670
+ * managing the booking.
671
+ */
672
+ revision: string | null;
673
+ /**
674
+ * Information about whether to notify the customer about the rescheduling and
675
+ * the message to send.
676
+ */
677
+ participantNotification?: ParticipantNotification;
678
+ /**
679
+ * Information about whether specific procedures of the standard Wix Bookings
680
+ * rescheduling flow are changed. For example, whether the availability of
681
+ * the new slot is checked before rescheduling the booking or if you can
682
+ * reschedule the booking even though the rescheduling policy doesn't allow it.
683
+ */
684
+ flowControlSettings?: RescheduleBookingRequestFlowControlSettings;
685
+ /**
686
+ * Total number of participants. Available only for services with
687
+ * variants.
688
+ * Pass when all participants book the same variant.
689
+ */
690
+ totalParticipants?: number;
691
+ /**
692
+ * Information about the service choices to book. Available only for services with
693
+ * variants.
694
+ * Pass when not all participants book the same variant.
695
+ */
696
+ participantsChoices?: ParticipantChoices;
697
+ }
698
+ /** @oneof */
699
+ export interface RescheduleBookingRequestParticipantsInfoOneOf {
700
+ /**
701
+ * Total number of participants. Available only for services with
702
+ * variants.
703
+ * Pass when all participants book the same variant.
704
+ */
705
+ totalParticipants?: number;
706
+ /**
707
+ * Information about the service choices to book. Available only for services with
708
+ * variants.
709
+ * Pass when not all participants book the same variant.
710
+ */
711
+ participantsChoices?: ParticipantChoices;
712
+ }
713
+ export interface V2Slot {
714
+ /** Identifier for underlying session when session is a single session or generated from a recurring session. Required. */
715
+ sessionId?: string | null;
716
+ /** Service identifier. Required. */
717
+ serviceId?: string;
718
+ /** Schedule identifier. Required. */
719
+ scheduleId?: string;
720
+ /** The start time of this Slot (formatted according to RFC3339). Required. */
721
+ startDate?: string | null;
722
+ /** The end time of this Slot (formatted according to RFC3339). Required. */
723
+ endDate?: string | null;
724
+ /** The timezone according to which the slot is calculated presented. */
725
+ timezone?: string | null;
726
+ /** The resource required for this slot. Currently, in Bookings, this is the relevant staff. Required. */
727
+ resource?: SlotSlotResource;
728
+ /** Geographic location of the slot. */
729
+ location?: SlotLocation;
730
+ }
731
+ export declare enum LocationLocationType {
732
+ UNDEFINED = "UNDEFINED",
733
+ OWNER_BUSINESS = "OWNER_BUSINESS",
734
+ OWNER_CUSTOM = "OWNER_CUSTOM",
735
+ CUSTOM = "CUSTOM"
736
+ }
737
+ export interface SlotSlotResource {
738
+ /**
739
+ * Resource ID
740
+ * @readonly
741
+ */
742
+ _id?: string | null;
743
+ /** Read only. Resource name. */
744
+ name?: string | null;
745
+ }
746
+ export interface SlotLocation {
747
+ /** Business Location ID. Present if the location is a business location. */
748
+ _id?: string | null;
749
+ /** Location name. */
750
+ name?: string | null;
751
+ /** A string containing the full address of this location. */
752
+ formattedAddress?: string | null;
753
+ /**
754
+ * Location type.
755
+ * One of:
756
+ * - `"OWNER_BUSINESS"` The business address as set in the site’s general settings.
757
+ * - `"OWNER_CUSTOM"` The address as set when creating the service.
758
+ * - `"CUSTOM"` The address set for the individual session.
759
+ */
760
+ locationType?: LocationLocationType;
761
+ }
762
+ export interface RescheduleBookingRequestFlowControlSettings {
763
+ /**
764
+ * Whether the rescheduling policy applies when rescheduling the booking.
765
+ * When passing `false` you can only cancel a booking if the rescheduling
766
+ * policy allows it. Your app must have the `BOOKINGS.IGNORE_BOOKING_POLICY `
767
+ * permission scope when passing `true`.
768
+ * Default: `false`.
769
+ * <!--ONLY:VELO
770
+ * Requires "Manage Wix Bookings App" and "Manage Bookings' Calendar" [roles](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin).
771
+ * <!--END:ONLY:VELO-->
772
+ */
773
+ ignoreReschedulePolicy?: boolean;
774
+ /**
775
+ * Whether the availability is checked before rescheduling the booking.
776
+ * When passing `false` a booking is only created when the slot or
777
+ * schedule is available. Your app must have the `BOOKINGS.OVERRIDE_AVAILABILITY`
778
+ * permission scope when passing `true`.
779
+ * Default: `false`.
780
+ */
781
+ skipAvailabilityValidation?: boolean;
782
+ /**
783
+ * Whether the rescheduled booking's status is automatically set to
784
+ * `CONFIRMED` for services that normally require the owner's manual
785
+ * confirmation. Your app must have the `BOOKINGS.OVERRIDE_AVAILABILITY`
786
+ * permission scope when passing `true`.
787
+ * Default: `false`.
788
+ */
789
+ skipBusinessConfirmation?: boolean;
790
+ }
791
+ export interface RescheduleBookingResponse {
792
+ /** Rescheduled booking. */
793
+ booking?: Booking;
794
+ }
795
+ export interface BulkRescheduleBookingRequest {
796
+ /** Reschedule multiple bookings to multiple slots. */
797
+ slotsBookings?: SlotBookings[];
798
+ /** Whether to notify participants about the change and an optional custom message */
799
+ participantNotification?: ParticipantNotification;
800
+ }
801
+ export interface BulkRescheduleBookingRequestBooking {
802
+ /** Id of the bookings to be rescheduled. */
803
+ _id?: string;
804
+ revision?: string | null;
805
+ }
806
+ /** Bookings to be rescheduled to the given slot. */
807
+ export interface SlotBookings {
808
+ /** The bookings details. */
809
+ bookings?: BulkRescheduleBookingRequestBooking[];
810
+ /**
811
+ * The slot to which the bookings was rescheduled
812
+ * This bookings will automatically be assigned to the session if given, or will create a new one if not.
813
+ */
814
+ slot?: BookedSlot;
815
+ }
816
+ export interface BulkRescheduleBookingResponse {
817
+ /** The bulk reschedule results. For each booking contains the metadata of the reschedule action. */
818
+ results?: ItemMetadata[];
819
+ /** Total successes and failures of the bulk reschedule action. */
820
+ bulkActionMetadata?: BulkActionMetadata;
821
+ }
822
+ /** Update the booked schedule of multiple bookings to the given schedule. */
823
+ export interface BulkUpdateBookedScheduleRequest {
824
+ /** The bookings whose booked schedule is to be updated to the given schedule. */
825
+ bookings?: BookingDetails[];
826
+ /** The id of the schedule to which the bookings booked schedule is to be updated. */
827
+ scheduleId?: string;
828
+ /** Whether to notify participants about the change and an optional custom message. */
829
+ participantNotification?: ParticipantNotification;
830
+ }
831
+ export interface BookingDetails {
832
+ /** Id of the bookings to be updated. */
833
+ _id?: string;
834
+ revision?: string | null;
835
+ }
836
+ export interface BulkUpdateBookedScheduleResponse {
837
+ /** The bulk update results. For each booking contains the metadata of the update action. */
838
+ results?: ItemMetadata[];
839
+ /** Total successes and failures of the bulk update action. */
840
+ bulkActionMetadata?: BulkActionMetadata;
841
+ }
842
+ export interface QueryBookingsRequest {
843
+ query?: QueryV2;
844
+ }
845
+ export interface QueryV2 extends QueryV2PagingMethodOneOf {
846
+ /**
847
+ * Filter object in the following format:
848
+ * `"filter" : {
849
+ * "fieldName1": "value1",
850
+ * "fieldName2":{"$operator":"value2"}
851
+ * }`
852
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
853
+ */
854
+ filter?: Record<string, any> | null;
855
+ /**
856
+ * Sort object in the following format:
857
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
858
+ */
859
+ sort?: Sorting[];
860
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
861
+ fields?: string[];
862
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
863
+ fieldsets?: string[];
864
+ /** Paging options to limit and skip the number of items. */
865
+ paging?: Paging;
866
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
867
+ cursorPaging?: CursorPaging;
868
+ }
869
+ /** @oneof */
870
+ export interface QueryV2PagingMethodOneOf {
871
+ /** Paging options to limit and skip the number of items. */
872
+ paging?: Paging;
873
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
874
+ cursorPaging?: CursorPaging;
875
+ }
876
+ export interface Sorting {
877
+ /** Name of the field to sort by. */
878
+ fieldName?: string;
879
+ /** Sort order. */
880
+ order?: SortOrder;
881
+ }
882
+ export declare enum SortOrder {
883
+ ASC = "ASC",
884
+ DESC = "DESC"
885
+ }
886
+ export interface Paging {
887
+ /** Number of items to load. */
888
+ limit?: number | null;
889
+ /** Number of items to skip in the current sort order. */
890
+ offset?: number | null;
891
+ }
892
+ export interface CursorPaging {
893
+ /** Number of items to load. */
894
+ limit?: number | null;
895
+ /**
896
+ * Pointer to the next or previous page in the list of results.
897
+ *
898
+ * You can get the relevant cursor token
899
+ * from the `pagingMetadata` object in the previous call's response.
900
+ * Not relevant for the first request.
901
+ */
902
+ cursor?: string | null;
903
+ }
904
+ export interface QueryBookingsResponse {
905
+ bookings?: Booking[];
906
+ pagingMetadata?: PagingMetadataV2;
907
+ }
908
+ export interface PagingMetadataV2 {
909
+ /** Number of items returned in the response. */
910
+ count?: number | null;
911
+ /** Offset that was requested. */
912
+ offset?: number | null;
913
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
914
+ total?: number | null;
915
+ /** Flag that indicates the server failed to calculate the `total` field. */
916
+ tooManyToCount?: boolean | null;
917
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
918
+ cursors?: Cursors;
919
+ }
920
+ export interface Cursors {
921
+ /** Cursor pointing to next page in the list of results. */
922
+ next?: string | null;
923
+ /** Cursor pointing to previous page in the list of results. */
924
+ prev?: string | null;
925
+ }
926
+ export interface ConfirmRequest {
927
+ /** ID of the booking to be confirmed. */
928
+ _id?: string;
929
+ /** Whether to notify the participants about the booking confirmation, and an optional custom message. */
930
+ participantNotification?: ParticipantNotification;
931
+ }
932
+ export interface ConfirmResponse {
933
+ /** Confirmed booking. */
934
+ booking?: Booking;
935
+ }
936
+ export interface ConfirmBookingRequest {
937
+ /** ID of the booking to confirm. */
938
+ bookingId: string;
939
+ /**
940
+ * Revision number, which increments by 1 each time the booking is updated.
941
+ * To prevent conflicting changes, the current revision must be passed when
942
+ * managing the booking.
943
+ */
944
+ revision: string | null;
945
+ /**
946
+ * Information about whether to notify the customer about the confirmation and
947
+ * the message to send.
948
+ */
949
+ participantNotification?: ParticipantNotification;
950
+ }
951
+ export interface ConfirmBookingResponse {
952
+ booking?: Booking;
953
+ }
954
+ export interface PartySizeRequest extends PartySizeRequestPartySizeForOneOf {
955
+ sessionId?: string | null;
956
+ scheduleId?: string | null;
957
+ }
958
+ /** @oneof */
959
+ export interface PartySizeRequestPartySizeForOneOf {
960
+ sessionId?: string | null;
961
+ scheduleId?: string | null;
962
+ }
963
+ export interface PartySizeResponse {
964
+ partySize?: number | null;
965
+ }
966
+ export interface ConsistentQueryBookingsRequest {
967
+ query?: QueryV2;
968
+ }
969
+ export interface ConsistentQueryBookingsResponse {
970
+ bookings?: Booking[];
971
+ pagingMetadata?: PagingMetadataV2;
972
+ }
973
+ export interface SetBookingSessionIdRequest {
974
+ /** Id of the booking to set its sessionId. */
975
+ _id?: string;
976
+ /** The sessionId to be set. */
977
+ sessionId?: string;
978
+ }
979
+ export interface SetBookingSessionIdResponse {
980
+ /** The updated booking. */
981
+ booking?: Booking;
982
+ }
983
+ export interface UpdateExtendedFieldsRequest {
984
+ /** entity_id */
985
+ _id?: string;
986
+ namespace?: string;
987
+ namespaceData?: Record<string, any> | null;
988
+ }
989
+ export interface UpdateExtendedFieldsResponse {
990
+ namespace?: string;
991
+ /** only data from UpdateExtendedFieldsRequest namespace_data */
992
+ namespaceData?: Record<string, any> | null;
993
+ }
994
+ export interface DeclineBookingRequest {
995
+ /** ID of the booking to decline. */
996
+ bookingId: string;
997
+ /**
998
+ * Revision number, which increments by 1 each time the booking is updated.
999
+ * To prevent conflicting changes, the current revision must be passed when
1000
+ * managing the booking.
1001
+ */
1002
+ revision: string | null;
1003
+ /**
1004
+ * Information about whether to notify the customer about the decline and
1005
+ * the message to send.
1006
+ */
1007
+ participantNotification?: ParticipantNotification;
1008
+ }
1009
+ export interface DeclineBookingResponse {
1010
+ /** eclined booking */
1011
+ booking?: Booking;
1012
+ }
1013
+ export interface BookingDeclined {
1014
+ /** The booking after the decline. */
1015
+ currentBooking?: Booking;
1016
+ /** Whether the booking is double-booking or was declined by the owner. */
1017
+ doubleBooking?: boolean | null;
1018
+ /** Whether to notify participants about the change and an optional custom message */
1019
+ participantNotification?: ParticipantNotification;
1020
+ /** The identity that did the action triggered the event */
1021
+ declinedBy?: IdentificationData;
1022
+ }
1023
+ export interface IdentificationData extends IdentificationDataIdOneOf {
1024
+ /**
1025
+ * ID of of a contact in the site's [CRM by Ascend](https://www.wix.com/ascend/crm) system.
1026
+ * @readonly
1027
+ */
1028
+ contactId?: string | null;
1029
+ /** ID of a site visitor that has not logged in to the site. */
1030
+ anonymousVisitorId?: string;
1031
+ /** ID of a site visitor that has logged in to the site. */
1032
+ memberId?: string;
1033
+ /** ID of a Wix user (site owner, contributor, etc.). */
1034
+ wixUserId?: string;
1035
+ /** ID of an app. */
1036
+ appId?: string;
1037
+ }
1038
+ /** @oneof */
1039
+ export interface IdentificationDataIdOneOf {
1040
+ /** ID of a site visitor that has not logged in to the site. */
1041
+ anonymousVisitorId?: string;
1042
+ /** ID of a site visitor that has logged in to the site. */
1043
+ memberId?: string;
1044
+ /** ID of a Wix user (site owner, contributor, etc.). */
1045
+ wixUserId?: string;
1046
+ /** ID of an app. */
1047
+ appId?: string;
1048
+ }
1049
+ export declare enum IdentityType {
1050
+ UNKNOWN = "UNKNOWN",
1051
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1052
+ MEMBER = "MEMBER",
1053
+ WIX_USER = "WIX_USER",
1054
+ APP = "APP"
1055
+ }
1056
+ export interface CancelBookingRequest {
1057
+ /** ID of the booking to cancel. */
1058
+ bookingId: string;
1059
+ /**
1060
+ * Information about whether to notify the customer about the cancelation and
1061
+ * the message to send.
1062
+ */
1063
+ participantNotification?: ParticipantNotification;
1064
+ /**
1065
+ * Information about whether specific procedures of the standard Wix Bookings
1066
+ * cancelation flow are changed. For example, whether the you can cancel
1067
+ * a booking even though the cancelation policy doesn't allow it or whether
1068
+ * to issue a refund.
1069
+ */
1070
+ flowControlSettings?: CancelBookingRequestFlowControlSettings;
1071
+ /**
1072
+ * Revision number, which increments by 1 each time the booking is updated.
1073
+ * To prevent conflicting changes,
1074
+ * the current revision must be passed when managing the booking.
1075
+ */
1076
+ revision: string | null;
1077
+ }
1078
+ export interface CancelBookingRequestFlowControlSettings {
1079
+ /**
1080
+ * Whether the cancelation policy applies when canceling the booking. When
1081
+ * passing `false` you can only cancel a booking if the cancelation policy
1082
+ * allows it. Your app must have the `BOOKINGS.IGNORE_BOOKING_POLICY `
1083
+ * permission scope when passing `true`.
1084
+ * Default: `false`.
1085
+ * <!--ONLY:VELO
1086
+ * Requires "Manage Wix Bookings App" and "Manage Bookings' Calendar" [roles](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin).
1087
+ * <!--END:ONLY:VELO-->
1088
+ */
1089
+ ignoreCancellationPolicy?: boolean | null;
1090
+ /**
1091
+ * Whether to issue a refund when canceling the booking.
1092
+ * The refund will be issued only if the booking is refundable.
1093
+ * Currently, booking is considered refundable when it was paid by membership.
1094
+ * If passing `true`, the booking flow control settings will be set with refund,
1095
+ * otherwise, either if `false` is passed or the field remains empty,
1096
+ * the booking flow control settings will be set with no refund.
1097
+ * Default: `false`.
1098
+ */
1099
+ withRefund?: boolean | null;
1100
+ }
1101
+ export interface CancelBookingResponse {
1102
+ /** Canceled booking. */
1103
+ booking?: Booking;
1104
+ }
1105
+ export interface BookingCanceled {
1106
+ /** The canceled booking. */
1107
+ currentBooking?: Booking;
1108
+ /** Whether the booking should be refunded */
1109
+ issueRefund?: boolean | null;
1110
+ /** Whether to notify participants about the change and an optional custom message */
1111
+ participantNotification?: ParticipantNotification;
1112
+ /** The identity that did the action triggered the event */
1113
+ canceledBy?: IdentificationData;
1114
+ }
1115
+ export interface UpdateNumberOfParticipantsRequest extends UpdateNumberOfParticipantsRequestParticipantsInfoOneOf {
1116
+ /** ID of the booking to update the number of participants for. */
1117
+ bookingId: string;
1118
+ /**
1119
+ * Revision number, which increments by 1 each time the booking is updated.
1120
+ * To prevent conflicting changes, the current revision must be passed when
1121
+ * managing the booking.
1122
+ */
1123
+ revision: string | null;
1124
+ /**
1125
+ * Total number of participants. Available only for services with
1126
+ * variants.
1127
+ * Pass when all participants book the same variant.
1128
+ */
1129
+ totalParticipants?: number;
1130
+ /**
1131
+ * Information about the service choices to book. Available only for services with
1132
+ * variants.
1133
+ * Pass when not all participants book the same variant.
1134
+ */
1135
+ participantsChoices?: ParticipantChoices;
1136
+ }
1137
+ /** @oneof */
1138
+ export interface UpdateNumberOfParticipantsRequestParticipantsInfoOneOf {
1139
+ /**
1140
+ * Total number of participants. Available only for services with
1141
+ * variants.
1142
+ * Pass when all participants book the same variant.
1143
+ */
1144
+ totalParticipants?: number;
1145
+ /**
1146
+ * Information about the service choices to book. Available only for services with
1147
+ * variants.
1148
+ * Pass when not all participants book the same variant.
1149
+ */
1150
+ participantsChoices?: ParticipantChoices;
1151
+ }
1152
+ export interface UpdateNumberOfParticipantsResponse {
1153
+ /** Booking with updated number of participants. */
1154
+ booking?: Booking;
1155
+ }
1156
+ export interface CalculateAllowedActionsRequest {
1157
+ /** The booking id that we want to calculate the allowedActions for */
1158
+ bookingId?: string | null;
1159
+ }
1160
+ export interface CalculateAllowedActionsResponse {
1161
+ allowedActions?: AllowedActions;
1162
+ }
1163
+ /** Possible allowed actions for a Booking */
1164
+ export interface AllowedActions {
1165
+ /** Is cancel booking allowed */
1166
+ cancel?: boolean;
1167
+ /** Is reschedule booking allowed */
1168
+ reschedule?: boolean;
1169
+ }
1170
+ export interface BulkCalculateAllowedActionsRequest {
1171
+ /** The booking id's that we want to calculate the allowedActions for */
1172
+ bookingIds?: string[] | null;
1173
+ }
1174
+ export interface BulkCalculateAllowedActionsResponse {
1175
+ results?: BulkCalculateAllowedActionsResult[];
1176
+ bulkActionMetadata?: BulkActionMetadata;
1177
+ }
1178
+ export interface BulkCalculateAllowedActionsResult {
1179
+ /** (id, indexInGivenSeq, isSuccessful, error) */
1180
+ itemMetadata?: ItemMetadata;
1181
+ item?: AllowedActions;
1182
+ }
1183
+ export interface GetSlotAvailabilityRequest {
1184
+ /** The slot for which the availability is checked. */
1185
+ slot?: V2Slot;
1186
+ /** The timezone for which availability is to be calculated. */
1187
+ timezone?: string | null;
1188
+ }
1189
+ export interface GetSlotAvailabilityResponse {
1190
+ availability?: SlotAvailability;
1191
+ bookingPolicySettings?: BookingPolicySettings;
1192
+ }
1193
+ export interface SlotAvailability {
1194
+ /** Identifier for underlying session when session is a single session or generated from a recurring session. Required. */
1195
+ slot?: V2Slot;
1196
+ /** Whether this available slot is bookable. */
1197
+ bookable?: boolean;
1198
+ /**
1199
+ * Total number of spots for this availability.
1200
+ * For example, for a class of 10 spots with 3 spots booked, `spotsTotal` is 10, `openSpots` is 7.
1201
+ */
1202
+ totalSpots?: number | null;
1203
+ /**
1204
+ * Number of open spots for this availability.
1205
+ * For appointment if there are existing bookings with overlapping time, service & resource, `openSpots` is 0, otherwise `openSpots` is 1.
1206
+ */
1207
+ openSpots?: number | null;
1208
+ /** An object describing the slot's waiting-list and its occupancy. */
1209
+ waitingList?: WaitingList;
1210
+ /** Indicators for booking policy violations for the slot. */
1211
+ bookingPolicyViolations?: BookingPolicyViolations;
1212
+ /** Indicates whether this slot is locked. */
1213
+ locked?: boolean | null;
1214
+ }
1215
+ export interface WaitingList {
1216
+ /**
1217
+ * Total number of spots and open spots for this waiting list.
1218
+ * For example, a Yoga class of 10 waiting list spots with 3 registered on the waiting list has total_spots: 10 and open_spots: 7.
1219
+ */
1220
+ totalSpots?: number | null;
1221
+ openSpots?: number | null;
1222
+ }
1223
+ export interface BookingPolicyViolations {
1224
+ /** Bookings policy violation. Too early to book this slot. */
1225
+ tooEarlyToBook?: boolean | null;
1226
+ /** Bookings policy violation. Too late to book this slot. */
1227
+ tooLateToBook?: boolean | null;
1228
+ /** Bookings policy violation. Online booking is disabled for this slot. */
1229
+ bookOnlineDisabled?: boolean | null;
1230
+ }
1231
+ export interface BookingPolicySettings {
1232
+ /** Booking policy settings for a given Slot/Schedule */
1233
+ maxParticipantsPerBooking?: number | null;
1234
+ }
1235
+ export interface GetScheduleAvailabilityRequest {
1236
+ /** The schedule ID for which availability is checked. */
1237
+ scheduleId?: string;
1238
+ }
1239
+ export interface GetScheduleAvailabilityResponse {
1240
+ availability?: ScheduleAvailability;
1241
+ bookingPolicySettings?: BookingPolicySettings;
1242
+ }
1243
+ export interface ScheduleAvailability {
1244
+ totalSpots?: number | null;
1245
+ openSpots?: number | null;
1246
+ /** Indicators of booking policy violations for the given Schedule. */
1247
+ bookingPolicyViolations?: BookingPolicyViolations;
1248
+ }
1249
+ export interface ConfirmOrDeclineRequest {
1250
+ /** ID of the booking to be confirmed or declined. */
1251
+ bookingId?: string;
1252
+ /** Will be updated on the booking to indicate the payment status. */
1253
+ paymentStatus?: PaymentStatus;
1254
+ /** Contact's ID. */
1255
+ contactId?: string | null;
1256
+ }
1257
+ export interface ConfirmOrDeclineResponse {
1258
+ booking?: Booking;
1259
+ }
1260
+ export interface ConfirmOrDeclineBookingRequest {
1261
+ /** ID of the booking to be confirmed or declined. */
1262
+ bookingId?: string;
1263
+ /** Will be passed to bookings.update to indicate the payment status. */
1264
+ paymentStatus?: PaymentStatus;
1265
+ /** Contact's ID. */
1266
+ contactId?: string | null;
1267
+ }
1268
+ export interface ConfirmOrDeclineBookingResponse {
1269
+ booking?: Booking;
1270
+ }
1271
+ export interface V2CreateBookingRequest extends V2CreateBookingRequestBookableItemOneOf, V2CreateBookingRequestParticipantsInfoOneOf {
1272
+ /** Contact details of the customer booking the service. */
1273
+ contactDetails?: ContactDetails;
1274
+ /**
1275
+ * Additional custom fields of the booking form. The customer must provide
1276
+ * information for each field when booking the service. For example, that they
1277
+ * bring their own towels or whether they use a wheelchair.
1278
+ *
1279
+ * Max: 100 fields
1280
+ */
1281
+ additionalFields?: CustomFormField[];
1282
+ /**
1283
+ * Total number of participants. Available only when the service doesn't have
1284
+ * [variants](https://dev.wix.com/api/rest/wix-bookings/service-options-and-variants/introduction).
1285
+ *
1286
+ * Max: `20`
1287
+ */
1288
+ numberOfParticipants?: number | null;
1289
+ /**
1290
+ * Internal business note. Not visible to the customer.
1291
+ *
1292
+ * Max: 200 characters
1293
+ */
1294
+ internalBusinessNote?: string | null;
1295
+ /**
1296
+ * Payment option the customer intends to use.
1297
+ * Must be one of the payment options defined for the service, unless
1298
+ * you pass `flowControlSettings.skipSelectedPaymentOptionValidation` as `true`.
1299
+ */
1300
+ selectedPaymentOption?: SelectedPaymentOption;
1301
+ /**
1302
+ * Identifies the source (platform, actor and app) that created this booking.
1303
+ * This property of the booking cannot be changed.
1304
+ * The app_def_id and app_name will be resolved automatically.
1305
+ * TODO GAP See if we need this - might be able to get this data from the headers?
1306
+ */
1307
+ bookingSource?: BookingSource;
1308
+ /**
1309
+ * A user identifier of an external application user that initiated the book request.
1310
+ * Allows an external application to later identify its own bookings and correlate to its own internal users
1311
+ */
1312
+ externalUserId?: string | null;
1313
+ /** Information about a message to send to the customer. */
1314
+ participantNotification?: ParticipantNotification;
1315
+ /**
1316
+ * Whether to send an SMS reminder to the customer 24 hours before the
1317
+ * session starts. The phone number is taken from `contactDetails.phone`.
1318
+ *
1319
+ * Default: `true`.
1320
+ */
1321
+ sendSmsReminder?: boolean | null;
1322
+ /**
1323
+ * Information about whether specific procedures of the standard Wix Bookings
1324
+ * creation flow are changed. For example, whether the availability is
1325
+ * checked before creating the booking or if additional payment options are
1326
+ * accepted.
1327
+ */
1328
+ flowControlSettings?: CreateBookingRequestFlowControlSettings;
1329
+ /**
1330
+ * Information about the slot to create a booking for.
1331
+ * If you set `slot.location.locationType` to `CUSTOM`, the created slot's
1332
+ * location is set to `slot.location.formattedAddress` when provided.
1333
+ * Otherwise it's set to `contactDetails.fullAddress.formattedAddress`.
1334
+ */
1335
+ slot?: Slot;
1336
+ /** Information about the schedule to create a booking for. */
1337
+ schedule?: BookedSchedule;
1338
+ }
1339
+ /** @oneof */
1340
+ export interface V2CreateBookingRequestBookableItemOneOf {
1341
+ /**
1342
+ * Information about the slot to create a booking for.
1343
+ * If you set `slot.location.locationType` to `CUSTOM`, the created slot's
1344
+ * location is set to `slot.location.formattedAddress` when provided.
1345
+ * Otherwise it's set to `contactDetails.fullAddress.formattedAddress`.
1346
+ */
1347
+ slot?: Slot;
1348
+ /** Information about the schedule to create a booking for. */
1349
+ schedule?: BookedSchedule;
1350
+ }
1351
+ /** @oneof */
1352
+ export interface V2CreateBookingRequestParticipantsInfoOneOf {
1353
+ }
1354
+ export interface Slot {
1355
+ /**
1356
+ * ID for the slot's corresponding session, when the session is either a single session
1357
+ * or a specific session generated from a recurring session.
1358
+ */
1359
+ sessionId?: string | null;
1360
+ /** Service ID. */
1361
+ serviceId?: string;
1362
+ /** Schedule ID. */
1363
+ scheduleId?: string;
1364
+ /**
1365
+ * The start time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
1366
+ * format.
1367
+ *
1368
+ * If `timezone` is specified,
1369
+ * dates are based on the local date/time. This means that the timezone offset
1370
+ * in the `start_date` is ignored.
1371
+ */
1372
+ startDate?: string | null;
1373
+ /**
1374
+ * The end time of this slot in
1375
+ * [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format.
1376
+ *
1377
+ * If `timezone` is specified,
1378
+ * dates are based on the local date/time. This means that the timezone offset
1379
+ * in the `end_date` is ignored.
1380
+ */
1381
+ endDate?: string | null;
1382
+ /**
1383
+ * The timezone for which slot availability is to be calculated.
1384
+ *
1385
+ * Learn more about [handling Daylight Savings Time (DST) for local time zones](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/query-availability#wix-bookings_availability-calendar_query-availability_handling-daylight-savings-time-dst-for-local-time-zones)
1386
+ * when calculating availability.
1387
+ */
1388
+ timezone?: string | null;
1389
+ /**
1390
+ * The resource required for this slot. Currently, the only supported resource
1391
+ * is the relevant staff member for the slot.
1392
+ */
1393
+ resource?: SlotResource;
1394
+ /** Geographic location of the slot. */
1395
+ location?: Location;
1396
+ }
1397
+ export interface SlotResource {
1398
+ /**
1399
+ * Resource ID.
1400
+ * @readonly
1401
+ */
1402
+ _id?: string | null;
1403
+ /** Resource name. Read only. */
1404
+ name?: string | null;
1405
+ }
1406
+ export interface CreateBookingRequestFlowControlSettings {
1407
+ /**
1408
+ * Whether the availability is checked before creating the booking. When
1409
+ * passing `false` a booking is only created when the slot or schedule is
1410
+ * available. Your app must have the `BOOKINGS.OVERRIDE_AVAILABILITY`
1411
+ * permission scope when passing `true`.
1412
+ *
1413
+ * Default: `false`.
1414
+ */
1415
+ skipAvailabilityValidation?: boolean;
1416
+ /**
1417
+ * Whether `PENDING` bookings are automatically set to `CONFIRMED` for
1418
+ * services that normally require the owner's manual confirmation. Your
1419
+ * app must have the `BOOKINGS.OVERRIDE_AVAILABILITY` permission scope
1420
+ * when passing `true`.
1421
+ *
1422
+ * Default: `false`.
1423
+ */
1424
+ skipBusinessConfirmation?: boolean;
1425
+ /**
1426
+ * Whether customers can pay using a payment method that isn't supported
1427
+ * for the service, but that's supported for other services. Your app
1428
+ * must have the `BOOKINGS.MANAGE_PAYMENTS` permission scope when passing
1429
+ * `true`.
1430
+ *
1431
+ * Default: `false`.
1432
+ */
1433
+ skipSelectedPaymentOptionValidation?: boolean;
1434
+ }
1435
+ export interface V2CreateBookingResponse {
1436
+ /** Created booking. */
1437
+ booking?: Booking;
1438
+ }
1439
+ export interface V2CancelBookingRequest {
1440
+ /** ID of the booking to cancel. */
1441
+ bookingId: string;
1442
+ /**
1443
+ * Information about whether to notify the customer about the cancelation and
1444
+ * the message to send.
1445
+ */
1446
+ participantNotification?: ParticipantNotification;
1447
+ /**
1448
+ * Revision number, which increments by 1 each time the booking is updated.
1449
+ * To prevent conflicting changes,
1450
+ * the current revision must be passed when managing the booking.
1451
+ */
1452
+ revision: string | null;
1453
+ }
1454
+ export interface V2CancelBookingRequestFlowControlSettings {
1455
+ /**
1456
+ * Whether the cancelation policy applies when canceling the booking. When
1457
+ * passing `false` you can only cancel a booking if the cancelation policy
1458
+ * allows it. Your app must have the `BOOKINGS.IGNORE_BOOKING_POLICY `
1459
+ * permission scope when passing `true`.
1460
+ *
1461
+ * Default: `false`.
1462
+ *
1463
+ * <!--ONLY:VELO
1464
+ * Requires "Manage Wix Bookings App" and "Manage Bookings' Calendar" [roles](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin).
1465
+ * <!--END:ONLY:VELO-->
1466
+ */
1467
+ ignoreCancellationPolicy?: boolean;
1468
+ /**
1469
+ * Whether to issue a refund when canceling the booking.
1470
+ * The refund will be issued only if the booking is refundable.
1471
+ * Currently, booking is considered refundable when it was paid by membership.
1472
+ * If passing `true`, the booking flow control settings will be set with refund,
1473
+ * otherwise, either if `false` is passed or the field remains empty,
1474
+ * the booking flow control settings will be set with no refund.
1475
+ *
1476
+ * Default: `false`.
1477
+ */
1478
+ withRefund?: boolean | null;
1479
+ }
1480
+ export interface V2CancelBookingResponse {
1481
+ /** Canceled booking. */
1482
+ booking?: Booking;
1483
+ }
1484
+ export interface V2RescheduleBookingRequest extends V2RescheduleBookingRequestParticipantsInfoOneOf {
1485
+ /** Id of the booking to reschedule. */
1486
+ bookingId: string;
1487
+ /** Information about the new slot. */
1488
+ slot: Slot;
1489
+ /**
1490
+ * Revision number, which increments by 1 each time the booking is updated.
1491
+ * To prevent conflicting changes, the current revision must be passed when
1492
+ * managing the booking.
1493
+ */
1494
+ revision: string | null;
1495
+ /**
1496
+ * Information about whether to notify the customer about the rescheduling and
1497
+ * the message to send.
1498
+ */
1499
+ participantNotification?: ParticipantNotification;
1500
+ }
1501
+ /** @oneof */
1502
+ export interface V2RescheduleBookingRequestParticipantsInfoOneOf {
1503
+ }
1504
+ export interface V2RescheduleBookingRequestFlowControlSettings {
1505
+ /**
1506
+ * Whether the rescheduling policy applies when rescheduling the booking.
1507
+ * When passing `false` you can only cancel a booking if the rescheduling
1508
+ * policy allows it. Your app must have the `BOOKINGS.IGNORE_BOOKING_POLICY `
1509
+ * permission scope when passing `true`.
1510
+ *
1511
+ * Default: `false`.
1512
+ *
1513
+ * <!--ONLY:VELO
1514
+ * Requires "Manage Wix Bookings App" and "Manage Bookings' Calendar" [roles](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin).
1515
+ * <!--END:ONLY:VELO-->
1516
+ */
1517
+ ignoreReschedulePolicy?: boolean;
1518
+ /**
1519
+ * Whether the availability is checked before rescheduling the booking.
1520
+ * When passing `false` a booking is only created when the slot or
1521
+ * schedule is available. Your app must have the `BOOKINGS.OVERRIDE_AVAILABILITY`
1522
+ * permission scope when passing `true`.
1523
+ *
1524
+ * Default: `false`.
1525
+ */
1526
+ skipAvailabilityValidation?: boolean;
1527
+ /**
1528
+ * Whether the rescheduled booking's status is automatically set to
1529
+ * `CONFIRMED` for services that normally require the owner's manual
1530
+ * confirmation. Your app must have the `BOOKINGS.OVERRIDE_AVAILABILITY`
1531
+ * permission scope when passing `true`.
1532
+ *
1533
+ * Default: `false`.
1534
+ */
1535
+ skipBusinessConfirmation?: boolean;
1536
+ }
1537
+ export interface V2RescheduleBookingResponse {
1538
+ /** Rescheduled booking. */
1539
+ booking?: Booking;
1540
+ }
1541
+ export interface V2ConfirmBookingRequest {
1542
+ /** ID of the booking to confirm. */
1543
+ bookingId: string;
1544
+ /**
1545
+ * Revision number, which increments by 1 each time the booking is updated.
1546
+ * To prevent conflicting changes, the current revision must be passed when
1547
+ * managing the booking.
1548
+ */
1549
+ revision: string | null;
1550
+ /**
1551
+ * Information about whether to notify the customer about the confirmation and
1552
+ * the message to send.
1553
+ */
1554
+ participantNotification?: ParticipantNotification;
1555
+ }
1556
+ export interface V2ConfirmBookingResponse {
1557
+ booking?: Booking;
1558
+ }
1559
+ export interface V2DeclineBookingRequest {
1560
+ /** ID of the booking to decline. */
1561
+ bookingId: string;
1562
+ /**
1563
+ * Revision number, which increments by 1 each time the booking is updated.
1564
+ * To prevent conflicting changes, the current revision must be passed when
1565
+ * managing the booking.
1566
+ */
1567
+ revision: string | null;
1568
+ /**
1569
+ * Information about whether to notify the customer about the decline and
1570
+ * the message to send.
1571
+ */
1572
+ participantNotification?: ParticipantNotification;
1573
+ }
1574
+ export interface V2DeclineBookingResponse {
1575
+ /** Declined booking. */
1576
+ booking?: Booking;
1577
+ }
1578
+ export interface V2UpdateNumberOfParticipantsRequest extends V2UpdateNumberOfParticipantsRequestParticipantsInfoOneOf {
1579
+ /** ID of the booking to update the number of participants for. */
1580
+ bookingId: string;
1581
+ /** Updated number of participants. */
1582
+ numberOfParticipants?: number | null;
1583
+ /**
1584
+ * Revision number, which increments by 1 each time the booking is updated.
1585
+ * To prevent conflicting changes, the current revision must be passed when
1586
+ * managing the booking.
1587
+ */
1588
+ revision: string | null;
1589
+ }
1590
+ /** @oneof */
1591
+ export interface V2UpdateNumberOfParticipantsRequestParticipantsInfoOneOf {
1592
+ }
1593
+ export interface V2UpdateNumberOfParticipantsResponse {
1594
+ /** Booking with updated number of participants. */
1595
+ booking?: Booking;
1596
+ }
1597
+ /**
1598
+ * Reschedules a booking to a different slot or session.
1599
+ *
1600
+ *
1601
+ * You can only reschedule bookings for appointments or classes, you can't
1602
+ * reschedule course bookings.
1603
+ *
1604
+ * The old session is removed from the calendar and the new session is
1605
+ * added.
1606
+ *
1607
+ * If you reschedule a booking for a class session the new session must be an
1608
+ * existing session for the same class.
1609
+ *
1610
+ * You can pass a `participantNotification.message` to notify the customer of
1611
+ * the rescheduling. You also need to pass `participantNotification.notifyParticipants`
1612
+ * as `true` to actually send the message.
1613
+ *
1614
+ * In case the service has
1615
+ * variants, you can call this endpoint to update the booking's `totalParticipants` or `participantsChoices`.
1616
+ * If you provide `participantsChoices`, all of the provided choices must exist for
1617
+ * the service. Otherwise, the call returns an `INVALID_SERVICE_CHOICES` error.
1618
+ * If you omit `participantsChoices` in the request, the existing choices are
1619
+ * kept and not replaced with an empty object.
1620
+ *
1621
+ * <!-- INTERNAL PERMISSION COMMENT:
1622
+ * You need to have the `BOOKINGS.NUMBER_OF_PARTICIPANTS_UPDATE` permission
1623
+ * to reschedule bookings including `participantsInfo`.
1624
+ * <!--END: INTERNAL PERMISSION COMMENT-->
1625
+ *
1626
+ * In case you want to reschedule a booking on behalf of a customer, we recommend
1627
+ * to pass `flowControlSettings.ignoreReschedulePolicy` as `false`. This
1628
+ * ensures that the rescheduling is validated against the service's rescheduling
1629
+ * policy.
1630
+ * @param bookingId - Id of the booking to reschedule.
1631
+ * @param slot - Information about the new slot.
1632
+ * @public
1633
+ * @documentationMaturity preview
1634
+ * @requiredField bookingId
1635
+ * @requiredField options.revision
1636
+ * @requiredField slot
1637
+ * @param options - An object representing the available options for rescheduling a booking.
1638
+ */
1639
+ export declare function rescheduleBooking(bookingId: string, slot: V2Slot, options?: RescheduleBookingOptions): Promise<RescheduleBookingResponse>;
1640
+ export interface RescheduleBookingOptions {
1641
+ /**
1642
+ * Revision number, which increments by 1 each time the booking is updated.
1643
+ * To prevent conflicting changes, the current revision must be passed when
1644
+ * managing the booking.
1645
+ */
1646
+ revision: string | null;
1647
+ /**
1648
+ * Information about whether to notify the customer about the rescheduling and
1649
+ * the message to send.
1650
+ */
1651
+ participantNotification?: ParticipantNotification;
1652
+ /**
1653
+ * Information about whether specific procedures of the standard Wix Bookings
1654
+ * rescheduling flow are changed. For example, whether the availability of
1655
+ * the new slot is checked before rescheduling the booking or if you can
1656
+ * reschedule the booking even though the rescheduling policy doesn't allow it.
1657
+ */
1658
+ flowControlSettings?: RescheduleBookingRequestFlowControlSettings;
1659
+ /**
1660
+ * Total number of participants. Available only for services with
1661
+ * variants.
1662
+ * Pass when all participants book the same variant.
1663
+ */
1664
+ totalParticipants?: number;
1665
+ /**
1666
+ * Information about the service choices to book. Available only for services with
1667
+ * variants.
1668
+ * Pass when not all participants book the same variant.
1669
+ */
1670
+ participantsChoices?: ParticipantChoices;
1671
+ }
1672
+ /**
1673
+ * Confirms a booking request and changes the booking status to `CONFIRMED`.
1674
+ *
1675
+ *
1676
+ * Calling this method doesn't check whether a slot or schedule is still
1677
+ * available at this time.
1678
+ *
1679
+ * You can only confirm bookings for services that require the owner's manual
1680
+ * approval for bookings and that have a status of `PENDING`.
1681
+ *
1682
+ * For appointment services the slot may become unavailable, depending on the
1683
+ * [service's](https://support.wix.com/en/article/creating-the-right-booking-service-for-your-business)
1684
+ * `policy.bookingApprovalPolicy.requestsAffectsAvailability`.
1685
+ *
1686
+ * Calling this method also changes the
1687
+ * [session's](https://www.wix.com/velo/reference/wix-bookings-backend/sessions/getsession)
1688
+ * `participants.approvalStatus` to `APPROVED`.
1689
+ *
1690
+ * You can pass a `participantNotification.message` to notify the customer of
1691
+ * the confirmation. You also need to pass `participantNotification.notifyParticipants`
1692
+ * as `true` to actually send the message.
1693
+ *
1694
+ * Bookings are automatically confirmed when the
1695
+ * service is configured to automatically confirm
1696
+ * bookings and the [eCommerce order](https://www.wix.com/velo/reference/wix-ecom-backend/orders)
1697
+ * has been approved. The slot's or schedule's availability is checked just
1698
+ * before confirming the booking as part of the automatic flow.
1699
+ * @param bookingId - ID of the booking to confirm.
1700
+ * @param revision - Revision number, which increments by 1 each time the booking is updated.
1701
+ * To prevent conflicting changes, the current revision must be passed when
1702
+ * managing the booking.
1703
+ * @public
1704
+ * @documentationMaturity preview
1705
+ * @requiredField bookingId
1706
+ * @requiredField revision
1707
+ * @param options - An object representing the available options for canceling a booking.
1708
+ */
1709
+ export declare function confirmBooking(bookingId: string, revision: string | null, options?: ConfirmBookingOptions): Promise<ConfirmBookingResponse>;
1710
+ export interface ConfirmBookingOptions {
1711
+ /**
1712
+ * Information about whether to notify the customer about the confirmation and
1713
+ * the message to send.
1714
+ */
1715
+ participantNotification?: ParticipantNotification;
1716
+ }
1717
+ /**
1718
+ * Declines a `PENDING` booking request and changes the booking status to
1719
+ * `DECLINED`.
1720
+ *
1721
+ * Calling this method also changes the
1722
+ * [session's](https://www.wix.com/velo/reference/wix-bookings-backend/sessions/getsession)
1723
+ * `participants.approvalStatus` to `DECLINED`.
1724
+ *
1725
+ * You can only decline bookings for services that require the owner's manual
1726
+ * approval for bookings and that have a status of `PENDING`.
1727
+ *
1728
+ * You can pass a `participantNotification.message` to notify the customer of
1729
+ * the decline. You also need to pass `participantNotification.notifyParticipants`
1730
+ * as `true` to actually send the message.
1731
+ * @param bookingId - ID of the booking to decline.
1732
+ * @param revision - Revision number, which increments by 1 each time the booking is updated.
1733
+ * To prevent conflicting changes, the current revision must be passed when
1734
+ * managing the booking.
1735
+ * @public
1736
+ * @documentationMaturity preview
1737
+ * @requiredField bookingId
1738
+ * @requiredField revision
1739
+ * @param options - An object representing the available options for declining a booking.
1740
+ */
1741
+ export declare function declineBooking(bookingId: string, revision: string | null, options?: DeclineBookingOptions): Promise<DeclineBookingResponse>;
1742
+ export interface DeclineBookingOptions {
1743
+ /**
1744
+ * Information about whether to notify the customer about the decline and
1745
+ * the message to send.
1746
+ */
1747
+ participantNotification?: ParticipantNotification;
1748
+ }
1749
+ /**
1750
+ * Cancels a booking.
1751
+ *
1752
+ *
1753
+ * The booking status changes to `CANCELED`.
1754
+ *
1755
+ * If the booking was for an appointment, the corresponding session is
1756
+ * deleted from the business calendar.
1757
+ *
1758
+ * If the booking was for a class or course, the participants are removed
1759
+ * from the class session or the course. But the course or class session
1760
+ * remains on the business calendar.
1761
+ *
1762
+ * You can pass a `participantNotification.message` to notify the customer of
1763
+ * the cancelation. You also need to pass `participantNotification.notifyParticipants`
1764
+ * as `true` to actually send the message.
1765
+ *
1766
+ * In case you want to cancel a booking on behalf of a customer, we recommend
1767
+ * to pass `flowControlSettings.ignoreCancellationPolicy` as `false`. This
1768
+ * ensures that the cancelation is validated against the service's cancelation
1769
+ * policy.
1770
+ * @param bookingId - ID of the booking to cancel.
1771
+ * @public
1772
+ * @documentationMaturity preview
1773
+ * @requiredField bookingId
1774
+ * @requiredField options.revision
1775
+ * @param options - An object representing the available options for canceling a booking.
1776
+ */
1777
+ export declare function cancelBooking(bookingId: string, options?: CancelBookingOptions): Promise<CancelBookingResponse>;
1778
+ export interface CancelBookingOptions {
1779
+ /**
1780
+ * Information about whether to notify the customer about the cancelation and
1781
+ * the message to send.
1782
+ */
1783
+ participantNotification?: ParticipantNotification;
1784
+ /**
1785
+ * Information about whether specific procedures of the standard Wix Bookings
1786
+ * cancelation flow are changed. For example, whether the you can cancel
1787
+ * a booking even though the cancelation policy doesn't allow it or whether
1788
+ * to issue a refund.
1789
+ */
1790
+ flowControlSettings?: CancelBookingRequestFlowControlSettings;
1791
+ /**
1792
+ * Revision number, which increments by 1 each time the booking is updated.
1793
+ * To prevent conflicting changes,
1794
+ * the current revision must be passed when managing the booking.
1795
+ */
1796
+ revision: string | null;
1797
+ }
1798
+ /**
1799
+ * Updates the number of participants for a booking.
1800
+ *
1801
+ *
1802
+ * You can only update the number of participants for class and course
1803
+ * bookings, you can't update it for appointment bookings.
1804
+ *
1805
+ * Calling this method also changes the
1806
+ * [session's](https://www.wix.com/velo/reference/wix-bookings-backend/sessions/getsession)
1807
+ * `totalNumberOfParticipants`.
1808
+ *
1809
+ * When updating the number of participants for a booking you must pass either
1810
+ * `participantsChoices` or `totalParticipants`. If you pass `participantsChoices`
1811
+ * for services that have variants,
1812
+ * all of the provided choices must exist for the service. Otherwise, the
1813
+ * call returns an `INVALID_SERVICE_CHOICES` error.
1814
+ * @param bookingId - ID of the booking to update the number of participants for.
1815
+ * @public
1816
+ * @documentationMaturity preview
1817
+ * @requiredField bookingId
1818
+ * @requiredField options.revision
1819
+ */
1820
+ export declare function updateNumberOfParticipants(bookingId: string, options?: UpdateNumberOfParticipantsOptions): Promise<UpdateNumberOfParticipantsResponse>;
1821
+ export interface UpdateNumberOfParticipantsOptions {
1822
+ /**
1823
+ * Revision number, which increments by 1 each time the booking is updated.
1824
+ * To prevent conflicting changes, the current revision must be passed when
1825
+ * managing the booking.
1826
+ */
1827
+ revision: string | null;
1828
+ /**
1829
+ * Total number of participants. Available only for services with
1830
+ * variants.
1831
+ * Pass when all participants book the same variant.
1832
+ */
1833
+ totalParticipants?: number;
1834
+ /**
1835
+ * Information about the service choices to book. Available only for services with
1836
+ * variants.
1837
+ * Pass when not all participants book the same variant.
1838
+ */
1839
+ participantsChoices?: ParticipantChoices;
1840
+ }