@wix/bookings 1.0.33 → 1.0.34

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 (31) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +2 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/src/bookings-services-v2-service.http.d.ts +21 -0
  5. package/build/cjs/src/bookings-services-v2-service.http.js +175 -0
  6. package/build/cjs/src/bookings-services-v2-service.http.js.map +1 -0
  7. package/build/cjs/src/bookings-services-v2-service.public.d.ts +5 -0
  8. package/build/cjs/src/bookings-services-v2-service.public.js +25 -0
  9. package/build/cjs/src/bookings-services-v2-service.public.js.map +1 -0
  10. package/build/cjs/src/bookings-services-v2-service.types.d.ts +958 -0
  11. package/build/cjs/src/bookings-services-v2-service.types.js +64 -0
  12. package/build/cjs/src/bookings-services-v2-service.types.js.map +1 -0
  13. package/build/cjs/src/bookings-services-v2-service.universal.d.ts +1034 -0
  14. package/build/cjs/src/bookings-services-v2-service.universal.js +272 -0
  15. package/build/cjs/src/bookings-services-v2-service.universal.js.map +1 -0
  16. package/build/es/index.d.ts +1 -0
  17. package/build/es/index.js +1 -0
  18. package/build/es/index.js.map +1 -1
  19. package/build/es/src/bookings-services-v2-service.http.d.ts +21 -0
  20. package/build/es/src/bookings-services-v2-service.http.js +170 -0
  21. package/build/es/src/bookings-services-v2-service.http.js.map +1 -0
  22. package/build/es/src/bookings-services-v2-service.public.d.ts +5 -0
  23. package/build/es/src/bookings-services-v2-service.public.js +13 -0
  24. package/build/es/src/bookings-services-v2-service.public.js.map +1 -0
  25. package/build/es/src/bookings-services-v2-service.types.d.ts +958 -0
  26. package/build/es/src/bookings-services-v2-service.types.js +61 -0
  27. package/build/es/src/bookings-services-v2-service.types.js.map +1 -0
  28. package/build/es/src/bookings-services-v2-service.universal.d.ts +1034 -0
  29. package/build/es/src/bookings-services-v2-service.universal.js +248 -0
  30. package/build/es/src/bookings-services-v2-service.universal.js.map +1 -0
  31. package/package.json +2 -2
@@ -0,0 +1,958 @@
1
+ /** The `Service` object represents the business offering that a business provides to its customers. */
2
+ export interface Service {
3
+ /**
4
+ * Service ID.
5
+ * @readonly
6
+ */
7
+ id?: string | null;
8
+ /** Service type. */
9
+ type?: ServiceType;
10
+ /** Order of a service within a category. */
11
+ sortOrder?: number | null;
12
+ /** Service name. */
13
+ name?: string | null;
14
+ /** Service description, Such as `High-class hair styling, cuts, straightening and color` */
15
+ description?: string | null;
16
+ /** Short service description, Such as `Hair styling` */
17
+ tagLine?: string | null;
18
+ /** Default maximum number of customers that can book the service. The service cannot be booked beyond this capacity. */
19
+ defaultCapacity?: number | null;
20
+ /** Media associated with the service. */
21
+ media?: Media;
22
+ /** Whether the service is hidden from the site. if `true`, the service is hidden. Otherwise, the service is visible. */
23
+ hidden?: boolean | null;
24
+ /** The category the service is associated with. */
25
+ category?: V2Category;
26
+ /** The form used when booking the service. */
27
+ form?: Form;
28
+ /** Payment options for booking the service. */
29
+ payment?: Payment;
30
+ /** Online booking settings. */
31
+ onlineBooking?: OnlineBooking;
32
+ /**
33
+ * IDs of the staff members providing the service. For appointments only.
34
+ * @readonly
35
+ */
36
+ staffMembersIds?: string[];
37
+ /** Conferencing options for this service. */
38
+ conferencing?: Conferencing;
39
+ /**
40
+ * The locations this service is offered at. For courses only: Currently, only 1 location is supported.
41
+ * @readonly
42
+ */
43
+ locations?: Location[];
44
+ /** Policy determining under what conditions this service can be booked. For example, whether the service can only be booked up to 30 minutes before it begins. */
45
+ bookingPolicy?: BookingPolicy;
46
+ /**
47
+ * The service's schedule, which can be used to manage the service's sessions.
48
+ * @readonly
49
+ */
50
+ schedule?: Schedule;
51
+ /**
52
+ * A slug is the last part of the URL address that serves as a unique identifier of the service.
53
+ * The list of supported slugs includes past service names for backwards compatibility, and a custom slug if one was set by the business owner.
54
+ * @readonly
55
+ */
56
+ supportedSlugs?: Slug[];
57
+ /**
58
+ * The main slug for the service. `mainSlug` is either taken from the current service name or is a custom slug set by the business owner.
59
+ * `mainSlug` is used to construct the service's URLs.
60
+ * @readonly
61
+ */
62
+ mainSlug?: Slug;
63
+ /**
64
+ * The URLs to various service-related pages, such as the calendar page and the booking page.
65
+ * @readonly
66
+ */
67
+ urls?: URLs;
68
+ /** Custom SEO data for the service. */
69
+ seoData?: SeoSchema;
70
+ /**
71
+ * Date and time the service was created. This is a system field.
72
+ * @readonly
73
+ */
74
+ createdDate?: Date;
75
+ /**
76
+ * Date and time the service was updated. This is a system field.
77
+ * @readonly
78
+ */
79
+ updatedDate?: Date;
80
+ /**
81
+ * Revision number, which increments by 1 each time the service is updated. To prevent conflicting changes, the existing revision must be used when updating a service.
82
+ * @readonly
83
+ */
84
+ revision?: string | null;
85
+ }
86
+ export declare enum ServiceType {
87
+ UNKNOWN_SERVICE_TYPE = "UNKNOWN_SERVICE_TYPE",
88
+ /** The service is an appointment. */
89
+ APPOINTMENT = "APPOINTMENT",
90
+ /** The service is a class. */
91
+ CLASS = "CLASS",
92
+ /** The service is a course. */
93
+ COURSE = "COURSE"
94
+ }
95
+ export interface Media {
96
+ /** Media items associated with the service. */
97
+ items?: MediaItem[];
98
+ /** Primary media associated with the service. */
99
+ mainMedia?: MediaItem;
100
+ /** Cover media associated with the service. */
101
+ coverMedia?: MediaItem;
102
+ }
103
+ export interface MediaItem extends MediaItemItemOneOf {
104
+ /** Details of the image associated with the service, such as URL and size. */
105
+ image?: Image;
106
+ }
107
+ /** @oneof */
108
+ export interface MediaItemItemOneOf {
109
+ /** Details of the image associated with the service, such as URL and size. */
110
+ image?: Image;
111
+ }
112
+ export interface Image {
113
+ /** WixMedia image ID. */
114
+ id?: string;
115
+ /** Image URL. */
116
+ url?: string;
117
+ /**
118
+ * Original image height.
119
+ * @readonly
120
+ */
121
+ height?: number;
122
+ /**
123
+ * Original image width.
124
+ * @readonly
125
+ */
126
+ width?: number;
127
+ /** Image alt text. */
128
+ altText?: string | null;
129
+ /**
130
+ * Image file name.
131
+ * @readonly
132
+ */
133
+ filename?: string | null;
134
+ }
135
+ export interface V2Category {
136
+ /**
137
+ * Category ID.
138
+ * @readonly
139
+ */
140
+ id?: string;
141
+ /**
142
+ * Category name.
143
+ * @readonly
144
+ */
145
+ name?: string | null;
146
+ /**
147
+ * Order of a category within a category list.
148
+ * @readonly
149
+ */
150
+ sortOrder?: number | null;
151
+ }
152
+ export interface Form {
153
+ /**
154
+ * ID of the form associated with the service.
155
+ * Form information submitted when booking, including contact details, participants, and other form fields, set up for the service.
156
+ * Managing the service booking form fields is done via the [Bookings forms API](https://dev.wix.com/api/rest/wix-bookings/services/form/form-object)
157
+ */
158
+ id?: string;
159
+ }
160
+ export interface FormSettings {
161
+ /** Whether the service booking form should be hidden from the site. if `true`, the form is hidden. Otherwise, the form is visible. */
162
+ hidden?: boolean | null;
163
+ }
164
+ export interface Payment extends PaymentRateOneOf {
165
+ /**
166
+ * The rate the customer is expected to pay for the service.
167
+ * Can be:
168
+ * - `FIXED`: The service has a fixed price.
169
+ * - `CUSTOM`: The service has a custom price, expressed as a price description.
170
+ * - `VARIED`: This service is offered with a set of different prices based on different terms.
171
+ * - `NO_FEE`: This service is offered free of charge.
172
+ */
173
+ rateType?: RateType;
174
+ /**
175
+ * IDs of pricing plans that can be used as payment for the service.
176
+ * @readonly
177
+ */
178
+ pricingPlansIds?: string[];
179
+ /** The payment options a customer can use to pay for the service. */
180
+ options?: PaymentOptions;
181
+ /**
182
+ * The details for the fixed price of the service.
183
+ * Required when `rateType` is `FIXED`.
184
+ */
185
+ fixed?: FixedPayment;
186
+ /**
187
+ * The details for the custom price of the service.
188
+ * Required when `rateType` is `CUSTOM`.
189
+ */
190
+ custom?: CustomPayment;
191
+ /**
192
+ * The details for the varied pricing of the service.
193
+ * Required when `rateType` is `VARIED`. Read more about [varied price options](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online#offering-varied-price-options)
194
+ */
195
+ varied?: VariedPayment;
196
+ }
197
+ /** @oneof */
198
+ export interface PaymentRateOneOf {
199
+ /**
200
+ * The details for the fixed price of the service.
201
+ * Required when `rateType` is `FIXED`.
202
+ */
203
+ fixed?: FixedPayment;
204
+ /**
205
+ * The details for the custom price of the service.
206
+ * Required when `rateType` is `CUSTOM`.
207
+ */
208
+ custom?: CustomPayment;
209
+ /**
210
+ * The details for the varied pricing of the service.
211
+ * Required when `rateType` is `VARIED`. Read more about [varied price options](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online#offering-varied-price-options)
212
+ */
213
+ varied?: VariedPayment;
214
+ }
215
+ export declare enum RateType {
216
+ UNKNOWN_RATE_TYPE = "UNKNOWN_RATE_TYPE",
217
+ /** The service has a fixed price. */
218
+ FIXED = "FIXED",
219
+ /** The service has a custom price, expressed as a price description. */
220
+ CUSTOM = "CUSTOM",
221
+ /** This service is offered with a set of different prices based on different terms. */
222
+ VARIED = "VARIED",
223
+ /** This service is offered free of charge. */
224
+ NO_FEE = "NO_FEE"
225
+ }
226
+ export interface FixedPayment {
227
+ /**
228
+ * The fixed price required to book the service.
229
+ * Required when `rateType` is `FIXED`.
230
+ */
231
+ price?: Money;
232
+ /** The deposit price required to book the service. Required when `rateType` is `FIXED` and `paymentOptions.deposit` is `true`. */
233
+ deposit?: Money;
234
+ }
235
+ /**
236
+ * Money.
237
+ * Default format to use. Sufficiently compliant with majority of standards: w3c, ISO 4217, ISO 20022, ISO 8583:2003.
238
+ */
239
+ export interface Money {
240
+ /** Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative. */
241
+ value?: string;
242
+ /** Currency code. Must be valid ISO 4217 currency code (e.g., USD). */
243
+ currency?: string;
244
+ /** Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. */
245
+ formattedValue?: string | null;
246
+ }
247
+ export interface CustomPayment {
248
+ /** A custom description explaining the customer how to pay for the service. */
249
+ description?: string | null;
250
+ }
251
+ export interface VariedPayment {
252
+ /** The default price for the service without any variants. It will also be used as the default price for any new variant. */
253
+ defaultPrice?: Money;
254
+ /** The deposit price required to book the service. Required when `rateType` is `VARIED` and `paymentOptions.deposit` is `true`. */
255
+ deposit?: Money;
256
+ /**
257
+ * The minimal price a customer may pay for this service, based on its variants.
258
+ * @readonly
259
+ */
260
+ minPrice?: Money;
261
+ /**
262
+ * The maximum price a customer may pay for this service, based on its variants.
263
+ * @readonly
264
+ */
265
+ maxPrice?: Money;
266
+ }
267
+ export interface PaymentOptions {
268
+ /**
269
+ * Customers can pay for the service online.
270
+ * When `true`:
271
+ * + `rateType` must be either `FIXED` or `VARIED`.
272
+ * + `fixed.price` or `varied.default_price` must be specified respectively. Read more about [getting paid online](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online)
273
+ */
274
+ online?: boolean | null;
275
+ /** Customers can pay for the service in person. */
276
+ inPerson?: boolean | null;
277
+ /**
278
+ * This service requires a deposit to be made online in order to book it.
279
+ * When `true`:
280
+ * + `rateType` must be `VARIED` or `FIXED`.
281
+ * + A `deposit` must be specified.
282
+ */
283
+ deposit?: boolean | null;
284
+ /** Customers can pay for the service using a pricing plan. */
285
+ pricingPlan?: boolean | null;
286
+ }
287
+ export interface OnlineBooking {
288
+ /**
289
+ * Whether this service can be booked online.
290
+ * When set to `true`, customers can book the service online. Configuring the payment options is done via `service.payment` property.
291
+ * When set to `false`, customers cannot book the service online, and the service can only be paid for in person.
292
+ */
293
+ enabled?: boolean | null;
294
+ /** Booking the service requires approval by the business owner. */
295
+ requireManualApproval?: boolean | null;
296
+ /** Multiple customers can request to book the same time slot. Relevant when `requireManualApproval` is `true`. */
297
+ allowMultipleRequests?: boolean | null;
298
+ }
299
+ export interface Conferencing {
300
+ /** Whether a conference link is generated for the service's sessions. */
301
+ enabled?: boolean | null;
302
+ }
303
+ export interface Location extends LocationOptionsOneOf {
304
+ /**
305
+ * The type of location:
306
+ * - `CUSTOM`: The location is specific to this service, and is not derived from the business location.
307
+ * - `BUSINESS`: A business location, as defined for the by the Business Info [Locations API](https://dev.wix.com/api/rest/business-info/locations)..
308
+ * - `CUSTOMER`: Will be determined by the customer. For appointments only.
309
+ */
310
+ type?: LocationType;
311
+ /**
312
+ * The location address, based on the location `type`. If `type` is `CUSTOMER`, this address is empty.
313
+ * @readonly
314
+ */
315
+ address?: Address;
316
+ /** The service is offered at the referenced business location. */
317
+ business?: BusinessLocationOptions;
318
+ /** The service is offered at a custom location. */
319
+ custom?: CustomLocationOptions;
320
+ }
321
+ /** @oneof */
322
+ export interface LocationOptionsOneOf {
323
+ /** The service is offered at the referenced business location. */
324
+ business?: BusinessLocationOptions;
325
+ /** The service is offered at a custom location. */
326
+ custom?: CustomLocationOptions;
327
+ }
328
+ export declare enum LocationType {
329
+ UNKNOWN_LOCATION_TYPE = "UNKNOWN_LOCATION_TYPE",
330
+ /** The location is unique to this service and isn't defined as one of the business locations. */
331
+ CUSTOM = "CUSTOM",
332
+ /** The location is one of the business locations available using the Business Info [Locations API](https://dev.wix.com/api/rest/business-info/locations). */
333
+ BUSINESS = "BUSINESS",
334
+ /** The location can be determined by the customer and is not set up beforehand. This is applicable to services of type `APPOINTMENT` only. */
335
+ CUSTOMER = "CUSTOMER"
336
+ }
337
+ export interface Address {
338
+ /** 2-letter country code in an [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. */
339
+ country?: string | null;
340
+ /** Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. */
341
+ subdivision?: string | null;
342
+ /** City name. */
343
+ city?: string | null;
344
+ /** Postal or zip code. */
345
+ postalCode?: string | null;
346
+ /** Street address. Includes street name, number, and apartment number in separate fields. */
347
+ streetAddress?: StreetAddress;
348
+ /** Full address of the location. */
349
+ formattedAddress?: string | null;
350
+ }
351
+ /** Street address. Includes street name, number, and apartment number in separate fields. */
352
+ export interface StreetAddress {
353
+ /** Street number. */
354
+ number?: string;
355
+ /** Street name. */
356
+ name?: string;
357
+ /** Apartment number. */
358
+ apt?: string;
359
+ }
360
+ export interface AddressLocation {
361
+ /** Address latitude. */
362
+ latitude?: number | null;
363
+ /** Address longitude. */
364
+ longitude?: number | null;
365
+ }
366
+ export interface BusinessLocationOptions {
367
+ /** Business location ID. */
368
+ id?: string;
369
+ /**
370
+ * Business location name.
371
+ * @readonly
372
+ */
373
+ name?: string;
374
+ /**
375
+ * Whether this is the default location. There can only be one default location per site. The default location can't be archived.
376
+ * @readonly
377
+ */
378
+ default?: boolean | null;
379
+ /**
380
+ * Business location address. The address is derived from the business location and is read-only.
381
+ * @readonly
382
+ */
383
+ address?: Address;
384
+ }
385
+ export interface CustomLocationOptions {
386
+ /** A custom address for the location. */
387
+ address?: Address;
388
+ }
389
+ /**
390
+ * `BookingPolicy` is the main entity of `BookingPolicyService` and specifies a set of rules for booking a service
391
+ * by visitors and members.
392
+ *
393
+ * Each `BookingPolicy` consists of a number of sub-policies. When the Bookings App is provisioned to a meta site then a
394
+ * default `BookingPolicy` will be created with defaults for each of these sub-policies. This also applies when a request
395
+ * is received to create a new `BookingPolicy` and one or more of these sub-policies are not provided.
396
+ *
397
+ * Sub-policies are defined in separate objects as specified below.
398
+ *
399
+ * - The `LimitEarlyBookingPolicy` object defines the policy for limiting early bookings.
400
+ * - The `LimitLateBookingPolicy` object defines the policy for limiting late bookings.
401
+ * - The `BookAfterStartPolicy` object defines the policy for booking after the start of the schedule.
402
+ * - The `CancellationPolicy` object defines the policy for canceling a booked entity.
403
+ * - The `ReschedulePolicy` object defines the policy for rescheduling booked entity.
404
+ * - The `WaitlistPolicy` object defines the policy for a waitlist.
405
+ * - The `ParticipantsPolicy` object defines the policy regarding the participants per booking.
406
+ *
407
+ * By default each sub-policy is disabled. A more detailed specification of the default settings of each sub-policy
408
+ * can be found in the description of the corresponding object.
409
+ *
410
+ * Partial updates are supported on the main entity level, however in order to update a sub-policy the client needs to provide the whole sub-policy object.
411
+ */
412
+ export interface BookingPolicy {
413
+ /** The ID referencing the policy for the booking. */
414
+ id?: string | null;
415
+ /**
416
+ * Revision number, which increments by 1 each time the policy is updated. To prevent conflicting changes, the existing revision must be used when updating a policy.
417
+ * @readonly
418
+ */
419
+ revision?: string | null;
420
+ /**
421
+ * Date and time the policy was created. This is a system field.
422
+ * @readonly
423
+ */
424
+ createdDate?: Date;
425
+ /**
426
+ * Date and time the policy was updated. This is a system field.
427
+ * @readonly
428
+ */
429
+ updatedDate?: Date;
430
+ /**
431
+ * Name of the policy.
432
+ * @readonly
433
+ */
434
+ name?: string | null;
435
+ /**
436
+ * Custom description for the policy. This policy is displayed to the participant.
437
+ * @readonly
438
+ */
439
+ customPolicyDescription?: PolicyDescription;
440
+ /**
441
+ * `true` if the policy is the default for the meta site. Otherwise, `false`.
442
+ * @readonly
443
+ */
444
+ default?: boolean | null;
445
+ /**
446
+ * Policy for limiting early bookings.
447
+ * @readonly
448
+ */
449
+ limitEarlyBookingPolicy?: LimitEarlyBookingPolicy;
450
+ /**
451
+ * Policy for limiting late bookings.
452
+ * @readonly
453
+ */
454
+ limitLateBookingPolicy?: LimitLateBookingPolicy;
455
+ /**
456
+ * Policy on booking an entity after the start of the schedule.
457
+ * @readonly
458
+ */
459
+ bookAfterStartPolicy?: BookAfterStartPolicy;
460
+ /**
461
+ * Policy for canceling a booked entity.
462
+ * @readonly
463
+ */
464
+ cancellationPolicy?: CancellationPolicy;
465
+ /**
466
+ * Policy for rescheduling a booked entity.
467
+ * @readonly
468
+ */
469
+ reschedulePolicy?: ReschedulePolicy;
470
+ /**
471
+ * Waitlist policy for the service.
472
+ * @readonly
473
+ */
474
+ waitlistPolicy?: WaitlistPolicy;
475
+ /**
476
+ * Policy regarding the participants per booking.
477
+ * @readonly
478
+ */
479
+ participantsPolicy?: ParticipantsPolicy;
480
+ }
481
+ /**
482
+ * This object specifies a policy description to be displayed to participants. By default `enabled` is set to `false`
483
+ * and `description` is left empty, implying that this BookingPolicy does not have a description.
484
+ */
485
+ export interface PolicyDescription {
486
+ /** `true` if a policy description should be displayed, otherwise `false`. */
487
+ enabled?: boolean;
488
+ /** Policy description to be displayed */
489
+ description?: string;
490
+ }
491
+ /**
492
+ * This object specifies the policy for limiting early bookings. By default `enabled` set to `false` and
493
+ * `earliest_booking_in_minutes` set to 10080 minutes (7 days).
494
+ */
495
+ export interface LimitEarlyBookingPolicy {
496
+ /**
497
+ * `true` if this policy is enabled, otherwise `false`. When not enabled then there is no limit on the earliest
498
+ * booking time.
499
+ */
500
+ enabled?: boolean;
501
+ /**
502
+ * Maximum number of minutes before the start of the entity that a booking can be made. This value must be greater
503
+ * than `latest_booking_in_minutes` in `LimitLateBookingPolicy`.
504
+ */
505
+ earliestBookingInMinutes?: number;
506
+ }
507
+ /**
508
+ * This object specifies the policy for limiting late bookings. By default `enabled` set to `false` and
509
+ * `latest_booking_in_minutes` set to 1440 minutes (1 day).
510
+ * Note that this policy and `BookAfterStartPolicy` cannot be enabled both at the same time. So if this policy
511
+ * is enabled then `BookAfterStartPolicy` must be disabled.
512
+ */
513
+ export interface LimitLateBookingPolicy {
514
+ /**
515
+ * `true` if this policy is enabled, otherwise `false`. When not enabled then there is no limit on the latest
516
+ * booking time.
517
+ */
518
+ enabled?: boolean;
519
+ /**
520
+ * Minimum number of minutes before the start of the entity that a booking can be made.
521
+ * For a schedule, this is relative to the start time of the next booked entity, excluding past booked entities.
522
+ * This value must be less than `earliest_booking_in_minutes` in `LimitEarlyBookingPolicy`.
523
+ */
524
+ latestBookingInMinutes?: number;
525
+ }
526
+ /**
527
+ * This object specifies the policy on whether an entity can be booked after the start of the schedule. By default
528
+ * `enabled` is set to `false`.
529
+ * Note that this policy and `LimitLateBookingPolicy` cannot be enabled both at the same time. So if this policy
530
+ * is enabled then `LimitLateBookingPolicy` must be disabled.
531
+ */
532
+ export interface BookAfterStartPolicy {
533
+ /** `true` if booking is allowed after the start of the schedule, otherwise `false`. */
534
+ enabled?: boolean;
535
+ }
536
+ /**
537
+ * This object specifies the policy on cancelling a booked entity. By default both `enabled` and
538
+ * `limit_latest_cancellation` are set to `false` and `latest_cancellation_in_minutes` is set to 1440 minutes (1 day).
539
+ */
540
+ export interface CancellationPolicy {
541
+ /** `true` if cancelling a booking is allowed, otherwise `false`. */
542
+ enabled?: boolean;
543
+ /** `true` if there is a limit on the latest cancellation time, otherwise `false`. */
544
+ limitLatestCancellation?: boolean;
545
+ /** Minimum number of minutes before the start of the booked entity that a booking can be cancelled. */
546
+ latestCancellationInMinutes?: number;
547
+ }
548
+ /**
549
+ * This object specifies the policy on rescheduling a booked entity. By default both `enabled` and
550
+ * `limit_latest_reschedule` are set to `false` and `latest_reschedule_in_minutes` is set to 1440 minutes (1 day).
551
+ */
552
+ export interface ReschedulePolicy {
553
+ /** `true` if rescheduling a booking is allowed, otherwise `false`. */
554
+ enabled?: boolean;
555
+ /** `true` if there is a limit on the latest reschedule time, otherwise `false`. */
556
+ limitLatestReschedule?: boolean;
557
+ /** Minimum number of minutes before the start of the booked entity that a booking can be rescheduled. */
558
+ latestRescheduleInMinutes?: number;
559
+ }
560
+ /**
561
+ * This object specifies the policy for the waitlist. By default `enabled` is set to false
562
+ * (indicating that waitlisting is disabled), and both `capacity` and `reservation_time_in_minutes` are set to 10.
563
+ */
564
+ export interface WaitlistPolicy {
565
+ /** `true` if the entity has a waitlist, otherwise `false`. */
566
+ enabled?: boolean;
567
+ /** Number of spots available in the waitlist. Defaults to 10 spots. */
568
+ capacity?: number;
569
+ /** Amount of time a participant is given to book, once notified that a spot is available. Defaults to 10 minutes. */
570
+ reservationTimeInMinutes?: number;
571
+ }
572
+ /**
573
+ * This object specifies the policy for the participants per booking (for example, setting the maximum number
574
+ * of participants). By default `enabled` is set to false and `max_participants_per_booking` is set to 1.
575
+ */
576
+ export interface ParticipantsPolicy {
577
+ /** `true` if a policy with respect to the participants applies, otherwise `false`. */
578
+ enabled?: boolean;
579
+ /** Maximum number of participants. Defaults to 1 participant. */
580
+ maxParticipantsPerBooking?: number;
581
+ }
582
+ export interface Schedule {
583
+ /**
584
+ * Schedule ID, used to manage the service's sessions.
585
+ * @readonly
586
+ */
587
+ id?: string | null;
588
+ /** Limitations dictating the way session availability is calculated. Relevant only for appointments. */
589
+ availabilityConstraints?: AvailabilityConstraints;
590
+ }
591
+ export interface AvailabilityConstraints {
592
+ /**
593
+ * A list of duration options for sessions, in minutes.
594
+ *
595
+ * Min: 1 minute
596
+ *
597
+ * The availability calculation generates slots for sessions with these durations, unless there is a conflict with existing sessions or other availability constraints exist.
598
+ * Required for services of type `APPOINTMENT` to allow the customer to book a session of the service. Not relevant for other service types.
599
+ */
600
+ sessionDurations?: number[];
601
+ /**
602
+ * The number of minutes between the end of a session and the start of the next.
603
+ *
604
+ * Min: 0 minutes
605
+ * Max: 720 minutes
606
+ */
607
+ timeBetweenSessions?: number;
608
+ }
609
+ export interface Slug {
610
+ /** The unique part of service's URL that identifies the service's information page. For example, `service-1` in `https:/example.com/services/service-1`. */
611
+ name?: string;
612
+ /**
613
+ * Whether the slug was generated or customized. If `true`, the slug was set manually by the business owner. Otherwise, the slug was generated from the service name.
614
+ * @readonly
615
+ */
616
+ custom?: boolean | null;
617
+ /**
618
+ * Date and time the slug was created. This is a system field.
619
+ * @readonly
620
+ */
621
+ createdDate?: Date;
622
+ }
623
+ export interface URLs {
624
+ /**
625
+ * The URL for the service page.
626
+ * @readonly
627
+ */
628
+ servicePage?: PageUrlV2;
629
+ /**
630
+ * The URL for the booking entry point. It can be either to the calendar or to the service page.
631
+ * @readonly
632
+ */
633
+ bookingPage?: PageUrlV2;
634
+ /**
635
+ * The URL for the calendar. Can be empty if no calendar exists.
636
+ * @readonly
637
+ */
638
+ calendarPage?: PageUrlV2;
639
+ }
640
+ export interface PageUrlV2 {
641
+ /** The path to that page - e.g /product-page/a-product */
642
+ relativePath?: string;
643
+ /** The URL of that page. e.g https://mysite.com/product-page/a-product */
644
+ url?: string | null;
645
+ }
646
+ export interface ExtendedFields {
647
+ /**
648
+ * Data Extensions extended fields
649
+ * Key: Namespace
650
+ * Value: extended fields data in Struct format
651
+ */
652
+ namespaces?: Record<string, Record<string, any>>;
653
+ }
654
+ /**
655
+ * The SEO schema object contains data about different types of meta tags. It makes sure that the information about your page is presented properly to search engines.
656
+ * The search engines use this information for ranking purposes, or to display snippets in the search results.
657
+ * This data will override other sources of tags (for example patterns) and will be included in the <head> section of the HTML document, while not being displayed on the page itself.
658
+ */
659
+ export interface SeoSchema {
660
+ /** SEO tags information. */
661
+ tags?: Tag[];
662
+ /** SEO general settings. */
663
+ settings?: Settings;
664
+ }
665
+ export interface Keyword {
666
+ /** Keyword value */
667
+ term?: string;
668
+ /** Whether the keyword is the main focused */
669
+ isMain?: boolean;
670
+ }
671
+ export interface Tag {
672
+ /**
673
+ * SEO tag type.
674
+ *
675
+ *
676
+ * Supported values: `title`, `meta`, `script`, `link`.
677
+ */
678
+ type?: string;
679
+ /**
680
+ * A `{'key':'value'} pair object where each SEO tag property (`'name'`, `'content'`, `'rel'`, `'href'`) contains a value.
681
+ * For example: `{'name': 'description', 'content': 'the description itself'}`.
682
+ */
683
+ props?: Record<string, any> | null;
684
+ /** SEO tag meta data. For example, `{height: 300, width: 240}`. */
685
+ meta?: Record<string, any> | null;
686
+ /** SEO tag inner content. For example, `<title> inner content </title>`. */
687
+ children?: string;
688
+ /** Whether the tag is a custom tag. */
689
+ custom?: boolean;
690
+ /** Whether the tag is disabled. */
691
+ disabled?: boolean;
692
+ }
693
+ export interface Settings {
694
+ /**
695
+ * Whether the auto redirects feature creating `301 redirects` on a slug change is enabled.
696
+ *
697
+ *
698
+ * Default: enabled
699
+ */
700
+ preventAutoRedirect?: boolean;
701
+ /** User-selected keyword terms for a specific page */
702
+ keywords?: Keyword[];
703
+ }
704
+ export interface CreateServiceRequest {
705
+ /** Service to be created */
706
+ service?: Service;
707
+ }
708
+ export interface CreateServiceResponse {
709
+ /** The created Service */
710
+ service?: Service;
711
+ }
712
+ export interface GetServiceRequest {
713
+ /** Id of the Service to retrieve */
714
+ serviceId: string;
715
+ }
716
+ export interface GetServiceResponse {
717
+ /** The retrieved Service */
718
+ service?: Service;
719
+ }
720
+ export interface UpdateServiceRequest {
721
+ /** Service to be updated, may be partial */
722
+ service?: Service;
723
+ /** Explicit list of fields to update */
724
+ mask?: string[];
725
+ }
726
+ export interface UpdateServiceResponse {
727
+ /** The updated Service */
728
+ service?: Service;
729
+ }
730
+ export interface DeleteServiceRequest {
731
+ /** Id of the Service to delete */
732
+ serviceId?: string;
733
+ /** The revision of the Service */
734
+ revision?: string;
735
+ }
736
+ export interface DeleteServiceResponse {
737
+ }
738
+ export interface QueryServicesRequest {
739
+ /** WQL expression */
740
+ query: CursorQuery;
741
+ }
742
+ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
743
+ /**
744
+ * Filter object in the following format:
745
+ * `"filter" : {
746
+ * "fieldName1": "value1",
747
+ * "fieldName2":{"$operator":"value2"}
748
+ * }`
749
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
750
+ */
751
+ filter?: Record<string, any> | null;
752
+ /**
753
+ * Sort object in the following format:
754
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
755
+ */
756
+ sort?: Sorting[];
757
+ /** 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`. */
758
+ cursorPaging?: CursorPaging;
759
+ }
760
+ /** @oneof */
761
+ export interface CursorQueryPagingMethodOneOf {
762
+ /** 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`. */
763
+ cursorPaging?: CursorPaging;
764
+ }
765
+ export interface Sorting {
766
+ /** Name of the field to sort by. */
767
+ fieldName?: string;
768
+ /** Sort order. */
769
+ order?: SortOrder;
770
+ }
771
+ export declare enum SortOrder {
772
+ ASC = "ASC",
773
+ DESC = "DESC"
774
+ }
775
+ export interface CursorPaging {
776
+ /** Number of items to load. */
777
+ limit?: number | null;
778
+ /**
779
+ * Pointer to the next or previous page in the list of results.
780
+ *
781
+ * You can get the relevant cursor token
782
+ * from the `pagingMetadata` object in the previous call's response.
783
+ * Not relevant for the first request.
784
+ */
785
+ cursor?: string | null;
786
+ }
787
+ export interface QueryServicesResponse {
788
+ /** The retrieved Services */
789
+ services?: Service[];
790
+ /** Paging metadata, including offset, count and [cursors](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_cursor-paging). */
791
+ pagingMetadata?: CursorPagingMetadata;
792
+ }
793
+ export interface CursorPagingMetadata {
794
+ /** Number of items returned in the response. */
795
+ count?: number | null;
796
+ /** Use these cursor to paginate between results. [Read more](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_cursor-paging). */
797
+ cursors?: Cursors;
798
+ /**
799
+ * Indicates if there are more results after the current page.
800
+ * If `true`, another page of results can be retrieved.
801
+ * If `false`, this is the last page.
802
+ */
803
+ hasNext?: boolean | null;
804
+ }
805
+ export interface Cursors {
806
+ /** Cursor pointing to next page in the list of results. */
807
+ next?: string | null;
808
+ /** Cursor pointing to previous page in the list of results. */
809
+ prev?: string | null;
810
+ }
811
+ export interface CountServicesRequest {
812
+ /** The filters to perform the count by. */
813
+ filter?: Record<string, any> | null;
814
+ }
815
+ export interface CountServicesResponse {
816
+ /** The number of Services matching the provided filter in the request. */
817
+ count?: number;
818
+ }
819
+ /** An event sent every time a category entity is changed. */
820
+ export interface CategoryNotification {
821
+ category?: Category;
822
+ event?: Event;
823
+ }
824
+ /** Categories are used to group multiple services together. A service must be associated with a category in order to be exposed in the Wix Bookings UI. */
825
+ export interface Category {
826
+ /**
827
+ * Category ID. Read-only.
828
+ * @readonly
829
+ */
830
+ id?: string | null;
831
+ /** Category name. */
832
+ name?: string | null;
833
+ /** Custom properties that can be associated with the category. */
834
+ customProperties?: Record<string, string>;
835
+ /**
836
+ * Category status Read-only.
837
+ * @readonly
838
+ */
839
+ status?: Status;
840
+ /** Sorting order of the category for Wix Bookings UI. */
841
+ sortOrder?: number | null;
842
+ }
843
+ export declare enum Status {
844
+ /** Default status. */
845
+ CREATED = "CREATED",
846
+ /** Category is deleted. */
847
+ DELETED = "DELETED"
848
+ }
849
+ export declare enum Event {
850
+ Updated = "Updated",
851
+ Deleted = "Deleted",
852
+ Created = "Created"
853
+ }
854
+ export interface Empty {
855
+ }
856
+ export interface AddStaffMembersToServiceRequest {
857
+ /** Id of the service to add the staff member to. */
858
+ serviceId?: string;
859
+ /** The staff id to add to the service. */
860
+ staffMembersIds?: string[];
861
+ }
862
+ export interface AddStaffMembersToServiceResponse {
863
+ /** The added staff members */
864
+ staffMembers?: StaffMember[];
865
+ }
866
+ export interface StaffMember {
867
+ /**
868
+ * Staff member id, can be used to retrieve resource information using wix-bookings-backend resources API.
869
+ * @readonly
870
+ */
871
+ id?: string;
872
+ /**
873
+ * Staff member's email address.
874
+ * @readonly
875
+ */
876
+ email?: string | null;
877
+ /**
878
+ * Staff member's phone number.
879
+ * @readonly
880
+ */
881
+ phone?: string | null;
882
+ /**
883
+ * Staff member's description.
884
+ * @readonly
885
+ */
886
+ description?: string | null;
887
+ /** Staff member's schedules */
888
+ schedules?: Schedule[];
889
+ }
890
+ export interface InvalidStaffMember {
891
+ /** The invalid staff member id. */
892
+ id?: string;
893
+ /** The reason for the staff member considered as invalid */
894
+ message?: string;
895
+ }
896
+ export interface RemoveStaffMembersFromServiceRequest {
897
+ /** Id of the service to remove the staff member from. */
898
+ serviceId?: string;
899
+ /** The staff id to remove from the service. */
900
+ staffMembersIds?: string[];
901
+ }
902
+ export interface RemoveStaffMembersFromServiceResponse {
903
+ }
904
+ export interface ConnectPricingPlansToServiceRequest {
905
+ /** Id of the service to add the pricing plan to. */
906
+ serviceId?: string;
907
+ /** The pricing plan id to add to the service. */
908
+ pricingPlansIds?: string[];
909
+ }
910
+ export interface ConnectPricingPlansToServiceResponse {
911
+ /** The pricing plan id connected to the service. */
912
+ pricingPlansIds?: string[];
913
+ }
914
+ export interface InvalidPricingPlan {
915
+ /** The invalid pricing plan id. */
916
+ id?: string;
917
+ /** The reason for the pricing plan considered as invalid */
918
+ message?: string;
919
+ }
920
+ export interface DisconnectPricingPlansFromServiceRequest {
921
+ /** Id of the service to remove the pricing plan from. */
922
+ serviceId?: string;
923
+ /** The pricing plan id to disconnect from the service. */
924
+ pricingPlansIds?: string[];
925
+ }
926
+ export interface DisconnectPricingPlansFromServiceResponse {
927
+ }
928
+ export interface SetCustomSlugRequest {
929
+ /** Id of the service to assign the custom slug to. */
930
+ serviceId?: string;
931
+ /** The custom name to set as the active slug for the service. */
932
+ slugName?: string;
933
+ }
934
+ export interface SetCustomSlugResponse {
935
+ /** The new slug set as the active slug for the service. */
936
+ slug?: Slug;
937
+ }
938
+ export interface ValidateSlugRequest {
939
+ /** The custom name to validate as a slug for the service. */
940
+ slugName?: string;
941
+ }
942
+ export interface ValidateSlugResponse {
943
+ /** true if the requested name is valid, false if invalid. */
944
+ valid?: boolean;
945
+ /** The requested custom name to validate, if valid - it can be set as a slug for the service, and will be populated with the requested slug, if valid is false - will be empty. */
946
+ slugName?: string | null;
947
+ /** In case the slug is invalid, this field would be populated with the reasons for why the slug is invalid, errors may include SLUG_IS_TOO_LONG, SLUG_CONTAIN_ILLEGAL_CHARACTERS and SLUG_ALREADY_EXISTS */
948
+ errors?: InvalidSlugError[];
949
+ }
950
+ export declare enum InvalidSlugError {
951
+ UNKNOWN_SLUG_ERROR = "UNKNOWN_SLUG_ERROR",
952
+ /** The provided slug name exceeds the maximum amount of characters for slug. */
953
+ SLUG_IS_TOO_LONG = "SLUG_IS_TOO_LONG",
954
+ /** The provided slug name contains illegal characters. */
955
+ SLUG_CONTAIN_ILLEGAL_CHARACTERS = "SLUG_CONTAIN_ILLEGAL_CHARACTERS",
956
+ /** The provided slug name already exists for the same or another service. */
957
+ SLUG_ALREADY_EXISTS = "SLUG_ALREADY_EXISTS"
958
+ }