@wix/bookings 1.0.1741 → 1.0.1742
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_sdk-exports/context-booking-checkout-context/runtime.d.ts +2784 -0
- package/_sdk-exports/context-booking-checkout-context/runtime.js +2 -0
- package/_sdk-exports/context-categories-context/runtime.d.ts +144 -0
- package/_sdk-exports/context-categories-context/runtime.js +1 -0
- package/_sdk-exports/context-locations-context/runtime.d.ts +282 -0
- package/_sdk-exports/context-locations-context/runtime.js +1 -0
- package/_sdk-exports/context-service-addons-context/runtime.d.ts +264 -0
- package/_sdk-exports/context-service-addons-context/runtime.js +1 -0
- package/_sdk-exports/context-service-context/runtime.d.ts +3667 -0
- package/_sdk-exports/context-service-context/runtime.js +2 -0
- package/_sdk-exports/context-services-context/runtime.d.ts +2863 -0
- package/_sdk-exports/context-services-context/runtime.js +2 -0
- package/_sdk-exports/context-time-slots-context/runtime.d.ts +660 -0
- package/_sdk-exports/context-time-slots-context/runtime.js +2 -0
- package/build/cjs/context-booking-checkout-context.d.ts +2784 -0
- package/build/cjs/context-booking-checkout-context.js +3940 -0
- package/build/cjs/context-booking-checkout-context.js.map +1 -0
- package/build/cjs/context-categories-context.d.ts +144 -0
- package/build/cjs/context-categories-context.js +1188 -0
- package/build/cjs/context-categories-context.js.map +1 -0
- package/build/cjs/context-locations-context.d.ts +282 -0
- package/build/cjs/context-locations-context.js +1252 -0
- package/build/cjs/context-locations-context.js.map +1 -0
- package/build/cjs/context-service-addons-context.d.ts +264 -0
- package/build/cjs/context-service-addons-context.js +1324 -0
- package/build/cjs/context-service-addons-context.js.map +1 -0
- package/build/cjs/context-service-context.d.ts +3667 -0
- package/build/cjs/context-service-context.js +5330 -0
- package/build/cjs/context-service-context.js.map +1 -0
- package/build/cjs/context-services-context.d.ts +2863 -0
- package/build/cjs/context-services-context.js +2203 -0
- package/build/cjs/context-services-context.js.map +1 -0
- package/build/cjs/context-time-slots-context.d.ts +660 -0
- package/build/cjs/context-time-slots-context.js +2822 -0
- package/build/cjs/context-time-slots-context.js.map +1 -0
- package/build/es/context-booking-checkout-context.d.mts +2784 -0
- package/build/es/context-booking-checkout-context.mjs +3898 -0
- package/build/es/context-booking-checkout-context.mjs.map +1 -0
- package/build/es/context-categories-context.d.mts +144 -0
- package/build/es/context-categories-context.mjs +1157 -0
- package/build/es/context-categories-context.mjs.map +1 -0
- package/build/es/context-locations-context.d.mts +282 -0
- package/build/es/context-locations-context.mjs +1221 -0
- package/build/es/context-locations-context.mjs.map +1 -0
- package/build/es/context-service-addons-context.d.mts +264 -0
- package/build/es/context-service-addons-context.mjs +1294 -0
- package/build/es/context-service-addons-context.mjs.map +1 -0
- package/build/es/context-service-context.d.mts +3667 -0
- package/build/es/context-service-context.mjs +5298 -0
- package/build/es/context-service-context.mjs.map +1 -0
- package/build/es/context-services-context.d.mts +2863 -0
- package/build/es/context-services-context.mjs +2172 -0
- package/build/es/context-services-context.mjs.map +1 -0
- package/build/es/context-time-slots-context.d.mts +660 -0
- package/build/es/context-time-slots-context.mjs +2792 -0
- package/build/es/context-time-slots-context.mjs.map +1 -0
- package/build/internal/cjs/context-booking-checkout-context.d.ts +2784 -0
- package/build/internal/cjs/context-categories-context.d.ts +144 -0
- package/build/internal/cjs/context-locations-context.d.ts +282 -0
- package/build/internal/cjs/context-service-addons-context.d.ts +264 -0
- package/build/internal/cjs/context-service-context.d.ts +3667 -0
- package/build/internal/cjs/context-services-context.d.ts +2863 -0
- package/build/internal/cjs/context-time-slots-context.d.ts +660 -0
- package/build/internal/es/context-booking-checkout-context.d.mts +2784 -0
- package/build/internal/es/context-categories-context.d.mts +144 -0
- package/build/internal/es/context-locations-context.d.mts +282 -0
- package/build/internal/es/context-service-addons-context.d.mts +264 -0
- package/build/internal/es/context-service-context.d.mts +3667 -0
- package/build/internal/es/context-services-context.d.mts +2863 -0
- package/build/internal/es/context-time-slots-context.d.mts +660 -0
- package/context/booking-checkout-context/package.json +3 -0
- package/context/categories-context/package.json +3 -0
- package/context/locations-context/package.json +3 -0
- package/context/service-addons-context/package.json +3 -0
- package/context/service-context/package.json +3 -0
- package/context/services-context/package.json +3 -0
- package/context/time-slots-context/package.json +3 -0
- package/package.json +68 -7
|
@@ -0,0 +1,2784 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/type-fest/source/observable-like.d.ts
|
|
4
|
+
declare global {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
6
|
+
interface SymbolConstructor {
|
|
7
|
+
readonly observable: symbol;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
@remarks
|
|
12
|
+
The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
|
|
13
|
+
As well, some guidance on making an `Observable` to not include `closed` property.
|
|
14
|
+
@see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
|
|
15
|
+
@see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
|
|
16
|
+
@see https://github.com/benlesh/symbol-observable#making-an-object-observable
|
|
17
|
+
|
|
18
|
+
@category Observable
|
|
19
|
+
*/
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region ../../node_modules/@wix/sdk-types/internal/build/index.d.ts
|
|
22
|
+
declare global {
|
|
23
|
+
interface ContextualClient {}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates concrete types from SDK descriptors when a contextual client is
|
|
27
|
+
* available.
|
|
28
|
+
*
|
|
29
|
+
* For a REST descriptor the built (bound) API is intersected with the original
|
|
30
|
+
* descriptor, matching what `contextualizeRESTModuleV2` returns at runtime — a
|
|
31
|
+
* value callable as the bound API and still usable as a descriptor. Keeping the
|
|
32
|
+
* descriptor half lets contextual modules be passed to descriptor-constrained
|
|
33
|
+
* helpers such as `elevate` from `@wix/sdk/context` (FEDINF-14092).
|
|
34
|
+
*
|
|
35
|
+
* The `& T` is scoped to REST descriptors — the only shape codegen wraps in
|
|
36
|
+
* `MaybeContext` — so `BuildDescriptors` (used by `createClient().use`) is left
|
|
37
|
+
* unchanged and stays bound-only. The fix lives here rather than in `elevate`,
|
|
38
|
+
* which is kept strict on purpose (see #941) so it still rejects bound-only
|
|
39
|
+
* functions that are unsafe through `createRESTModule`.
|
|
40
|
+
*/
|
|
41
|
+
declare global {
|
|
42
|
+
/**
|
|
43
|
+
* A global interface to set the exposure toggle for the SDK.
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* declare global {
|
|
47
|
+
* interface SDKExposureToggle {
|
|
48
|
+
* alpha: true;
|
|
49
|
+
* }
|
|
50
|
+
* }
|
|
51
|
+
*/
|
|
52
|
+
interface SDKExposureToggle {}
|
|
53
|
+
}
|
|
54
|
+
declare global {
|
|
55
|
+
/**
|
|
56
|
+
* A global interface to set the type mode for the SDK.
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* declare global {
|
|
60
|
+
* interface SDKTypeMode {
|
|
61
|
+
* strict: true;
|
|
62
|
+
* }
|
|
63
|
+
* }
|
|
64
|
+
*/
|
|
65
|
+
interface SDKTypeMode {}
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../../node_modules/@wix/auto_sdk_bookings_service-options-and-variants/build/es/index.typings.d.mts
|
|
69
|
+
/**
|
|
70
|
+
* The `serviceOptionsAndVariants` object links a [service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction)
|
|
71
|
+
* to its variants.
|
|
72
|
+
* You can use it to offer customers different prices for a service,
|
|
73
|
+
* depending on which choices they book.
|
|
74
|
+
*/
|
|
75
|
+
interface ServiceOptionsAndVariants$1 {
|
|
76
|
+
/**
|
|
77
|
+
* ID of the `serviceOptionsAndVariants` object.
|
|
78
|
+
* @format GUID
|
|
79
|
+
* @readonly
|
|
80
|
+
*/
|
|
81
|
+
_id?: string | null;
|
|
82
|
+
/**
|
|
83
|
+
* ID of the service related to these options and variants.
|
|
84
|
+
* @format GUID
|
|
85
|
+
* @immutable
|
|
86
|
+
*/
|
|
87
|
+
serviceId?: string | null;
|
|
88
|
+
/** Service options. Note that currently only a single option is supported per service. */
|
|
89
|
+
options?: ServiceOptions;
|
|
90
|
+
/** Information about the service's variants. */
|
|
91
|
+
variants?: ServiceVariants;
|
|
92
|
+
/**
|
|
93
|
+
* Price of the cheapest service variant.
|
|
94
|
+
* @readonly
|
|
95
|
+
*/
|
|
96
|
+
minPrice?: Money$2;
|
|
97
|
+
/**
|
|
98
|
+
* Price of the most expensive service variant.
|
|
99
|
+
* @readonly
|
|
100
|
+
*/
|
|
101
|
+
maxPrice?: Money$2;
|
|
102
|
+
/**
|
|
103
|
+
* Revision number, which increments by 1 each time the `serviceOptionsAndVariants` object is updated.
|
|
104
|
+
* To prevent conflicting changes,
|
|
105
|
+
* the current revision must be passed when updating and deleting the `serviceOptionsAndVariants` object.
|
|
106
|
+
*
|
|
107
|
+
* Ignored when creating a `serviceOptionsAndVariants` object.
|
|
108
|
+
* @immutable
|
|
109
|
+
*/
|
|
110
|
+
revision?: string | null;
|
|
111
|
+
/** Extensions enabling users to save custom data related to service options and variants. */
|
|
112
|
+
extendedFields?: ExtendedFields$1;
|
|
113
|
+
}
|
|
114
|
+
interface ServiceOption extends ServiceOptionOptionSpecificDataOneOf {
|
|
115
|
+
/** Details about the custom option. Available only for `CUSTOM` options. */
|
|
116
|
+
customData?: CustomServiceOption;
|
|
117
|
+
durationData?: DurationServiceOption;
|
|
118
|
+
/**
|
|
119
|
+
* ID of the service option.
|
|
120
|
+
* @format GUID
|
|
121
|
+
*/
|
|
122
|
+
_id?: string;
|
|
123
|
+
/** Type of the service option. */
|
|
124
|
+
type?: ServiceOptionTypeWithLiterals;
|
|
125
|
+
}
|
|
126
|
+
/** @oneof */
|
|
127
|
+
interface ServiceOptionOptionSpecificDataOneOf {
|
|
128
|
+
/** Details about the custom option. Available only for `CUSTOM` options. */
|
|
129
|
+
customData?: CustomServiceOption;
|
|
130
|
+
durationData?: DurationServiceOption;
|
|
131
|
+
}
|
|
132
|
+
declare enum ServiceOptionType {
|
|
133
|
+
/** There is no information about the option type. */
|
|
134
|
+
UNKNOWN = "UNKNOWN",
|
|
135
|
+
/**
|
|
136
|
+
* The service option is based on a custom parameter. For example, age group,
|
|
137
|
+
* booked equipment, or appointment timing.
|
|
138
|
+
*/
|
|
139
|
+
CUSTOM = "CUSTOM",
|
|
140
|
+
/**
|
|
141
|
+
* It's a [staff member](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/introduction)
|
|
142
|
+
* based option.
|
|
143
|
+
*/
|
|
144
|
+
STAFF_MEMBER = "STAFF_MEMBER",
|
|
145
|
+
/** It's a duration-based option. */
|
|
146
|
+
DURATION = "DURATION",
|
|
147
|
+
/**
|
|
148
|
+
* The price is resolved from rules based on when the service is booked
|
|
149
|
+
* (days and hours, months, or a date range).
|
|
150
|
+
* @documentationMaturity preview
|
|
151
|
+
*/
|
|
152
|
+
DATE_TIME = "DATE_TIME",
|
|
153
|
+
/**
|
|
154
|
+
* The price is resolved from rules based on the number of participants.
|
|
155
|
+
* @documentationMaturity preview
|
|
156
|
+
*/
|
|
157
|
+
NUMBER_OF_PARTICIPANTS = "NUMBER_OF_PARTICIPANTS",
|
|
158
|
+
/**
|
|
159
|
+
* The price is resolved from pricing tiers based on the booking duration range.
|
|
160
|
+
* @documentationMaturity preview
|
|
161
|
+
*/
|
|
162
|
+
DURATION_RANGE = "DURATION_RANGE"
|
|
163
|
+
}
|
|
164
|
+
/** @enumType */
|
|
165
|
+
type ServiceOptionTypeWithLiterals = ServiceOptionType | 'UNKNOWN' | 'CUSTOM' | 'STAFF_MEMBER' | 'DURATION' | 'DATE_TIME' | 'NUMBER_OF_PARTICIPANTS' | 'DURATION_RANGE';
|
|
166
|
+
interface CustomServiceOption {
|
|
167
|
+
/**
|
|
168
|
+
* Name of the service option. For example, `Age group`, `Location`, `Equipment`,
|
|
169
|
+
* or `Time`.
|
|
170
|
+
* @maxLength 255
|
|
171
|
+
*/
|
|
172
|
+
name?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Available choices for the service option. For example, `child`, `student`,
|
|
175
|
+
* `adult`, and `senior` for a service option named `Age group`. Each value must
|
|
176
|
+
* be unique. The value's case is ignored, meaning `Child` and `child` are
|
|
177
|
+
* considered to be identical. Currently, only a single choice is supported
|
|
178
|
+
* because a service can have only a single option.
|
|
179
|
+
*
|
|
180
|
+
* Max: 1 choice
|
|
181
|
+
* @maxSize 100
|
|
182
|
+
* @maxLength 255
|
|
183
|
+
*/
|
|
184
|
+
choices?: string[];
|
|
185
|
+
}
|
|
186
|
+
interface DurationServiceOption {
|
|
187
|
+
/**
|
|
188
|
+
* Optional name of the duration option. For example, `Short Class`, or
|
|
189
|
+
* `Extended Class`.
|
|
190
|
+
* @maxLength 255
|
|
191
|
+
*/
|
|
192
|
+
name?: string | null;
|
|
193
|
+
}
|
|
194
|
+
interface ServiceVariant {
|
|
195
|
+
/**
|
|
196
|
+
* Choices for the service option. Currently, only a single choice is supported
|
|
197
|
+
* because a service can have only a single option.
|
|
198
|
+
*
|
|
199
|
+
* Max: 1 choice
|
|
200
|
+
* @minSize 1
|
|
201
|
+
* @maxSize 1
|
|
202
|
+
*/
|
|
203
|
+
choices?: ServiceChoice$1[];
|
|
204
|
+
/** Information about the service variant's price. */
|
|
205
|
+
price?: Money$2;
|
|
206
|
+
}
|
|
207
|
+
interface ServiceChoice$1 extends ServiceChoiceChoiceOneOf$1 {
|
|
208
|
+
/**
|
|
209
|
+
* Name of the custom choice.
|
|
210
|
+
* @maxLength 255
|
|
211
|
+
*/
|
|
212
|
+
custom?: string;
|
|
213
|
+
/**
|
|
214
|
+
* ID of the [resource](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)
|
|
215
|
+
* associated with the [staff member](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/introduction)
|
|
216
|
+
* providing the service.
|
|
217
|
+
* @format GUID
|
|
218
|
+
*/
|
|
219
|
+
staffMemberId?: string;
|
|
220
|
+
/** Information about the option's duration. */
|
|
221
|
+
duration?: Duration$1;
|
|
222
|
+
/** A rule resolving the price by when the service is booked. Available only for `DATE_TIME` options. */
|
|
223
|
+
dateTime?: DateTimeRule$1;
|
|
224
|
+
/** A rule resolving the price by the number of participants. Available only for `NUMBER_OF_PARTICIPANTS` options. */
|
|
225
|
+
participantRange?: ParticipantsRange$1;
|
|
226
|
+
/**
|
|
227
|
+
* A duration range tier resolving the price by how long the booking is.
|
|
228
|
+
* Available only for `DURATION_RANGE` options.
|
|
229
|
+
*/
|
|
230
|
+
durationRange?: DurationRange$1;
|
|
231
|
+
/**
|
|
232
|
+
* ID of the service option.
|
|
233
|
+
* @format GUID
|
|
234
|
+
*/
|
|
235
|
+
optionId?: string;
|
|
236
|
+
}
|
|
237
|
+
/** @oneof */
|
|
238
|
+
interface ServiceChoiceChoiceOneOf$1 {
|
|
239
|
+
/**
|
|
240
|
+
* Name of the custom choice.
|
|
241
|
+
* @maxLength 255
|
|
242
|
+
*/
|
|
243
|
+
custom?: string;
|
|
244
|
+
/**
|
|
245
|
+
* ID of the [resource](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)
|
|
246
|
+
* associated with the [staff member](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/introduction)
|
|
247
|
+
* providing the service.
|
|
248
|
+
* @format GUID
|
|
249
|
+
*/
|
|
250
|
+
staffMemberId?: string;
|
|
251
|
+
/** Information about the option's duration. */
|
|
252
|
+
duration?: Duration$1;
|
|
253
|
+
/** A rule resolving the price by when the service is booked. Available only for `DATE_TIME` options. */
|
|
254
|
+
dateTime?: DateTimeRule$1;
|
|
255
|
+
/** A rule resolving the price by the number of participants. Available only for `NUMBER_OF_PARTICIPANTS` options. */
|
|
256
|
+
participantRange?: ParticipantsRange$1;
|
|
257
|
+
/**
|
|
258
|
+
* A duration range tier resolving the price by how long the booking is.
|
|
259
|
+
* Available only for `DURATION_RANGE` options.
|
|
260
|
+
*/
|
|
261
|
+
durationRange?: DurationRange$1;
|
|
262
|
+
}
|
|
263
|
+
interface Duration$1 {
|
|
264
|
+
/**
|
|
265
|
+
* Duration of the service in minutes.
|
|
266
|
+
*
|
|
267
|
+
* Min: `1` minute
|
|
268
|
+
* Max: `44639` minutes (30 days, 23 hours, and 59 minutes)
|
|
269
|
+
* @min 1
|
|
270
|
+
* @max 44639
|
|
271
|
+
*/
|
|
272
|
+
minutes?: number;
|
|
273
|
+
/**
|
|
274
|
+
* Name of the duration option.
|
|
275
|
+
*
|
|
276
|
+
* Default: Human-readable text of `minutes`. For example, `1 hr 30 min`.
|
|
277
|
+
* @maxLength 255
|
|
278
|
+
*/
|
|
279
|
+
name?: string | null;
|
|
280
|
+
}
|
|
281
|
+
interface DateTimeRule$1 extends DateTimeRuleRuleOneOf {
|
|
282
|
+
/** Matches when the booked slot falls on one of the given days within the time window. */
|
|
283
|
+
hoursAndDaysRule?: HoursAndDaysRule;
|
|
284
|
+
/** Matches when the booked slot falls in one of the given months. */
|
|
285
|
+
monthsRule?: MonthsRule;
|
|
286
|
+
/** Matches when the booked slot falls within the date range. */
|
|
287
|
+
dateRangeRule?: DateRangeRule;
|
|
288
|
+
/** Which kind of rule this is. Must match the populated `rule` case. */
|
|
289
|
+
ruleType?: DateTimeRuleTypeWithLiterals;
|
|
290
|
+
/**
|
|
291
|
+
* Optional name of the rule. For example, `Weekend mornings`, or `Holiday season`.
|
|
292
|
+
* @maxLength 255
|
|
293
|
+
*/
|
|
294
|
+
name?: string | null;
|
|
295
|
+
}
|
|
296
|
+
/** @oneof */
|
|
297
|
+
interface DateTimeRuleRuleOneOf {
|
|
298
|
+
/** Matches when the booked slot falls on one of the given days within the time window. */
|
|
299
|
+
hoursAndDaysRule?: HoursAndDaysRule;
|
|
300
|
+
/** Matches when the booked slot falls in one of the given months. */
|
|
301
|
+
monthsRule?: MonthsRule;
|
|
302
|
+
/** Matches when the booked slot falls within the date range. */
|
|
303
|
+
dateRangeRule?: DateRangeRule;
|
|
304
|
+
}
|
|
305
|
+
declare enum DateTimeRuleType {
|
|
306
|
+
HOURS_AND_DAYS = "HOURS_AND_DAYS",
|
|
307
|
+
MONTHS = "MONTHS",
|
|
308
|
+
DATE_RANGE = "DATE_RANGE"
|
|
309
|
+
}
|
|
310
|
+
/** @enumType */
|
|
311
|
+
type DateTimeRuleTypeWithLiterals = DateTimeRuleType | 'HOURS_AND_DAYS' | 'MONTHS' | 'DATE_RANGE';
|
|
312
|
+
interface HoursAndDaysRule {
|
|
313
|
+
/**
|
|
314
|
+
* Days the rule applies to. The time window is evaluated in the business time zone.
|
|
315
|
+
* @minSize 1
|
|
316
|
+
* @maxSize 7
|
|
317
|
+
*/
|
|
318
|
+
days?: DayWithLiterals[];
|
|
319
|
+
/**
|
|
320
|
+
* Start of the time window in `HH:mm` format, inclusive. Evaluated in the business time zone.
|
|
321
|
+
* @format LOCAL_TIME
|
|
322
|
+
*/
|
|
323
|
+
startTime?: string | null;
|
|
324
|
+
/**
|
|
325
|
+
* End of the time window in `HH:mm` format, exclusive. When earlier than `start_time` the window wraps past midnight.
|
|
326
|
+
* @format LOCAL_TIME
|
|
327
|
+
*/
|
|
328
|
+
endTime?: string | null;
|
|
329
|
+
}
|
|
330
|
+
declare enum Day {
|
|
331
|
+
MONDAY = "MONDAY",
|
|
332
|
+
TUESDAY = "TUESDAY",
|
|
333
|
+
WEDNESDAY = "WEDNESDAY",
|
|
334
|
+
THURSDAY = "THURSDAY",
|
|
335
|
+
FRIDAY = "FRIDAY",
|
|
336
|
+
SATURDAY = "SATURDAY",
|
|
337
|
+
SUNDAY = "SUNDAY"
|
|
338
|
+
}
|
|
339
|
+
/** @enumType */
|
|
340
|
+
type DayWithLiterals = Day | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY';
|
|
341
|
+
interface MonthsRule {
|
|
342
|
+
/**
|
|
343
|
+
* Months the rule applies to, as numbers `1`-`12`. Each value must be unique.
|
|
344
|
+
*
|
|
345
|
+
* Min: 1 month
|
|
346
|
+
* Max: 12 months
|
|
347
|
+
* @minSize 1
|
|
348
|
+
* @maxSize 12
|
|
349
|
+
* @min 1
|
|
350
|
+
* @max 12
|
|
351
|
+
*/
|
|
352
|
+
months?: number[];
|
|
353
|
+
}
|
|
354
|
+
interface DateRangeRule {
|
|
355
|
+
/**
|
|
356
|
+
* Start of the date range in `YYYY-MM-DDThh:mm:ss` format, inclusive. Evaluated in the business time zone.
|
|
357
|
+
* @format LOCAL_DATE_TIME
|
|
358
|
+
*/
|
|
359
|
+
localStartDate?: string | null;
|
|
360
|
+
/**
|
|
361
|
+
* End of the date range in `YYYY-MM-DDThh:mm:ss` format, inclusive. Evaluated in the business time zone.
|
|
362
|
+
* @format LOCAL_DATE_TIME
|
|
363
|
+
*/
|
|
364
|
+
localEndDate?: string | null;
|
|
365
|
+
/**
|
|
366
|
+
* Whether the date range repeats every year on the same month and day.
|
|
367
|
+
* The range dates define both the window (month and day) and the first occurrence.
|
|
368
|
+
*
|
|
369
|
+
* Changing this field from `true` to `false` pins the range to the current year:
|
|
370
|
+
* `local_start_date` and `local_end_date` then apply to a single concrete year
|
|
371
|
+
* instead of repeating annually.
|
|
372
|
+
*/
|
|
373
|
+
repeatsAnnually?: boolean | null;
|
|
374
|
+
}
|
|
375
|
+
interface ParticipantsRange$1 {
|
|
376
|
+
/**
|
|
377
|
+
* Lower bound of the participants range, inclusive.
|
|
378
|
+
*
|
|
379
|
+
* Min: `1`
|
|
380
|
+
* Max: `999`
|
|
381
|
+
* @min 1
|
|
382
|
+
* @max 999
|
|
383
|
+
*/
|
|
384
|
+
minParticipants?: number | null;
|
|
385
|
+
/**
|
|
386
|
+
* Upper bound of the participants range, inclusive.
|
|
387
|
+
*
|
|
388
|
+
* Min: `1`
|
|
389
|
+
* Max: `999`
|
|
390
|
+
* @min 1
|
|
391
|
+
* @max 999
|
|
392
|
+
*/
|
|
393
|
+
maxParticipants?: number | null;
|
|
394
|
+
/**
|
|
395
|
+
* Optional name of the range. For example, `Small group`, or `Large group`.
|
|
396
|
+
* @maxLength 255
|
|
397
|
+
*/
|
|
398
|
+
name?: string | null;
|
|
399
|
+
}
|
|
400
|
+
interface DurationRange$1 extends DurationRangeConfigOneOf$1 {
|
|
401
|
+
/** Tier bounds in minutes. Set when `unit_type` is `HOUR`. */
|
|
402
|
+
hourOptions?: HourlyConfig$1;
|
|
403
|
+
/** Tier bounds in days. Set when `unit_type` is `DAY`. */
|
|
404
|
+
dayOptions?: DailyConfig$1;
|
|
405
|
+
/**
|
|
406
|
+
* Display name for this tier. For example, `1–3 hours` or `4–7 days`.
|
|
407
|
+
* @maxLength 255
|
|
408
|
+
*/
|
|
409
|
+
name?: string | null;
|
|
410
|
+
/** Unit type for this tier. */
|
|
411
|
+
unitType?: DurationUnitTypeWithLiterals;
|
|
412
|
+
}
|
|
413
|
+
/** @oneof */
|
|
414
|
+
interface DurationRangeConfigOneOf$1 {
|
|
415
|
+
/** Tier bounds in minutes. Set when `unit_type` is `HOUR`. */
|
|
416
|
+
hourOptions?: HourlyConfig$1;
|
|
417
|
+
/** Tier bounds in days. Set when `unit_type` is `DAY`. */
|
|
418
|
+
dayOptions?: DailyConfig$1;
|
|
419
|
+
}
|
|
420
|
+
declare enum DurationUnitType {
|
|
421
|
+
/** Duration is expressed in minutes (hourly services). */
|
|
422
|
+
HOUR = "HOUR",
|
|
423
|
+
/** Duration is expressed in days (daily services). */
|
|
424
|
+
DAY = "DAY"
|
|
425
|
+
}
|
|
426
|
+
/** @enumType */
|
|
427
|
+
type DurationUnitTypeWithLiterals = DurationUnitType | 'HOUR' | 'DAY';
|
|
428
|
+
/** Hourly bounds for a duration range tier. Durations are in minutes. */
|
|
429
|
+
interface HourlyConfig$1 {
|
|
430
|
+
/**
|
|
431
|
+
* @min 30
|
|
432
|
+
* @max 1440
|
|
433
|
+
*/
|
|
434
|
+
minDurationInMinutes?: number;
|
|
435
|
+
/**
|
|
436
|
+
* @min 30
|
|
437
|
+
* @max 1440
|
|
438
|
+
*/
|
|
439
|
+
maxDurationInMinutes?: number;
|
|
440
|
+
}
|
|
441
|
+
/** Daily bounds for a duration range tier. Durations are in days. */
|
|
442
|
+
interface DailyConfig$1 {
|
|
443
|
+
/**
|
|
444
|
+
* @min 1
|
|
445
|
+
* @max 40
|
|
446
|
+
*/
|
|
447
|
+
minDurationInDays?: number;
|
|
448
|
+
/**
|
|
449
|
+
* @min 1
|
|
450
|
+
* @max 40
|
|
451
|
+
*/
|
|
452
|
+
maxDurationInDays?: number;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Money.
|
|
456
|
+
* Default format to use. Sufficiently compliant with majority of standards: w3c, ISO 4217, ISO 20022, ISO 8583:2003.
|
|
457
|
+
*/
|
|
458
|
+
interface Money$2 {
|
|
459
|
+
/**
|
|
460
|
+
* 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.
|
|
461
|
+
* @format DECIMAL_VALUE
|
|
462
|
+
* @decimalValue options { gte:0, maxScale:2 }
|
|
463
|
+
*/
|
|
464
|
+
value?: string;
|
|
465
|
+
/**
|
|
466
|
+
* Currency code. Must be valid ISO 4217 currency code (e.g., USD).
|
|
467
|
+
* @format CURRENCY
|
|
468
|
+
*/
|
|
469
|
+
currency?: string;
|
|
470
|
+
/**
|
|
471
|
+
* Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative.
|
|
472
|
+
* @maxLength 50
|
|
473
|
+
*/
|
|
474
|
+
formattedValue?: string | null;
|
|
475
|
+
}
|
|
476
|
+
interface ServiceOptions {
|
|
477
|
+
/**
|
|
478
|
+
* Values of the service options.
|
|
479
|
+
*
|
|
480
|
+
* Max: 1 service option
|
|
481
|
+
* @minSize 1
|
|
482
|
+
* @maxSize 1
|
|
483
|
+
*/
|
|
484
|
+
values?: ServiceOption[];
|
|
485
|
+
}
|
|
486
|
+
interface ServiceVariants {
|
|
487
|
+
/**
|
|
488
|
+
* Values of the service variants.
|
|
489
|
+
* @minSize 1
|
|
490
|
+
* @maxSize 100
|
|
491
|
+
*/
|
|
492
|
+
values?: ServiceVariant[];
|
|
493
|
+
}
|
|
494
|
+
interface ExtendedFields$1 {
|
|
495
|
+
/**
|
|
496
|
+
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
497
|
+
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
498
|
+
*
|
|
499
|
+
* You can only access fields for which you have the appropriate permissions.
|
|
500
|
+
*
|
|
501
|
+
* Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
|
|
502
|
+
*/
|
|
503
|
+
namespaces?: Record<string, Record<string, any>>;
|
|
504
|
+
}
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region ../../node_modules/@wix/auto_sdk_bookings_services/build/es/bookings-services-v2-service-services.universal-Bf4TC5aj.d.mts
|
|
507
|
+
/** The `service` object represents an offering that a business provides to its customers. */
|
|
508
|
+
interface Service$2 {
|
|
509
|
+
/**
|
|
510
|
+
* Service ID.
|
|
511
|
+
* @format GUID
|
|
512
|
+
* @readonly
|
|
513
|
+
*/
|
|
514
|
+
_id?: string | null;
|
|
515
|
+
/**
|
|
516
|
+
* ID of the app associated with the service. You can't update `appId`.
|
|
517
|
+
* Services are displayed in Wix Bookings only if they are associated with the Wix Bookings appId or have no associated app ID.
|
|
518
|
+
* Default: `13d21c63-b5ec-5912-8397-c3a5ddb27a97` (Wix Bookings app ID)
|
|
519
|
+
* For services from Wix apps, the following values apply:
|
|
520
|
+
* - Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
|
|
521
|
+
* - Wix Services: `"cc552162-24a4-45e0-9695-230c4931ef40"`
|
|
522
|
+
* - Wix Meetings: `"6646a75c-2027-4f49-976c-58f3d713ed0f"`.<!-- [Scheduling Form Fields](https://dev.wix.com/docs/api-reference/business-solutions/bookings/about-scheduling-form-fields) services also use this app ID. Use `createdByAppId` to distinguish between Wix Meetings and Scheduling Form Fields services.-->
|
|
523
|
+
* [Full list of apps created by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix).
|
|
524
|
+
* <!-- TODO: Uncomment when Platform docs are published - Learn more about [app identity in the Bookings Platform](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings-platform/app-identity-in-the-bookings-platform). -->
|
|
525
|
+
* @format GUID
|
|
526
|
+
* @immutable
|
|
527
|
+
*/
|
|
528
|
+
appId?: string | null;
|
|
529
|
+
/**
|
|
530
|
+
* ID of the app that created the service. This field is used for analytics, auditing, and tracking creation sources.
|
|
531
|
+
* This read-only field is automatically populated during service creation by checking these sources in order:
|
|
532
|
+
* 1. The caller's App ID from the request identity context.
|
|
533
|
+
* 2. The service's `appId` field.
|
|
534
|
+
* 3. The Wix Bookings App ID (`13d21c63-b5ec-5912-8397-c3a5ddb27a97`) as the final fallback.
|
|
535
|
+
* <!-- TODO: Uncomment when Platform docs are published - Learn more about [app identity in the Bookings Platform](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings-platform/app-identity-in-the-bookings-platform). -->
|
|
536
|
+
* @format GUID
|
|
537
|
+
* @readonly
|
|
538
|
+
*/
|
|
539
|
+
createdByAppId?: string | null;
|
|
540
|
+
/**
|
|
541
|
+
* Service type.
|
|
542
|
+
* Learn more about [service types](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-types).
|
|
543
|
+
*/
|
|
544
|
+
type?: ServiceTypeWithLiterals;
|
|
545
|
+
/** Order of the service within a [category](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v1/category-object). */
|
|
546
|
+
sortOrder?: number | null;
|
|
547
|
+
/**
|
|
548
|
+
* Service name.
|
|
549
|
+
* @maxLength 400
|
|
550
|
+
* @minLength 1
|
|
551
|
+
*/
|
|
552
|
+
name?: string | null;
|
|
553
|
+
/**
|
|
554
|
+
* Service description. For example, `High-class hair styling, cuts, straightening and color`.
|
|
555
|
+
* @maxLength 7000
|
|
556
|
+
*/
|
|
557
|
+
description?: string | null;
|
|
558
|
+
/**
|
|
559
|
+
* Short service description, such as `Hair styling`.
|
|
560
|
+
* @maxLength 6000
|
|
561
|
+
*/
|
|
562
|
+
tagLine?: string | null;
|
|
563
|
+
/**
|
|
564
|
+
* Default maximum number of customers that can book the service. The service cannot be booked beyond this capacity.
|
|
565
|
+
* @min 1
|
|
566
|
+
* @max 1000
|
|
567
|
+
*/
|
|
568
|
+
defaultCapacity?: number | null;
|
|
569
|
+
/** Media associated with the service. */
|
|
570
|
+
media?: Media;
|
|
571
|
+
/** Whether the service is hidden from Wix Bookings pages and widgets. */
|
|
572
|
+
hidden?: boolean | null;
|
|
573
|
+
/**
|
|
574
|
+
* [Category](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/introduction)
|
|
575
|
+
* the service is associated with. Services aren't automatically assigned to a category.
|
|
576
|
+
* Without an associated category, the service isn't visible on the live site.
|
|
577
|
+
*/
|
|
578
|
+
category?: V2Category;
|
|
579
|
+
/** Form the customer filled out when booking the service. */
|
|
580
|
+
form?: Form;
|
|
581
|
+
/**
|
|
582
|
+
* Payment options for booking the service.
|
|
583
|
+
* Learn more about [service payments](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-payments).
|
|
584
|
+
*/
|
|
585
|
+
payment?: Payment$1;
|
|
586
|
+
/** Online booking settings. */
|
|
587
|
+
onlineBooking?: OnlineBooking;
|
|
588
|
+
/** Conferencing options for the service. */
|
|
589
|
+
conferencing?: Conferencing;
|
|
590
|
+
/**
|
|
591
|
+
* The locations this service is offered at. Read more about [service locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations).
|
|
592
|
+
* @immutable
|
|
593
|
+
* @maxSize 500
|
|
594
|
+
*/
|
|
595
|
+
locations?: V2Location[];
|
|
596
|
+
/**
|
|
597
|
+
* [Policy](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/introduction)
|
|
598
|
+
* 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.
|
|
599
|
+
*/
|
|
600
|
+
bookingPolicy?: BookingPolicy;
|
|
601
|
+
/**
|
|
602
|
+
* The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction),
|
|
603
|
+
* which can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction).
|
|
604
|
+
*/
|
|
605
|
+
schedule?: Schedule;
|
|
606
|
+
/**
|
|
607
|
+
* IDs of the [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction) associated with the [staff members](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/introduction) providing the service.
|
|
608
|
+
* Note that these are the resource IDs, not the staff member IDs.
|
|
609
|
+
*
|
|
610
|
+
* For appointment-based services, set this field when creating or updating the service.
|
|
611
|
+
* For classes and courses, this field is read-only and is automatically derived from staff assigned to the service's recurring scheduled sessions.
|
|
612
|
+
* Staff assigned only to single, non-recurring events are not included.
|
|
613
|
+
* Once all of a staff member's upcoming recurring sessions have ended, their ID is removed from this field.
|
|
614
|
+
* To retrieve the full list of staff for classes or courses, query the service's calendar events instead.
|
|
615
|
+
* Learn more about [retrieving staff for classes and courses](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/sample-flows#retrieve-staff-members-for-a-class-or-course).
|
|
616
|
+
* @maxSize 220
|
|
617
|
+
* @format GUID
|
|
618
|
+
*/
|
|
619
|
+
staffMemberIds?: string[];
|
|
620
|
+
/** Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified. */
|
|
621
|
+
staffMemberDetails?: StaffMemberDetails;
|
|
622
|
+
/**
|
|
623
|
+
* Information about which resources must be available so customers can book the service.
|
|
624
|
+
* For example, a meeting room or equipment.
|
|
625
|
+
* Some nested fields are only returned when specific conditional fields are requested:
|
|
626
|
+
* pass `RESOURCE_TYPE_DETAILS` to retrieve `resourceType.name`, and `RESOURCE_DETAILS` to retrieve `resourceDetails.resources`.
|
|
627
|
+
* @maxSize 8
|
|
628
|
+
*/
|
|
629
|
+
serviceResources?: ServiceResource[];
|
|
630
|
+
/**
|
|
631
|
+
* A slug is the last part of the URL address that serves as a unique identifier of the service.
|
|
632
|
+
* The list of supported slugs includes past service names for backwards compatibility, and a custom slug if one was set by the business owner.
|
|
633
|
+
* @readonly
|
|
634
|
+
* @maxSize 100
|
|
635
|
+
*/
|
|
636
|
+
supportedSlugs?: Slug[];
|
|
637
|
+
/**
|
|
638
|
+
* Active slug for the service.
|
|
639
|
+
* Learn more about [service slugs](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-slugs).
|
|
640
|
+
* @readonly
|
|
641
|
+
*/
|
|
642
|
+
mainSlug?: Slug;
|
|
643
|
+
/**
|
|
644
|
+
* URLs to various service-related pages, such as the calendar page and the booking page.
|
|
645
|
+
* @readonly
|
|
646
|
+
*/
|
|
647
|
+
urls?: URLs;
|
|
648
|
+
/** Extensions enabling users to save custom data related to the service. */
|
|
649
|
+
extendedFields?: ExtendedFields;
|
|
650
|
+
/** Custom SEO data for the service. */
|
|
651
|
+
seoData?: SeoSchema;
|
|
652
|
+
/**
|
|
653
|
+
* Date and time the service was created in `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
654
|
+
* @readonly
|
|
655
|
+
*/
|
|
656
|
+
_createdDate?: Date | null;
|
|
657
|
+
/**
|
|
658
|
+
* Date and time the service was updated in `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
659
|
+
* @readonly
|
|
660
|
+
*/
|
|
661
|
+
_updatedDate?: Date | null;
|
|
662
|
+
/**
|
|
663
|
+
* Revision number, which increments by 1 each time the service is updated. To
|
|
664
|
+
* prevent conflicting changes, the existing revision must be used when updating
|
|
665
|
+
* a service.
|
|
666
|
+
* @readonly
|
|
667
|
+
*/
|
|
668
|
+
revision?: string | null;
|
|
669
|
+
/**
|
|
670
|
+
* Information about the [add-on groups](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-add-on-groups) associated with the service.
|
|
671
|
+
* @maxSize 3
|
|
672
|
+
*/
|
|
673
|
+
addOnGroups?: AddOnGroup[];
|
|
674
|
+
/**
|
|
675
|
+
* Details about all [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction) customers can choose when booking the service.
|
|
676
|
+
* @readonly
|
|
677
|
+
* @maxSize 50
|
|
678
|
+
*/
|
|
679
|
+
addOnDetails?: AddOnDetails[];
|
|
680
|
+
/** Taxable address used to calculate tax */
|
|
681
|
+
taxableAddress?: TaxableAddress;
|
|
682
|
+
/**
|
|
683
|
+
* ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction)
|
|
684
|
+
* that serves as the primary resource for this appointment service. The primary resource type
|
|
685
|
+
* determines which resources drive slot assignment and availability resolution.
|
|
686
|
+
*
|
|
687
|
+
* For example, when set to a "Meeting Rooms" resource type, availability is calculated
|
|
688
|
+
* based on the rooms' schedules rather than staff schedules.
|
|
689
|
+
*
|
|
690
|
+
* Default: The staff resource type.
|
|
691
|
+
* @format GUID
|
|
692
|
+
*/
|
|
693
|
+
primaryResourceType?: string | null;
|
|
694
|
+
}
|
|
695
|
+
declare enum ServiceType {
|
|
696
|
+
/** Appointment-based service. */
|
|
697
|
+
APPOINTMENT = "APPOINTMENT",
|
|
698
|
+
/** Class service. */
|
|
699
|
+
CLASS = "CLASS",
|
|
700
|
+
/** Course service. */
|
|
701
|
+
COURSE = "COURSE"
|
|
702
|
+
}
|
|
703
|
+
/** @enumType */
|
|
704
|
+
type ServiceTypeWithLiterals = ServiceType | 'APPOINTMENT' | 'CLASS' | 'COURSE';
|
|
705
|
+
interface Media {
|
|
706
|
+
/**
|
|
707
|
+
* Media items associated with the service.
|
|
708
|
+
* @maxSize 100
|
|
709
|
+
*/
|
|
710
|
+
items?: MediaItem[];
|
|
711
|
+
/** Primary media associated with the service. */
|
|
712
|
+
mainMedia?: MediaItem;
|
|
713
|
+
/** Cover media associated with the service. */
|
|
714
|
+
coverMedia?: MediaItem;
|
|
715
|
+
}
|
|
716
|
+
interface MediaItem extends MediaItemItemOneOf {
|
|
717
|
+
/** Details of the image associated with the service, such as URL and size. */
|
|
718
|
+
image?: string;
|
|
719
|
+
}
|
|
720
|
+
/** @oneof */
|
|
721
|
+
interface MediaItemItemOneOf {
|
|
722
|
+
/** Details of the image associated with the service, such as URL and size. */
|
|
723
|
+
image?: string;
|
|
724
|
+
}
|
|
725
|
+
interface V2Category {
|
|
726
|
+
/**
|
|
727
|
+
* Category ID.
|
|
728
|
+
* @format GUID
|
|
729
|
+
*/
|
|
730
|
+
_id?: string;
|
|
731
|
+
/**
|
|
732
|
+
* Category name.
|
|
733
|
+
* @maxLength 500
|
|
734
|
+
* @readonly
|
|
735
|
+
*/
|
|
736
|
+
name?: string | null;
|
|
737
|
+
/**
|
|
738
|
+
* Order of a category within a category list.
|
|
739
|
+
* @readonly
|
|
740
|
+
*/
|
|
741
|
+
sortOrder?: number | null;
|
|
742
|
+
}
|
|
743
|
+
interface Form {
|
|
744
|
+
/**
|
|
745
|
+
* ID of the form associated with the service.
|
|
746
|
+
* The form information that you submit when booking includes contact details, participants, and other form fields set up for the service.
|
|
747
|
+
* You can manage the service booking form fields using the Bookings Forms API.
|
|
748
|
+
* @format GUID
|
|
749
|
+
*/
|
|
750
|
+
_id?: string;
|
|
751
|
+
}
|
|
752
|
+
interface Payment$1 extends PaymentRateOneOf {
|
|
753
|
+
/**
|
|
754
|
+
* The details for the fixed price of the service.
|
|
755
|
+
*
|
|
756
|
+
* Required when: `rateType` is `FIXED`
|
|
757
|
+
*/
|
|
758
|
+
fixed?: FixedPayment;
|
|
759
|
+
/**
|
|
760
|
+
* The details for the custom price of the service.
|
|
761
|
+
*
|
|
762
|
+
* Required when: `rateType` is `CUSTOM`
|
|
763
|
+
*/
|
|
764
|
+
custom?: CustomPayment;
|
|
765
|
+
/**
|
|
766
|
+
* The details for the varied pricing of the service.
|
|
767
|
+
* Read more about [varied price options](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online#offering-varied-price-options).
|
|
768
|
+
*
|
|
769
|
+
* Required when: `rateType` is `VARIED`
|
|
770
|
+
*/
|
|
771
|
+
varied?: VariedPayment;
|
|
772
|
+
/**
|
|
773
|
+
* Subscription pricing details for the service. Supported for course services only.
|
|
774
|
+
* The business charges recurring monthly payments instead of a one-time fee.
|
|
775
|
+
*
|
|
776
|
+
* Required when: `rateType` is `SUBSCRIPTION`.
|
|
777
|
+
*/
|
|
778
|
+
subscription?: SubscriptionPayment;
|
|
779
|
+
/** The rate the customer is expected to pay for the service. */
|
|
780
|
+
rateType?: RateTypeWithLiterals;
|
|
781
|
+
/** The payment options a customer can use to pay for the service. */
|
|
782
|
+
options?: PaymentOptions;
|
|
783
|
+
/**
|
|
784
|
+
* IDs of pricing plans that can be used as payment for the service.
|
|
785
|
+
* Read more about [service payment options](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments).
|
|
786
|
+
* @readonly
|
|
787
|
+
* @maxSize 75
|
|
788
|
+
* @format GUID
|
|
789
|
+
*/
|
|
790
|
+
pricingPlanIds?: string[];
|
|
791
|
+
/**
|
|
792
|
+
* How customers can pay for add-ons when paying for the related booking with a [pricing plan](https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/pricing-plans/introduction).
|
|
793
|
+
* If customers pay for the booking using any method other than a pricing plan, the value of this field is ignored.
|
|
794
|
+
*/
|
|
795
|
+
addOnOption?: AddOnPaymentOptionsWithLiterals;
|
|
796
|
+
/**
|
|
797
|
+
* Estimated discount information for the service based on active [eCommerce discounts](https://dev.wix.com/docs/rest/business-solutions/e-commerce/extensions/discounts/introduction).
|
|
798
|
+
* The final discount is determined during eCommerce checkout and may differ from the estimate,
|
|
799
|
+
* for example when discounts depend on cart totals.
|
|
800
|
+
*
|
|
801
|
+
* A discount is considered active when its start time has passed and its end time hasn't.
|
|
802
|
+
* If multiple active discounts apply, one is returned:
|
|
803
|
+
* + Services with subscription pricing: the most recently updated discount that the business set to cover subscription purchases.
|
|
804
|
+
* + Other services, when at least one discount's price can be estimated: the discount with the lowest estimated price.
|
|
805
|
+
* + Other services, when no discount's price can be estimated: the most recently updated discount.
|
|
806
|
+
*
|
|
807
|
+
* The returned discount is an estimate and isn't guaranteed to be the one applied at checkout.
|
|
808
|
+
*
|
|
809
|
+
* Returned only when `DISCOUNT_INFO_DETAILS` is requested.
|
|
810
|
+
* @readonly
|
|
811
|
+
*/
|
|
812
|
+
discountInfo?: DiscountInfo;
|
|
813
|
+
}
|
|
814
|
+
/** @oneof */
|
|
815
|
+
interface PaymentRateOneOf {
|
|
816
|
+
/**
|
|
817
|
+
* The details for the fixed price of the service.
|
|
818
|
+
*
|
|
819
|
+
* Required when: `rateType` is `FIXED`
|
|
820
|
+
*/
|
|
821
|
+
fixed?: FixedPayment;
|
|
822
|
+
/**
|
|
823
|
+
* The details for the custom price of the service.
|
|
824
|
+
*
|
|
825
|
+
* Required when: `rateType` is `CUSTOM`
|
|
826
|
+
*/
|
|
827
|
+
custom?: CustomPayment;
|
|
828
|
+
/**
|
|
829
|
+
* The details for the varied pricing of the service.
|
|
830
|
+
* Read more about [varied price options](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online#offering-varied-price-options).
|
|
831
|
+
*
|
|
832
|
+
* Required when: `rateType` is `VARIED`
|
|
833
|
+
*/
|
|
834
|
+
varied?: VariedPayment;
|
|
835
|
+
/**
|
|
836
|
+
* Subscription pricing details for the service. Supported for course services only.
|
|
837
|
+
* The business charges recurring monthly payments instead of a one-time fee.
|
|
838
|
+
*
|
|
839
|
+
* Required when: `rateType` is `SUBSCRIPTION`.
|
|
840
|
+
*/
|
|
841
|
+
subscription?: SubscriptionPayment;
|
|
842
|
+
}
|
|
843
|
+
declare enum RateType {
|
|
844
|
+
/** The service has a fixed price. */
|
|
845
|
+
FIXED = "FIXED",
|
|
846
|
+
/** The service has a custom price, expressed as a price description. */
|
|
847
|
+
CUSTOM = "CUSTOM",
|
|
848
|
+
/** This service is offered with a set of different prices based on different terms. */
|
|
849
|
+
VARIED = "VARIED",
|
|
850
|
+
/** This service is offered free of charge. */
|
|
851
|
+
NO_FEE = "NO_FEE",
|
|
852
|
+
/**
|
|
853
|
+
* The service charges recurring monthly payments. Supported for course services only.
|
|
854
|
+
* @documentationMaturity preview
|
|
855
|
+
*/
|
|
856
|
+
SUBSCRIPTION = "SUBSCRIPTION"
|
|
857
|
+
}
|
|
858
|
+
/** @enumType */
|
|
859
|
+
type RateTypeWithLiterals = RateType | 'FIXED' | 'CUSTOM' | 'VARIED' | 'NO_FEE' | 'SUBSCRIPTION';
|
|
860
|
+
interface FixedPayment {
|
|
861
|
+
/**
|
|
862
|
+
* The fixed price required to book the service.
|
|
863
|
+
*
|
|
864
|
+
* Required when: `rateType` is `FIXED`
|
|
865
|
+
*/
|
|
866
|
+
price?: Money$1;
|
|
867
|
+
/**
|
|
868
|
+
* The deposit price required to book the service.
|
|
869
|
+
*
|
|
870
|
+
* Required when: `rateType` is `FIXED` and `paymentOptions.deposit` is `true`
|
|
871
|
+
*/
|
|
872
|
+
deposit?: Money$1;
|
|
873
|
+
/**
|
|
874
|
+
* Whether customers can choose to pay the full service price upfront instead of only the deposit.
|
|
875
|
+
*
|
|
876
|
+
* Used only when a `deposit` amount is set.
|
|
877
|
+
*
|
|
878
|
+
* Default: `false`.
|
|
879
|
+
*/
|
|
880
|
+
fullUpfrontPaymentAllowed?: boolean | null;
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Money.
|
|
884
|
+
* Default format to use. Sufficiently compliant with majority of standards: w3c, ISO 4217, ISO 20022, ISO 8583:2003.
|
|
885
|
+
*/
|
|
886
|
+
interface Money$1 {
|
|
887
|
+
/**
|
|
888
|
+
* Monetary amount. Decimal string with a period as a decimal separator. For example `25.05`.
|
|
889
|
+
* @format DECIMAL_VALUE
|
|
890
|
+
* @decimalValue options { gt:0, maxScale:2 }
|
|
891
|
+
*/
|
|
892
|
+
value?: string;
|
|
893
|
+
/**
|
|
894
|
+
* Currency code in [ISO 4217 format](https://en.wikipedia.org/wiki/ISO_4217). For example, `USD`.
|
|
895
|
+
* @format CURRENCY
|
|
896
|
+
* @readonly
|
|
897
|
+
*/
|
|
898
|
+
currency?: string;
|
|
899
|
+
/**
|
|
900
|
+
* Monetary amount. Decimal string in local format. For example, `1 000,30`.
|
|
901
|
+
* @maxLength 50
|
|
902
|
+
*/
|
|
903
|
+
formattedValue?: string | null;
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* A deposit expressed as exactly one of a fixed monetary amount or a percentage of the full service price.
|
|
907
|
+
* Structurally exclusive: at most one of `amount` or `percentage` may be set.
|
|
908
|
+
*/
|
|
909
|
+
interface CustomPayment {
|
|
910
|
+
/**
|
|
911
|
+
* A custom description explaining to the customer how to pay for the service.
|
|
912
|
+
* @maxLength 50
|
|
913
|
+
*/
|
|
914
|
+
description?: string | null;
|
|
915
|
+
}
|
|
916
|
+
interface VariedPayment {
|
|
917
|
+
/** The default price for the service without any variants. It will also be used as the default price for any new variant. */
|
|
918
|
+
defaultPrice?: Money$1;
|
|
919
|
+
/**
|
|
920
|
+
* The deposit price required to book the service.
|
|
921
|
+
*
|
|
922
|
+
* Required when: `rateType` is `VARIED` and `paymentOptions.deposit` is `true`
|
|
923
|
+
*/
|
|
924
|
+
deposit?: Money$1;
|
|
925
|
+
/**
|
|
926
|
+
* The minimal price a customer may pay for this service, based on its variants.
|
|
927
|
+
* @readonly
|
|
928
|
+
*/
|
|
929
|
+
minPrice?: Money$1;
|
|
930
|
+
/**
|
|
931
|
+
* The maximum price a customer may pay for this service, based on its variants.
|
|
932
|
+
* @readonly
|
|
933
|
+
*/
|
|
934
|
+
maxPrice?: Money$1;
|
|
935
|
+
/**
|
|
936
|
+
* Whether customers can choose to pay the full service price upfront instead of only the deposit.
|
|
937
|
+
*
|
|
938
|
+
* Used only when a `deposit` amount is set.
|
|
939
|
+
*
|
|
940
|
+
* Default: `false`.
|
|
941
|
+
*/
|
|
942
|
+
fullUpfrontPaymentAllowed?: boolean | null;
|
|
943
|
+
}
|
|
944
|
+
interface SubscriptionPayment {
|
|
945
|
+
/**
|
|
946
|
+
* Base price charged per billing cycle before tax and discounts.
|
|
947
|
+
* The actual amount charged may differ after checkout applies tax and discounts.
|
|
948
|
+
*/
|
|
949
|
+
amountPerBillingCycle?: Money$1;
|
|
950
|
+
/**
|
|
951
|
+
* Billing frequency for recurring subscription charges.
|
|
952
|
+
* Reflected as `billingFrequency` in the booking's subscription info.
|
|
953
|
+
*
|
|
954
|
+
* Currently supports `MONTHLY` only.
|
|
955
|
+
*/
|
|
956
|
+
frequency?: FrequencyTypeWithLiterals;
|
|
957
|
+
/**
|
|
958
|
+
* Total number of billing cycles in the subscription. For example, `12` for a 12-month subscription with monthly payments.
|
|
959
|
+
* Reflected as `totalCycles` in the booking's subscription info.
|
|
960
|
+
*
|
|
961
|
+
* Required when: `rateType` is `SUBSCRIPTION`.
|
|
962
|
+
* @min 2
|
|
963
|
+
*/
|
|
964
|
+
totalPayments?: number | null;
|
|
965
|
+
/** Determines when the first billing cycle payment is charged. Used together with `recurringStartDate` to define the subscription billing schedule. */
|
|
966
|
+
firstChargeDate?: FirstChargeDateTypeWithLiterals;
|
|
967
|
+
/**
|
|
968
|
+
* Date and time when recurring billing starts.
|
|
969
|
+
*
|
|
970
|
+
* When `firstChargeDate` is `CHECKOUT`, the first charge occurs at checkout and subsequent billing cycles start from this date.
|
|
971
|
+
*
|
|
972
|
+
* When `firstChargeDate` is `SCHEDULED`, the first charge occurs on this date.
|
|
973
|
+
*
|
|
974
|
+
* Customers who book after recurring billing starts are billed for the remaining billing cycles only.
|
|
975
|
+
*
|
|
976
|
+
* Required when: `rateType` is `SUBSCRIPTION`.
|
|
977
|
+
*/
|
|
978
|
+
recurringStartDate?: Date | null;
|
|
979
|
+
/**
|
|
980
|
+
* Deprecated.
|
|
981
|
+
* @deprecated Deprecated.
|
|
982
|
+
* @targetRemovalDate 2026-07-01
|
|
983
|
+
*/
|
|
984
|
+
enrollmentFeeAmount?: Money$1;
|
|
985
|
+
}
|
|
986
|
+
declare enum FrequencyType {
|
|
987
|
+
/** Billing cycle repeats once per month. */
|
|
988
|
+
MONTHLY = "MONTHLY"
|
|
989
|
+
}
|
|
990
|
+
/** @enumType */
|
|
991
|
+
type FrequencyTypeWithLiterals = FrequencyType | 'MONTHLY';
|
|
992
|
+
declare enum FirstChargeDateType {
|
|
993
|
+
/** The first billing cycle is charged at checkout. Recurring billing continues from the `recurringStartDate`. */
|
|
994
|
+
CHECKOUT = "CHECKOUT",
|
|
995
|
+
/** The first billing cycle is charged on the `recurringStartDate`. */
|
|
996
|
+
SCHEDULED = "SCHEDULED"
|
|
997
|
+
}
|
|
998
|
+
/** @enumType */
|
|
999
|
+
type FirstChargeDateTypeWithLiterals = FirstChargeDateType | 'CHECKOUT' | 'SCHEDULED';
|
|
1000
|
+
/**
|
|
1001
|
+
* The payment options a customer can use to pay for the service.
|
|
1002
|
+
* For payments of type `FIXED` or `VARIED`, at least one of `online`, `inPerson`, or `pricingPlan` must be `true`.
|
|
1003
|
+
*/
|
|
1004
|
+
interface PaymentOptions {
|
|
1005
|
+
/**
|
|
1006
|
+
* Customers can pay for the service online.
|
|
1007
|
+
* When `true`:
|
|
1008
|
+
* + `rateType` must be `FIXED`, `VARIED`, or `SUBSCRIPTION`.
|
|
1009
|
+
* + `fixed.price`, `varied.defaultPrice`, or `subscription.amountPerBillingCycle` must be specified respectively.
|
|
1010
|
+
*
|
|
1011
|
+
* Required when: `rateType` is `SUBSCRIPTION`.
|
|
1012
|
+
* Read more about [getting paid online](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online).
|
|
1013
|
+
*/
|
|
1014
|
+
online?: boolean | null;
|
|
1015
|
+
/** Customers can pay for the service in person. */
|
|
1016
|
+
inPerson?: boolean | null;
|
|
1017
|
+
/**
|
|
1018
|
+
* This service requires a deposit to be made online in order to book it.
|
|
1019
|
+
* When `true`:
|
|
1020
|
+
* + `rateType` must be `VARIED` or `FIXED`.
|
|
1021
|
+
* + A `deposit` must be specified.
|
|
1022
|
+
* + `online` must be `true`.
|
|
1023
|
+
* + `inPerson` must be `false`.
|
|
1024
|
+
*/
|
|
1025
|
+
deposit?: boolean | null;
|
|
1026
|
+
/**
|
|
1027
|
+
* Whether customers can pay for the service using a pricing plan.
|
|
1028
|
+
* Read more about [service payment options](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments).
|
|
1029
|
+
*/
|
|
1030
|
+
pricingPlan?: boolean | null;
|
|
1031
|
+
}
|
|
1032
|
+
declare enum AddOnPaymentOptions {
|
|
1033
|
+
/** Customers are required to pay online for add-ons when the booking is paid for with a pricing plan. */
|
|
1034
|
+
ONLINE = "ONLINE",
|
|
1035
|
+
/** Customers are required to pay in person for add-ons when the booking is paid for with a pricing plan. */
|
|
1036
|
+
IN_PERSON = "IN_PERSON"
|
|
1037
|
+
}
|
|
1038
|
+
/** @enumType */
|
|
1039
|
+
type AddOnPaymentOptionsWithLiterals = AddOnPaymentOptions | 'ONLINE' | 'IN_PERSON';
|
|
1040
|
+
/** Estimated discount information for a service based on active eCommerce discounts. */
|
|
1041
|
+
interface DiscountInfo {
|
|
1042
|
+
/**
|
|
1043
|
+
* Name of the discount. For example, `Summer Sale - 20% Off`.
|
|
1044
|
+
* @minLength 1
|
|
1045
|
+
* @maxLength 50
|
|
1046
|
+
*/
|
|
1047
|
+
discountName?: string;
|
|
1048
|
+
/**
|
|
1049
|
+
* Estimated price after applying the discount. The final price is determined at checkout and may differ when additional discounts are applied or rules are re-evaluated with complete booking information.
|
|
1050
|
+
* For services with subscription pricing, this is the estimated price per billing cycle for the discounted cycles (see `discountedCycleCount`).
|
|
1051
|
+
*
|
|
1052
|
+
* Not returned when the discount depends on booking or cart context, for example a discount that applies to a service only when booked together with another service, or when the discount requires information only available at checkout.
|
|
1053
|
+
*/
|
|
1054
|
+
priceAfterDiscount?: Money$1;
|
|
1055
|
+
}
|
|
1056
|
+
/** A mandatory fee the customer pays in addition to the service price. */
|
|
1057
|
+
interface OnlineBooking {
|
|
1058
|
+
/**
|
|
1059
|
+
* Whether the service can be booked online.
|
|
1060
|
+
* When set to `true`, customers can book the service online. Configure the payment options via the `service.payment` property.
|
|
1061
|
+
* When set to `false`, customers cannot book the service online, and the service can only be paid for in person.
|
|
1062
|
+
*/
|
|
1063
|
+
enabled?: boolean | null;
|
|
1064
|
+
/** Booking the service requires approval by the Wix user. */
|
|
1065
|
+
requireManualApproval?: boolean | null;
|
|
1066
|
+
/** Multiple customers can request to book the same time slot. This is relevant when `requireManualApproval` is `true`. */
|
|
1067
|
+
allowMultipleRequests?: boolean | null;
|
|
1068
|
+
}
|
|
1069
|
+
interface Conferencing {
|
|
1070
|
+
/** Whether a conference link is generated for the service's sessions. */
|
|
1071
|
+
enabled?: boolean | null;
|
|
1072
|
+
}
|
|
1073
|
+
interface V2Location extends V2LocationOptionsOneOf {
|
|
1074
|
+
/** Information about business locations. Required when `type` is `BUSINESS`. */
|
|
1075
|
+
business?: BusinessLocationOptions;
|
|
1076
|
+
/** Information about custom locations. Required when `type` is `CUSTOM`. */
|
|
1077
|
+
custom?: CustomLocationOptions;
|
|
1078
|
+
/**
|
|
1079
|
+
* Location ID.
|
|
1080
|
+
* @format GUID
|
|
1081
|
+
* @readonly
|
|
1082
|
+
*/
|
|
1083
|
+
_id?: string;
|
|
1084
|
+
/**
|
|
1085
|
+
* Location type.
|
|
1086
|
+
*
|
|
1087
|
+
* Default: `CUSTOM`
|
|
1088
|
+
*/
|
|
1089
|
+
type?: LocationTypeEnumLocationTypeWithLiterals;
|
|
1090
|
+
/**
|
|
1091
|
+
* Location address. Empty for `{"type": "CUSTOMER"}`.
|
|
1092
|
+
* @readonly
|
|
1093
|
+
*/
|
|
1094
|
+
calculatedAddress?: CommonAddress;
|
|
1095
|
+
}
|
|
1096
|
+
/** @oneof */
|
|
1097
|
+
interface V2LocationOptionsOneOf {
|
|
1098
|
+
/** Information about business locations. Required when `type` is `BUSINESS`. */
|
|
1099
|
+
business?: BusinessLocationOptions;
|
|
1100
|
+
/** Information about custom locations. Required when `type` is `CUSTOM`. */
|
|
1101
|
+
custom?: CustomLocationOptions;
|
|
1102
|
+
}
|
|
1103
|
+
declare enum LocationTypeEnumLocationType {
|
|
1104
|
+
/** Location set by the business that is not a standard business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction). */
|
|
1105
|
+
CUSTOM = "CUSTOM",
|
|
1106
|
+
/** Business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction). */
|
|
1107
|
+
BUSINESS = "BUSINESS",
|
|
1108
|
+
/**
|
|
1109
|
+
* The customer specifies any address when booking. Available only for
|
|
1110
|
+
* appointment-based services.
|
|
1111
|
+
*/
|
|
1112
|
+
CUSTOMER = "CUSTOMER"
|
|
1113
|
+
}
|
|
1114
|
+
/** @enumType */
|
|
1115
|
+
type LocationTypeEnumLocationTypeWithLiterals = LocationTypeEnumLocationType | 'CUSTOM' | 'BUSINESS' | 'CUSTOMER';
|
|
1116
|
+
interface CommonAddress extends CommonAddressStreetOneOf {
|
|
1117
|
+
/** Street name and number. */
|
|
1118
|
+
streetAddress?: CommonStreetAddress;
|
|
1119
|
+
/** @maxLength 255 */
|
|
1120
|
+
addressLine1?: string | null;
|
|
1121
|
+
/**
|
|
1122
|
+
* 2-letter country code in an [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
|
|
1123
|
+
* @format COUNTRY
|
|
1124
|
+
*/
|
|
1125
|
+
country?: string | null;
|
|
1126
|
+
/**
|
|
1127
|
+
* Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.
|
|
1128
|
+
* @maxLength 255
|
|
1129
|
+
*/
|
|
1130
|
+
subdivision?: string | null;
|
|
1131
|
+
/**
|
|
1132
|
+
* City name.
|
|
1133
|
+
* @maxLength 255
|
|
1134
|
+
*/
|
|
1135
|
+
city?: string | null;
|
|
1136
|
+
/**
|
|
1137
|
+
* Postal or zip code.
|
|
1138
|
+
* @maxLength 255
|
|
1139
|
+
*/
|
|
1140
|
+
postalCode?: string | null;
|
|
1141
|
+
/**
|
|
1142
|
+
* Full address of the location.
|
|
1143
|
+
* @maxLength 512
|
|
1144
|
+
*/
|
|
1145
|
+
formatted?: string | null;
|
|
1146
|
+
}
|
|
1147
|
+
/** @oneof */
|
|
1148
|
+
interface CommonAddressStreetOneOf {
|
|
1149
|
+
/** Street name and number. */
|
|
1150
|
+
streetAddress?: CommonStreetAddress;
|
|
1151
|
+
/** @maxLength 255 */
|
|
1152
|
+
addressLine?: string | null;
|
|
1153
|
+
}
|
|
1154
|
+
/** Street address. Includes street name, number, and apartment number in separate fields. */
|
|
1155
|
+
interface CommonStreetAddress {
|
|
1156
|
+
/**
|
|
1157
|
+
* Street number.
|
|
1158
|
+
* @maxLength 255
|
|
1159
|
+
*/
|
|
1160
|
+
number?: string;
|
|
1161
|
+
/**
|
|
1162
|
+
* Street name.
|
|
1163
|
+
* @maxLength 255
|
|
1164
|
+
*/
|
|
1165
|
+
name?: string;
|
|
1166
|
+
/**
|
|
1167
|
+
* Apartment number.
|
|
1168
|
+
* @maxLength 255
|
|
1169
|
+
*/
|
|
1170
|
+
apt?: string;
|
|
1171
|
+
}
|
|
1172
|
+
interface BusinessLocationOptions {
|
|
1173
|
+
/**
|
|
1174
|
+
* ID of the business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction).
|
|
1175
|
+
* When setting a business location, specify only the location ID. Other location details are overwritten.
|
|
1176
|
+
* @format GUID
|
|
1177
|
+
*/
|
|
1178
|
+
_id?: string;
|
|
1179
|
+
/**
|
|
1180
|
+
* Business location name.
|
|
1181
|
+
* @readonly
|
|
1182
|
+
* @maxLength 150
|
|
1183
|
+
*/
|
|
1184
|
+
name?: string;
|
|
1185
|
+
/**
|
|
1186
|
+
* Whether this is the default location. There can only be a single default location per site.
|
|
1187
|
+
* @readonly
|
|
1188
|
+
*/
|
|
1189
|
+
default?: boolean | null;
|
|
1190
|
+
/**
|
|
1191
|
+
* Business location address.
|
|
1192
|
+
* @readonly
|
|
1193
|
+
*/
|
|
1194
|
+
address?: CommonAddress;
|
|
1195
|
+
/**
|
|
1196
|
+
* Business location email.
|
|
1197
|
+
* @format EMAIL
|
|
1198
|
+
* @readonly
|
|
1199
|
+
*/
|
|
1200
|
+
email?: string | null;
|
|
1201
|
+
/**
|
|
1202
|
+
* Business location phone.
|
|
1203
|
+
* @format PHONE
|
|
1204
|
+
* @readonly
|
|
1205
|
+
*/
|
|
1206
|
+
phone?: string | null;
|
|
1207
|
+
}
|
|
1208
|
+
interface CustomLocationOptions {
|
|
1209
|
+
/**
|
|
1210
|
+
* ID of the custom location.
|
|
1211
|
+
* @format GUID
|
|
1212
|
+
* @readonly
|
|
1213
|
+
*/
|
|
1214
|
+
_id?: string;
|
|
1215
|
+
/** Address of the custom location. */
|
|
1216
|
+
address?: CommonAddress;
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* `BookingPolicy` is the main entity of `BookingPolicyService` and specifies a set of rules for booking a service
|
|
1220
|
+
* by visitors and members.
|
|
1221
|
+
*
|
|
1222
|
+
* Each `BookingPolicy` consists of a number of sub-policies. When the Bookings App is provisioned to a meta site then a
|
|
1223
|
+
* default `BookingPolicy` will be created with defaults for each of these sub-policies. This also applies when a request
|
|
1224
|
+
* is received to create a new `BookingPolicy` and one or more of these sub-policies are not provided.
|
|
1225
|
+
*
|
|
1226
|
+
* Sub-policies are defined in separate objects as specified below.
|
|
1227
|
+
*
|
|
1228
|
+
* - The `LimitEarlyBookingPolicy` object defines the policy for limiting early bookings.
|
|
1229
|
+
* - The `LimitLateBookingPolicy` object defines the policy for limiting late bookings.
|
|
1230
|
+
* - The `BookAfterStartPolicy` object defines the policy for booking after the start of the schedule.
|
|
1231
|
+
* - The `CancellationPolicy` object defines the policy for canceling a booked entity.
|
|
1232
|
+
* - The `ReschedulePolicy` object defines the policy for rescheduling booked entity.
|
|
1233
|
+
* - The `WaitlistPolicy` object defines the policy for a waitlist.
|
|
1234
|
+
* - The `ParticipantsPolicy` object defines the policy regarding the participants per booking.
|
|
1235
|
+
* - The `ResourcesPolicy` object defines the policy regarding the resources per booking.
|
|
1236
|
+
* - The `CancellationFeePolicy` object defines the policy regarding cancellation fees.
|
|
1237
|
+
* - The `SaveCreditCardPolicy` object defines the policy for saving credit card details.
|
|
1238
|
+
*
|
|
1239
|
+
* By default each sub-policy is disabled. A more detailed specification of the default settings of each sub-policy
|
|
1240
|
+
* can be found in the description of the corresponding object.
|
|
1241
|
+
*
|
|
1242
|
+
* 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.
|
|
1243
|
+
*/
|
|
1244
|
+
interface BookingPolicy {
|
|
1245
|
+
/**
|
|
1246
|
+
* The ID to the policy for the booking.
|
|
1247
|
+
* @format GUID
|
|
1248
|
+
*/
|
|
1249
|
+
_id?: string;
|
|
1250
|
+
/**
|
|
1251
|
+
* Date and time the policy was created.
|
|
1252
|
+
* @readonly
|
|
1253
|
+
*/
|
|
1254
|
+
_createdDate?: Date | null;
|
|
1255
|
+
/**
|
|
1256
|
+
* Date and time the policy was updated.
|
|
1257
|
+
* @readonly
|
|
1258
|
+
*/
|
|
1259
|
+
_updatedDate?: Date | null;
|
|
1260
|
+
/**
|
|
1261
|
+
* Name of the policy.
|
|
1262
|
+
* @maxLength 400
|
|
1263
|
+
* @readonly
|
|
1264
|
+
*/
|
|
1265
|
+
name?: string | null;
|
|
1266
|
+
/**
|
|
1267
|
+
* Custom description for the policy. This policy is displayed to the participant.
|
|
1268
|
+
* @readonly
|
|
1269
|
+
*/
|
|
1270
|
+
customPolicyDescription?: PolicyDescription;
|
|
1271
|
+
/**
|
|
1272
|
+
* Whether the policy is the default for the meta site.
|
|
1273
|
+
* @readonly
|
|
1274
|
+
*/
|
|
1275
|
+
default?: boolean | null;
|
|
1276
|
+
/**
|
|
1277
|
+
* Policy for limiting early bookings.
|
|
1278
|
+
* @readonly
|
|
1279
|
+
*/
|
|
1280
|
+
limitEarlyBookingPolicy?: LimitEarlyBookingPolicy;
|
|
1281
|
+
/**
|
|
1282
|
+
* Policy for limiting late bookings.
|
|
1283
|
+
* @readonly
|
|
1284
|
+
*/
|
|
1285
|
+
limitLateBookingPolicy?: LimitLateBookingPolicy;
|
|
1286
|
+
/**
|
|
1287
|
+
* Policy on booking an entity after the start of the schedule.
|
|
1288
|
+
* @readonly
|
|
1289
|
+
*/
|
|
1290
|
+
bookAfterStartPolicy?: BookAfterStartPolicy;
|
|
1291
|
+
/**
|
|
1292
|
+
* Policy for canceling a booked entity.
|
|
1293
|
+
* @readonly
|
|
1294
|
+
*/
|
|
1295
|
+
cancellationPolicy?: CancellationPolicy;
|
|
1296
|
+
/**
|
|
1297
|
+
* Policy for rescheduling a booked entity.
|
|
1298
|
+
* @readonly
|
|
1299
|
+
*/
|
|
1300
|
+
reschedulePolicy?: ReschedulePolicy;
|
|
1301
|
+
/**
|
|
1302
|
+
* Waitlist policy for the service.
|
|
1303
|
+
* @readonly
|
|
1304
|
+
*/
|
|
1305
|
+
waitlistPolicy?: WaitlistPolicy;
|
|
1306
|
+
/**
|
|
1307
|
+
* Policy regarding the participants per booking.
|
|
1308
|
+
* @readonly
|
|
1309
|
+
*/
|
|
1310
|
+
participantsPolicy?: ParticipantsPolicy;
|
|
1311
|
+
/**
|
|
1312
|
+
* Policy for allocating resources.
|
|
1313
|
+
* @readonly
|
|
1314
|
+
*/
|
|
1315
|
+
resourcesPolicy?: ResourcesPolicy;
|
|
1316
|
+
/**
|
|
1317
|
+
* Rules for cancellation fees.
|
|
1318
|
+
* @readonly
|
|
1319
|
+
*/
|
|
1320
|
+
cancellationFeePolicy?: CancellationFeePolicy;
|
|
1321
|
+
/**
|
|
1322
|
+
* Rule for saving credit card.
|
|
1323
|
+
* @readonly
|
|
1324
|
+
*/
|
|
1325
|
+
saveCreditCardPolicy?: SaveCreditCardPolicy;
|
|
1326
|
+
/** Rule for requiring customers to complete an [intake form](https://dev.wix.com/docs/api-reference/crm/forms/other-services/intake-forms/introduction) during or after booking. */
|
|
1327
|
+
intakeFormPolicy?: IntakeFormPolicy;
|
|
1328
|
+
}
|
|
1329
|
+
/** A description of the policy to display to participants. */
|
|
1330
|
+
interface PolicyDescription {
|
|
1331
|
+
/**
|
|
1332
|
+
* Whether the description should be displayed. If `true`, the description is displayed.
|
|
1333
|
+
*
|
|
1334
|
+
* Default: `false`
|
|
1335
|
+
*/
|
|
1336
|
+
enabled?: boolean;
|
|
1337
|
+
/**
|
|
1338
|
+
* The description to display.
|
|
1339
|
+
*
|
|
1340
|
+
* Default: Empty
|
|
1341
|
+
* Max length: 2500 characters
|
|
1342
|
+
* @maxLength 2500
|
|
1343
|
+
*/
|
|
1344
|
+
description?: string;
|
|
1345
|
+
}
|
|
1346
|
+
/** The policy for limiting early bookings. */
|
|
1347
|
+
interface LimitEarlyBookingPolicy {
|
|
1348
|
+
/**
|
|
1349
|
+
* Whether there is a limit on how early a customer
|
|
1350
|
+
* can book. When `false`, there is no limit on the earliest
|
|
1351
|
+
* booking time and customers can book in advance, as early as they like.
|
|
1352
|
+
*
|
|
1353
|
+
* Default: `false`
|
|
1354
|
+
*/
|
|
1355
|
+
enabled?: boolean;
|
|
1356
|
+
/**
|
|
1357
|
+
* Maximum number of minutes before the start of the session that a booking can be made. This value must be greater
|
|
1358
|
+
* than `latest_booking_in_minutes` in the `LimitLateBookingPolicy` policy.
|
|
1359
|
+
*
|
|
1360
|
+
* Default: 10080 minutes (7 days)
|
|
1361
|
+
* Min: 1 minute
|
|
1362
|
+
* @min 1
|
|
1363
|
+
*/
|
|
1364
|
+
earliestBookingInMinutes?: number;
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* The policy for limiting late bookings.
|
|
1368
|
+
*
|
|
1369
|
+
* This policy and the `BookAfterStartPolicy` policy cannot be enabled at the same time. So if this policy
|
|
1370
|
+
* is enabled, `BookAfterStartPolicy` must be disabled.
|
|
1371
|
+
*/
|
|
1372
|
+
interface LimitLateBookingPolicy {
|
|
1373
|
+
/**
|
|
1374
|
+
* Whether there is a limit on how late a customer
|
|
1375
|
+
* can book. When `false`, there is no limit on the latest
|
|
1376
|
+
* booking time and customers can book up to the last minute.
|
|
1377
|
+
*
|
|
1378
|
+
* Default: `false`
|
|
1379
|
+
*/
|
|
1380
|
+
enabled?: boolean;
|
|
1381
|
+
/**
|
|
1382
|
+
* Minimum number of minutes before the start of the session that a booking can be made.
|
|
1383
|
+
* For a schedule, this is relative to the start time of the next booked session, excluding past-booked sessions.
|
|
1384
|
+
* This value must be less than `earliest_booking_in_minutes` in the `LimitEarlyBookingPolicy` policy.
|
|
1385
|
+
*
|
|
1386
|
+
* Default: 1440 minutes (1 day)
|
|
1387
|
+
* Min: 1 minute
|
|
1388
|
+
* @min 1
|
|
1389
|
+
*/
|
|
1390
|
+
latestBookingInMinutes?: number;
|
|
1391
|
+
}
|
|
1392
|
+
/**
|
|
1393
|
+
* The policy for whether a session can be booked after the start of the schedule.
|
|
1394
|
+
* This policy and `LimitLateBookingPolicy` cannot be enabled at the same time. So if this policy
|
|
1395
|
+
* is enabled, the `LimitLateBookingPolicy` policy must be disabled.
|
|
1396
|
+
*/
|
|
1397
|
+
interface BookAfterStartPolicy {
|
|
1398
|
+
/**
|
|
1399
|
+
* Whether booking is allowed after the start of the schedule. When `true`,
|
|
1400
|
+
* customers can book after the start of the schedule.
|
|
1401
|
+
*
|
|
1402
|
+
* Default: `false`
|
|
1403
|
+
*/
|
|
1404
|
+
enabled?: boolean;
|
|
1405
|
+
}
|
|
1406
|
+
/** The policy for canceling a booked session. */
|
|
1407
|
+
interface CancellationPolicy {
|
|
1408
|
+
/**
|
|
1409
|
+
* Whether canceling a booking is allowed. When `true`, customers
|
|
1410
|
+
* can cancel the booking.
|
|
1411
|
+
*
|
|
1412
|
+
* Default: `false`
|
|
1413
|
+
*/
|
|
1414
|
+
enabled?: boolean;
|
|
1415
|
+
/**
|
|
1416
|
+
* Whether there is a limit on the latest cancellation time. When `true`,
|
|
1417
|
+
* a time limit is enforced.
|
|
1418
|
+
*
|
|
1419
|
+
* Default: `false`
|
|
1420
|
+
*/
|
|
1421
|
+
limitLatestCancellation?: boolean;
|
|
1422
|
+
/**
|
|
1423
|
+
* Minimum number of minutes before the start of the booked session that the booking can be canceled.
|
|
1424
|
+
*
|
|
1425
|
+
* Default: 1440 minutes (1 day)
|
|
1426
|
+
* Min: 1 minute
|
|
1427
|
+
* @min 1
|
|
1428
|
+
*/
|
|
1429
|
+
latestCancellationInMinutes?: number;
|
|
1430
|
+
/**
|
|
1431
|
+
* Whether this cancellation policy allows anonymous cancellations.
|
|
1432
|
+
*
|
|
1433
|
+
* **Important**: This flag only applies when `enabled` is `true`. If the cancellation
|
|
1434
|
+
* policy itself is disabled (`enabled` = `false`), anonymous users cannot cancel
|
|
1435
|
+
* regardless of this flag's value.
|
|
1436
|
+
*
|
|
1437
|
+
* When not set (null), defaults to enabled. Anonymous cancellations are allowed by default
|
|
1438
|
+
* so that customers aren't required to be site members to cancel their bookings.
|
|
1439
|
+
*
|
|
1440
|
+
* Default: `null` (treated as `true`)
|
|
1441
|
+
*/
|
|
1442
|
+
allowAnonymous?: boolean | null;
|
|
1443
|
+
}
|
|
1444
|
+
/** The policy for rescheduling a booked session. */
|
|
1445
|
+
interface ReschedulePolicy {
|
|
1446
|
+
/**
|
|
1447
|
+
* Whether rescheduling a booking is allowed. When `true`, customers
|
|
1448
|
+
* can reschedule the booking.
|
|
1449
|
+
*
|
|
1450
|
+
* Default: `false`
|
|
1451
|
+
*/
|
|
1452
|
+
enabled?: boolean;
|
|
1453
|
+
/**
|
|
1454
|
+
* Whether there is a limit on the latest reschedule time. When `true`,
|
|
1455
|
+
* a time limit is enforced.
|
|
1456
|
+
*
|
|
1457
|
+
* Default: `false`
|
|
1458
|
+
*/
|
|
1459
|
+
limitLatestReschedule?: boolean;
|
|
1460
|
+
/**
|
|
1461
|
+
* Minimum number of minutes before the start of the booked session that the booking can be rescheduled.
|
|
1462
|
+
*
|
|
1463
|
+
* Default: 1440 minutes (1 day)
|
|
1464
|
+
* Min: 1 minute
|
|
1465
|
+
* @min 1
|
|
1466
|
+
*/
|
|
1467
|
+
latestRescheduleInMinutes?: number;
|
|
1468
|
+
/**
|
|
1469
|
+
* Whether this reschedule policy allows anonymous rescheduling.
|
|
1470
|
+
*
|
|
1471
|
+
* **Important**: This flag only applies when `enabled` is `true`. If the reschedule
|
|
1472
|
+
* policy itself is disabled (`enabled` = `false`), anonymous users cannot reschedule
|
|
1473
|
+
* regardless of this flag's value.
|
|
1474
|
+
*
|
|
1475
|
+
* When not set (null), defaults to enabled. Anonymous rescheduling is allowed by default
|
|
1476
|
+
* so that customers aren't required to be site members to reschedule their bookings.
|
|
1477
|
+
*
|
|
1478
|
+
* Default: `null` (treated as `true`)
|
|
1479
|
+
*/
|
|
1480
|
+
allowAnonymous?: boolean | null;
|
|
1481
|
+
}
|
|
1482
|
+
/** The policy for the waitlist. */
|
|
1483
|
+
interface WaitlistPolicy {
|
|
1484
|
+
/**
|
|
1485
|
+
* Whether the session has a waitlist. If `true`, there is a waitlist.
|
|
1486
|
+
*
|
|
1487
|
+
* Default: `false`
|
|
1488
|
+
*/
|
|
1489
|
+
enabled?: boolean;
|
|
1490
|
+
/**
|
|
1491
|
+
* Number of spots available in the waitlist.
|
|
1492
|
+
*
|
|
1493
|
+
* Default: 10 spots
|
|
1494
|
+
* Min: 1 spot
|
|
1495
|
+
* @min 1
|
|
1496
|
+
*/
|
|
1497
|
+
capacity?: number;
|
|
1498
|
+
/**
|
|
1499
|
+
* Amount of time a participant is given to book, once notified that a spot is available.
|
|
1500
|
+
*
|
|
1501
|
+
* Default: 10 minutes
|
|
1502
|
+
* Min: 1 spot
|
|
1503
|
+
* @min 1
|
|
1504
|
+
*/
|
|
1505
|
+
reservationTimeInMinutes?: number;
|
|
1506
|
+
}
|
|
1507
|
+
/** The policy for the maximum number of participants per booking. */
|
|
1508
|
+
interface ParticipantsPolicy {
|
|
1509
|
+
/**
|
|
1510
|
+
* Maximum number of participants allowed.
|
|
1511
|
+
*
|
|
1512
|
+
* Default: 1 participant
|
|
1513
|
+
* Min: 1 participant
|
|
1514
|
+
* @min 1
|
|
1515
|
+
*/
|
|
1516
|
+
maxParticipantsPerBooking?: number;
|
|
1517
|
+
}
|
|
1518
|
+
/** The policy regarding the allocation of resources (e.g. staff members). */
|
|
1519
|
+
interface ResourcesPolicy {
|
|
1520
|
+
/**
|
|
1521
|
+
* `true` if this policy is enabled, `false` otherwise.
|
|
1522
|
+
* When `false` then the client must always select a resource when booking an appointment.
|
|
1523
|
+
*/
|
|
1524
|
+
enabled?: boolean;
|
|
1525
|
+
/**
|
|
1526
|
+
* `true`, if it is allowed to automatically assign a resource when booking an appointment,
|
|
1527
|
+
* `false`, if the client must always select a resource.
|
|
1528
|
+
*
|
|
1529
|
+
* Default: `false`
|
|
1530
|
+
*/
|
|
1531
|
+
autoAssignAllowed?: boolean;
|
|
1532
|
+
}
|
|
1533
|
+
interface CancellationFeePolicy {
|
|
1534
|
+
/**
|
|
1535
|
+
* Whether canceling a booking will result in a cancellation fee
|
|
1536
|
+
*
|
|
1537
|
+
* Default: `false`
|
|
1538
|
+
*/
|
|
1539
|
+
enabled?: boolean;
|
|
1540
|
+
/**
|
|
1541
|
+
* Cancellation windows describing the time of cancellation and the fee to charge.
|
|
1542
|
+
* @maxSize 2
|
|
1543
|
+
*/
|
|
1544
|
+
cancellationWindows?: CancellationWindow[];
|
|
1545
|
+
/**
|
|
1546
|
+
* Whether the cancellation fee should not be automatically collected when customer cancels the booking.
|
|
1547
|
+
*
|
|
1548
|
+
* Default: `true`
|
|
1549
|
+
*/
|
|
1550
|
+
autoCollectFeeEnabled?: boolean | null;
|
|
1551
|
+
}
|
|
1552
|
+
interface CancellationWindow extends CancellationWindowFeeOneOf {
|
|
1553
|
+
/** Amount to be charged as a cancellation fee. */
|
|
1554
|
+
amount?: Money$1;
|
|
1555
|
+
/**
|
|
1556
|
+
* Percentage of the original price to be charged as a cancellation fee.
|
|
1557
|
+
* @decimalValue options { gt:0, lte:100, maxScale:2 }
|
|
1558
|
+
*/
|
|
1559
|
+
percentage?: string;
|
|
1560
|
+
/**
|
|
1561
|
+
* The fee will be applied if the booked session starts within this start time in minutes.
|
|
1562
|
+
* @min 1
|
|
1563
|
+
*/
|
|
1564
|
+
startInMinutes?: number | null;
|
|
1565
|
+
}
|
|
1566
|
+
/** @oneof */
|
|
1567
|
+
interface CancellationWindowFeeOneOf {
|
|
1568
|
+
/** Amount to be charged as a cancellation fee. */
|
|
1569
|
+
amount?: Money$1;
|
|
1570
|
+
/**
|
|
1571
|
+
* Percentage of the original price to be charged as a cancellation fee.
|
|
1572
|
+
* @decimalValue options { gt:0, lte:100, maxScale:2 }
|
|
1573
|
+
*/
|
|
1574
|
+
percentage?: string;
|
|
1575
|
+
}
|
|
1576
|
+
interface SaveCreditCardPolicy {
|
|
1577
|
+
/** Default: `false` */
|
|
1578
|
+
enabled?: boolean;
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* Policy for determining how staff members are sorted and selected during the booking process.
|
|
1582
|
+
* This affects which staff member is chosen when multiple staff members are available for a service.
|
|
1583
|
+
*/
|
|
1584
|
+
/** Policy for integrating with Intake form. Stores which form to use and when to present it. */
|
|
1585
|
+
interface IntakeFormPolicy {
|
|
1586
|
+
/**
|
|
1587
|
+
* Whether intake form integration is enabled for the service.
|
|
1588
|
+
* Default: `false`
|
|
1589
|
+
*/
|
|
1590
|
+
enabled?: boolean;
|
|
1591
|
+
/**
|
|
1592
|
+
* ID of the intake form to integrate with the service.
|
|
1593
|
+
* @format GUID
|
|
1594
|
+
*/
|
|
1595
|
+
formId?: string | null;
|
|
1596
|
+
/** When to present the intake form to the customer. */
|
|
1597
|
+
timing?: TimingWithLiterals;
|
|
1598
|
+
completionRequirement?: CompletionRequirementWithLiterals;
|
|
1599
|
+
}
|
|
1600
|
+
declare enum Timing {
|
|
1601
|
+
/** Send form after booking. */
|
|
1602
|
+
AFTER_BOOKING = "AFTER_BOOKING",
|
|
1603
|
+
/** Show form during booking flow. */
|
|
1604
|
+
BEFORE_BOOKING = "BEFORE_BOOKING"
|
|
1605
|
+
}
|
|
1606
|
+
/** @enumType */
|
|
1607
|
+
type TimingWithLiterals = Timing | 'AFTER_BOOKING' | 'BEFORE_BOOKING';
|
|
1608
|
+
/** Requirement for completing the intake form. */
|
|
1609
|
+
declare enum CompletionRequirement {
|
|
1610
|
+
/** Form completion is optional and can be skipped entirely. */
|
|
1611
|
+
OPTIONAL = "OPTIONAL",
|
|
1612
|
+
/**
|
|
1613
|
+
* Form must be completed before the booking can be finalized.
|
|
1614
|
+
* can used only if timing is BEFORE_BOOKING.
|
|
1615
|
+
*/
|
|
1616
|
+
REQUIRED_BEFORE_BOOKING = "REQUIRED_BEFORE_BOOKING"
|
|
1617
|
+
}
|
|
1618
|
+
/** @enumType */
|
|
1619
|
+
type CompletionRequirementWithLiterals = CompletionRequirement | 'OPTIONAL' | 'REQUIRED_BEFORE_BOOKING';
|
|
1620
|
+
/**
|
|
1621
|
+
* Rule limiting how many times the same customer can book a service within a given period.
|
|
1622
|
+
* The first booking is always allowed; the limit constrains additional bookings.
|
|
1623
|
+
*/
|
|
1624
|
+
interface Schedule {
|
|
1625
|
+
/**
|
|
1626
|
+
* ID of the [schedule](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/introduction)
|
|
1627
|
+
* to which the service's events belong.
|
|
1628
|
+
* @format GUID
|
|
1629
|
+
* @readonly
|
|
1630
|
+
*/
|
|
1631
|
+
_id?: string | null;
|
|
1632
|
+
/**
|
|
1633
|
+
* Start time of the first session in the schedule. For courses only.
|
|
1634
|
+
* @readonly
|
|
1635
|
+
*/
|
|
1636
|
+
firstSessionStart?: Date | null;
|
|
1637
|
+
/**
|
|
1638
|
+
* End time of the last session in the schedule. For courses only.
|
|
1639
|
+
* @readonly
|
|
1640
|
+
*/
|
|
1641
|
+
lastSessionEnd?: Date | null;
|
|
1642
|
+
/** Limitations affecting the service availability. */
|
|
1643
|
+
availabilityConstraints?: AvailabilityConstraints;
|
|
1644
|
+
}
|
|
1645
|
+
interface AvailabilityConstraints {
|
|
1646
|
+
/**
|
|
1647
|
+
* Calculated list of all supported session durations for the service. For
|
|
1648
|
+
* appointment-based services without varied pricing based on session length, it
|
|
1649
|
+
* matches the single value in the `sessionDurations` array. For appointment-based
|
|
1650
|
+
* services with varied pricing based on session length, it includes session
|
|
1651
|
+
* durations for all [variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction),
|
|
1652
|
+
* while ignoring `sessionDurations`.
|
|
1653
|
+
* For courses and classes, it includes durations for all future
|
|
1654
|
+
* recurring sessions but excludes durations for one-off or past recurring sessions.
|
|
1655
|
+
* @readonly
|
|
1656
|
+
* @maxSize 50
|
|
1657
|
+
*/
|
|
1658
|
+
durations?: V2Duration[];
|
|
1659
|
+
/**
|
|
1660
|
+
* List of supported session durations in minutes.
|
|
1661
|
+
*
|
|
1662
|
+
* - For appointment-based services, specify `sessionDurations` when creating a service.
|
|
1663
|
+
* - For appointment-based services with varied pricing by session length, you must still specify `sessionDurations`, but the values are ignored. Actual durations are taken from the [service variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction).
|
|
1664
|
+
* - For classes or courses, don't specify `sessionDurations` when creating a service.
|
|
1665
|
+
* @min 1
|
|
1666
|
+
* @max 44639
|
|
1667
|
+
* @maxSize 50
|
|
1668
|
+
*/
|
|
1669
|
+
sessionDurations?: number[];
|
|
1670
|
+
/**
|
|
1671
|
+
* The number of minutes between the end of a session and the start of the next.
|
|
1672
|
+
* @max 720
|
|
1673
|
+
*/
|
|
1674
|
+
timeBetweenSessions?: number;
|
|
1675
|
+
/**
|
|
1676
|
+
* Duration range for the service. When set, the customer picks a duration
|
|
1677
|
+
* within the configured min/max range instead of a fixed session duration.
|
|
1678
|
+
* Mutually exclusive with `sessionDurations`. A service uses one or the other.
|
|
1679
|
+
* Can't be combined with `workingHours`.
|
|
1680
|
+
*
|
|
1681
|
+
* Use `durationRange` for services where the customer chooses how long to book,
|
|
1682
|
+
* such as equipment or space rentals. The `unitType` determines whether the range
|
|
1683
|
+
* is measured in hours or days.
|
|
1684
|
+
*/
|
|
1685
|
+
durationRange?: DurationRange;
|
|
1686
|
+
}
|
|
1687
|
+
interface V2Duration {
|
|
1688
|
+
/**
|
|
1689
|
+
* The duration of the service in minutes.
|
|
1690
|
+
* @min 1
|
|
1691
|
+
* @max 44639
|
|
1692
|
+
*/
|
|
1693
|
+
minutes?: number;
|
|
1694
|
+
}
|
|
1695
|
+
/**
|
|
1696
|
+
* Duration range configuration for a service. Defines the minimum and maximum
|
|
1697
|
+
* booking duration a customer can select, and the unit of measurement.
|
|
1698
|
+
*
|
|
1699
|
+
* For hourly services, durations are configured in minutes via `hourOptions`.
|
|
1700
|
+
* For daily services, durations are configured in days via `dayOptions`.
|
|
1701
|
+
*/
|
|
1702
|
+
interface DurationRange extends DurationRangeConfigOneOf {
|
|
1703
|
+
/** Configuration for hourly duration ranges. Set when `unitType` is `HOUR`. */
|
|
1704
|
+
hourOptions?: HourlyConfig;
|
|
1705
|
+
/** Configuration for daily duration ranges. Set when `unitType` is `DAY`. */
|
|
1706
|
+
dayOptions?: DailyConfig;
|
|
1707
|
+
/** The unit type for this duration range. Determines which configuration to use in the `config` union. */
|
|
1708
|
+
unitType?: UnitTypeWithLiterals;
|
|
1709
|
+
}
|
|
1710
|
+
/** @oneof */
|
|
1711
|
+
interface DurationRangeConfigOneOf {
|
|
1712
|
+
/** Configuration for hourly duration ranges. Set when `unitType` is `HOUR`. */
|
|
1713
|
+
hourOptions?: HourlyConfig;
|
|
1714
|
+
/** Configuration for daily duration ranges. Set when `unitType` is `DAY`. */
|
|
1715
|
+
dayOptions?: DailyConfig;
|
|
1716
|
+
}
|
|
1717
|
+
/** The booking unit for the duration range. */
|
|
1718
|
+
declare enum UnitType {
|
|
1719
|
+
/** Hourly booking unit. Durations are configured in minutes via `hourOptions`. */
|
|
1720
|
+
HOUR = "HOUR",
|
|
1721
|
+
/** Daily booking unit. Durations are configured in days via `dayOptions`. */
|
|
1722
|
+
DAY = "DAY"
|
|
1723
|
+
}
|
|
1724
|
+
/** @enumType */
|
|
1725
|
+
type UnitTypeWithLiterals = UnitType | 'HOUR' | 'DAY';
|
|
1726
|
+
/** Hourly duration configuration. Durations are specified in minutes. */
|
|
1727
|
+
interface HourlyConfig {
|
|
1728
|
+
/**
|
|
1729
|
+
* Minimum bookable duration in minutes. The customer can't book for less than this duration.
|
|
1730
|
+
* @min 30
|
|
1731
|
+
* @max 1440
|
|
1732
|
+
*/
|
|
1733
|
+
minDurationInMinutes?: number;
|
|
1734
|
+
/**
|
|
1735
|
+
* Maximum bookable duration in minutes. The customer can't book for more than this duration.
|
|
1736
|
+
*
|
|
1737
|
+
* Must be greater than or equal to `minDurationInMinutes`.
|
|
1738
|
+
* @min 30
|
|
1739
|
+
* @max 1440
|
|
1740
|
+
*/
|
|
1741
|
+
maxDurationInMinutes?: number;
|
|
1742
|
+
}
|
|
1743
|
+
/** Daily duration configuration. Durations are specified in days. */
|
|
1744
|
+
interface DailyConfig {
|
|
1745
|
+
/**
|
|
1746
|
+
* Minimum bookable duration in days. The customer can't book for less than this number of days.
|
|
1747
|
+
* @min 1
|
|
1748
|
+
* @max 40
|
|
1749
|
+
*/
|
|
1750
|
+
minDurationInDays?: number;
|
|
1751
|
+
/**
|
|
1752
|
+
* Maximum bookable duration in days. The customer can't book for more than this number of days.
|
|
1753
|
+
*
|
|
1754
|
+
* Must be greater than or equal to `minDurationInDays`.
|
|
1755
|
+
* @min 1
|
|
1756
|
+
* @max 40
|
|
1757
|
+
*/
|
|
1758
|
+
maxDurationInDays?: number;
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
* Controls how a service's own working hours combine with the working hours of its assigned
|
|
1762
|
+
* staff members and required resources. The hours themselves are not held here. They are the
|
|
1763
|
+
* `WORKING_HOURS` events on the service's schedule (`schedule.id`), and this message controls
|
|
1764
|
+
* only how they combine with the resources working hours.
|
|
1765
|
+
*/
|
|
1766
|
+
interface StaffMember {
|
|
1767
|
+
/**
|
|
1768
|
+
* ID of the [resource](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction) associated with the staff member providing the service.
|
|
1769
|
+
* Despite the field name, this is the resource ID, not the staff member ID.
|
|
1770
|
+
* This value matches the staff member's `resourceId` from the [Staff Members API](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/introduction)
|
|
1771
|
+
* and corresponds to the IDs in the service's `staffMemberIds` field.
|
|
1772
|
+
* @format GUID
|
|
1773
|
+
* @readonly
|
|
1774
|
+
*/
|
|
1775
|
+
staffMemberId?: string;
|
|
1776
|
+
/**
|
|
1777
|
+
* Name of the staff member
|
|
1778
|
+
* @maxLength 40
|
|
1779
|
+
* @readonly
|
|
1780
|
+
*/
|
|
1781
|
+
name?: string | null;
|
|
1782
|
+
/**
|
|
1783
|
+
* Main media associated with the service.
|
|
1784
|
+
* @readonly
|
|
1785
|
+
*/
|
|
1786
|
+
mainMedia?: StaffMediaItem;
|
|
1787
|
+
}
|
|
1788
|
+
interface StaffMediaItem extends StaffMediaItemItemOneOf {
|
|
1789
|
+
/** Details of the image associated with the staff, such as URL and size. */
|
|
1790
|
+
image?: string;
|
|
1791
|
+
}
|
|
1792
|
+
/** @oneof */
|
|
1793
|
+
interface StaffMediaItemItemOneOf {
|
|
1794
|
+
/** Details of the image associated with the staff, such as URL and size. */
|
|
1795
|
+
image?: string;
|
|
1796
|
+
}
|
|
1797
|
+
/**
|
|
1798
|
+
* Working hours location coverage derived from Calendar v3 WORKING_HOURS events
|
|
1799
|
+
* (`NONE` and `MASTER` recurrence types). The server paginates through Calendar results
|
|
1800
|
+
* (100 events per page) until all matching events are collected.
|
|
1801
|
+
*
|
|
1802
|
+
* Coverage states when enrichment is requested:
|
|
1803
|
+
* + `available_at_all_locations = true`: Staff applies to every business location. Set when the staff
|
|
1804
|
+
* uses default business working hours, or has any WORKING_HOURS event without a location ID
|
|
1805
|
+
* (including when mixed with location-specific events).
|
|
1806
|
+
* + `available_at_all_locations = false` with non-empty `location_ids`: Staff has location-specific
|
|
1807
|
+
* WORKING_HOURS only. Show the staff member only when the selected location is in `location_ids`.
|
|
1808
|
+
* + `available_at_all_locations = false` with empty `location_ids`: Staff has working-hours schedules
|
|
1809
|
+
* but no applicable location coverage was found.
|
|
1810
|
+
*
|
|
1811
|
+
* Recommended client filter:
|
|
1812
|
+
* `availableAtAllLocations || locationIds.includes(selectedLocationId)`
|
|
1813
|
+
*
|
|
1814
|
+
* Omitted when `STAFF_WORKING_HOURS_LOCATIONS` is not requested.
|
|
1815
|
+
*/
|
|
1816
|
+
interface StaffMemberDetails {
|
|
1817
|
+
/**
|
|
1818
|
+
* Staff members providing the service. For appointments only.
|
|
1819
|
+
* @maxSize 220
|
|
1820
|
+
*/
|
|
1821
|
+
staffMembers?: StaffMember[];
|
|
1822
|
+
}
|
|
1823
|
+
interface ResourceIds {
|
|
1824
|
+
/**
|
|
1825
|
+
* Values of the resource IDs.
|
|
1826
|
+
* @maxSize 100
|
|
1827
|
+
* @format GUID
|
|
1828
|
+
*/
|
|
1829
|
+
values?: string[];
|
|
1830
|
+
}
|
|
1831
|
+
interface ServiceResource extends ServiceResourceSelectionOneOf {
|
|
1832
|
+
/**
|
|
1833
|
+
* IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)
|
|
1834
|
+
* assigned to this service resource. Each ID must reference a resource within the specified `resourceType`.
|
|
1835
|
+
*
|
|
1836
|
+
* When set, only these resources are considered for availability and booking.
|
|
1837
|
+
* When not set, all resources of the specified resource type are eligible.
|
|
1838
|
+
*/
|
|
1839
|
+
resourceIds?: ResourceIds;
|
|
1840
|
+
/** Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction). */
|
|
1841
|
+
resourceType?: ResourceType;
|
|
1842
|
+
}
|
|
1843
|
+
/** @oneof */
|
|
1844
|
+
interface ServiceResourceSelectionOneOf {
|
|
1845
|
+
/**
|
|
1846
|
+
* IDs of specific [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction)
|
|
1847
|
+
* assigned to this service resource. Each ID must reference a resource within the specified `resourceType`.
|
|
1848
|
+
*
|
|
1849
|
+
* When set, only these resources are considered for availability and booking.
|
|
1850
|
+
* When not set, all resources of the specified resource type are eligible.
|
|
1851
|
+
*/
|
|
1852
|
+
resourceIds?: ResourceIds;
|
|
1853
|
+
}
|
|
1854
|
+
interface ResourceType {
|
|
1855
|
+
/**
|
|
1856
|
+
* The type of the resource.
|
|
1857
|
+
* @format GUID
|
|
1858
|
+
*/
|
|
1859
|
+
_id?: string | null;
|
|
1860
|
+
/**
|
|
1861
|
+
* The name of the resource type.
|
|
1862
|
+
* @readonly
|
|
1863
|
+
* @maxLength 40
|
|
1864
|
+
* @minLength 1
|
|
1865
|
+
*/
|
|
1866
|
+
name?: string | null;
|
|
1867
|
+
}
|
|
1868
|
+
/** Details about the individual resources assigned to a service resource. */
|
|
1869
|
+
interface Slug {
|
|
1870
|
+
/**
|
|
1871
|
+
* 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`.
|
|
1872
|
+
* @maxLength 500
|
|
1873
|
+
*/
|
|
1874
|
+
name?: string;
|
|
1875
|
+
/**
|
|
1876
|
+
* Whether the slug was generated or customized. If `true`, the slug was customized manually by the business owner. Otherwise, the slug was automatically generated from the service name.
|
|
1877
|
+
* @readonly
|
|
1878
|
+
*/
|
|
1879
|
+
custom?: boolean | null;
|
|
1880
|
+
/**
|
|
1881
|
+
* Date and time the slug was created. This is a system field.
|
|
1882
|
+
* @readonly
|
|
1883
|
+
*/
|
|
1884
|
+
_createdDate?: Date | null;
|
|
1885
|
+
}
|
|
1886
|
+
interface URLs {
|
|
1887
|
+
/**
|
|
1888
|
+
* The URL for the service page.
|
|
1889
|
+
* @readonly
|
|
1890
|
+
*/
|
|
1891
|
+
servicePage?: string;
|
|
1892
|
+
/**
|
|
1893
|
+
* The URL for the booking entry point. It can be either to the calendar or to the service page.
|
|
1894
|
+
* @readonly
|
|
1895
|
+
*/
|
|
1896
|
+
bookingPage?: string;
|
|
1897
|
+
/**
|
|
1898
|
+
* The URL for the calendar. Can be empty if no calendar exists.
|
|
1899
|
+
* @readonly
|
|
1900
|
+
*/
|
|
1901
|
+
calendarPage?: string;
|
|
1902
|
+
}
|
|
1903
|
+
interface ExtendedFields {
|
|
1904
|
+
/**
|
|
1905
|
+
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
1906
|
+
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
1907
|
+
*
|
|
1908
|
+
* You can only access fields for which you have the appropriate permissions.
|
|
1909
|
+
*
|
|
1910
|
+
* Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
|
|
1911
|
+
*/
|
|
1912
|
+
namespaces?: Record<string, Record<string, any>>;
|
|
1913
|
+
}
|
|
1914
|
+
/**
|
|
1915
|
+
* 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.
|
|
1916
|
+
* The search engines use this information for ranking purposes, or to display snippets in the search results.
|
|
1917
|
+
* 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.
|
|
1918
|
+
*/
|
|
1919
|
+
interface SeoSchema {
|
|
1920
|
+
/** SEO tag information. */
|
|
1921
|
+
tags?: Tag[];
|
|
1922
|
+
/** SEO general settings. */
|
|
1923
|
+
settings?: Settings;
|
|
1924
|
+
}
|
|
1925
|
+
interface Keyword {
|
|
1926
|
+
/** Keyword value. */
|
|
1927
|
+
term?: string;
|
|
1928
|
+
/** Whether the keyword is the main focus keyword. */
|
|
1929
|
+
isMain?: boolean;
|
|
1930
|
+
/**
|
|
1931
|
+
* The source that added the keyword terms to the SEO settings.
|
|
1932
|
+
* @maxLength 1000
|
|
1933
|
+
*/
|
|
1934
|
+
origin?: string | null;
|
|
1935
|
+
}
|
|
1936
|
+
interface Tag {
|
|
1937
|
+
/**
|
|
1938
|
+
* SEO tag type.
|
|
1939
|
+
*
|
|
1940
|
+
*
|
|
1941
|
+
* Supported values: `title`, `meta`, `script`, `link`.
|
|
1942
|
+
*
|
|
1943
|
+
* Which of these an API actually accepts depends on where the tag is being set: this
|
|
1944
|
+
* list is not a blanket guarantee across every API that reuses this message. Site SEO
|
|
1945
|
+
* Tags in particular accepts only `meta` (see `SiteSeoTags.tags`) and rejects
|
|
1946
|
+
* `title`/`script`/`link` with a validation error even though they appear here —
|
|
1947
|
+
* check the field description of the specific `tags`-typed field you're writing to
|
|
1948
|
+
* for the types it actually supports and the error it returns.
|
|
1949
|
+
*
|
|
1950
|
+
* Limitation: `title` and `script` (e.g. a `script` tag with `props.type`
|
|
1951
|
+
* `"application/ld+json"` carrying structured data) are supported only when
|
|
1952
|
+
* `custom` is unset or `false`. Setting `custom: true` on a `title` or `script`
|
|
1953
|
+
* tag is rejected with `TAG_TYPE_NOT_ALLOWED`, because `custom: true` routes the
|
|
1954
|
+
* write through the site's Advanced/Custom Tags list. To write structured data,
|
|
1955
|
+
* omit `custom` (or set it to `false`).
|
|
1956
|
+
*/
|
|
1957
|
+
type?: string;
|
|
1958
|
+
/**
|
|
1959
|
+
* A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value.
|
|
1960
|
+
* For example: `{"name": "description", "content": "the description itself"}`.
|
|
1961
|
+
*/
|
|
1962
|
+
props?: Record<string, any> | null;
|
|
1963
|
+
/** SEO tag metadata. For example, `{"height": 300, "width": 240}`. */
|
|
1964
|
+
meta?: Record<string, any> | null;
|
|
1965
|
+
/** SEO tag inner content. For example, `<title> inner content </title>`. */
|
|
1966
|
+
children?: string;
|
|
1967
|
+
/**
|
|
1968
|
+
* Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) —
|
|
1969
|
+
* i.e. an entry from the site's Advanced/Custom Tags list.
|
|
1970
|
+
*
|
|
1971
|
+
* Setting this to `true` on a write restricts which `type` values are accepted
|
|
1972
|
+
* — the same restriction the Advanced/Custom Tags UI enforces. `title` and
|
|
1973
|
+
* `script` tags (including JSON-LD structured data) must be sent with `custom`
|
|
1974
|
+
* omitted or `false`; sending them with `custom: true` is rejected with
|
|
1975
|
+
* `TAG_TYPE_NOT_ALLOWED`.
|
|
1976
|
+
*
|
|
1977
|
+
* Note this is a separate restriction from Site SEO Tags' own type restriction on
|
|
1978
|
+
* `SiteSeoTags.tags`: even with `custom` unset, Site SEO Tags rejects `script` (e.g.
|
|
1979
|
+
* for site-wide structured data) unconditionally. There is currently no way to set
|
|
1980
|
+
* site-wide, every-page structured data through any of these APIs — write a per-page
|
|
1981
|
+
* `script` tag through the Item SEO Tags API instead.
|
|
1982
|
+
*
|
|
1983
|
+
* This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag
|
|
1984
|
+
* (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed
|
|
1985
|
+
* default/pattern — standard tags always resolve with `custom: false`, even when their content comes
|
|
1986
|
+
* from a page's manually saved SEO title/description override. Don't use this field to verify whether
|
|
1987
|
+
* a live page reflects a manual per-page SEO edit.
|
|
1988
|
+
*
|
|
1989
|
+
* Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read
|
|
1990
|
+
* only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor
|
|
1991
|
+
* or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the
|
|
1992
|
+
* response entirely — there, `false` means this API could not tell, not that no custom tag exists.
|
|
1993
|
+
* Pass `seoData` explicitly to resolve against a known set of tags.
|
|
1994
|
+
*/
|
|
1995
|
+
custom?: boolean;
|
|
1996
|
+
/** Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. */
|
|
1997
|
+
disabled?: boolean;
|
|
1998
|
+
}
|
|
1999
|
+
interface Settings {
|
|
2000
|
+
/**
|
|
2001
|
+
* Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled.
|
|
2002
|
+
*
|
|
2003
|
+
*
|
|
2004
|
+
* Default: `false` (automatical redirect is enabled).
|
|
2005
|
+
*/
|
|
2006
|
+
preventAutoRedirect?: boolean;
|
|
2007
|
+
/**
|
|
2008
|
+
* User-selected keyword terms for a specific page.
|
|
2009
|
+
* @maxSize 5
|
|
2010
|
+
*/
|
|
2011
|
+
keywords?: Keyword[];
|
|
2012
|
+
}
|
|
2013
|
+
interface AddOnGroup {
|
|
2014
|
+
/**
|
|
2015
|
+
* ID of the add-on group.
|
|
2016
|
+
* Wix Bookings automatically populates this field when creating or updating an add-on group.
|
|
2017
|
+
* @readonly
|
|
2018
|
+
* @format GUID
|
|
2019
|
+
*/
|
|
2020
|
+
_id?: string | null;
|
|
2021
|
+
/**
|
|
2022
|
+
* Name of the add-on group.
|
|
2023
|
+
* @maxLength 100
|
|
2024
|
+
*/
|
|
2025
|
+
name?: string | null;
|
|
2026
|
+
/**
|
|
2027
|
+
* Maximum number of different [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction) from the group customers can add when booking the service.
|
|
2028
|
+
* When empty, there's no upper limit.
|
|
2029
|
+
*/
|
|
2030
|
+
maxNumberOfAddOns?: number | null;
|
|
2031
|
+
/**
|
|
2032
|
+
* List of IDs of all [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction) included in the group.
|
|
2033
|
+
* @format GUID
|
|
2034
|
+
* @maxSize 7
|
|
2035
|
+
*/
|
|
2036
|
+
addOnIds?: string[] | null;
|
|
2037
|
+
/**
|
|
2038
|
+
* Description or instructional prompt of the add-on group that's displayed to customers when booking the service.
|
|
2039
|
+
* @maxLength 200
|
|
2040
|
+
*/
|
|
2041
|
+
prompt?: string | null;
|
|
2042
|
+
}
|
|
2043
|
+
interface AddOnDetails {
|
|
2044
|
+
/**
|
|
2045
|
+
* ID of the add-on.
|
|
2046
|
+
* @format GUID
|
|
2047
|
+
*/
|
|
2048
|
+
addOnId?: string | null;
|
|
2049
|
+
/**
|
|
2050
|
+
* Duration in minutes for add-ons that extend service time.
|
|
2051
|
+
* Empty for [quantity-based add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction#terminology).
|
|
2052
|
+
*/
|
|
2053
|
+
durationInMinutes?: number | null;
|
|
2054
|
+
}
|
|
2055
|
+
/** `TaxableAddress` defines the taxable address used for the service. */
|
|
2056
|
+
interface TaxableAddress {
|
|
2057
|
+
/** Taxable address type. */
|
|
2058
|
+
taxableAddressType?: TaxableAddressTypeWithLiterals;
|
|
2059
|
+
}
|
|
2060
|
+
declare enum TaxableAddressType {
|
|
2061
|
+
BUSINESS = "BUSINESS",
|
|
2062
|
+
BILLING = "BILLING"
|
|
2063
|
+
}
|
|
2064
|
+
/** @enumType */
|
|
2065
|
+
type TaxableAddressTypeWithLiterals = TaxableAddressType | 'BUSINESS' | 'BILLING';
|
|
2066
|
+
interface ServiceChoices {
|
|
2067
|
+
/**
|
|
2068
|
+
* Number of participants for this [variant](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction).
|
|
2069
|
+
* @min 1
|
|
2070
|
+
*/
|
|
2071
|
+
numberOfParticipants?: number | null;
|
|
2072
|
+
/**
|
|
2073
|
+
* Service choices for these participants.
|
|
2074
|
+
* @maxSize 5
|
|
2075
|
+
*/
|
|
2076
|
+
choices?: ServiceChoice[];
|
|
2077
|
+
}
|
|
2078
|
+
interface ServiceChoice extends ServiceChoiceChoiceOneOf {
|
|
2079
|
+
/**
|
|
2080
|
+
* Value for one of the choices in the [`CustomServiceOption.choices`](https://example.com) list.
|
|
2081
|
+
* Choices are specific values for an option the customer can choose to book. For example,
|
|
2082
|
+
* the option `ageGroup` may have these choices: `child`, `student`, `adult`, and `senior`.
|
|
2083
|
+
* Each choice may have a different price.
|
|
2084
|
+
*/
|
|
2085
|
+
custom?: string;
|
|
2086
|
+
duration?: Duration;
|
|
2087
|
+
/** The matched date-time pricing rule. Available only for `DATE_TIME` options. */
|
|
2088
|
+
dateTime?: DateTimeRule;
|
|
2089
|
+
/** The matched participants pricing rule. Available only for `NUMBER_OF_PARTICIPANTS` options. */
|
|
2090
|
+
participantRange?: ParticipantsRange;
|
|
2091
|
+
/**
|
|
2092
|
+
* ID of the corresponding option for the choice. For example, the choice `child`
|
|
2093
|
+
* could correspond to the option `ageGroup`. In this case, `optionId` is the ID
|
|
2094
|
+
* for the `ageGroup` option.
|
|
2095
|
+
* @format GUID
|
|
2096
|
+
*/
|
|
2097
|
+
optionId?: string;
|
|
2098
|
+
/**
|
|
2099
|
+
* ID of the service choice. When provided, the choice details are automatically populated based on this ID.
|
|
2100
|
+
* @format GUID
|
|
2101
|
+
*/
|
|
2102
|
+
choiceId?: string | null;
|
|
2103
|
+
}
|
|
2104
|
+
/** @oneof */
|
|
2105
|
+
interface ServiceChoiceChoiceOneOf {
|
|
2106
|
+
/**
|
|
2107
|
+
* Value for one of the choices in the [`CustomServiceOption.choices`](https://example.com) list.
|
|
2108
|
+
* Choices are specific values for an option the customer can choose to book. For example,
|
|
2109
|
+
* the option `ageGroup` may have these choices: `child`, `student`, `adult`, and `senior`.
|
|
2110
|
+
* Each choice may have a different price.
|
|
2111
|
+
*/
|
|
2112
|
+
custom?: string;
|
|
2113
|
+
duration?: Duration;
|
|
2114
|
+
/** The matched date-time pricing rule. Available only for `DATE_TIME` options. */
|
|
2115
|
+
dateTime?: DateTimeRule;
|
|
2116
|
+
/** The matched participants pricing rule. Available only for `NUMBER_OF_PARTICIPANTS` options. */
|
|
2117
|
+
participantRange?: ParticipantsRange;
|
|
2118
|
+
}
|
|
2119
|
+
interface Duration {
|
|
2120
|
+
/**
|
|
2121
|
+
* Duration of the service in minutes.
|
|
2122
|
+
* Min: 1 minute, Max: 30 days, 23 hours, and 59 minutes
|
|
2123
|
+
* @min 1
|
|
2124
|
+
* @max 44639
|
|
2125
|
+
*/
|
|
2126
|
+
minutes?: number;
|
|
2127
|
+
/**
|
|
2128
|
+
* Name of the duration option.
|
|
2129
|
+
* Defaults to the formatted duration e.g. "1 hour, 30 minutes".
|
|
2130
|
+
* @maxLength 255
|
|
2131
|
+
*/
|
|
2132
|
+
name?: string | null;
|
|
2133
|
+
}
|
|
2134
|
+
interface DateTimeRule {
|
|
2135
|
+
/**
|
|
2136
|
+
* Name of the date-time rule. For example, "Weekend mornings".
|
|
2137
|
+
* @maxLength 255
|
|
2138
|
+
*/
|
|
2139
|
+
name?: string | null;
|
|
2140
|
+
}
|
|
2141
|
+
interface ParticipantsRange {
|
|
2142
|
+
/**
|
|
2143
|
+
* Name of the participants range. For example, "Large group".
|
|
2144
|
+
* @maxLength 255
|
|
2145
|
+
*/
|
|
2146
|
+
name?: string | null;
|
|
2147
|
+
}
|
|
2148
|
+
interface BookedAddOn {
|
|
2149
|
+
/**
|
|
2150
|
+
* The ID of the add-on.
|
|
2151
|
+
* @format GUID
|
|
2152
|
+
*/
|
|
2153
|
+
_id?: string;
|
|
2154
|
+
/**
|
|
2155
|
+
* The ID of the add-on group.
|
|
2156
|
+
* @format GUID
|
|
2157
|
+
*/
|
|
2158
|
+
groupId?: string;
|
|
2159
|
+
/**
|
|
2160
|
+
* The add-on duration in minutes at the time of booking.
|
|
2161
|
+
* Populated for duration-based add-ons.
|
|
2162
|
+
* @min 1
|
|
2163
|
+
* @max 1440
|
|
2164
|
+
* @readonly
|
|
2165
|
+
*/
|
|
2166
|
+
durationInMinutes?: number | null;
|
|
2167
|
+
/**
|
|
2168
|
+
* The quantity of booked add-ons.
|
|
2169
|
+
* For duration-based add-ons, `quantity` is not applicable.
|
|
2170
|
+
* If `quantity` is provided as `1` for a duration-based add-on, it will be accepted but the value will be cleared.
|
|
2171
|
+
* If any other value is provided, an `INVALID_ARGUMENT` error will be returned with the message: "Invalid AddOn details: either duration or quantity must be set correctly".
|
|
2172
|
+
* @min 1
|
|
2173
|
+
* @max 1000
|
|
2174
|
+
*/
|
|
2175
|
+
quantity?: number | null;
|
|
2176
|
+
/**
|
|
2177
|
+
* Add-on `name` at the time of booking.
|
|
2178
|
+
* @maxLength 100
|
|
2179
|
+
* @readonly
|
|
2180
|
+
*/
|
|
2181
|
+
name?: string | null;
|
|
2182
|
+
/**
|
|
2183
|
+
* Add-on name translated to the language the customer used during booking.
|
|
2184
|
+
* @maxLength 100
|
|
2185
|
+
* @readonly
|
|
2186
|
+
*/
|
|
2187
|
+
nameTranslated?: string | null;
|
|
2188
|
+
}
|
|
2189
|
+
/** Server-computed datetime adjusted to a requested timezone. */
|
|
2190
|
+
//#endregion
|
|
2191
|
+
//#region ../../node_modules/@wix/auto_sdk_bookings_bookings/build/es/index.typings.d.mts
|
|
2192
|
+
declare enum ResourceTransparency {
|
|
2193
|
+
OPAQUE = "OPAQUE",
|
|
2194
|
+
TRANSPARENT = "TRANSPARENT"
|
|
2195
|
+
}
|
|
2196
|
+
/** @enumType */
|
|
2197
|
+
type ResourceTransparencyWithLiterals = ResourceTransparency | 'OPAQUE' | 'TRANSPARENT';
|
|
2198
|
+
interface ResourceSelection$1 {
|
|
2199
|
+
/**
|
|
2200
|
+
* ID of the [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction).
|
|
2201
|
+
* @format GUID
|
|
2202
|
+
*/
|
|
2203
|
+
resourceTypeId?: string | null;
|
|
2204
|
+
/** Information about how the customer has selected the resource for this resource type. */
|
|
2205
|
+
selectionMethod?: SelectionMethodWithLiterals;
|
|
2206
|
+
/**
|
|
2207
|
+
* Gender the customer narrowed "any available resource" to, for a staff member resource type.
|
|
2208
|
+
*
|
|
2209
|
+
* Populated only when `selectionMethod` is `ANY_RESOURCE`, the resource type is the staff member resource type, and the business allows customers to narrow "any available" by gender.
|
|
2210
|
+
*
|
|
2211
|
+
* Omit the field for a plain "any available staff member" with no gender narrowing.
|
|
2212
|
+
*
|
|
2213
|
+
* Requires `genderPubliclyAccessible` to be enabled in the business's [staff member settings](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-member-settings/introduction). Creating a booking with this field fails when it's disabled.
|
|
2214
|
+
*/
|
|
2215
|
+
requestedGender?: RequestedGenderValue;
|
|
2216
|
+
}
|
|
2217
|
+
declare enum SelectionMethod {
|
|
2218
|
+
/** The customer explicitly chose a particular resource. */
|
|
2219
|
+
SPECIFIC_RESOURCE = "SPECIFIC_RESOURCE",
|
|
2220
|
+
/** The customer explicitly chose "any available resource" for this resource type. */
|
|
2221
|
+
ANY_RESOURCE = "ANY_RESOURCE",
|
|
2222
|
+
/** The customer wasn't offered a resource selection or agreement option for this resource type. */
|
|
2223
|
+
NO_SELECTION = "NO_SELECTION"
|
|
2224
|
+
}
|
|
2225
|
+
/** @enumType */
|
|
2226
|
+
type SelectionMethodWithLiterals = SelectionMethod | 'SPECIFIC_RESOURCE' | 'ANY_RESOURCE' | 'NO_SELECTION';
|
|
2227
|
+
/** Gender a customer requested when narrowing "any available staff member" to a gender. */
|
|
2228
|
+
interface RequestedGenderValue {
|
|
2229
|
+
/** Requested gender. */
|
|
2230
|
+
gender?: RequestedGenderWithLiterals;
|
|
2231
|
+
}
|
|
2232
|
+
declare enum RequestedGender$1 {
|
|
2233
|
+
/** The customer requested any available male staff member. */
|
|
2234
|
+
ANY_MALE = "ANY_MALE",
|
|
2235
|
+
/** The customer requested any available female staff member. */
|
|
2236
|
+
ANY_FEMALE = "ANY_FEMALE"
|
|
2237
|
+
}
|
|
2238
|
+
/** @enumType */
|
|
2239
|
+
type RequestedGenderWithLiterals = RequestedGender$1 | 'ANY_MALE' | 'ANY_FEMALE';
|
|
2240
|
+
interface V2Slot {
|
|
2241
|
+
/** Identifier for the underlying session when the session is a single session or generated from a recurring session. */
|
|
2242
|
+
sessionId?: string | null;
|
|
2243
|
+
/** Service identifier. Required. */
|
|
2244
|
+
serviceId?: string;
|
|
2245
|
+
/** Schedule identifier. Required. */
|
|
2246
|
+
scheduleId?: string;
|
|
2247
|
+
/** The start time of this slot in `YYYY-MM-DDThh:mm:ss`, `YYYY-MM-DDThh:mm:ss:SSS`, or `YYYY-MM-DDThh:mm:ss:SSSZZ` [ISO-8601 format](https://en.wikipedia.org/wiki/ISO_8601). For example, `2026-01-30T13:30:00`, `2026-01-30T13:30:00:000`, or `2026-01-30T13:30:00:000-05:00`. */
|
|
2248
|
+
startDate?: string | null;
|
|
2249
|
+
/** The end time of this slot in `YYYY-MM-DDThh:mm:ss`, `YYYY-MM-DDThh:mm:ss:SSS`, or `YYYY-MM-DDThh:mm:ss:SSSZZ` [ISO-8601 format](https://en.wikipedia.org/wiki/ISO_8601). For example, `2026-01-30T13:30:00`, `2026-01-30T13:30:00:000`, or `2026-01-30T13:30:00:000-05:00`. */
|
|
2250
|
+
endDate?: string | null;
|
|
2251
|
+
/** The timezone according to which the slot is calculated and presented. */
|
|
2252
|
+
timezone?: string | null;
|
|
2253
|
+
/**
|
|
2254
|
+
* The resource required for this slot.
|
|
2255
|
+
* When populated, the specified resource will be assigned to the slot upon confirmation according to its availability.
|
|
2256
|
+
* When empty, if `skip_availability_validation` is `false`, a random available resource will be assigned to the slot upon confirmation.
|
|
2257
|
+
* Otherwise, one of the service resources will be assigned to the slot randomly upon confirmation.
|
|
2258
|
+
*/
|
|
2259
|
+
resource?: SlotSlotResource;
|
|
2260
|
+
/** Geographic location of the slot. */
|
|
2261
|
+
location?: SlotLocation;
|
|
2262
|
+
/**
|
|
2263
|
+
* Calendar event ID - not supported.
|
|
2264
|
+
* If not empty, on all write flows (create/update), it takes priority over `sessionId`.
|
|
2265
|
+
* So if both `sessionId` and `eventId` are provided, the `sessionId` will be based on the `eventId`.
|
|
2266
|
+
* Otherwise, if `eventId` is empty on write flow,
|
|
2267
|
+
* @minLength 36
|
|
2268
|
+
* @maxLength 250
|
|
2269
|
+
*/
|
|
2270
|
+
eventId?: string | null;
|
|
2271
|
+
/**
|
|
2272
|
+
* Information about how the customer has selected resources for the booking.
|
|
2273
|
+
* Each resource type may have a different selection method.
|
|
2274
|
+
* Check `resource` for resource details.
|
|
2275
|
+
* @maxSize 3
|
|
2276
|
+
*/
|
|
2277
|
+
resourceSelections?: ResourceSelection$1[];
|
|
2278
|
+
/**
|
|
2279
|
+
* Whether the slot spans one or more full days.
|
|
2280
|
+
* For class bookings, this value is derived from the linked calendar event.
|
|
2281
|
+
* For appointment bookings, this value is derived from the availability slot. Any caller-provided value is ignored.
|
|
2282
|
+
*
|
|
2283
|
+
* When `true`, `startDate` is set to `00:00:00` of the first day and `endDate` is set to `00:00:00` of the day after the last day (exclusive). Midnight boundaries are interpreted in the slot's `timezone`.
|
|
2284
|
+
*
|
|
2285
|
+
* Default: `false`
|
|
2286
|
+
*/
|
|
2287
|
+
allDay?: boolean | null;
|
|
2288
|
+
}
|
|
2289
|
+
declare enum LocationLocationType {
|
|
2290
|
+
/** Undefined location type. */
|
|
2291
|
+
UNDEFINED = "UNDEFINED",
|
|
2292
|
+
/** The business address as set in the site’s general settings. */
|
|
2293
|
+
OWNER_BUSINESS = "OWNER_BUSINESS",
|
|
2294
|
+
/** The address set when creating the service. */
|
|
2295
|
+
OWNER_CUSTOM = "OWNER_CUSTOM",
|
|
2296
|
+
/** The address set for the individual session. */
|
|
2297
|
+
CUSTOM = "CUSTOM"
|
|
2298
|
+
}
|
|
2299
|
+
/** @enumType */
|
|
2300
|
+
type LocationLocationTypeWithLiterals = LocationLocationType | 'UNDEFINED' | 'OWNER_BUSINESS' | 'OWNER_CUSTOM' | 'CUSTOM';
|
|
2301
|
+
interface SlotSlotResource {
|
|
2302
|
+
/**
|
|
2303
|
+
* Resource ID.
|
|
2304
|
+
* @format GUID
|
|
2305
|
+
* @readonly
|
|
2306
|
+
*/
|
|
2307
|
+
_id?: string | null;
|
|
2308
|
+
/**
|
|
2309
|
+
* Resource name.
|
|
2310
|
+
* @maxLength 1200
|
|
2311
|
+
*/
|
|
2312
|
+
name?: string | null;
|
|
2313
|
+
/**
|
|
2314
|
+
* The desired transparency for this resource in the calendar event.
|
|
2315
|
+
*
|
|
2316
|
+
* Supported values:
|
|
2317
|
+
* + `OPAQUE`: The schedule is blocked during the booking, preventing other bookings involving the same resource from being scheduled at the same time.
|
|
2318
|
+
* + `TRANSPARENT`: The schedule remains open during the booking, allowing other bookings to be scheduled concurrently.
|
|
2319
|
+
*
|
|
2320
|
+
* Default: `UNKNOWN_TRANSPARENCY`.
|
|
2321
|
+
*/
|
|
2322
|
+
transparency?: ResourceTransparencyWithLiterals;
|
|
2323
|
+
}
|
|
2324
|
+
interface SlotLocation {
|
|
2325
|
+
/**
|
|
2326
|
+
* Business Location ID. Present if the location is a business location.
|
|
2327
|
+
* @format GUID
|
|
2328
|
+
*/
|
|
2329
|
+
_id?: string | null;
|
|
2330
|
+
/** Location name. */
|
|
2331
|
+
name?: string | null;
|
|
2332
|
+
/** A string containing the full address of this location. */
|
|
2333
|
+
formattedAddress?: string | null;
|
|
2334
|
+
/** Location type. */
|
|
2335
|
+
locationType?: LocationLocationTypeWithLiterals;
|
|
2336
|
+
}
|
|
2337
|
+
/** Response for RescheduleBookingAnonymously */
|
|
2338
|
+
//#endregion
|
|
2339
|
+
//#region ../bookings-flow-data/dist/types.d.ts
|
|
2340
|
+
/** Whether the Booking Preferences hold one service or a Multi-Service Appointment. Derived,
|
|
2341
|
+
* not chosen: the bookings-uou writer sets it from the service count on every encode (2+
|
|
2342
|
+
* services is `multi`). Readers should count `services` rather than read it. */
|
|
2343
|
+
type BookingMode = 'single' | 'multi';
|
|
2344
|
+
/** A committed resource selection for one resource *type* (staff, room, equipment…).
|
|
2345
|
+
* Carried as ids — the server accepts ids via `resourceSelections`, so the full resource
|
|
2346
|
+
* object (name, schedule) is never needed in the contract.
|
|
2347
|
+
*
|
|
2348
|
+
* Not `bookings.ResourceSelection` (API shape is `resourceTypeId` + `selectionMethod`). */
|
|
2349
|
+
interface ResourceSelection {
|
|
2350
|
+
type: string;
|
|
2351
|
+
ids: string[];
|
|
2352
|
+
/** The user picked "any available" rather than a specific resource of this type. */
|
|
2353
|
+
anyResource?: boolean;
|
|
2354
|
+
}
|
|
2355
|
+
/** A chosen service variant (dynamic pricing): participant count and/or option choices. */
|
|
2356
|
+
type SelectedVariant = Pick<ServiceChoices, 'numberOfParticipants'> & {
|
|
2357
|
+
/** Selected option values (wire carries string ids / custom values, not full `ServiceChoice` objects). */choices?: string[];
|
|
2358
|
+
};
|
|
2359
|
+
/** Genders a visitor can narrow "any staff member" to, in display order. Same literals as the
|
|
2360
|
+
* availability API's `requestedGender.gender`, single- and multi-service alike. */
|
|
2361
|
+
declare const REQUESTED_GENDERS: readonly ["ANY_FEMALE", "ANY_MALE"];
|
|
2362
|
+
type RequestedGender = (typeof REQUESTED_GENDERS)[number];
|
|
2363
|
+
/** A chosen add-on with its quantity — maps SDK `BookedAddOn` fields to flow names (`id` ↔ `_id`). */
|
|
2364
|
+
type AddOn = {
|
|
2365
|
+
id: NonNullable<BookedAddOn['_id']>;
|
|
2366
|
+
quantity: NonNullable<BookedAddOn['quantity']>;
|
|
2367
|
+
};
|
|
2368
|
+
/** One service's committed selections. Slot/schedule fields align with `bookings.V2Slot`. */
|
|
2369
|
+
type ServicePreference = {
|
|
2370
|
+
serviceId: NonNullable<V2Slot['serviceId']>;
|
|
2371
|
+
slug?: NonNullable<Slug['name']>;
|
|
2372
|
+
serviceType?: Service$2['type']; /** ISO local datetimes — per service (services in a bundle can start at different times). */
|
|
2373
|
+
slotStart?: V2Slot['startDate'];
|
|
2374
|
+
slotEnd?: V2Slot['endDate'];
|
|
2375
|
+
eventId?: V2Slot['eventId'];
|
|
2376
|
+
scheduleId?: V2Slot['scheduleId']; /** Needed to rehydrate class sessions in the OOI form. */
|
|
2377
|
+
sessionId?: V2Slot['sessionId']; /** Id only — maps to `SlotLocation._id` / location refetch at the destination. */
|
|
2378
|
+
locationId?: NonNullable<SlotLocation['_id']>; /** Availability naming (`BUSINESS` | `CUSTOM` | `CUSTOMER`); the booking step translates it to the bookings enum. */
|
|
2379
|
+
locationType?: 'BUSINESS' | 'CUSTOM' | 'CUSTOMER';
|
|
2380
|
+
resources?: ResourceSelection[];
|
|
2381
|
+
selectedVariants?: SelectedVariant[];
|
|
2382
|
+
addOns?: AddOn[]; /** The duration variant choice's id, sent to availability as `customerChoices.durationChoiceId`. */
|
|
2383
|
+
durationChoiceId?: string;
|
|
2384
|
+
/** A chosen duration in minutes, sent as `customerChoices.durationInMinutes`. With add-ons the
|
|
2385
|
+
* API requires it to equal the service duration plus theirs, so writers usually omit it. */
|
|
2386
|
+
durationInMinutes?: number; /** Narrows "any staff member" to a gender, sent as `customerChoices.requestedGender`. */
|
|
2387
|
+
requestedGender?: RequestedGender;
|
|
2388
|
+
};
|
|
2389
|
+
/** One accumulating object; each destination builder projects the slice it needs. */
|
|
2390
|
+
interface BookingPreferences {
|
|
2391
|
+
mode: BookingMode;
|
|
2392
|
+
timezone?: V2Slot['timezone'];
|
|
2393
|
+
services: ServicePreference[];
|
|
2394
|
+
/** The visitor ticked "I have a coupon" in the Booking Summary, so checkout must not be skipped.
|
|
2395
|
+
* Absent means unticked; writers omit `false`. */
|
|
2396
|
+
wantsPromoCode?: boolean;
|
|
2397
|
+
}
|
|
2398
|
+
//#endregion
|
|
2399
|
+
//#region src/api/adapters/service/service.d.ts
|
|
2400
|
+
type Service$1 = Service$2;
|
|
2401
|
+
//#endregion
|
|
2402
|
+
//#region src/domains/payment-options/consts.d.ts
|
|
2403
|
+
/**
|
|
2404
|
+
* No MEMBERSHIP on purpose: the data panel would let the owner preselect it and the
|
|
2405
|
+
* filter would reduce the list to plan rows. Plan rows carry `paymentMethod: null`.
|
|
2406
|
+
*/
|
|
2407
|
+
declare const PAYMENT_METHOD: {
|
|
2408
|
+
readonly ONLINE: "ONLINE";
|
|
2409
|
+
readonly OFFLINE: "OFFLINE";
|
|
2410
|
+
};
|
|
2411
|
+
type PaymentMethod = (typeof PAYMENT_METHOD)[keyof typeof PAYMENT_METHOD];
|
|
2412
|
+
declare const BOOKING_PAYMENT_OPTION: {
|
|
2413
|
+
readonly ONLINE: "ONLINE";
|
|
2414
|
+
readonly OFFLINE: "OFFLINE";
|
|
2415
|
+
readonly MEMBERSHIP: "MEMBERSHIP";
|
|
2416
|
+
};
|
|
2417
|
+
type BookingPaymentOption = (typeof BOOKING_PAYMENT_OPTION)[keyof typeof BOOKING_PAYMENT_OPTION];
|
|
2418
|
+
/**
|
|
2419
|
+
* Service rows use the kind as their id. MEMBERSHIP and BUY_PLAN rows key by
|
|
2420
|
+
* membership id and `plan:${planId}`, since there can be several.
|
|
2421
|
+
*/
|
|
2422
|
+
declare const PAYMENT_OPTION_KIND: {
|
|
2423
|
+
readonly ONLINE: "ONLINE"; /** Deposit online now, the rest in person. */
|
|
2424
|
+
readonly DEPOSIT: "DEPOSIT";
|
|
2425
|
+
readonly FULL_AMOUNT: "FULL_AMOUNT";
|
|
2426
|
+
readonly OFFLINE: "OFFLINE";
|
|
2427
|
+
readonly FREE: "FREE"; /** CUSTOM rate: a price description instead of an amount. */
|
|
2428
|
+
readonly CUSTOM_PRICE: "CUSTOM_PRICE";
|
|
2429
|
+
readonly MEMBERSHIP: "MEMBERSHIP";
|
|
2430
|
+
readonly BUY_PLAN: "BUY_PLAN";
|
|
2431
|
+
};
|
|
2432
|
+
type PaymentOptionKind = (typeof PAYMENT_OPTION_KIND)[keyof typeof PAYMENT_OPTION_KIND];
|
|
2433
|
+
//#endregion
|
|
2434
|
+
//#region ../../node_modules/@wix/auto_sdk_pricing-plans_plans-v-3/build/es/pricing-plans-v3-plan-plans-v-3.universal-CSm3CgP7.d.mts
|
|
2435
|
+
/**
|
|
2436
|
+
* The choices a buyer makes about a plan, carried in the `options` field of an eCommerce line item's
|
|
2437
|
+
* `catalogReference`.
|
|
2438
|
+
*
|
|
2439
|
+
* `catalogReference.appId` must be the Wix Pricing Plans app ID `1522827f-c56c-a5c9-2ac9-00f9e6ae12d3`
|
|
2440
|
+
* and `catalogReference.catalogItemId` must be the plan ID. Wix Pricing Plans reads this object to price
|
|
2441
|
+
* and validate the line item.
|
|
2442
|
+
*/
|
|
2443
|
+
interface Options extends OptionsOptionsOneOf {
|
|
2444
|
+
/** Options for buying a plan. Applies when `type` is `PLAN`. */
|
|
2445
|
+
planOptions?: PlanOptions;
|
|
2446
|
+
/** What the buyer is purchasing. Determines which options object below applies. */
|
|
2447
|
+
type?: TypeWithLiterals;
|
|
2448
|
+
}
|
|
2449
|
+
/** @oneof */
|
|
2450
|
+
interface OptionsOptionsOneOf {
|
|
2451
|
+
/** Options for buying a plan. Applies when `type` is `PLAN`. */
|
|
2452
|
+
planOptions?: PlanOptions;
|
|
2453
|
+
}
|
|
2454
|
+
declare enum Type {
|
|
2455
|
+
/** Buying a plan. Set `planOptions`. */
|
|
2456
|
+
PLAN = "PLAN"
|
|
2457
|
+
}
|
|
2458
|
+
/** @enumType */
|
|
2459
|
+
type TypeWithLiterals = Type | 'PLAN';
|
|
2460
|
+
interface PlanOptions extends PlanOptionsPricingStrategyOptionsOneOf {
|
|
2461
|
+
/**
|
|
2462
|
+
* ID of the pricing variant the buyer selected, from the plan's `pricingVariants`.
|
|
2463
|
+
*
|
|
2464
|
+
* Required. This is how you choose between a plan's billing options, for example monthly versus yearly.
|
|
2465
|
+
* A catalog reference whose variant ID isn't on the plan fails to add to the cart with ITEM_NOT_FOUND_IN_CATALOG.
|
|
2466
|
+
* @format GUID
|
|
2467
|
+
*/
|
|
2468
|
+
pricingVariantId?: string;
|
|
2469
|
+
/**
|
|
2470
|
+
* Date the subscription should start.
|
|
2471
|
+
*
|
|
2472
|
+
* Set this only when the selected pricing variant's `billingTerms.startType` is `CUSTOM`, which means the
|
|
2473
|
+
* plan lets the buyer choose when billing begins. The merchant can restrict that choice to a date range,
|
|
2474
|
+
* and a date outside it is rejected at checkout with a `start-date-not-in-permitted-range` violation.
|
|
2475
|
+
*
|
|
2476
|
+
* When `startType` is `ON_PURCHASE`, Wix works the start date out from the plan's own settings. If those
|
|
2477
|
+
* don't produce one, a value set here is used as a fallback.
|
|
2478
|
+
*/
|
|
2479
|
+
startDate?: Date | null;
|
|
2480
|
+
/**
|
|
2481
|
+
* ID of the Wix Forms submission the buyer filled in alongside the purchase, if the plan collects one.
|
|
2482
|
+
* @format GUID
|
|
2483
|
+
*/
|
|
2484
|
+
submissionId?: string | null;
|
|
2485
|
+
/**
|
|
2486
|
+
* How the plan is being bought.
|
|
2487
|
+
*
|
|
2488
|
+
* Leave this unset for a storefront purchase the buyer makes themselves. An unset value behaves as
|
|
2489
|
+
* `ONLINE`. Set `MANUAL` for an order the site owner records on the buyer's behalf. See `MANUAL`.
|
|
2490
|
+
*/
|
|
2491
|
+
purchaseFlow?: PurchaseFlowWithLiterals;
|
|
2492
|
+
}
|
|
2493
|
+
/** @oneof */
|
|
2494
|
+
interface PlanOptionsPricingStrategyOptionsOneOf {}
|
|
2495
|
+
declare enum PurchaseFlow {
|
|
2496
|
+
/**
|
|
2497
|
+
* A purchase the site owner records on the buyer's behalf, rather than one the buyer makes themselves.
|
|
2498
|
+
* `start_date` is used as passed, without the plan's start date rules.
|
|
2499
|
+
*
|
|
2500
|
+
* Requires the Pricing Plans Manage Orders scope (`SCOPE.DC-PAIDPLANS.MANAGE-ORDERS`). Without it, the
|
|
2501
|
+
* purchase is treated as `ONLINE`.
|
|
2502
|
+
*/
|
|
2503
|
+
MANUAL = "MANUAL",
|
|
2504
|
+
/** A purchase the buyer makes themselves on the site. Use this for a storefront purchase. */
|
|
2505
|
+
ONLINE = "ONLINE"
|
|
2506
|
+
}
|
|
2507
|
+
/** @enumType */
|
|
2508
|
+
type PurchaseFlowWithLiterals = PurchaseFlow | 'MANUAL' | 'ONLINE';
|
|
2509
|
+
//#endregion
|
|
2510
|
+
//#region src/domains/payment-options/from-plans.d.ts
|
|
2511
|
+
/** A plan in eCom's catalog: Pricing Plans' own `options` carry the pricing variant. */
|
|
2512
|
+
interface PlanCatalogReference {
|
|
2513
|
+
appId: string;
|
|
2514
|
+
catalogItemId: string;
|
|
2515
|
+
options?: Options | null;
|
|
2516
|
+
}
|
|
2517
|
+
interface PlanPurchase {
|
|
2518
|
+
catalogReference: PlanCatalogReference;
|
|
2519
|
+
benefitId: string;
|
|
2520
|
+
price: string;
|
|
2521
|
+
/** Pricing Plans' page for a plan that needs a start date or a form before purchase. */
|
|
2522
|
+
infoCollectionUrl?: string | null;
|
|
2523
|
+
}
|
|
2524
|
+
//#endregion
|
|
2525
|
+
//#region src/domains/payment-options/from-service.d.ts
|
|
2526
|
+
type Service = Service$2;
|
|
2527
|
+
type Payment = NonNullable<Service['payment']>;
|
|
2528
|
+
type Money = NonNullable<NonNullable<Payment['fixed']>['price']>;
|
|
2529
|
+
interface MembershipRowData {
|
|
2530
|
+
membershipId: string;
|
|
2531
|
+
appId: string;
|
|
2532
|
+
label: string;
|
|
2533
|
+
/** `null` is unlimited, `0` is a spent plan. */
|
|
2534
|
+
creditRemain: number | null;
|
|
2535
|
+
creditCost: number;
|
|
2536
|
+
isSessionBased: boolean;
|
|
2537
|
+
total: number | null;
|
|
2538
|
+
expirationDate: string | null;
|
|
2539
|
+
}
|
|
2540
|
+
interface PaymentOption$1 {
|
|
2541
|
+
id: string;
|
|
2542
|
+
kind: PaymentOptionKind;
|
|
2543
|
+
paymentMethod: PaymentMethod | null;
|
|
2544
|
+
/** Raw `Money`: the caller formats it with a locale. `null` for free or custom-price rows. */
|
|
2545
|
+
amount: Money | null;
|
|
2546
|
+
/** `amount` is the lowest variant price: reads "From $30". */
|
|
2547
|
+
isFromPrice: boolean;
|
|
2548
|
+
/** Discounted service amount. Payment rows keep displaying their original `amount`. */
|
|
2549
|
+
amountAfterDiscount: Money | null;
|
|
2550
|
+
/** Shown below the payment label, including when a discounted price is available. */
|
|
2551
|
+
discountName: string | null;
|
|
2552
|
+
/** Custom-price row only. */
|
|
2553
|
+
priceText: string | null;
|
|
2554
|
+
disabled: boolean;
|
|
2555
|
+
disabledReason: string | null;
|
|
2556
|
+
membershipDisabledReason?: 'INSUFFICIENT_CREDITS' | 'MULTIPLE_PARTICIPANTS';
|
|
2557
|
+
titleText: string | null;
|
|
2558
|
+
detailText: string | null;
|
|
2559
|
+
suffixText: string | null;
|
|
2560
|
+
membership: MembershipRowData | null;
|
|
2561
|
+
purchasablePlan?: PlanPurchase;
|
|
2562
|
+
}
|
|
2563
|
+
//#endregion
|
|
2564
|
+
//#region src/domains/payment-options/to-booking.d.ts
|
|
2565
|
+
interface SelectedMembership {
|
|
2566
|
+
membershipId: string;
|
|
2567
|
+
appId: string;
|
|
2568
|
+
/** Service the plan was quoted for; other basket services must not be charged to it. */
|
|
2569
|
+
serviceId: string;
|
|
2570
|
+
}
|
|
2571
|
+
//#endregion
|
|
2572
|
+
//#region src/api/adapters/pricing/preview-price.d.ts
|
|
2573
|
+
/** One `participantsChoices.serviceChoices` entry of the booking. */
|
|
2574
|
+
interface ParticipantsServiceChoice {
|
|
2575
|
+
numberOfParticipants?: number;
|
|
2576
|
+
choices: Array<{
|
|
2577
|
+
choiceId?: string;
|
|
2578
|
+
optionId?: string;
|
|
2579
|
+
}>;
|
|
2580
|
+
}
|
|
2581
|
+
/** The count's previewed price, in the service's currency: the response carries none. */
|
|
2582
|
+
interface ParticipantsPrice {
|
|
2583
|
+
/** `calculatedPrice`: what legacy's payment summary shows and its totals line item charges. */
|
|
2584
|
+
total: number;
|
|
2585
|
+
/** The matched range's `pricePerParticipant`; absent unless a single range prices them all. */
|
|
2586
|
+
perParticipant?: number;
|
|
2587
|
+
}
|
|
2588
|
+
//#endregion
|
|
2589
|
+
//#region src/domains/booking-checkout/to-booking-entity.d.ts
|
|
2590
|
+
type ServiceOptionsAndVariants = ServiceOptionsAndVariants$1;
|
|
2591
|
+
interface ContactDetailsInput {
|
|
2592
|
+
firstName: string;
|
|
2593
|
+
lastName: string;
|
|
2594
|
+
email: string;
|
|
2595
|
+
/** Omitted when invalid: eCom rejects it. */
|
|
2596
|
+
phone?: string;
|
|
2597
|
+
}
|
|
2598
|
+
type PaymentOption = BookingPaymentOption;
|
|
2599
|
+
type OfferedAddOnGroup = Pick<NonNullable<Service$1['addOnGroups']>[number], '_id' | 'addOnIds'>;
|
|
2600
|
+
interface BookingPayment {
|
|
2601
|
+
paymentOption: PaymentOption;
|
|
2602
|
+
/** Deposit (`true`) or full amount (`false`). */
|
|
2603
|
+
depositSelected: boolean | null;
|
|
2604
|
+
/** The plan bought in the same cart that pays this entry (Plan & Book). */
|
|
2605
|
+
purchase?: PlanPurchase | null;
|
|
2606
|
+
}
|
|
2607
|
+
interface CreateBookingInput {
|
|
2608
|
+
contactDetails: ContactDetailsInput;
|
|
2609
|
+
/** One per Booking Preferences entry, in order: each MSA booking pays its own way. */
|
|
2610
|
+
payments: BookingPayment[];
|
|
2611
|
+
membership?: SelectedMembership | null;
|
|
2612
|
+
/** Aligned to Booking Preferences, so repeated services may use different plans. */
|
|
2613
|
+
memberships?: Array<SelectedMembership | null>;
|
|
2614
|
+
formSubmission?: Record<string, unknown>;
|
|
2615
|
+
/** By service id. A service not listed books no add-ons. */
|
|
2616
|
+
offeredAddOnGroups?: Record<string, OfferedAddOnGroup[]>;
|
|
2617
|
+
/** By service id, as an id-less custom choice is keyed by its text, which two services can share. */
|
|
2618
|
+
optionsAndVariantsByService?: Record<string, ServiceOptionsAndVariants>;
|
|
2619
|
+
/** Participants for an entry without variants; 1 when absent. Set by the checkout context. */
|
|
2620
|
+
totalParticipants?: number;
|
|
2621
|
+
/**
|
|
2622
|
+
* Rule-based number-of-participants pricing: the range the count falls in, booked in place of
|
|
2623
|
+
* `totalParticipants`, as legacy's previewed selectedVariants. Set by the checkout context.
|
|
2624
|
+
*/
|
|
2625
|
+
participantsChoices?: ParticipantsServiceChoice[];
|
|
2626
|
+
/** A service charges a cancellation fee or saves the card: only eCom's checkout page takes the card. */
|
|
2627
|
+
requiresCheckoutPage?: boolean;
|
|
2628
|
+
}
|
|
2629
|
+
//#endregion
|
|
2630
|
+
//#region src/lib/navigation.d.ts
|
|
2631
|
+
type OwnerLink = {
|
|
2632
|
+
href: string;
|
|
2633
|
+
target?: '_self' | '_blank';
|
|
2634
|
+
};
|
|
2635
|
+
//#endregion
|
|
2636
|
+
//#region src/domains/plan-and-book/flow.d.ts
|
|
2637
|
+
declare const PLAN_AND_BOOK_CTA: {
|
|
2638
|
+
readonly BOOK: "BOOK";
|
|
2639
|
+
readonly BUY_PLAN_AND_BOOK: "BUY_PLAN_AND_BOOK";
|
|
2640
|
+
readonly BUY_PLAN: "BUY_PLAN";
|
|
2641
|
+
};
|
|
2642
|
+
type PlanAndBookCta = (typeof PLAN_AND_BOOK_CTA)[keyof typeof PLAN_AND_BOOK_CTA];
|
|
2643
|
+
declare const PLAN_AND_BOOK_ROUTE: {
|
|
2644
|
+
/** The existing booking checkout. */readonly CHECKOUT: "CHECKOUT"; /** One cart: the plan line(s) first, then the bookings paid by their future membership. */
|
|
2645
|
+
readonly INLINE_CART: "INLINE_CART"; /** Pricing Plans collects the plan's details and fills the cart Bookings created. */
|
|
2646
|
+
readonly DETAILS_PAGE: "DETAILS_PAGE"; /** Buy the plan(s) on Pricing Plans, then return to the form and book. */
|
|
2647
|
+
readonly PRICING_PLANS: "PRICING_PLANS";
|
|
2648
|
+
};
|
|
2649
|
+
type PlanAndBookRoute = (typeof PLAN_AND_BOOK_ROUTE)[keyof typeof PLAN_AND_BOOK_ROUTE];
|
|
2650
|
+
interface PlanAndBookFlow {
|
|
2651
|
+
cta: PlanAndBookCta;
|
|
2652
|
+
route: PlanAndBookRoute;
|
|
2653
|
+
}
|
|
2654
|
+
//#endregion
|
|
2655
|
+
//#region src/domains/booking-checkout/checkout-error.d.ts
|
|
2656
|
+
/** A failed Book or Add to Cart, read off the backend's applicationError. */
|
|
2657
|
+
interface CheckoutError {
|
|
2658
|
+
/** applicationError.code, or UNKNOWN_CHECKOUT_ERROR without one. */
|
|
2659
|
+
code: string;
|
|
2660
|
+
/** The first violation's text, which eCom sends with VIOLATIONS_WITH_ERROR_SEVERITY. */
|
|
2661
|
+
violation?: string;
|
|
2662
|
+
}
|
|
2663
|
+
//#endregion
|
|
2664
|
+
//#region src/extensions/contexts/booking-checkout-context/use-booking-checkout.d.ts
|
|
2665
|
+
interface BookingFormHandle {
|
|
2666
|
+
/** The selection overlaps a cart appointment of the same staff member. */
|
|
2667
|
+
hasCartConflict?: boolean;
|
|
2668
|
+
/** Shows errors inline; resolves false when the form can't be submitted. */
|
|
2669
|
+
validate: () => Promise<boolean>;
|
|
2670
|
+
getInput: () => CreateBookingInput;
|
|
2671
|
+
/**
|
|
2672
|
+
* Rule-based number-of-participants pricing only: the range to book the count in, as legacy
|
|
2673
|
+
* previews it. Null books the plain count.
|
|
2674
|
+
*/
|
|
2675
|
+
previewParticipants?: (count: number) => Promise<ParticipantsServiceChoice[] | null>;
|
|
2676
|
+
/** The form's BI defaults under the legacy click-next (659) fields, read at click time. Never throws. */
|
|
2677
|
+
getBiParams?: () => Record<string, unknown>;
|
|
2678
|
+
}
|
|
2679
|
+
/** What the Booking Form tells the widgets beside it, once it is usable and the cart is read. */
|
|
2680
|
+
interface FormFacts {
|
|
2681
|
+
/** How the visitor pays each booked service. */
|
|
2682
|
+
payments: {
|
|
2683
|
+
serviceId: string | null;
|
|
2684
|
+
paymentOption: BookingPaymentOption;
|
|
2685
|
+
hasPrice: boolean;
|
|
2686
|
+
}[];
|
|
2687
|
+
/** Bookings lines only, as in OOI's `isServiceInCart`. */
|
|
2688
|
+
hasBookingsInCart: boolean;
|
|
2689
|
+
/** Rule-based number-of-participants pricing only: the picked count's previewed price. */
|
|
2690
|
+
participantsPrice?: PreviewedParticipantsPrice;
|
|
2691
|
+
}
|
|
2692
|
+
/** `failed` too when the preview has no price; `count` is the count it prices. */
|
|
2693
|
+
type PreviewedParticipantsPrice = {
|
|
2694
|
+
status: 'loading';
|
|
2695
|
+
} | {
|
|
2696
|
+
status: 'failed';
|
|
2697
|
+
} | ({
|
|
2698
|
+
status: 'loaded';
|
|
2699
|
+
count: number;
|
|
2700
|
+
} & ParticipantsPrice);
|
|
2701
|
+
interface BookingCheckoutResult {
|
|
2702
|
+
bookingIds: string[];
|
|
2703
|
+
cartId: string;
|
|
2704
|
+
}
|
|
2705
|
+
/** Where addToCart() sends the visitor once the items are in the cart. `stay` leaves them on the page. */
|
|
2706
|
+
type AddToCartDestination = 'cart' | 'home' | 'stay' | OwnerLink;
|
|
2707
|
+
/**
|
|
2708
|
+
* The failure, or the bookings now in the cart and whether this page is being left. Null when the
|
|
2709
|
+
* form is invalid, a run is in flight or the selection changed before it failed.
|
|
2710
|
+
*/
|
|
2711
|
+
type AddToCartOutcome = {
|
|
2712
|
+
error: CheckoutError;
|
|
2713
|
+
} | {
|
|
2714
|
+
bookingIds: string[];
|
|
2715
|
+
leavesPage: boolean;
|
|
2716
|
+
} | null;
|
|
2717
|
+
/** The failure, for the clicked button to show; null when nothing failed, nothing ran or the selection changed before it failed. */
|
|
2718
|
+
type CreateBookingOutcome = {
|
|
2719
|
+
error: CheckoutError;
|
|
2720
|
+
} | null;
|
|
2721
|
+
interface BookingCheckoutState {
|
|
2722
|
+
/** Null when the page has no usable `b=`. */
|
|
2723
|
+
selection: BookingPreferences | null;
|
|
2724
|
+
/** Every entry passes canBookSelection and a booking form is registered. */
|
|
2725
|
+
canBook: boolean;
|
|
2726
|
+
/** The button the visitor sees and where createBooking sends them, from the selected rows. */
|
|
2727
|
+
planAndBookFlow: PlanAndBookFlow;
|
|
2728
|
+
/** Null without resolved payment choices for the current selection. */
|
|
2729
|
+
selectedPaymentOptions: Array<PaymentOption$1 | null> | null;
|
|
2730
|
+
isLoadingPaymentOptions: boolean;
|
|
2731
|
+
/** Publish prices independently of form validation; null means payment options are loading. */
|
|
2732
|
+
registerPaymentOptions: (options: Array<PaymentOption$1 | null> | null, isPlanAndBookBlocked: boolean) => () => void;
|
|
2733
|
+
/** From the registered form. */
|
|
2734
|
+
hasCartConflict: boolean;
|
|
2735
|
+
/** The form registers on mount and passes null on unmount. */
|
|
2736
|
+
registerForm: (form: BookingFormHandle | null) => void;
|
|
2737
|
+
/** Published by the form; null until it is usable. */
|
|
2738
|
+
formFacts: FormFacts | null;
|
|
2739
|
+
/** The form publishes its facts for the widgets beside it (Booking Summary); null on unmount. */
|
|
2740
|
+
publishFormFacts: (facts: FormFacts | null) => void;
|
|
2741
|
+
/** The form shows legacy's empty state in place of itself, so Book and Add to Cart hide, as legacy's did with it. */
|
|
2742
|
+
isFormEmptyState: boolean;
|
|
2743
|
+
/** The form publishes it while its empty state shows; false on unmount. */
|
|
2744
|
+
publishFormEmptyState: (isEmptyState: boolean) => void;
|
|
2745
|
+
/** Validates, creates the booking(s) and cart, then places the order or goes to checkout. One run at a time. */
|
|
2746
|
+
createBooking: () => Promise<CreateBookingOutcome>;
|
|
2747
|
+
/** Stays true on success while the checkout or thank-you page loads. */
|
|
2748
|
+
isCreating: boolean;
|
|
2749
|
+
/** The last failure; cleared by the next Book or Add to Cart, a changed selection or participant count. */
|
|
2750
|
+
createError: CheckoutError | null;
|
|
2751
|
+
/** Validates the form, creates the booking(s), adds them to the visitor's current cart and goes to `destination` (the cart page by default). Shares the guard with createBooking. */
|
|
2752
|
+
addToCart: (destination?: AddToCartDestination) => Promise<AddToCartOutcome>;
|
|
2753
|
+
/** True from the click until a failure or a `stay`; stays true on success while the next page loads. */
|
|
2754
|
+
isAddingToCart: boolean;
|
|
2755
|
+
/** As createError, for Add to Cart. */
|
|
2756
|
+
addToCartError: CheckoutError | null;
|
|
2757
|
+
/** Participants for a single service without variants; 1 by default. Booked as totalParticipants. */
|
|
2758
|
+
participants: number;
|
|
2759
|
+
/** Takes an integer of at least 1 (anything else books 1). Uncapped: as legacy, a max that drops later leaves it. */
|
|
2760
|
+
setParticipants: (count: number) => void;
|
|
2761
|
+
/** For QA in the console. */
|
|
2762
|
+
lastResult: BookingCheckoutResult | null;
|
|
2763
|
+
}
|
|
2764
|
+
declare function canBookSelection(selection: BookingPreferences | null): boolean;
|
|
2765
|
+
//#endregion
|
|
2766
|
+
//#region src/extensions/contexts/booking-checkout-context/booking-checkout-context.d.ts
|
|
2767
|
+
/** The booking in progress: the selection decoded from the page URL, its payment options and participant count, and the actions to create the booking or add it to the cart. */
|
|
2768
|
+
type BookingCheckoutContextValue = BookingCheckoutState;
|
|
2769
|
+
declare const bookingCheckoutContext: React.Context<BookingCheckoutState | null>;
|
|
2770
|
+
declare const BOOKING_CHECKOUT_CONTEXT_MISSING_PROVIDER_ERROR = "useBookingCheckoutContext must be used within BookingCheckoutContextProvider";
|
|
2771
|
+
/** Reads the booking checkout state; returns null instead of throwing when `optional` is true and no provider is above. */
|
|
2772
|
+
declare function useBookingCheckoutContext(optional: true): BookingCheckoutContextValue | null;
|
|
2773
|
+
/** Reads the booking checkout state; throws when no BookingCheckoutContextProvider is above. */
|
|
2774
|
+
declare function useBookingCheckoutContext(optional?: false): BookingCheckoutContextValue;
|
|
2775
|
+
/** Props accepted by {@link BookingCheckoutContextProvider}. */
|
|
2776
|
+
interface BookingCheckoutContextProviderProps {
|
|
2777
|
+
children: ReactNode;
|
|
2778
|
+
}
|
|
2779
|
+
/** Decodes the booking selection from the page URL and lets descendants book it or add it to the cart. */
|
|
2780
|
+
declare function BookingCheckoutContextProvider({
|
|
2781
|
+
children
|
|
2782
|
+
}: BookingCheckoutContextProviderProps): React.JSX.Element;
|
|
2783
|
+
//#endregion
|
|
2784
|
+
export { BOOKING_CHECKOUT_CONTEXT_MISSING_PROVIDER_ERROR, BookingCheckoutContextProviderProps, BookingCheckoutContextValue, type BookingCheckoutResult, type BookingFormHandle, type CreateBookingInput, bookingCheckoutContext, canBookSelection, BookingCheckoutContextProvider as default, useBookingCheckoutContext };
|