@wix/auto_sdk_packages_packages 1.0.0

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