@wix/auto_sdk_packages_packages 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/build/cjs/index.d.ts +273 -1
  2. package/build/cjs/index.js +953 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +1867 -1
  5. package/build/cjs/index.typings.js +864 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +543 -1
  8. package/build/cjs/meta.js +574 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/{internal/cjs/src/premium-reseller-v1-packages-packages.public.d.ts → es/index.d.mts} +27 -16
  11. package/build/es/index.mjs +906 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/{internal/cjs/src/premium-reseller-v1-packages-packages.universal.d.ts → es/index.typings.d.mts} +192 -149
  14. package/build/es/index.typings.mjs +817 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +543 -0
  17. package/build/es/meta.mjs +541 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +273 -1
  20. package/build/internal/cjs/index.js +953 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +1867 -1
  23. package/build/internal/cjs/index.typings.js +864 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +543 -1
  26. package/build/internal/cjs/meta.js +574 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/{cjs/src/premium-reseller-v1-packages-packages.public.d.ts → internal/es/index.d.mts} +27 -16
  29. package/build/internal/es/index.mjs +906 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/{cjs/src/premium-reseller-v1-packages-packages.universal.d.ts → internal/es/index.typings.d.mts} +192 -149
  32. package/build/internal/es/index.typings.mjs +817 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/internal/es/meta.d.mts +543 -0
  35. package/build/internal/es/meta.mjs +541 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +11 -10
  38. package/build/cjs/src/premium-reseller-v1-packages-packages.context.d.ts +0 -14
  39. package/build/cjs/src/premium-reseller-v1-packages-packages.context.js +0 -34
  40. package/build/cjs/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
  41. package/build/cjs/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
  42. package/build/cjs/src/premium-reseller-v1-packages-packages.http.js +0 -563
  43. package/build/cjs/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
  44. package/build/cjs/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
  45. package/build/cjs/src/premium-reseller-v1-packages-packages.meta.js +0 -218
  46. package/build/cjs/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
  47. package/build/cjs/src/premium-reseller-v1-packages-packages.public.js +0 -84
  48. package/build/cjs/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
  49. package/build/cjs/src/premium-reseller-v1-packages-packages.types.d.ts +0 -1377
  50. package/build/cjs/src/premium-reseller-v1-packages-packages.types.js +0 -155
  51. package/build/cjs/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
  52. package/build/cjs/src/premium-reseller-v1-packages-packages.universal.js +0 -756
  53. package/build/cjs/src/premium-reseller-v1-packages-packages.universal.js.map +0 -1
  54. package/build/es/index.d.ts +0 -1
  55. package/build/es/index.js +0 -2
  56. package/build/es/index.js.map +0 -1
  57. package/build/es/index.typings.d.ts +0 -1
  58. package/build/es/index.typings.js +0 -2
  59. package/build/es/index.typings.js.map +0 -1
  60. package/build/es/meta.d.ts +0 -1
  61. package/build/es/meta.js +0 -2
  62. package/build/es/meta.js.map +0 -1
  63. package/build/es/src/premium-reseller-v1-packages-packages.context.d.ts +0 -14
  64. package/build/es/src/premium-reseller-v1-packages-packages.context.js +0 -14
  65. package/build/es/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
  66. package/build/es/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
  67. package/build/es/src/premium-reseller-v1-packages-packages.http.js +0 -550
  68. package/build/es/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
  69. package/build/es/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
  70. package/build/es/src/premium-reseller-v1-packages-packages.meta.js +0 -182
  71. package/build/es/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
  72. package/build/es/src/premium-reseller-v1-packages-packages.public.d.ts +0 -262
  73. package/build/es/src/premium-reseller-v1-packages-packages.public.js +0 -54
  74. package/build/es/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
  75. package/build/es/src/premium-reseller-v1-packages-packages.types.d.ts +0 -1377
  76. package/build/es/src/premium-reseller-v1-packages-packages.types.js +0 -152
  77. package/build/es/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
  78. package/build/es/src/premium-reseller-v1-packages-packages.universal.d.ts +0 -1824
  79. package/build/es/src/premium-reseller-v1-packages-packages.universal.js +0 -720
  80. package/build/es/src/premium-reseller-v1-packages-packages.universal.js.map +0 -1
  81. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.context.d.ts +0 -14
  82. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.context.js +0 -34
  83. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
  84. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
  85. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.http.js +0 -563
  86. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
  87. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
  88. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.meta.js +0 -218
  89. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
  90. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.public.js +0 -84
  91. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
  92. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.types.d.ts +0 -1377
  93. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.types.js +0 -155
  94. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
  95. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.universal.js +0 -756
  96. package/build/internal/cjs/src/premium-reseller-v1-packages-packages.universal.js.map +0 -1
  97. package/build/internal/es/index.d.ts +0 -1
  98. package/build/internal/es/index.js +0 -2
  99. package/build/internal/es/index.js.map +0 -1
  100. package/build/internal/es/index.typings.d.ts +0 -1
  101. package/build/internal/es/index.typings.js +0 -2
  102. package/build/internal/es/index.typings.js.map +0 -1
  103. package/build/internal/es/meta.d.ts +0 -1
  104. package/build/internal/es/meta.js +0 -2
  105. package/build/internal/es/meta.js.map +0 -1
  106. package/build/internal/es/src/premium-reseller-v1-packages-packages.context.d.ts +0 -14
  107. package/build/internal/es/src/premium-reseller-v1-packages-packages.context.js +0 -14
  108. package/build/internal/es/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
  109. package/build/internal/es/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
  110. package/build/internal/es/src/premium-reseller-v1-packages-packages.http.js +0 -550
  111. package/build/internal/es/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
  112. package/build/internal/es/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
  113. package/build/internal/es/src/premium-reseller-v1-packages-packages.meta.js +0 -182
  114. package/build/internal/es/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
  115. package/build/internal/es/src/premium-reseller-v1-packages-packages.public.d.ts +0 -262
  116. package/build/internal/es/src/premium-reseller-v1-packages-packages.public.js +0 -54
  117. package/build/internal/es/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
  118. package/build/internal/es/src/premium-reseller-v1-packages-packages.types.d.ts +0 -1377
  119. package/build/internal/es/src/premium-reseller-v1-packages-packages.types.js +0 -152
  120. package/build/internal/es/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
  121. package/build/internal/es/src/premium-reseller-v1-packages-packages.universal.d.ts +0 -1824
  122. package/build/internal/es/src/premium-reseller-v1-packages-packages.universal.js +0 -720
  123. package/build/internal/es/src/premium-reseller-v1-packages-packages.universal.js.map +0 -1
@@ -1 +1,1867 @@
1
- export * from './src/premium-reseller-v1-packages-packages.universal.js';
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ /**
4
+ * A package is group of instances of Wix services that a reseller offers to a
5
+ * customer as part of a single transaction.
6
+ */
7
+ interface Package {
8
+ /**
9
+ * Package ID.
10
+ * @readonly
11
+ * @format GUID
12
+ */
13
+ _id?: string;
14
+ /**
15
+ * Wix account ID. See
16
+ * [Account Level APIs](https://dev.wix.com/docs/rest/account-level/about-account-level-apis)
17
+ * for more details.
18
+ * @readonly
19
+ * @format GUID
20
+ */
21
+ accountId?: string;
22
+ /**
23
+ * External reference. For example, an external subscription ID.
24
+ * This field isn't validated by Wix.
25
+ *
26
+ * Max: 100 characters
27
+ * @maxLength 100
28
+ */
29
+ externalId?: string | null;
30
+ /**
31
+ * Product instances that are included in the package.
32
+ *
33
+ * Min: 1 product instance
34
+ * Max: 1000 product instances
35
+ * @maxSize 1000
36
+ * @minSize 1
37
+ */
38
+ productInstances?: ProductInstance[];
39
+ /**
40
+ * Date and time the package was created.
41
+ * @readonly
42
+ */
43
+ _createdDate?: Date | null;
44
+ /**
45
+ * Date and time the package was last updated.
46
+ * @readonly
47
+ */
48
+ _updatedDate?: Date | null;
49
+ }
50
+ /**
51
+ * A product instance is a specific instance of a Wix service that a reseller
52
+ * offers to one of their customers.
53
+ */
54
+ interface ProductInstance extends ProductInstanceContractDetailsOneOf {
55
+ /** Billing information for the contract between the reseller and Wix. */
56
+ billingInfo?: ProductInstanceCycle;
57
+ /**
58
+ * ID of the instance of the resold Wix service. **Note:** Differs from the
59
+ * `catalogProductId`. Allows you to identify different instances of the same
60
+ * product in a package.
61
+ * @readonly
62
+ * @format GUID
63
+ */
64
+ instanceId?: string;
65
+ /**
66
+ * ID of the Wix site that the product instance is assigned to.
67
+ * See the [Query Sites API](https://dev.wix.com/api/rest/account-level-apis/sites/query-sites)
68
+ * for more information.
69
+ * @format GUID
70
+ */
71
+ siteId?: string | null;
72
+ /**
73
+ * Product ID, as defined in the Wix Premium Product Catalog.
74
+ * Contact the [Wix B2B sales team](mailto:bizdev@wix.com)
75
+ * for more details about available Wix services.
76
+ * @format GUID
77
+ */
78
+ catalogProductId?: string;
79
+ /**
80
+ * Status of the product instance.
81
+ * @readonly
82
+ */
83
+ status?: StatusWithLiterals;
84
+ /**
85
+ * Failure object. Only present for status `FAILED`. Describes why the product instance `FAILED`.
86
+ * @readonly
87
+ */
88
+ failure?: FailureReason;
89
+ /**
90
+ * Date and time the product instance was created.
91
+ * @readonly
92
+ */
93
+ _createdDate?: Date | null;
94
+ /**
95
+ * Date and time the product instance was last updated.
96
+ * @readonly
97
+ */
98
+ _updatedDate?: Date | null;
99
+ /**
100
+ * Two-letter country code in
101
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
102
+ * format. Specifies where customers can claim vouchers that may come with the
103
+ * product. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) to get more
104
+ * information about vouchers and supported locations.
105
+ * @format COUNTRY
106
+ */
107
+ countryCode?: string | null;
108
+ /**
109
+ * Date and time the product instance expires in `YYYY-MM-DDThh:mm:ss.sssZ` format.
110
+ * Used only for instances that don't auto renew at the end of the current billing cycle.
111
+ * @readonly
112
+ */
113
+ expirationDate?: Date | null;
114
+ /**
115
+ * Discount code indicating that the reseller provisioned the product instance
116
+ * during a sale. Wix doesn't guarantee that a discount code reduces the
117
+ * price between Wix and the reseller, even when it's valid. Contact the
118
+ * [Wix B2B sales team](mailto:bizdev@wix.com) for more information.
119
+ *
120
+ * Max: 25 characters
121
+ * @maxLength 25
122
+ */
123
+ discountCode?: string | null;
124
+ /**
125
+ * ID of a different product instance that you can use to offer your customers
126
+ * time-limited free access to an additional product or service. For example,
127
+ * Wix offers a 1-year free domain registration to all customers who purchase a
128
+ * Premium plan. The referenced product instance must have either status `"PENDING"` or
129
+ * `"ACTIVE"`. You can use each product instance only a single time as reference
130
+ * instance.
131
+ * @format GUID
132
+ */
133
+ referenceProductInstanceId?: string | null;
134
+ }
135
+ /** @oneof */
136
+ interface ProductInstanceContractDetailsOneOf {
137
+ /** Billing information for the contract between the reseller and Wix. */
138
+ billingInfo?: ProductInstanceCycle;
139
+ }
140
+ declare enum FailureReasonFailureReason {
141
+ UNKNOWN = "UNKNOWN",
142
+ /** The product instance couldn't be created because the Resellers API timed out. */
143
+ DELIVERY_TIMEOUT = "DELIVERY_TIMEOUT",
144
+ /** The product instance couldn't be created because an external process failed. */
145
+ EXTERNAL_FAILURE = "EXTERNAL_FAILURE"
146
+ }
147
+ /** @enumType */
148
+ type FailureReasonFailureReasonWithLiterals = FailureReasonFailureReason | 'UNKNOWN' | 'DELIVERY_TIMEOUT' | 'EXTERNAL_FAILURE';
149
+ declare enum IntervalIntervalUnit {
150
+ /** unknown interval unit */
151
+ UNKNOWN = "UNKNOWN",
152
+ /** Day */
153
+ DAY = "DAY",
154
+ /** Week */
155
+ WEEK = "WEEK",
156
+ /** Month */
157
+ MONTH = "MONTH",
158
+ /** Year */
159
+ YEAR = "YEAR"
160
+ }
161
+ /** @enumType */
162
+ type IntervalIntervalUnitWithLiterals = IntervalIntervalUnit | 'UNKNOWN' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
163
+ declare enum CycleDescriptorType {
164
+ /** The payment type hasn't been set. */
165
+ UNKNOWN = "UNKNOWN",
166
+ /** The reseller pays Wix in a single payment. */
167
+ ONE_TIME = "ONE_TIME",
168
+ /** The reseller pays Wix on a recurring schedule. */
169
+ RECURRING = "RECURRING"
170
+ }
171
+ /** @enumType */
172
+ type CycleDescriptorTypeWithLiterals = CycleDescriptorType | 'UNKNOWN' | 'ONE_TIME' | 'RECURRING';
173
+ interface CycleInterval {
174
+ /** Unit of the billing cycle. */
175
+ unit?: IntervalIntervalUnitWithLiterals;
176
+ /**
177
+ * Count of units that make up the billing cycle.
178
+ * @min 1
179
+ */
180
+ count?: number;
181
+ }
182
+ declare enum Status {
183
+ /** The product instance isn't yet available to the customer. */
184
+ PENDING = "PENDING",
185
+ /** The customer can use the product instance. */
186
+ ENABLED = "ENABLED",
187
+ /** The product instance isn't any longer available to the customer. */
188
+ CANCELED = "CANCELED",
189
+ /** The product instance couldn't be delivered successfully and has never been available to the customer. */
190
+ FAILED = "FAILED",
191
+ /** The product instance isn't yet available to the customer, because an external provider or the customer must take an action. */
192
+ AWAITING_ACTION = "AWAITING_ACTION"
193
+ }
194
+ /** @enumType */
195
+ type StatusWithLiterals = Status | 'PENDING' | 'ENABLED' | 'CANCELED' | 'FAILED' | 'AWAITING_ACTION';
196
+ interface FailureReason {
197
+ /** Failure code. */
198
+ code?: FailureReasonFailureReasonWithLiterals;
199
+ /** Failure message. */
200
+ message?: string;
201
+ }
202
+ interface ProductInstanceCycle {
203
+ /** Payment type. */
204
+ type?: CycleDescriptorTypeWithLiterals;
205
+ /** Duration of the billing cycle. Available only for `RECURRING` payments. */
206
+ cycleDuration?: CycleInterval;
207
+ }
208
+ interface CreatePackageRequest {
209
+ /**
210
+ * Idempotency key.
211
+ * @maxLength 100
212
+ */
213
+ idempotencyKey?: string | null;
214
+ /**
215
+ * External reference. For example, an external subscription ID. **Note:** This field is not validated by Wix.
216
+ * @maxLength 100
217
+ */
218
+ externalId?: string | null;
219
+ /**
220
+ * Wix services that are resold.
221
+ * @maxSize 1000
222
+ * @minSize 1
223
+ */
224
+ products: ProductInstance[];
225
+ }
226
+ interface CreatePackageResponse {
227
+ /**
228
+ * Idempotency key.
229
+ * @maxLength 100
230
+ */
231
+ idempotencyKey?: string | null;
232
+ /** Created package. */
233
+ package?: Package;
234
+ }
235
+ interface CancelPackageRequest {
236
+ /**
237
+ * Idempotency key.
238
+ * @maxLength 100
239
+ */
240
+ idempotencyKey?: string | null;
241
+ /**
242
+ * ID of the package to cancel.
243
+ * @format GUID
244
+ */
245
+ _id: string;
246
+ }
247
+ interface CancelPackageResponse {
248
+ /**
249
+ * Idempotency key.
250
+ * @maxLength 100
251
+ */
252
+ idempotencyKey?: string | null;
253
+ /** Canceled package. */
254
+ package?: Package;
255
+ }
256
+ interface PackageCanceled {
257
+ /** Canceled package. */
258
+ package?: Package;
259
+ }
260
+ interface GetPackageRequest {
261
+ /**
262
+ * Package ID.
263
+ * @format GUID
264
+ */
265
+ _id: string;
266
+ }
267
+ interface GetPackageResponse {
268
+ /** Retrieved package. */
269
+ package?: Package;
270
+ }
271
+ interface QueryPackagesRequest {
272
+ /** Query options. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) for more details. */
273
+ query: QueryV2;
274
+ }
275
+ interface QueryV2 extends QueryV2PagingMethodOneOf {
276
+ /** Paging options to limit and offset the number of items. */
277
+ paging?: Paging;
278
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
279
+ cursorPaging?: CursorPaging;
280
+ /**
281
+ * Filter object.
282
+ *
283
+ * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
284
+ */
285
+ filter?: Record<string, any> | null;
286
+ /**
287
+ * Sort object.
288
+ *
289
+ * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
290
+ */
291
+ sort?: Sorting[];
292
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
293
+ fields?: string[];
294
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
295
+ fieldsets?: string[];
296
+ }
297
+ /** @oneof */
298
+ interface QueryV2PagingMethodOneOf {
299
+ /** Paging options to limit and offset the number of items. */
300
+ paging?: Paging;
301
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
302
+ cursorPaging?: CursorPaging;
303
+ }
304
+ interface Sorting {
305
+ /**
306
+ * Name of the field to sort by.
307
+ * @maxLength 512
308
+ */
309
+ fieldName?: string;
310
+ /** Sort order. */
311
+ order?: SortOrderWithLiterals;
312
+ }
313
+ declare enum SortOrder {
314
+ ASC = "ASC",
315
+ DESC = "DESC"
316
+ }
317
+ /** @enumType */
318
+ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
319
+ interface Paging {
320
+ /** Number of items to load. */
321
+ limit?: number | null;
322
+ /** Number of items to skip in the current sort order. */
323
+ offset?: number | null;
324
+ }
325
+ interface CursorPaging {
326
+ /**
327
+ * Maximum number of items to return in the results.
328
+ * @max 100
329
+ */
330
+ limit?: number | null;
331
+ /**
332
+ * Pointer to the next or previous page in the list of results.
333
+ *
334
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
335
+ * Not relevant for the first request.
336
+ * @maxLength 16000
337
+ */
338
+ cursor?: string | null;
339
+ }
340
+ interface QueryPackagesResponse {
341
+ /** Paging metadata. */
342
+ metadata?: PagingMetadataV2;
343
+ /**
344
+ * Retrieved packages.
345
+ *
346
+ * Max: 1000 packages
347
+ * @maxSize 1000
348
+ */
349
+ packages?: Package[];
350
+ }
351
+ interface PagingMetadataV2 {
352
+ /** Number of items returned in the response. */
353
+ count?: number | null;
354
+ /** Offset that was requested. */
355
+ offset?: number | null;
356
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
357
+ total?: number | null;
358
+ /** Flag that indicates the server failed to calculate the `total` field. */
359
+ tooManyToCount?: boolean | null;
360
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
361
+ cursors?: Cursors;
362
+ }
363
+ interface Cursors {
364
+ /**
365
+ * Cursor string pointing to the next page in the list of results.
366
+ * @maxLength 16000
367
+ */
368
+ next?: string | null;
369
+ /**
370
+ * Cursor pointing to the previous page in the list of results.
371
+ * @maxLength 16000
372
+ */
373
+ prev?: string | null;
374
+ }
375
+ interface AssignProductInstanceToSiteRequest {
376
+ /**
377
+ * Idempotency key.
378
+ * @maxLength 100
379
+ */
380
+ idempotencyKey?: string | null;
381
+ /**
382
+ * ID of the product instance to assign to a site.
383
+ * @format GUID
384
+ */
385
+ instanceId: string;
386
+ /**
387
+ * ID of the site to which the product instance is assigned.
388
+ * @format GUID
389
+ */
390
+ siteId: string;
391
+ }
392
+ interface AssignProductInstanceToSiteResponse {
393
+ /**
394
+ * Idempotency key.
395
+ * @maxLength 100
396
+ */
397
+ idempotencyKey?: string | null;
398
+ /** Updated package that includes the assigned product instance. */
399
+ package?: Package;
400
+ }
401
+ interface AssignedProductInstanceToSite {
402
+ /** Updated package. */
403
+ package?: Package;
404
+ /**
405
+ * ID of the product instance that was assigned to the site.
406
+ * @readonly
407
+ * @format GUID
408
+ */
409
+ productInstanceId?: string;
410
+ /**
411
+ * ID of the site the product instance was assigned to.
412
+ * @readonly
413
+ * @format GUID
414
+ */
415
+ siteId?: string;
416
+ }
417
+ interface UnassignProductInstanceFromSiteRequest {
418
+ /**
419
+ * Idempotency key.
420
+ * @maxLength 100
421
+ */
422
+ idempotencyKey?: string | null;
423
+ /**
424
+ * ID of the product instance to unassign from a site.
425
+ * @format GUID
426
+ */
427
+ instanceId: string;
428
+ }
429
+ interface UnassignProductInstanceFromSiteResponse {
430
+ /**
431
+ * Idempotency key.
432
+ * @maxLength 100
433
+ */
434
+ idempotencyKey?: string | null;
435
+ /** Updated package that includes the unassigned product instance. */
436
+ package?: Package;
437
+ }
438
+ interface UnassignedProductInstanceFromSite {
439
+ /** Updated package. */
440
+ package?: Package;
441
+ /**
442
+ * ID of the product instance that was unassigned from the site.
443
+ * @readonly
444
+ * @format GUID
445
+ */
446
+ productInstanceId?: string;
447
+ /**
448
+ * MetasiteId of the site the product instance was unassigned from.
449
+ * @readonly
450
+ * @format GUID
451
+ */
452
+ metaSiteId?: string;
453
+ }
454
+ interface CancelProductInstanceRequest {
455
+ /**
456
+ * Idempotency key.
457
+ * @maxLength 100
458
+ */
459
+ idempotencyKey?: string | null;
460
+ /**
461
+ * ID of the product instance to cancel.
462
+ * @format GUID
463
+ */
464
+ instanceId: string;
465
+ }
466
+ interface CancelProductInstanceResponse {
467
+ /**
468
+ * Idempotency key.
469
+ * @maxLength 100
470
+ */
471
+ idempotencyKey?: string | null;
472
+ /** Updated package that includes the previously included the canceled product instance. */
473
+ package?: Package;
474
+ }
475
+ interface ProductInstanceCanceled {
476
+ /** Updated package. */
477
+ package?: Package;
478
+ /**
479
+ * ID of the product instance that was canceled.
480
+ * @readonly
481
+ * @format GUID
482
+ */
483
+ productInstanceId?: string;
484
+ }
485
+ interface AdjustProductInstanceSpecificationsRequest {
486
+ /**
487
+ * Idempotency key.
488
+ * @maxLength 100
489
+ */
490
+ idempotencyKey?: string | null;
491
+ /**
492
+ * ID of the product instance to adjust.
493
+ * @format GUID
494
+ */
495
+ instanceId: string;
496
+ /**
497
+ * ID of the product to replace the original instance. Required in case you don't
498
+ * provide a new `billingInfo` object.
499
+ * @format GUID
500
+ */
501
+ catalogProductId?: string | null;
502
+ /**
503
+ * Information about the billing cycle. Required in case you don't provide a new
504
+ * `catalogProductId`. The new billing cycle must be supported for the service.
505
+ * Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for
506
+ * information about a service's supported billing cycles. If
507
+ * you adjust the billing cycle for a product instance with `RECURRING`
508
+ * payments, you must also provide `billingInfo.cycleDuration.unit`.
509
+ */
510
+ billingInfo?: ProductInstanceCycle;
511
+ /**
512
+ * Discount code indicating that the reseller provisioned the product instance
513
+ * during a sale. In case you pass a code that isn't valid, the call succeeds and
514
+ * no discount is applied to the product instance. Wix doesn't guarantee that a
515
+ * discount code reduces the price between Wix and the reseller, even when it's
516
+ * valid. You can't add a discount code after you've created the
517
+ * product instance. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for
518
+ * more information about supported codes.
519
+ *
520
+ * Max: 25 characters
521
+ * @maxLength 25
522
+ */
523
+ discountCode?: string | null;
524
+ }
525
+ interface AdjustProductInstanceSpecificationsResponse {
526
+ /**
527
+ * Idempotency key.
528
+ * @maxLength 100
529
+ */
530
+ idempotencyKey?: string | null;
531
+ /** Updated package that includes the adjusted product instance. */
532
+ package?: Package;
533
+ }
534
+ interface AdjustedProductInstanceSpecifications {
535
+ /** Updated package. */
536
+ package?: Package;
537
+ /**
538
+ * ID of the product instance to adjust.
539
+ * @readonly
540
+ * @format GUID
541
+ */
542
+ productInstanceId?: string;
543
+ }
544
+ interface SubscriptionEvent extends SubscriptionEventEventOneOf {
545
+ /** Triggered when a subscription is created. */
546
+ created?: SubscriptionCreated;
547
+ /**
548
+ * Triggered when a subscription is assigned to a Wix site, including the initial
549
+ * assignment of a floating subscription or a re-assignement from a different site.
550
+ */
551
+ assigned?: SubscriptionAssigned;
552
+ /** Triggered when a subscription is canceled. */
553
+ cancelled?: SubscriptionCancelled;
554
+ /** Triggered when the subscription's auto renew is turned on. */
555
+ autoRenewTurnedOn?: SubscriptionAutoRenewTurnedOn;
556
+ /** Triggered when the subscription's auto renew is turned off. */
557
+ autoRenewTurnedOff?: SubscriptionAutoRenewTurnedOff;
558
+ /**
559
+ * Triggered when a subscription is unassigned from a Wix site and becomes
560
+ * floating.
561
+ */
562
+ unassigned?: SubscriptionUnassigned;
563
+ /**
564
+ * Triggered when a subscription is transferred from one Wix account to another.
565
+ * A transfer includes cancelling the original subscription and creating a new
566
+ * subscription for the target account. The event returns both the original
567
+ * and the new subscription.
568
+ */
569
+ transferred?: SubscriptionTransferred;
570
+ /** Triggered when a recurring charge succeeds for a subscription. */
571
+ recurringChargeSucceeded?: RecurringChargeSucceeded;
572
+ /**
573
+ * Triggered when a subscription was updated including when its product has been
574
+ * up- or downgraded or the billing cycle is changed.
575
+ */
576
+ contractSwitched?: ContractSwitched;
577
+ /**
578
+ * Triggered when a subscription gets close to the end of its billing cycle.
579
+ * The exact number of days is defined in the billing system.
580
+ */
581
+ nearEndOfPeriod?: SubscriptionNearEndOfPeriod;
582
+ /**
583
+ * Triggered when a subscription is updated and the change doesn't happen
584
+ * immediately but at the end of the current billing cycle.
585
+ */
586
+ pendingChange?: SubscriptionPendingChange;
587
+ /** Triggered when a recurring charge attempt fails for a subscription. */
588
+ recurringChargeAttemptFailed?: RecurringChargeAttemptFailed;
589
+ /**
590
+ * ID of the subscription's event.
591
+ * @format GUID
592
+ */
593
+ eventId?: string | null;
594
+ /**
595
+ * Date and time of the event in
596
+ * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
597
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
598
+ */
599
+ eventDate?: Date | null;
600
+ }
601
+ /** @oneof */
602
+ interface SubscriptionEventEventOneOf {
603
+ /** Triggered when a subscription is created. */
604
+ created?: SubscriptionCreated;
605
+ /**
606
+ * Triggered when a subscription is assigned to a Wix site, including the initial
607
+ * assignment of a floating subscription or a re-assignement from a different site.
608
+ */
609
+ assigned?: SubscriptionAssigned;
610
+ /** Triggered when a subscription is canceled. */
611
+ cancelled?: SubscriptionCancelled;
612
+ /** Triggered when the subscription's auto renew is turned on. */
613
+ autoRenewTurnedOn?: SubscriptionAutoRenewTurnedOn;
614
+ /** Triggered when the subscription's auto renew is turned off. */
615
+ autoRenewTurnedOff?: SubscriptionAutoRenewTurnedOff;
616
+ /**
617
+ * Triggered when a subscription is unassigned from a Wix site and becomes
618
+ * floating.
619
+ */
620
+ unassigned?: SubscriptionUnassigned;
621
+ /**
622
+ * Triggered when a subscription is transferred from one Wix account to another.
623
+ * A transfer includes cancelling the original subscription and creating a new
624
+ * subscription for the target account. The event returns both the original
625
+ * and the new subscription.
626
+ */
627
+ transferred?: SubscriptionTransferred;
628
+ /** Triggered when a recurring charge succeeds for a subscription. */
629
+ recurringChargeSucceeded?: RecurringChargeSucceeded;
630
+ /**
631
+ * Triggered when a subscription was updated including when its product has been
632
+ * up- or downgraded or the billing cycle is changed.
633
+ */
634
+ contractSwitched?: ContractSwitched;
635
+ /**
636
+ * Triggered when a subscription gets close to the end of its billing cycle.
637
+ * The exact number of days is defined in the billing system.
638
+ */
639
+ nearEndOfPeriod?: SubscriptionNearEndOfPeriod;
640
+ /**
641
+ * Triggered when a subscription is updated and the change doesn't happen
642
+ * immediately but at the end of the current billing cycle.
643
+ */
644
+ pendingChange?: SubscriptionPendingChange;
645
+ /** Triggered when a recurring charge attempt fails for a subscription. */
646
+ recurringChargeAttemptFailed?: RecurringChargeAttemptFailed;
647
+ }
648
+ /** Triggered when a subscription is created. */
649
+ interface SubscriptionCreated {
650
+ /** Created subscription. */
651
+ subscription?: Subscription;
652
+ /** Metadata for the `created` event. */
653
+ metadata?: Record<string, string>;
654
+ /**
655
+ * Subscription reactivation data.
656
+ * A subscription can be reactivated for example if it was incorrectly canceled because of fraud and then reactivated
657
+ * by the billing system
658
+ */
659
+ reactivationData?: ReactivationData;
660
+ }
661
+ /**
662
+ * A subscription holds information about a Premium product that a Wix account
663
+ * owner has purchased including details about the billing.
664
+ */
665
+ interface Subscription {
666
+ /**
667
+ * ID of the subscription.
668
+ * @format GUID
669
+ */
670
+ _id?: string;
671
+ /**
672
+ * ID of the Wix account that purchased the subscription.
673
+ * @format GUID
674
+ */
675
+ userId?: string;
676
+ /**
677
+ * ID of the [product](https://bo.wix.com/wix-docs/rest/premium/premium-product-catalog-v2/products/product-object)
678
+ * for which the subscription was purchased.
679
+ * @format GUID
680
+ */
681
+ productId?: string;
682
+ /**
683
+ * Date and time the subscription was created in
684
+ * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
685
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
686
+ */
687
+ createdAt?: Date | null;
688
+ /**
689
+ * Date and time the subscription was last updated in
690
+ * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
691
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
692
+ */
693
+ updatedAt?: Date | null;
694
+ /**
695
+ * ID of the metasite that the subscription is assigned to.
696
+ * Available only when the subscription is assigned to a Wix site.
697
+ * Subscriptions for account level products can't be assigned to a Wix site.
698
+ * @format GUID
699
+ */
700
+ metaSiteId?: string | null;
701
+ /** Information about the system that manages the subscription's billing. */
702
+ billingReference?: BillingReference;
703
+ /** Information about the billing cycle of the subscription. */
704
+ cycle?: Cycle;
705
+ /**
706
+ * Subscription status.
707
+ *
708
+ * + `UNKNOWN`: Default status.
709
+ * + `AUTO_RENEW_ON`: Subscription is active and automatically renews at the end of the current billing cycle.
710
+ * + `AUTO_RENEW_OFF`: Subscription is active but expires at the end of the current billing cycle.
711
+ * + `MANUAL_RECURRING`: Subscription is active and renews at the end of the current billing cycle, in case the customer takes an action related to the payment.
712
+ * + `CANCELLED`: Subscription isn't active because it has been canceled.
713
+ * + `TRANSFERRED`: Subscription isn't active because it has been transferred to a different account. A different active subscription was created for the target account.
714
+ */
715
+ status?: SubscriptionStatusWithLiterals;
716
+ /**
717
+ * Date and time the subscription was last transferred from one Wix account to
718
+ * another in
719
+ * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
720
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
721
+ */
722
+ transferredAt?: Date | null;
723
+ /**
724
+ * ID of the [product type](https://bo.wix.com/wix-docs/rest/premium/premium-product-catalog-v2/product-types/product-type-object)
725
+ * that the product, for which the subscription was purchased, belongs to.
726
+ * @format GUID
727
+ */
728
+ productTypeId?: string;
729
+ /** Version number, which increments by 1 each time the subscription is updated. */
730
+ version?: number;
731
+ /**
732
+ * Whether the subscription is active. Includes the statuses
733
+ * `"AUTO_RENEW_ON"`, `"AUTO_RENEW_OFF"`, and `"MANUAL_RECURRING"`.
734
+ */
735
+ active?: boolean;
736
+ /**
737
+ * Date and time the subscription was originally created in
738
+ * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
739
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
740
+ * Differs from `createdAt` in case the subscription was originally created for a different Wix account and has been transferred.
741
+ */
742
+ originalCreationDate?: Date | null;
743
+ /** Custom metadata about the subscription. */
744
+ metadata?: Record<string, string>;
745
+ /**
746
+ * 2-letter country code in
747
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
748
+ * format.
749
+ */
750
+ countryCode?: string | null;
751
+ /**
752
+ * Seats of the product that the subscription was purchased for.
753
+ * Will be Null for products that don't support seats.
754
+ * @min 1
755
+ * @max 500
756
+ */
757
+ seats?: number | null;
758
+ }
759
+ interface BillingReference {
760
+ /**
761
+ * Name of the billing system that manages the subscription.
762
+ *
763
+ * + `"UNKNOWN"`: Default value.
764
+ * + `"SBS"`: [Wix Billing](https://github.com/wix-p/premium-billing/tree/master/sbs).
765
+ * + `"LICENSER"`:
766
+ * + `"BASS"`: [Billing and Subscriptions System](https://dev.wix.com/docs/rest/internal-only/premium/subscriptions-by-billing-by-wix/introduction).
767
+ * + `"RESELLER"`: [External Reseller](https://dev.wix.com/api/rest/account-level-apis/resellers/introduction).
768
+ */
769
+ providerName?: ProviderNameWithLiterals;
770
+ /** Current provider reference ID. */
771
+ providerReferenceId?: string | null;
772
+ /** Previous provider reference IDs. Used for when a subscription is extended, specifically for domains. */
773
+ previousProviderReferenceIds?: string[];
774
+ }
775
+ declare enum ProviderName {
776
+ UNKNOWN = "UNKNOWN",
777
+ SBS = "SBS",
778
+ LICENSER = "LICENSER",
779
+ BASS = "BASS",
780
+ RESELLER = "RESELLER",
781
+ RECURRING_INVOICES = "RECURRING_INVOICES"
782
+ }
783
+ /** @enumType */
784
+ type ProviderNameWithLiterals = ProviderName | 'UNKNOWN' | 'SBS' | 'LICENSER' | 'BASS' | 'RESELLER' | 'RECURRING_INVOICES';
785
+ interface Cycle extends CycleCycleSelectorOneOf {
786
+ /** repetitive interval */
787
+ interval?: Interval;
788
+ /** one time */
789
+ oneTime?: OneTime;
790
+ }
791
+ /** @oneof */
792
+ interface CycleCycleSelectorOneOf {
793
+ /** repetitive interval */
794
+ interval?: Interval;
795
+ /** one time */
796
+ oneTime?: OneTime;
797
+ }
798
+ interface Interval {
799
+ /** interval unit of measure */
800
+ unit?: IntervalUnitWithLiterals;
801
+ /** number of interval */
802
+ count?: number;
803
+ }
804
+ declare enum IntervalUnit {
805
+ /** unknown interval unit */
806
+ UNKNOWN = "UNKNOWN",
807
+ /** day */
808
+ DAY = "DAY",
809
+ /** week */
810
+ WEEK = "WEEK",
811
+ /** month */
812
+ MONTH = "MONTH",
813
+ /** year */
814
+ YEAR = "YEAR"
815
+ }
816
+ /** @enumType */
817
+ type IntervalUnitWithLiterals = IntervalUnit | 'UNKNOWN' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
818
+ interface OneTime {
819
+ }
820
+ declare enum SubscriptionStatus {
821
+ UNKNOWN = "UNKNOWN",
822
+ AUTO_RENEW_ON = "AUTO_RENEW_ON",
823
+ AUTO_RENEW_OFF = "AUTO_RENEW_OFF",
824
+ MANUAL_RECURRING = "MANUAL_RECURRING",
825
+ CANCELLED = "CANCELLED",
826
+ TRANSFERRED = "TRANSFERRED"
827
+ }
828
+ /** @enumType */
829
+ type SubscriptionStatusWithLiterals = SubscriptionStatus | 'UNKNOWN' | 'AUTO_RENEW_ON' | 'AUTO_RENEW_OFF' | 'MANUAL_RECURRING' | 'CANCELLED' | 'TRANSFERRED';
830
+ /** Triggered when a subscription is reactivated. */
831
+ interface ReactivationData {
832
+ reactivationReason?: ReactivationReasonEnumWithLiterals;
833
+ /**
834
+ * In the event of reactivation after chargeback dispute, the subscription may be extended according to the
835
+ * number of days it was inactive during the time of resolving the dispute
836
+ */
837
+ newEndOfPeriod?: Date | null;
838
+ /** The original end date, before the inactive period. */
839
+ oldEndOfPeriod?: Date | null;
840
+ /** The difference in days between the new new_end_of_period and old_end_of_period */
841
+ differenceInDays?: number | null;
842
+ }
843
+ /** Reason for subscription reactivation */
844
+ declare enum ReactivationReasonEnum {
845
+ UNKNOWN = "UNKNOWN",
846
+ /**
847
+ * Subscription was reactivated due to billing status change from CANCELED to ACTIVE, for example if it was incorrectly
848
+ * canceled because of suspicion of fraud
849
+ */
850
+ BILLING_STATUS_CHANGE = "BILLING_STATUS_CHANGE",
851
+ /** Subscription was reactivated after a chargeback dispute */
852
+ REACTIVATED_AFTER_CHARGEBACK = "REACTIVATED_AFTER_CHARGEBACK"
853
+ }
854
+ /** @enumType */
855
+ type ReactivationReasonEnumWithLiterals = ReactivationReasonEnum | 'UNKNOWN' | 'BILLING_STATUS_CHANGE' | 'REACTIVATED_AFTER_CHARGEBACK';
856
+ /**
857
+ * Triggered when a subscription is assigned to a Wix site, including the initial
858
+ * assignment of a floating subscription or a re-assignement from a different site.
859
+ */
860
+ interface SubscriptionAssigned {
861
+ /** Assigned subscription. */
862
+ subscription?: Subscription;
863
+ /**
864
+ * ID of the metasite that the subscription has been assigned to before the update.
865
+ * @format GUID
866
+ */
867
+ previousMetaSiteId?: string | null;
868
+ }
869
+ /** Triggered when a subscription is canceled. */
870
+ interface SubscriptionCancelled {
871
+ /** Canceled subscription. */
872
+ subscription?: Subscription;
873
+ /** Details about the cancellation including who canceled the subscription and why. */
874
+ cancellationDetails?: CancellationDetails;
875
+ /**
876
+ * Whether the subscription is canceled immediately or expires at the end of the current billing cycle.
877
+ *
878
+ * Default: `false`
879
+ */
880
+ immediateCancel?: boolean;
881
+ /** Whether the subscription was canceled during the free trial period. */
882
+ canceledInFreeTrial?: boolean;
883
+ }
884
+ /** Information about the cancellation flow including who canceled the subscription and why it was canceled. */
885
+ interface CancellationDetails {
886
+ /**
887
+ * Cancellation code.
888
+ *
889
+ * Values supported for cancellations on behalf of the billing system: `-1`, `-2`, `-3`, `-4`, `-5`, `-6`, `-7`, `-8`.
890
+ * For cancellations on behalf of the site owner or the service provider `cancellationCode`
891
+ * is taken from the request of
892
+ * [Cancel Immediately Offline](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/cancel-immediately-offline).
893
+ *
894
+ * + `-1`: The subscription has been cancelled by the billing system but none of the listed cancellation reasons applies.
895
+ * + `-2`: There were payment problems.
896
+ * + `-3`: There was a chargeback.
897
+ * + `-4`: Customer support has canceled the subscription and issued a refund.
898
+ * + `-5`: The site owner has changed their existing subscription.
899
+ * + `-6`: The subscription has been transferred to a different Wix account.
900
+ * + `-7`: The subscription has been canceled because the site owner hasn't manually authenticated the recurring payment during the subscription's grace period. For example, site owners must manually confirm recurring payments within 40 days when paying with boleto.
901
+ * + `-8`: The Wix account that the subscription belonged to has been deleted.
902
+ */
903
+ cancellationCode?: number | null;
904
+ /**
905
+ * Cancellation reason. For cancellations on behalf of the site owner or the service provider `cancellationReason`
906
+ * is taken from the request of
907
+ * [Cancel Immediately Offline](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/cancel-immediately-offline).
908
+ * For cancellations on behalf of the billing system `cancellationReason` is `null` or an empty string.
909
+ */
910
+ cancellationReason?: string | null;
911
+ /**
912
+ * Initiator of the cancellation. For `"USER_REQUESTED"` and `"APP_MANAGED"`,
913
+ * `cancellationCode` and `cancellationReason` are taken from the request of
914
+ * [Cancel Immediately](https://dev.wix.com/docs/rest/account-level/premium/premium-subscriptions-manager/subscription-v1/cancel-immediately)
915
+ * or [Cancel Immediately Offline](https://dev.wix.com/docs/rest/account-level/premium/premium-subscriptions-manager/subscription-v1/cancel-immediately-offline).
916
+ * For `"PASSIVE"`, cancellations `cancellationCode` is automatically calculated and `cancellationReason`
917
+ * is `null` or an empty string.
918
+ *
919
+ * + `"UNKNOWN`: Default value.
920
+ * + `"USER_REQUESTED"`: The Wix account owner has canceled the subscription.
921
+ * + `"APP_MANAGED"`: The service provider has canceled the subscription.
922
+ * + `"PASSIVE"`: The billing system has canceled the subscription. For example, in case of payment failure or fraud.
923
+ */
924
+ initiator?: InitiatorWithLiterals;
925
+ }
926
+ declare enum Initiator {
927
+ UNKNOWN = "UNKNOWN",
928
+ USER_REQUESTED = "USER_REQUESTED",
929
+ APP_MANAGED = "APP_MANAGED",
930
+ PASSIVE = "PASSIVE"
931
+ }
932
+ /** @enumType */
933
+ type InitiatorWithLiterals = Initiator | 'UNKNOWN' | 'USER_REQUESTED' | 'APP_MANAGED' | 'PASSIVE';
934
+ /** Triggered when the subscription's auto renew is turned on. */
935
+ interface SubscriptionAutoRenewTurnedOn {
936
+ /** Subscription for which auto renew is turned on. */
937
+ subscription?: Subscription;
938
+ /**
939
+ * Supported values: `USER`, `APP`.
940
+ *
941
+ * Information about who turned auto renew on.
942
+ * + `"USER"`: The site owner who purchased the subscription has turned auto renew on.
943
+ * + `"APP"`: The service provider has turned auto renew on.
944
+ */
945
+ initiator?: string | null;
946
+ }
947
+ /** Triggered when the subscription's auto renew is turned off. */
948
+ interface SubscriptionAutoRenewTurnedOff {
949
+ /** Subscription for which auto renew is turned off. */
950
+ subscription?: Subscription;
951
+ /** Details about the cancellation including who canceled the subscription and why. */
952
+ cancellationDetails?: CancellationDetails;
953
+ /**
954
+ * Whether the subscription is immediately canceled or expires at the end of the current billing cycle.
955
+ *
956
+ * Default: `false`
957
+ */
958
+ immediateCancel?: boolean;
959
+ }
960
+ /**
961
+ * Triggered when a subscription is unassigned from a Wix site and becomes
962
+ * floating.
963
+ */
964
+ interface SubscriptionUnassigned {
965
+ /** Unassigned subscription. */
966
+ subscription?: Subscription;
967
+ /**
968
+ * ID of the metasite that the subscription has been assigned to before the event.
969
+ * @format GUID
970
+ */
971
+ previousMetaSiteId?: string;
972
+ /**
973
+ * Reason why the subscription is unassigned.
974
+ *
975
+ * + `"UNKNOWN"`: Default value.
976
+ * + `"USER_REQUESTED"`: The Wix account owner has unassigned the subscription.
977
+ * + `"REPLACED_BY_ANOTHER_SUBSCRIPTION"`: A different subscription that replaces this subscription is assigned to the site.
978
+ */
979
+ unassignReason?: UnassignReasonWithLiterals;
980
+ }
981
+ declare enum UnassignReason {
982
+ UNKNOWN = "UNKNOWN",
983
+ USER_REQUESTED = "USER_REQUESTED",
984
+ REPLACED_BY_ANOTHER_SUBSCRIPTION = "REPLACED_BY_ANOTHER_SUBSCRIPTION"
985
+ }
986
+ /** @enumType */
987
+ type UnassignReasonWithLiterals = UnassignReason | 'UNKNOWN' | 'USER_REQUESTED' | 'REPLACED_BY_ANOTHER_SUBSCRIPTION';
988
+ /**
989
+ * Triggered when a subscription is transferred from one Wix account to another.
990
+ * A transfer includes cancelling the original subscription and creating a new
991
+ * subscription for the target account. The event returns both the original
992
+ * and the new subscription.
993
+ */
994
+ interface SubscriptionTransferred {
995
+ /** Original subscription that was canceled for the transfer. */
996
+ originSubscription?: Subscription;
997
+ /** Newly created subscription for the target account. */
998
+ targetSubscription?: Subscription;
999
+ }
1000
+ /** Triggered when a recurring charge succeeds for a subscription. */
1001
+ interface RecurringChargeSucceeded {
1002
+ /** Subscription for which the recurring charge has succeeded. */
1003
+ subscription?: Subscription;
1004
+ /** Indication that there was a successful charge at the end of the free trial period */
1005
+ freeTrialPeriodEnd?: boolean;
1006
+ }
1007
+ /**
1008
+ * Triggered when a subscription was updated including when its product has been
1009
+ * up- or downgraded or the billing cycle is changed.
1010
+ */
1011
+ interface ContractSwitched {
1012
+ /** Updated subscription. */
1013
+ subscription?: Subscription;
1014
+ /** Billing cycle before the update. */
1015
+ previousCycle?: Cycle;
1016
+ /**
1017
+ * ID of the product belonging to the subscription before the update.
1018
+ * @format GUID
1019
+ */
1020
+ previousProductId?: string;
1021
+ /**
1022
+ * ID of the product type that the subscription's original product belonged to before the update.
1023
+ * @format GUID
1024
+ */
1025
+ previousProductTypeId?: string;
1026
+ /**
1027
+ * Update type. __Note__: Doesn't include information about a product adjustment.
1028
+ * For that purpose, see `productAdjustment`.
1029
+ *
1030
+ * + `"NOT_APPLICABLE"`: Default value.
1031
+ * + `"ADDITIONAL_QUANTITY"`: An increased usage quota is added to the subscription. For example, a second mailbox is added to a subscription that previously included a single mailbox.
1032
+ * + `"CREDIT_UNUSED_PERIOD"`: The subscription is upgraded and the new price is less than the regular price. The new price applies to every billing cycle, not just the first cycle.
1033
+ * + `"REFUND_PRICE_DIFF"`: Not implemented.
1034
+ * + `"ADJUST_PERIOD_END"`: Not implemented.
1035
+ * + `"DOWNGRADE_GRACE_PERIOD"`: For downgrades during the grace period. In this situation, the site owner hasn’t paid yet and must immediately pay for the downgraded subscription.
1036
+ * + `"FULL_AMOUNT_PERIOD"`: For upgrades in which the site owner retains unused benefits. For example, site owners upgrading a Facebook Ads subscription retain their unused FB Ads credit. The unused credit is added to the new credit.
1037
+ * + `"END_OF_PERIOD"`: The subscription's billing current cycle is extended because of a downgrade.
1038
+ * + `"PENDING_CHANGES"`: The subscription's billing is updated, but the change doesn't apply immediately. Instead, the update becomes effective at the end of current billing cycle.
1039
+ * + `"DOWNGRADE_RENEWAL"`: The subscription is downgraded because of a declined payment. This prevents subscriptions from churning.
1040
+ */
1041
+ contractSwitchType?: ContractSwitchTypeWithLiterals;
1042
+ /**
1043
+ * ID of the metasite the subscription has been assigned to previously.
1044
+ * Available only in case the subscription is assigned to a different site.
1045
+ * @format GUID
1046
+ */
1047
+ previousMetaSiteId?: string | null;
1048
+ /**
1049
+ * Update reason.
1050
+ *
1051
+ * + `"PRICE_INCREASE"`: The subscription's price has been increased.
1052
+ * + `"EXTERNAL_PROVIDER_TRIGGER"`: Any reason other than a price increase.
1053
+ */
1054
+ contractSwitchReason?: ContractSwitchReasonWithLiterals;
1055
+ /** Information about the price update. Available only for updates with a price increase. */
1056
+ productPriceIncreaseData?: ProductPriceIncreaseData;
1057
+ /**
1058
+ * Information about a product adjustment. For example, a downgrade.
1059
+ * __Note__: This isn't the same as `contractSwitchType`.
1060
+ *
1061
+ * + `NOT_APPLICABLE`: There is no information about whether the product has been up- or downgraded.
1062
+ * + `DOWNGRADE`: The product has been downgraded.
1063
+ */
1064
+ productAdjustment?: ProductAdjustmentWithLiterals;
1065
+ }
1066
+ /** Copied from SBS */
1067
+ declare enum ContractSwitchType {
1068
+ NOT_APPLICABLE = "NOT_APPLICABLE",
1069
+ ADDITIONAL_QUANTITY = "ADDITIONAL_QUANTITY",
1070
+ CREDIT_UNUSED_PERIOD = "CREDIT_UNUSED_PERIOD",
1071
+ REFUND_PRICE_DIFF = "REFUND_PRICE_DIFF",
1072
+ ADJUST_PERIOD_END = "ADJUST_PERIOD_END",
1073
+ DOWNGRADE_GRACE_PERIOD = "DOWNGRADE_GRACE_PERIOD",
1074
+ FULL_AMOUNT_PERIOD = "FULL_AMOUNT_PERIOD",
1075
+ END_OF_PERIOD = "END_OF_PERIOD",
1076
+ PENDING_CHANGES = "PENDING_CHANGES",
1077
+ DOWNGRADE_RENEWAL = "DOWNGRADE_RENEWAL"
1078
+ }
1079
+ /** @enumType */
1080
+ type ContractSwitchTypeWithLiterals = ContractSwitchType | 'NOT_APPLICABLE' | 'ADDITIONAL_QUANTITY' | 'CREDIT_UNUSED_PERIOD' | 'REFUND_PRICE_DIFF' | 'ADJUST_PERIOD_END' | 'DOWNGRADE_GRACE_PERIOD' | 'FULL_AMOUNT_PERIOD' | 'END_OF_PERIOD' | 'PENDING_CHANGES' | 'DOWNGRADE_RENEWAL';
1081
+ declare enum ContractSwitchReason {
1082
+ EXTERNAL_PROVIDER_TRIGGER = "EXTERNAL_PROVIDER_TRIGGER",
1083
+ PRICE_INCREASE = "PRICE_INCREASE"
1084
+ }
1085
+ /** @enumType */
1086
+ type ContractSwitchReasonWithLiterals = ContractSwitchReason | 'EXTERNAL_PROVIDER_TRIGGER' | 'PRICE_INCREASE';
1087
+ /** Triggered when a subscription's price is increased. */
1088
+ interface ProductPriceIncreaseData {
1089
+ /**
1090
+ * Price of the subscription before the update.
1091
+ * @format DECIMAL_VALUE
1092
+ */
1093
+ previousPrice?: string | null;
1094
+ /** A value that is used in order to select the correct email template to send the user regarding the price increase. */
1095
+ emailTemplateSelector?: string | null;
1096
+ /** Used to differentiate between migration segments. Does not have to be unique per segment. */
1097
+ segmentName?: string | null;
1098
+ /** Used to determine how the price increase was triggered. */
1099
+ priceIncreaseTrigger?: PriceIncreaseTriggerWithLiterals;
1100
+ }
1101
+ /** Reason for Price Increase Trigger */
1102
+ declare enum PriceIncreaseTrigger {
1103
+ NEAR_RENEWAL = "NEAR_RENEWAL",
1104
+ RECURRING_SUCCESS = "RECURRING_SUCCESS",
1105
+ MANUAL = "MANUAL"
1106
+ }
1107
+ /** @enumType */
1108
+ type PriceIncreaseTriggerWithLiterals = PriceIncreaseTrigger | 'NEAR_RENEWAL' | 'RECURRING_SUCCESS' | 'MANUAL';
1109
+ /** Triggered when a subscription's product is adusted. */
1110
+ declare enum ProductAdjustment {
1111
+ /** flag to show that the ContractSwitchedEvent is not applicable / needed */
1112
+ NOT_APPLICABLE = "NOT_APPLICABLE",
1113
+ /** flag to show that the ContractSwitchedEvent is a Downgrade */
1114
+ DOWNGRADE = "DOWNGRADE"
1115
+ }
1116
+ /** @enumType */
1117
+ type ProductAdjustmentWithLiterals = ProductAdjustment | 'NOT_APPLICABLE' | 'DOWNGRADE';
1118
+ /**
1119
+ * Triggered when a subscription gets close to the end of its billing cycle.
1120
+ * The exact number of days is defined in the billing system.
1121
+ */
1122
+ interface SubscriptionNearEndOfPeriod {
1123
+ /** Subscription that got close to the end of its billing cycle. */
1124
+ subscription?: Subscription;
1125
+ /** Whether the subscription is within the free trial period. */
1126
+ inFreeTrial?: boolean;
1127
+ }
1128
+ /**
1129
+ * Triggered when a subscription is updated and the change doesn't happen
1130
+ * immediately but at the end of the current billing cycle.
1131
+ */
1132
+ interface SubscriptionPendingChange {
1133
+ /** Subscription for which a pending update is triggered. */
1134
+ subscription?: Subscription;
1135
+ }
1136
+ /** Triggered when a recurring charge attempt failed for a subscription. */
1137
+ interface RecurringChargeAttemptFailed {
1138
+ /** Subscription for which the recurring charge attempt has failed. */
1139
+ subscription?: Subscription;
1140
+ }
1141
+ interface Empty {
1142
+ }
1143
+ interface ProductInstanceUpdated {
1144
+ /** Updated package. */
1145
+ package?: Package;
1146
+ /**
1147
+ * ID of the product instance that was adjusted.
1148
+ * @readonly
1149
+ * @format GUID
1150
+ */
1151
+ productInstanceId?: string;
1152
+ }
1153
+ interface FailureReportRequest {
1154
+ /**
1155
+ * ID of the product instance that failed.
1156
+ * @format GUID
1157
+ */
1158
+ instanceId?: string;
1159
+ /** Failure reason. */
1160
+ reason?: FailureReason;
1161
+ }
1162
+ interface ProductInstanceFailed {
1163
+ /** Updated package. */
1164
+ package?: Package;
1165
+ /**
1166
+ * ID of the product instance that `FAILED`.
1167
+ * @readonly
1168
+ * @format GUID
1169
+ */
1170
+ productInstanceId?: string;
1171
+ /** Failure reason. */
1172
+ reason?: FailureReason;
1173
+ }
1174
+ interface Task {
1175
+ key?: TaskKey;
1176
+ executeAt?: Date | null;
1177
+ payload?: string | null;
1178
+ }
1179
+ interface TaskKey {
1180
+ appId?: string;
1181
+ instanceId?: string;
1182
+ subjectId?: string | null;
1183
+ }
1184
+ interface TaskAction extends TaskActionActionOneOf {
1185
+ complete?: Complete;
1186
+ cancel?: Cancel;
1187
+ reschedule?: Reschedule;
1188
+ }
1189
+ /** @oneof */
1190
+ interface TaskActionActionOneOf {
1191
+ complete?: Complete;
1192
+ cancel?: Cancel;
1193
+ reschedule?: Reschedule;
1194
+ }
1195
+ interface Complete {
1196
+ }
1197
+ interface Cancel {
1198
+ }
1199
+ interface Reschedule {
1200
+ executeAt?: Date | null;
1201
+ payload?: string | null;
1202
+ }
1203
+ interface UpdateProductInstanceRequest {
1204
+ /**
1205
+ * ID of the product instance to update.
1206
+ * @format GUID
1207
+ */
1208
+ instanceId?: string;
1209
+ status?: StatusWithLiterals;
1210
+ /** @format COUNTRY */
1211
+ countryCode?: string | null;
1212
+ /** Which field to update, currently only status and countryCode are supported. */
1213
+ fieldToUpdate?: FieldToUpdateWithLiterals;
1214
+ }
1215
+ declare enum FieldToUpdate {
1216
+ STATUS = "STATUS",
1217
+ COUNTRY_CODE = "COUNTRY_CODE"
1218
+ }
1219
+ /** @enumType */
1220
+ type FieldToUpdateWithLiterals = FieldToUpdate | 'STATUS' | 'COUNTRY_CODE';
1221
+ interface UpdateProductInstanceResponse {
1222
+ /** Updated Product Instance */
1223
+ productInstance?: ProductInstance;
1224
+ }
1225
+ interface UpdatePackageExternalIdRequest {
1226
+ /**
1227
+ * ID of the package to update.
1228
+ * @format GUID
1229
+ */
1230
+ packageId: string;
1231
+ /**
1232
+ * External ID that will be assigned to the package.
1233
+ * @maxLength 100
1234
+ */
1235
+ externalId: string;
1236
+ }
1237
+ interface UpdatePackageExternalIdResponse {
1238
+ /** Updated package. */
1239
+ updatedPackage?: Package;
1240
+ }
1241
+ interface CountPackagesRequest {
1242
+ /** Filter on what packages to count */
1243
+ filter?: Record<string, any> | null;
1244
+ }
1245
+ interface CountPackagesResponse {
1246
+ /** Number of packages */
1247
+ count?: number;
1248
+ }
1249
+ interface DomainEvent extends DomainEventBodyOneOf {
1250
+ createdEvent?: EntityCreatedEvent;
1251
+ updatedEvent?: EntityUpdatedEvent;
1252
+ deletedEvent?: EntityDeletedEvent;
1253
+ actionEvent?: ActionEvent;
1254
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
1255
+ _id?: string;
1256
+ /**
1257
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
1258
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
1259
+ */
1260
+ entityFqdn?: string;
1261
+ /**
1262
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
1263
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
1264
+ */
1265
+ slug?: string;
1266
+ /** ID of the entity associated with the event. */
1267
+ entityId?: string;
1268
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
1269
+ eventTime?: Date | null;
1270
+ /**
1271
+ * Whether the event was triggered as a result of a privacy regulation application
1272
+ * (for example, GDPR).
1273
+ */
1274
+ triggeredByAnonymizeRequest?: boolean | null;
1275
+ /** If present, indicates the action that triggered the event. */
1276
+ originatedFrom?: string | null;
1277
+ /**
1278
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
1279
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
1280
+ */
1281
+ entityEventSequence?: string | null;
1282
+ }
1283
+ /** @oneof */
1284
+ interface DomainEventBodyOneOf {
1285
+ createdEvent?: EntityCreatedEvent;
1286
+ updatedEvent?: EntityUpdatedEvent;
1287
+ deletedEvent?: EntityDeletedEvent;
1288
+ actionEvent?: ActionEvent;
1289
+ }
1290
+ interface EntityCreatedEvent {
1291
+ entity?: string;
1292
+ }
1293
+ interface RestoreInfo {
1294
+ deletedDate?: Date | null;
1295
+ }
1296
+ interface EntityUpdatedEvent {
1297
+ /**
1298
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
1299
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
1300
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
1301
+ */
1302
+ currentEntity?: string;
1303
+ }
1304
+ interface EntityDeletedEvent {
1305
+ /** Entity that was deleted. */
1306
+ deletedEntity?: string | null;
1307
+ }
1308
+ interface ActionEvent {
1309
+ body?: string;
1310
+ }
1311
+ interface MessageEnvelope {
1312
+ /**
1313
+ * App instance ID.
1314
+ * @format GUID
1315
+ */
1316
+ instanceId?: string | null;
1317
+ /**
1318
+ * Event type.
1319
+ * @maxLength 150
1320
+ */
1321
+ eventType?: string;
1322
+ /** The identification type and identity data. */
1323
+ identity?: IdentificationData;
1324
+ /** Stringify payload. */
1325
+ data?: string;
1326
+ }
1327
+ interface IdentificationData extends IdentificationDataIdOneOf {
1328
+ /**
1329
+ * ID of a site visitor that has not logged in to the site.
1330
+ * @format GUID
1331
+ */
1332
+ anonymousVisitorId?: string;
1333
+ /**
1334
+ * ID of a site visitor that has logged in to the site.
1335
+ * @format GUID
1336
+ */
1337
+ memberId?: string;
1338
+ /**
1339
+ * ID of a Wix user (site owner, contributor, etc.).
1340
+ * @format GUID
1341
+ */
1342
+ wixUserId?: string;
1343
+ /**
1344
+ * ID of an app.
1345
+ * @format GUID
1346
+ */
1347
+ appId?: string;
1348
+ /** @readonly */
1349
+ identityType?: WebhookIdentityTypeWithLiterals;
1350
+ }
1351
+ /** @oneof */
1352
+ interface IdentificationDataIdOneOf {
1353
+ /**
1354
+ * ID of a site visitor that has not logged in to the site.
1355
+ * @format GUID
1356
+ */
1357
+ anonymousVisitorId?: string;
1358
+ /**
1359
+ * ID of a site visitor that has logged in to the site.
1360
+ * @format GUID
1361
+ */
1362
+ memberId?: string;
1363
+ /**
1364
+ * ID of a Wix user (site owner, contributor, etc.).
1365
+ * @format GUID
1366
+ */
1367
+ wixUserId?: string;
1368
+ /**
1369
+ * ID of an app.
1370
+ * @format GUID
1371
+ */
1372
+ appId?: string;
1373
+ }
1374
+ declare enum WebhookIdentityType {
1375
+ UNKNOWN = "UNKNOWN",
1376
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1377
+ MEMBER = "MEMBER",
1378
+ WIX_USER = "WIX_USER",
1379
+ APP = "APP"
1380
+ }
1381
+ /** @enumType */
1382
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
1383
+ interface MigrateSubscriptionToPackagesRequest {
1384
+ /** Created package. */
1385
+ productInstance?: ProductInstance;
1386
+ /**
1387
+ * Existing subscriptionId to migrate
1388
+ * @format GUID
1389
+ */
1390
+ subscriptionId?: string | null;
1391
+ /**
1392
+ * User id of the migration - only for Immigrator
1393
+ * @format GUID
1394
+ */
1395
+ userId?: string | null;
1396
+ }
1397
+ interface MigrateSubscriptionToPackagesResponse {
1398
+ package?: Package;
1399
+ }
1400
+ interface FixBrokenMigrationRequest {
1401
+ /**
1402
+ * Subscription id of the broken subscription
1403
+ * @format GUID
1404
+ */
1405
+ subscriptionId?: string;
1406
+ /**
1407
+ * SBS service id that points to the broken subscription
1408
+ * @format GUID
1409
+ */
1410
+ sbsServiceId?: string;
1411
+ /**
1412
+ * Owner of the broken subscription
1413
+ * @format GUID
1414
+ */
1415
+ userId?: string;
1416
+ }
1417
+ interface FixBrokenMigrationResponse {
1418
+ }
1419
+ type PackagesNonNullablePaths = `_id` | `accountId` | `productInstances` | `productInstances.${number}.billingInfo.type` | `productInstances.${number}.billingInfo.cycleDuration.unit` | `productInstances.${number}.billingInfo.cycleDuration.count` | `productInstances.${number}.instanceId` | `productInstances.${number}.catalogProductId` | `productInstances.${number}.status` | `productInstances.${number}.failure.code` | `productInstances.${number}.failure.message`;
1420
+ /**
1421
+ * Creates a new package.
1422
+ *
1423
+ * Deprecated: This method is deprecated and will be removed by 2024-12-31.
1424
+ * Use com.wixpress.premium.reseller.packages.v1.Packages.CreatePackageV2 instead.
1425
+ *
1426
+ * HTTP Request:
1427
+ * POST /v1/packages
1428
+ *
1429
+ * Permissions:
1430
+ * Requires the "premium.reseller-package.manage" permission with MANUAL type.
1431
+ *
1432
+ * Event:
1433
+ * A PRIVATE callback will be triggered when the package is successfully created.
1434
+ *
1435
+ * Required Fields:
1436
+ * - CreatePackageRequest.products
1437
+ *
1438
+ * Maturity: BETA
1439
+ * Exposure: PUBLIC
1440
+ * @public
1441
+ * @documentationMaturity preview
1442
+ * @requiredField options.products
1443
+ * @permissionId premium.reseller-package.manage
1444
+ * @fqn com.wixpress.premium.reseller.packages.v1.Packages.CreatePackage
1445
+ * @deprecated
1446
+ * @replacedBy com.wixpress.premium.reseller.packages.v1.Packages.CreatePackageV2
1447
+ * @targetRemovalDate 2024-12-31
1448
+ */
1449
+ declare function createPackage(options?: NonNullablePaths<CreatePackageOptions, `products`>): Promise<NonNullablePaths<CreatePackageResponse, {
1450
+ [P in PackagesNonNullablePaths]: `package.${P}`;
1451
+ }[PackagesNonNullablePaths]>>;
1452
+ interface CreatePackageOptions {
1453
+ /**
1454
+ * Idempotency key.
1455
+ * @maxLength 100
1456
+ */
1457
+ idempotencyKey?: string | null;
1458
+ /**
1459
+ * External reference. For example, an external subscription ID. **Note:** This field is not validated by Wix.
1460
+ * @maxLength 100
1461
+ */
1462
+ externalId?: string | null;
1463
+ /**
1464
+ * Wix services that are resold.
1465
+ * @maxSize 1000
1466
+ * @minSize 1
1467
+ */
1468
+ products: ProductInstance[];
1469
+ }
1470
+ /**
1471
+ * Creates a package of product instances.
1472
+ *
1473
+ *
1474
+ * You must pass the relevant Wix account ID in the header of the call. In
1475
+ * the DIY flow, we recommend to pass the customer's sub-account ID instead
1476
+ * of your main reseller account ID.
1477
+ *
1478
+ * You may also pass a Wix site ID for each product in the body of the call.
1479
+ * If you omit the site ID, a floating product instance is created.
1480
+ *
1481
+ * When Wix customers purchase a specific paid service or product, Wix may offer
1482
+ * them time-limited free access to a different product. For example, customers
1483
+ * get a voucher for a free 1-year domain registration when purchasing any Wix
1484
+ * Premium plan. If you want to offer your customers the same benefit, create a
1485
+ * package containing the original product first. Then, create a second package
1486
+ * with the additional product. In the second Create Package call, pass the
1487
+ * instance ID of the original product as `referenceProductInstanceId`. This way,
1488
+ * Wix doesn't charge you for the additional product. Make sure that the status
1489
+ * of the referenced product is either `"PENDING"` or `"ACTIVE"`. Note that you
1490
+ * can use each product instance only a single time as reference instance.
1491
+ *
1492
+ * You need to pass a `countryCode` to specify where customers can claim
1493
+ * vouchers that may come with a product. Contact the
1494
+ * [Wix B2B sales team](mailto:bizdev@wix.com) to get information about
1495
+ * vouchers and supported locations.
1496
+ *
1497
+ * > **Important**: This call requires an account level API key and cannot be
1498
+ * > authenticated with the standard authorization header.
1499
+ * @public
1500
+ * @documentationMaturity preview
1501
+ * @requiredField options.products
1502
+ * @requiredField options.products.countryCode
1503
+ * @permissionId premium.reseller-package.manage
1504
+ * @fqn com.wixpress.premium.reseller.packages.v1.Packages.CreatePackageV2
1505
+ */
1506
+ declare function createPackageV2(options?: NonNullablePaths<CreatePackageV2Options, `products` | `products.${number}.countryCode`>): Promise<NonNullablePaths<CreatePackageResponse, {
1507
+ [P in PackagesNonNullablePaths]: `package.${P}`;
1508
+ }[PackagesNonNullablePaths]>>;
1509
+ interface CreatePackageV2Options {
1510
+ /**
1511
+ * Idempotency key.
1512
+ * @maxLength 100
1513
+ */
1514
+ idempotencyKey?: string | null;
1515
+ /**
1516
+ * External reference. For example, an external subscription ID. **Note:** This field is not validated by Wix.
1517
+ * @maxLength 100
1518
+ */
1519
+ externalId?: string | null;
1520
+ /**
1521
+ * Wix services that are resold.
1522
+ * @maxSize 1000
1523
+ * @minSize 1
1524
+ */
1525
+ products: ProductInstance[];
1526
+ }
1527
+ /**
1528
+ * Cancels all product instances included in the package and the customer
1529
+ * immediately loses access to the canceled functionality.
1530
+ *
1531
+ *
1532
+ * You must pass the ID of the Wix account that the package belongs to in the
1533
+ * header of the call. The call fails, if the package and Wix account don't
1534
+ * match.
1535
+ *
1536
+ * If a canceled product instance is a requirement for another Wix service, that
1537
+ * functionality is also no longer available to the customer. For example, if
1538
+ * you cancel a Premium plan, a previously connected domain is automatically
1539
+ * disconnected from the site.
1540
+ *
1541
+ * > **Important**: This call requires an account level API key and cannot be
1542
+ * > authenticated with the standard authorization header.
1543
+ * @param _id - ID of the package to cancel.
1544
+ * @public
1545
+ * @documentationMaturity preview
1546
+ * @requiredField _id
1547
+ * @permissionId premium.reseller-package.manage
1548
+ * @fqn com.wixpress.premium.reseller.packages.v1.Packages.CancelPackage
1549
+ */
1550
+ declare function cancelPackage(_id: string, options?: CancelPackageOptions): Promise<NonNullablePaths<CancelPackageResponse, {
1551
+ [P in PackagesNonNullablePaths]: `package.${P}`;
1552
+ }[PackagesNonNullablePaths]>>;
1553
+ interface CancelPackageOptions {
1554
+ /**
1555
+ * Idempotency key.
1556
+ * @maxLength 100
1557
+ */
1558
+ idempotencyKey?: string | null;
1559
+ }
1560
+ /**
1561
+ * Retrieves a package.
1562
+ *
1563
+ *
1564
+ * You must pass the ID of the Wix account that the package belongs to in the
1565
+ * header of the call. The call fails, if the package and Wix account don't
1566
+ * match.
1567
+ *
1568
+ * > **Important**: This call requires an account level API key and cannot be
1569
+ * > authenticated with the standard authorization header.
1570
+ * @param _id - Package ID.
1571
+ * @public
1572
+ * @documentationMaturity preview
1573
+ * @requiredField _id
1574
+ * @permissionId premium.reseller-package.read
1575
+ * @returns Retrieved package.
1576
+ * @fqn com.wixpress.premium.reseller.packages.v1.Packages.GetPackage
1577
+ */
1578
+ declare function getPackage(_id: string): Promise<NonNullablePaths<Package, PackagesNonNullablePaths>>;
1579
+ /**
1580
+ * Retrieves a list of packages, given the provided paging, filtering, and sorting.
1581
+ *
1582
+ *
1583
+ * You must pass the ID of the Wix account that the packages belong to in the
1584
+ * header of the call. The call returns packages that belong to the parent
1585
+ * account, regardless if you pass the ID of a parent or sub-account. In case
1586
+ * you want to retrieve only packages that belong to a sub-account, you must
1587
+ * pass the sub-account ID as `filter` in the `query` object like this:
1588
+ *
1589
+ * ```json
1590
+ * {
1591
+ * "query": {
1592
+ * "filter": {
1593
+ * "accountId": {
1594
+ * "$eq": "<SUB_ACCOUNT_ID>"
1595
+ * }
1596
+ * }
1597
+ * }
1598
+ * }
1599
+ * ```
1600
+ *
1601
+ * Query Packages runs with these defaults, which you can override:
1602
+ *
1603
+ * - `createdDate` is sorted in `DESC` order
1604
+ * - `cursorPaging.limit` is `100`
1605
+ *
1606
+ * By default `pagingMetadata.cursors` are returned, unless you specifically pass
1607
+ * `query.paging`.
1608
+ *
1609
+ * The maximum for `cursorPaging.limit` is `100`.
1610
+ *
1611
+ * If you pass a cursor token that you have received in a previous Query Package response,
1612
+ * passing additional sort or filter information results in an invalid cursor
1613
+ * error. Since the received cursor token already holds all the needed information
1614
+ * for sort and filter. Changing the sort and filter properties during the span of
1615
+ * a cursor query isn't supported. But you can provide a different limit.
1616
+ *
1617
+ * For field support for filters and sorting,
1618
+ * see [Query Packages: Supported Filters and Sorting](https://dev.wix.com/api/rest/account-level-apis/resellers/supported-filters).
1619
+ *
1620
+ * To learn about working with _Query_ endpoints, see
1621
+ * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
1622
+ * [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
1623
+ * and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
1624
+ *
1625
+ * > **Important**: This call requires an account level API key and cannot be
1626
+ * > authenticated with the standard authorization header.
1627
+ * @public
1628
+ * @documentationMaturity preview
1629
+ * @permissionId premium.reseller-package.read
1630
+ * @fqn com.wixpress.premium.reseller.packages.v1.Packages.QueryPackages
1631
+ */
1632
+ declare function queryPackages(): PackagesQueryBuilder;
1633
+ interface QueryCursorResult {
1634
+ cursors: Cursors;
1635
+ hasNext: () => boolean;
1636
+ hasPrev: () => boolean;
1637
+ length: number;
1638
+ pageSize: number;
1639
+ }
1640
+ interface PackagesQueryResult extends QueryCursorResult {
1641
+ items: Package[];
1642
+ query: PackagesQueryBuilder;
1643
+ next: () => Promise<PackagesQueryResult>;
1644
+ prev: () => Promise<PackagesQueryResult>;
1645
+ }
1646
+ interface PackagesQueryBuilder {
1647
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
1648
+ * @documentationMaturity preview
1649
+ */
1650
+ limit: (limit: number) => PackagesQueryBuilder;
1651
+ /** @param cursor - A pointer to specific record
1652
+ * @documentationMaturity preview
1653
+ */
1654
+ skipTo: (cursor: string) => PackagesQueryBuilder;
1655
+ /** @documentationMaturity preview */
1656
+ find: () => Promise<PackagesQueryResult>;
1657
+ }
1658
+ /**
1659
+ * Assigns a product instance to a site.
1660
+ *
1661
+ * You must pass the ID of the Wix account that the product instance belongs to in the header of the call.
1662
+ *
1663
+ * The customer immediately gains access to features included in the assigned service. It's up to the reseller to decide whether assigning a product instance affects the customer’s payment.
1664
+ *
1665
+ * It's possible to assign a product instance that's already assigned to a site, to a different site without [unassigning](/packages/unassign-product-instance-from-site) it first. But if the call fails in such a situation, the product instance may either remain assigned to the original site or become unassigned. You can confirm the instance's status by [retrieving the relevant package](/packages/get-package).
1666
+ *
1667
+ * > **Important:** This call requires an account level API key and cannot be authenticated with the standard authorization header.
1668
+ * @public
1669
+ * @documentationMaturity preview
1670
+ * @requiredField identifiers
1671
+ * @requiredField identifiers.instanceId
1672
+ * @requiredField identifiers.siteId
1673
+ * @permissionId premium.reseller-package.manage
1674
+ * @fqn com.wixpress.premium.reseller.packages.v1.Packages.AssignProductInstanceToSite
1675
+ */
1676
+ declare function assignProductInstanceToSite(identifiers: NonNullablePaths<AssignProductInstanceToSiteIdentifiers, `instanceId` | `siteId`>, options?: AssignProductInstanceToSiteOptions): Promise<NonNullablePaths<AssignProductInstanceToSiteResponse, {
1677
+ [P in PackagesNonNullablePaths]: `package.${P}`;
1678
+ }[PackagesNonNullablePaths]>>;
1679
+ interface AssignProductInstanceToSiteIdentifiers {
1680
+ /**
1681
+ * ID of the product instance to assign to a site.
1682
+ * @format GUID
1683
+ */
1684
+ instanceId: string;
1685
+ /**
1686
+ * ID of the site to which the product instance is assigned.
1687
+ * @format GUID
1688
+ */
1689
+ siteId: string;
1690
+ }
1691
+ interface AssignProductInstanceToSiteOptions {
1692
+ /**
1693
+ * Idempotency key.
1694
+ * @maxLength 100
1695
+ */
1696
+ idempotencyKey?: string | null;
1697
+ }
1698
+ /**
1699
+ * Unassigns a product instance from a site.
1700
+ *
1701
+ * You must pass the ID of the Wix account that the product instance belongs to in the header of the call.
1702
+ *
1703
+ * The product instance becomes floating and the customer immediately looses access to features included in the unassigned service. It's up to the reseller to decide whether unassigning a product instance affects the customer’s payment.
1704
+ *
1705
+ * If an unassigned product instance is a requirement for another service, that service may not be available to the customer any longer. For example, if you unassign a `Combo Plan` plan from a site, a previously connected domain is disconnected.
1706
+ *
1707
+ * You can assign floating product instances to sites using the [Assign Product Instance to Site](/packages/assign-product-instance-to-site) method.
1708
+ *
1709
+ * > **Important:** This call requires an account level API key and cannot be authenticated with the standard authorization header.
1710
+ * @param instanceId - ID of the product instance to unassign from a site.
1711
+ * @public
1712
+ * @documentationMaturity preview
1713
+ * @requiredField instanceId
1714
+ * @permissionId premium.reseller-package.manage
1715
+ * @fqn com.wixpress.premium.reseller.packages.v1.Packages.UnassignProductInstanceFromSite
1716
+ */
1717
+ declare function unassignProductInstanceFromSite(instanceId: string, options?: UnassignProductInstanceFromSiteOptions): Promise<NonNullablePaths<UnassignProductInstanceFromSiteResponse, {
1718
+ [P in PackagesNonNullablePaths]: `package.${P}`;
1719
+ }[PackagesNonNullablePaths]>>;
1720
+ interface UnassignProductInstanceFromSiteOptions {
1721
+ /**
1722
+ * Idempotency key.
1723
+ * @maxLength 100
1724
+ */
1725
+ idempotencyKey?: string | null;
1726
+ }
1727
+ /**
1728
+ * Cancels a product instance.
1729
+ *
1730
+ *
1731
+ * You must pass the ID of the Wix account that the product instance belongs
1732
+ * to in the header of the call. The call fails, if the product instance and
1733
+ * Wix account don't match.
1734
+ *
1735
+ * The customer immediately loses access to features included in the
1736
+ * canceled service. It's up to the reseller to decide whether the adjustment
1737
+ * affects the customer’s payment.
1738
+ *
1739
+ * If a canceled service is a requirement for another service, that service
1740
+ * may not be available to the customer any longer. For example, if you cancel
1741
+ * a `Combo Plan` plan, a previously connected domain is disconnected
1742
+ * from the site.
1743
+ *
1744
+ *
1745
+ * > **Important**: This call requires an account level API key and cannot be
1746
+ * > authenticated with the standard authorization header.
1747
+ * @param instanceId - ID of the product instance to cancel.
1748
+ * @public
1749
+ * @documentationMaturity preview
1750
+ * @requiredField instanceId
1751
+ * @permissionId premium.reseller-package.manage
1752
+ * @fqn com.wixpress.premium.reseller.packages.v1.Packages.CancelProductInstance
1753
+ */
1754
+ declare function cancelProductInstance(instanceId: string, options?: CancelProductInstanceOptions): Promise<NonNullablePaths<CancelProductInstanceResponse, {
1755
+ [P in PackagesNonNullablePaths]: `package.${P}`;
1756
+ }[PackagesNonNullablePaths]>>;
1757
+ interface CancelProductInstanceOptions {
1758
+ /**
1759
+ * Idempotency key.
1760
+ * @maxLength 100
1761
+ */
1762
+ idempotencyKey?: string | null;
1763
+ }
1764
+ /**
1765
+ * Upgrades or downgrades a product instance. For example, you can upgrade a
1766
+ * customer's `Business Unlimited Premium` plan to `Business VIP` using this
1767
+ * endpoint.
1768
+ *
1769
+ *
1770
+ * You must pass the ID of the Wix account that the product instance belongs
1771
+ * to in the header of the call. The call fails, if the product instance and
1772
+ * Wix account don't match.
1773
+ *
1774
+ * The customer has immediate access to new features, while losing access to
1775
+ * features not included in the new service. It's up to the reseller to
1776
+ * decide whether the adjustment affects the customer’s payment.
1777
+ *
1778
+ * You can only exchange a product instance with a service of the same type.
1779
+ * Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for details about
1780
+ * which services belong to the same type.
1781
+ *
1782
+ * You must provide either a new `catalogProductId` or a new `billingInfo`
1783
+ * object. The new billing cycle must be supported for the product. Contact the
1784
+ * [Wix B2B sales team](mailto:bizdev@wix.com) for information
1785
+ * about which billing cycles are supported for each product. If you adjust the
1786
+ * billing cycle for a product instance with `RECURRING` payments, you must
1787
+ * also provide `billingInfo.cycleDuration.unit`.
1788
+ *
1789
+ * If a removed feature is a requirement for another service, that service
1790
+ * may not be available to the customer any longer. For example, if you downgrade a
1791
+ * `Business Unlimited` plan to `Business Basic`, the site owners won’t be
1792
+ * able to use `Pro eCommerce Features` any longer.
1793
+ *
1794
+ * > **Important**: This call requires an account level API key and cannot be
1795
+ * > authenticated with the standard authorization header.
1796
+ * @param instanceId - ID of the product instance to adjust.
1797
+ * @public
1798
+ * @documentationMaturity preview
1799
+ * @requiredField instanceId
1800
+ * @permissionId premium.reseller-package.manage
1801
+ * @fqn com.wixpress.premium.reseller.packages.v1.Packages.AdjustProductInstanceSpecifications
1802
+ */
1803
+ declare function adjustProductInstanceSpecifications(instanceId: string, options?: AdjustProductInstanceSpecificationsOptions): Promise<NonNullablePaths<AdjustProductInstanceSpecificationsResponse, {
1804
+ [P in PackagesNonNullablePaths]: `package.${P}`;
1805
+ }[PackagesNonNullablePaths]>>;
1806
+ interface AdjustProductInstanceSpecificationsOptions {
1807
+ /**
1808
+ * Idempotency key.
1809
+ * @maxLength 100
1810
+ */
1811
+ idempotencyKey?: string | null;
1812
+ /**
1813
+ * ID of the product to replace the original instance. Required in case you don't
1814
+ * provide a new `billingInfo` object.
1815
+ * @format GUID
1816
+ */
1817
+ catalogProductId?: string | null;
1818
+ /**
1819
+ * Information about the billing cycle. Required in case you don't provide a new
1820
+ * `catalogProductId`. The new billing cycle must be supported for the service.
1821
+ * Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for
1822
+ * information about a service's supported billing cycles. If
1823
+ * you adjust the billing cycle for a product instance with `RECURRING`
1824
+ * payments, you must also provide `billingInfo.cycleDuration.unit`.
1825
+ */
1826
+ billingInfo?: ProductInstanceCycle;
1827
+ /**
1828
+ * Discount code indicating that the reseller provisioned the product instance
1829
+ * during a sale. In case you pass a code that isn't valid, the call succeeds and
1830
+ * no discount is applied to the product instance. Wix doesn't guarantee that a
1831
+ * discount code reduces the price between Wix and the reseller, even when it's
1832
+ * valid. You can't add a discount code after you've created the
1833
+ * product instance. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for
1834
+ * more information about supported codes.
1835
+ *
1836
+ * Max: 25 characters
1837
+ * @maxLength 25
1838
+ */
1839
+ discountCode?: string | null;
1840
+ }
1841
+ /**
1842
+ * Updates a package's external ID field.
1843
+ * @public
1844
+ * @documentationMaturity preview
1845
+ * @requiredField identifiers
1846
+ * @requiredField identifiers.externalId
1847
+ * @requiredField identifiers.packageId
1848
+ * @permissionId PREMIUM.PACKAGE_UPDATE_EXTERNAL_ID
1849
+ * @fqn com.wixpress.premium.reseller.packages.v1.Packages.UpdatePackageExternalId
1850
+ */
1851
+ declare function updatePackageExternalId(identifiers: NonNullablePaths<UpdatePackageExternalIdIdentifiers, `externalId` | `packageId`>): Promise<NonNullablePaths<UpdatePackageExternalIdResponse, {
1852
+ [P in PackagesNonNullablePaths]: `updatedPackage.${P}`;
1853
+ }[PackagesNonNullablePaths]>>;
1854
+ interface UpdatePackageExternalIdIdentifiers {
1855
+ /**
1856
+ * ID of the package to update.
1857
+ * @format GUID
1858
+ */
1859
+ packageId: string;
1860
+ /**
1861
+ * External ID that will be assigned to the package.
1862
+ * @maxLength 100
1863
+ */
1864
+ externalId: string;
1865
+ }
1866
+
1867
+ export { type ActionEvent, type AdjustProductInstanceSpecificationsOptions, type AdjustProductInstanceSpecificationsRequest, type AdjustProductInstanceSpecificationsResponse, type AdjustedProductInstanceSpecifications, type AssignProductInstanceToSiteIdentifiers, type AssignProductInstanceToSiteOptions, type AssignProductInstanceToSiteRequest, type AssignProductInstanceToSiteResponse, type AssignedProductInstanceToSite, type BillingReference, type Cancel, type CancelPackageOptions, type CancelPackageRequest, type CancelPackageResponse, type CancelProductInstanceOptions, type CancelProductInstanceRequest, type CancelProductInstanceResponse, type CancellationDetails, type Complete, ContractSwitchReason, type ContractSwitchReasonWithLiterals, ContractSwitchType, type ContractSwitchTypeWithLiterals, type ContractSwitched, type CountPackagesRequest, type CountPackagesResponse, type CreatePackageOptions, type CreatePackageRequest, type CreatePackageResponse, type CreatePackageV2Options, type CursorPaging, type Cursors, type Cycle, type CycleCycleSelectorOneOf, CycleDescriptorType, type CycleDescriptorTypeWithLiterals, type CycleInterval, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type FailureReason, FailureReasonFailureReason, type FailureReasonFailureReasonWithLiterals, type FailureReportRequest, FieldToUpdate, type FieldToUpdateWithLiterals, type FixBrokenMigrationRequest, type FixBrokenMigrationResponse, type GetPackageRequest, type GetPackageResponse, type IdentificationData, type IdentificationDataIdOneOf, Initiator, type InitiatorWithLiterals, type Interval, IntervalIntervalUnit, type IntervalIntervalUnitWithLiterals, IntervalUnit, type IntervalUnitWithLiterals, type MessageEnvelope, type MigrateSubscriptionToPackagesRequest, type MigrateSubscriptionToPackagesResponse, type OneTime, type Package, type PackageCanceled, type PackagesQueryBuilder, type PackagesQueryResult, type Paging, type PagingMetadataV2, PriceIncreaseTrigger, type PriceIncreaseTriggerWithLiterals, ProductAdjustment, type ProductAdjustmentWithLiterals, type ProductInstance, type ProductInstanceCanceled, type ProductInstanceContractDetailsOneOf, type ProductInstanceCycle, type ProductInstanceFailed, type ProductInstanceUpdated, type ProductPriceIncreaseData, ProviderName, type ProviderNameWithLiterals, type QueryPackagesRequest, type QueryPackagesResponse, type QueryV2, type QueryV2PagingMethodOneOf, type ReactivationData, ReactivationReasonEnum, type ReactivationReasonEnumWithLiterals, type RecurringChargeAttemptFailed, type RecurringChargeSucceeded, type Reschedule, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, Status, type StatusWithLiterals, type Subscription, type SubscriptionAssigned, type SubscriptionAutoRenewTurnedOff, type SubscriptionAutoRenewTurnedOn, type SubscriptionCancelled, type SubscriptionCreated, type SubscriptionEvent, type SubscriptionEventEventOneOf, type SubscriptionNearEndOfPeriod, type SubscriptionPendingChange, SubscriptionStatus, type SubscriptionStatusWithLiterals, type SubscriptionTransferred, type SubscriptionUnassigned, type Task, type TaskAction, type TaskActionActionOneOf, type TaskKey, type UnassignProductInstanceFromSiteOptions, type UnassignProductInstanceFromSiteRequest, type UnassignProductInstanceFromSiteResponse, UnassignReason, type UnassignReasonWithLiterals, type UnassignedProductInstanceFromSite, type UpdatePackageExternalIdIdentifiers, type UpdatePackageExternalIdRequest, type UpdatePackageExternalIdResponse, type UpdateProductInstanceRequest, type UpdateProductInstanceResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, adjustProductInstanceSpecifications, assignProductInstanceToSite, cancelPackage, cancelProductInstance, createPackage, createPackageV2, getPackage, queryPackages, unassignProductInstanceFromSite, updatePackageExternalId };