@wix/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.
@@ -0,0 +1,1186 @@
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
+ interface Package$1 {
6
+ /**
7
+ * Package ID.
8
+ * @readonly
9
+ */
10
+ id?: string;
11
+ /**
12
+ * Wix account ID. See
13
+ * [Account Level APIs](https://dev.wix.com/api/rest/account-level-apis/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$1[];
32
+ /**
33
+ * Date and time the package was created.
34
+ * @readonly
35
+ */
36
+ createdDate?: Date;
37
+ /**
38
+ * Date and time the package was last updated.
39
+ * @readonly
40
+ */
41
+ updatedDate?: Date;
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
+ interface ProductInstance$1 extends ProductInstanceContractDetailsOneOf$1 {
48
+ /** Billing information for the contract between the reseller and Wix. */
49
+ billingInfo?: ProductInstanceCycle$1;
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
+ *
72
+ * + `PENDING`: The product instance isn't yet available to the customer.
73
+ * + `ENABLED`: The customer can use the product instance.
74
+ * + `CANCELED`: The product instance isn't any longer available to the customer.
75
+ * + `FAILED`: The product instance couldn't be delivered successfully and has never been available to the customer.
76
+ * + `AWAITING_ACTION`: The product instance isn't yet available to the customer, because an external provider or the customer must take an action.
77
+ * @readonly
78
+ */
79
+ status?: Status$1;
80
+ /**
81
+ * Failure object. Only present for status `FAILED`. Describes why the product instance `FAILED`.
82
+ * @readonly
83
+ */
84
+ failure?: FailureReason$1;
85
+ /**
86
+ * Date and time the product instance was created.
87
+ * @readonly
88
+ */
89
+ createdDate?: Date;
90
+ /**
91
+ * Date and time the product instance was last updated.
92
+ * @readonly
93
+ */
94
+ updatedDate?: Date;
95
+ /**
96
+ * Two-letter country code in
97
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
98
+ * format. Specifies where customers can claim vouchers that may come with the
99
+ * product. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) to get more
100
+ * information about vouchers and supported locations.
101
+ */
102
+ countryCode?: string | null;
103
+ /**
104
+ * Date and time the product instance expires in `YYYY-MM-DDThh:mm:ss.sssZ` format.
105
+ * Used only for instances that don't auto renew at the end of the current billing cycle.
106
+ * @readonly
107
+ */
108
+ expirationDate?: Date;
109
+ /**
110
+ * Discount code indicating that the reseller provisioned the product instance
111
+ * during a sale. Wix doesn't guarantee that a discount code reduces the
112
+ * price between Wix and the reseller, even when it's valid. Contact the
113
+ * [Wix B2B sales team](mailto:bizdev@wix.com) for more information.
114
+ *
115
+ * Max: 25 characters
116
+ */
117
+ discountCode?: string | null;
118
+ /**
119
+ * ID of a different product instance that you can use to offer your customers
120
+ * time-limited free access to an additional product or service. For example,
121
+ * Wix offers a 1-year free domain registration to all customers who purchase a
122
+ * Premium plan. The referenced product instance must have either status `"PENDING"` or
123
+ * `"ACTIVE"`. You can use each product instance only a single time as reference
124
+ * instance.
125
+ */
126
+ referenceProductInstanceId?: string | null;
127
+ }
128
+ /** @oneof */
129
+ interface ProductInstanceContractDetailsOneOf$1 {
130
+ /** Billing information for the contract between the reseller and Wix. */
131
+ billingInfo?: ProductInstanceCycle$1;
132
+ }
133
+ declare enum FailureReasonFailureReason$1 {
134
+ UNKNOWN = "UNKNOWN",
135
+ /** The delivery of the product took too long */
136
+ DELIVERY_TIMEOUT = "DELIVERY_TIMEOUT",
137
+ /** An external process failed */
138
+ EXTERNAL_FAILURE = "EXTERNAL_FAILURE"
139
+ }
140
+ declare enum IntervalIntervalUnit$1 {
141
+ /** unknown interval unit */
142
+ UNKNOWN = "UNKNOWN",
143
+ /** day */
144
+ DAY = "DAY",
145
+ /** week */
146
+ WEEK = "WEEK",
147
+ /** month */
148
+ MONTH = "MONTH",
149
+ /** year */
150
+ YEAR = "YEAR"
151
+ }
152
+ declare enum CycleDescriptorType$1 {
153
+ UNKNOWN = "UNKNOWN",
154
+ ONE_TIME = "ONE_TIME",
155
+ RECURRING = "RECURRING"
156
+ }
157
+ interface CycleInterval$1 {
158
+ /** Unit of the billing cycle. */
159
+ unit?: IntervalIntervalUnit$1;
160
+ /** Count of units that make up the billing cycle. */
161
+ count?: number;
162
+ }
163
+ declare enum Status$1 {
164
+ PENDING = "PENDING",
165
+ ENABLED = "ENABLED",
166
+ CANCELED = "CANCELED",
167
+ FAILED = "FAILED",
168
+ AWAITING_ACTION = "AWAITING_ACTION"
169
+ }
170
+ interface FailureReason$1 {
171
+ /**
172
+ * Failure code.
173
+ *
174
+ * + `DELIVERY_TIMEOUT`: The product instance couldn't be created because the Resellers API timed out.
175
+ * + `EXTERNAL_FAILURE`: The product instance couldn't be created because an external process failed. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more information.
176
+ */
177
+ code?: FailureReasonFailureReason$1;
178
+ /** Failure message. */
179
+ message?: string;
180
+ }
181
+ interface ProductInstanceCycle$1 {
182
+ /**
183
+ * Payment type.
184
+ * + `UNKNOWN`: The payment type hasn't been set.
185
+ * + `ONE_TIME`: The reseller pays Wix in a single payment.
186
+ * + `RECURRING`: The reseller pays Wix on a recurring schedule.
187
+ */
188
+ type?: CycleDescriptorType$1;
189
+ /** Duration of the billing cycle. Available only for `RECURRING` payments. */
190
+ cycleDuration?: CycleInterval$1;
191
+ }
192
+ interface CreatePackageRequest$1 {
193
+ /** Idempotency key. */
194
+ idempotencyKey?: string | null;
195
+ /** External reference. For example, an external subscription ID. **Note:** This field is not validated by Wix. */
196
+ externalId?: string | null;
197
+ /** Wix services that are resold. */
198
+ products: ProductInstance$1[];
199
+ }
200
+ interface CreatePackageResponse$1 {
201
+ /** Idempotency key. */
202
+ idempotencyKey?: string | null;
203
+ /** Created package. */
204
+ package?: Package$1;
205
+ }
206
+ interface CancelPackageRequest$1 {
207
+ /** Idempotency key. */
208
+ idempotencyKey?: string | null;
209
+ /** ID of the package to cancel. */
210
+ id: string;
211
+ }
212
+ interface CancelPackageResponse$1 {
213
+ /** Idempotency key. */
214
+ idempotencyKey?: string | null;
215
+ /** Canceled package. */
216
+ package?: Package$1;
217
+ }
218
+ interface GetPackageRequest$1 {
219
+ /** Package ID. */
220
+ id: string;
221
+ }
222
+ interface GetPackageResponse$1 {
223
+ /** Retrieved package. */
224
+ package?: Package$1;
225
+ }
226
+ interface QueryPackagesRequest$1 {
227
+ /** Query options. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) for more details. */
228
+ query: QueryV2$1;
229
+ }
230
+ interface QueryV2$1 extends QueryV2PagingMethodOneOf$1 {
231
+ /** Paging options to limit and skip the number of items. */
232
+ paging?: Paging$1;
233
+ /** 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`. */
234
+ cursorPaging?: CursorPaging$1;
235
+ /**
236
+ * Filter object in the following format:
237
+ * `"filter" : {
238
+ * "fieldName1": "value1",
239
+ * "fieldName2":{"$operator":"value2"}
240
+ * }`
241
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
242
+ */
243
+ filter?: Record<string, any> | null;
244
+ /**
245
+ * Sort object in the following format:
246
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
247
+ */
248
+ sort?: Sorting$1[];
249
+ /** 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. */
250
+ fields?: string[];
251
+ /** 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. */
252
+ fieldsets?: string[];
253
+ }
254
+ /** @oneof */
255
+ interface QueryV2PagingMethodOneOf$1 {
256
+ /** Paging options to limit and skip the number of items. */
257
+ paging?: Paging$1;
258
+ /** 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`. */
259
+ cursorPaging?: CursorPaging$1;
260
+ }
261
+ interface Sorting$1 {
262
+ /** Name of the field to sort by. */
263
+ fieldName?: string;
264
+ /** Sort order. */
265
+ order?: SortOrder$1;
266
+ }
267
+ declare enum SortOrder$1 {
268
+ ASC = "ASC",
269
+ DESC = "DESC"
270
+ }
271
+ interface Paging$1 {
272
+ /** Number of items to load. */
273
+ limit?: number | null;
274
+ /** Number of items to skip in the current sort order. */
275
+ offset?: number | null;
276
+ }
277
+ interface CursorPaging$1 {
278
+ /** Maximum number of items to return in the results. */
279
+ limit?: number | null;
280
+ /**
281
+ * Pointer to the next or previous page in the list of results.
282
+ *
283
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
284
+ * Not relevant for the first request.
285
+ */
286
+ cursor?: string | null;
287
+ }
288
+ interface QueryPackagesResponse$1 {
289
+ /** Paging metadata. */
290
+ metadata?: PagingMetadataV2$1;
291
+ /**
292
+ * Retrieved packages.
293
+ *
294
+ * Max: 1000 packages
295
+ */
296
+ packages?: Package$1[];
297
+ }
298
+ interface PagingMetadataV2$1 {
299
+ /** Number of items returned in the response. */
300
+ count?: number | null;
301
+ /** Offset that was requested. */
302
+ offset?: number | null;
303
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
304
+ total?: number | null;
305
+ /** Flag that indicates the server failed to calculate the `total` field. */
306
+ tooManyToCount?: boolean | null;
307
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
308
+ cursors?: Cursors$1;
309
+ }
310
+ interface Cursors$1 {
311
+ /** Cursor string pointing to the next page in the list of results. */
312
+ next?: string | null;
313
+ /** Cursor pointing to the previous page in the list of results. */
314
+ prev?: string | null;
315
+ }
316
+ interface AssignProductInstanceToSiteRequest$1 {
317
+ /** Idempotency key. */
318
+ idempotencyKey?: string | null;
319
+ /** ID of the product instance to assign to a site. */
320
+ instanceId: string;
321
+ /** ID of the site to which the product instance is assigned. */
322
+ siteId: string;
323
+ }
324
+ interface AssignProductInstanceToSiteResponse$1 {
325
+ /** Idempotency key. */
326
+ idempotencyKey?: string | null;
327
+ /** Updated package that includes the assigned product instance. */
328
+ package?: Package$1;
329
+ }
330
+ interface UnassignProductInstanceFromSiteRequest$1 {
331
+ /** Idempotency key. */
332
+ idempotencyKey?: string | null;
333
+ /** ID of the product instance to unassign from a site. */
334
+ instanceId: string;
335
+ }
336
+ interface UnassignProductInstanceFromSiteResponse$1 {
337
+ /** Idempotency key. */
338
+ idempotencyKey?: string | null;
339
+ /** Updated package that includes the unassigned product instance. */
340
+ package?: Package$1;
341
+ }
342
+ interface CancelProductInstanceRequest$1 {
343
+ /** Idempotency key. */
344
+ idempotencyKey?: string | null;
345
+ /** ID of the product instance to cancel. */
346
+ instanceId: string;
347
+ }
348
+ interface CancelProductInstanceResponse$1 {
349
+ /** Idempotency key. */
350
+ idempotencyKey?: string | null;
351
+ /** Updated package that includes the previously included the canceled product instance. */
352
+ package?: Package$1;
353
+ }
354
+ interface AdjustProductInstanceSpecificationsRequest$1 {
355
+ /** Idempotency key. */
356
+ idempotencyKey?: string | null;
357
+ /** ID of the product instance to adjust. */
358
+ instanceId: string;
359
+ /**
360
+ * ID of the product to replace the original instance. Required in case you don't
361
+ * provide a new `billingInfo` object.
362
+ */
363
+ catalogProductId?: string | null;
364
+ /**
365
+ * Information about the billing cycle. Required in case you don't provide a new
366
+ * `catalogProductId`. The new billing cycle must be supported for the service.
367
+ * Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for
368
+ * information about a service's supported billing cycles. If
369
+ * you adjust the billing cycle for a product instance with `RECURRING`
370
+ * payments, you must also provide `billingInfo.cycleDuration.unit`.
371
+ */
372
+ billingInfo?: ProductInstanceCycle$1;
373
+ /**
374
+ * Discount code indicating that the reseller provisioned the product instance
375
+ * during a sale. Ignored when you don't pass a new `catalogProductId` as well.
376
+ * In case you pass a code that isn't valid, the call succeeds and
377
+ * no discount is applied to the product instance. Wix doesn't guarantee that a
378
+ * discount code reduces the price between Wix and the reseller, even when it's
379
+ * valid. You can't add a discount code after you've created the
380
+ * product instance. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for
381
+ * more information about supported codes.
382
+ *
383
+ * Max: 25 characters
384
+ */
385
+ discountCode?: string | null;
386
+ }
387
+ interface AdjustProductInstanceSpecificationsResponse$1 {
388
+ /** Idempotency key. */
389
+ idempotencyKey?: string | null;
390
+ /** Updated package that includes the adjusted product instance. */
391
+ package?: Package$1;
392
+ }
393
+ interface CreatePackageResponseNonNullableFields$1 {
394
+ package?: {
395
+ id: string;
396
+ accountId: string;
397
+ productInstances: {
398
+ billingInfo?: {
399
+ type: CycleDescriptorType$1;
400
+ cycleDuration?: {
401
+ unit: IntervalIntervalUnit$1;
402
+ count: number;
403
+ };
404
+ };
405
+ instanceId: string;
406
+ catalogProductId: string;
407
+ status: Status$1;
408
+ failure?: {
409
+ code: FailureReasonFailureReason$1;
410
+ message: string;
411
+ };
412
+ }[];
413
+ };
414
+ }
415
+ interface CancelPackageResponseNonNullableFields$1 {
416
+ package?: {
417
+ id: string;
418
+ accountId: string;
419
+ productInstances: {
420
+ billingInfo?: {
421
+ type: CycleDescriptorType$1;
422
+ cycleDuration?: {
423
+ unit: IntervalIntervalUnit$1;
424
+ count: number;
425
+ };
426
+ };
427
+ instanceId: string;
428
+ catalogProductId: string;
429
+ status: Status$1;
430
+ failure?: {
431
+ code: FailureReasonFailureReason$1;
432
+ message: string;
433
+ };
434
+ }[];
435
+ };
436
+ }
437
+ interface GetPackageResponseNonNullableFields$1 {
438
+ package?: {
439
+ id: string;
440
+ accountId: string;
441
+ productInstances: {
442
+ billingInfo?: {
443
+ type: CycleDescriptorType$1;
444
+ cycleDuration?: {
445
+ unit: IntervalIntervalUnit$1;
446
+ count: number;
447
+ };
448
+ };
449
+ instanceId: string;
450
+ catalogProductId: string;
451
+ status: Status$1;
452
+ failure?: {
453
+ code: FailureReasonFailureReason$1;
454
+ message: string;
455
+ };
456
+ }[];
457
+ };
458
+ }
459
+ interface QueryPackagesResponseNonNullableFields$1 {
460
+ packages: {
461
+ id: string;
462
+ accountId: string;
463
+ productInstances: {
464
+ billingInfo?: {
465
+ type: CycleDescriptorType$1;
466
+ cycleDuration?: {
467
+ unit: IntervalIntervalUnit$1;
468
+ count: number;
469
+ };
470
+ };
471
+ instanceId: string;
472
+ catalogProductId: string;
473
+ status: Status$1;
474
+ failure?: {
475
+ code: FailureReasonFailureReason$1;
476
+ message: string;
477
+ };
478
+ }[];
479
+ }[];
480
+ }
481
+ interface AssignProductInstanceToSiteResponseNonNullableFields$1 {
482
+ package?: {
483
+ id: string;
484
+ accountId: string;
485
+ productInstances: {
486
+ billingInfo?: {
487
+ type: CycleDescriptorType$1;
488
+ cycleDuration?: {
489
+ unit: IntervalIntervalUnit$1;
490
+ count: number;
491
+ };
492
+ };
493
+ instanceId: string;
494
+ catalogProductId: string;
495
+ status: Status$1;
496
+ failure?: {
497
+ code: FailureReasonFailureReason$1;
498
+ message: string;
499
+ };
500
+ }[];
501
+ };
502
+ }
503
+ interface UnassignProductInstanceFromSiteResponseNonNullableFields$1 {
504
+ package?: {
505
+ id: string;
506
+ accountId: string;
507
+ productInstances: {
508
+ billingInfo?: {
509
+ type: CycleDescriptorType$1;
510
+ cycleDuration?: {
511
+ unit: IntervalIntervalUnit$1;
512
+ count: number;
513
+ };
514
+ };
515
+ instanceId: string;
516
+ catalogProductId: string;
517
+ status: Status$1;
518
+ failure?: {
519
+ code: FailureReasonFailureReason$1;
520
+ message: string;
521
+ };
522
+ }[];
523
+ };
524
+ }
525
+ interface CancelProductInstanceResponseNonNullableFields$1 {
526
+ package?: {
527
+ id: string;
528
+ accountId: string;
529
+ productInstances: {
530
+ billingInfo?: {
531
+ type: CycleDescriptorType$1;
532
+ cycleDuration?: {
533
+ unit: IntervalIntervalUnit$1;
534
+ count: number;
535
+ };
536
+ };
537
+ instanceId: string;
538
+ catalogProductId: string;
539
+ status: Status$1;
540
+ failure?: {
541
+ code: FailureReasonFailureReason$1;
542
+ message: string;
543
+ };
544
+ }[];
545
+ };
546
+ }
547
+ interface AdjustProductInstanceSpecificationsResponseNonNullableFields$1 {
548
+ package?: {
549
+ id: string;
550
+ accountId: string;
551
+ productInstances: {
552
+ billingInfo?: {
553
+ type: CycleDescriptorType$1;
554
+ cycleDuration?: {
555
+ unit: IntervalIntervalUnit$1;
556
+ count: number;
557
+ };
558
+ };
559
+ instanceId: string;
560
+ catalogProductId: string;
561
+ status: Status$1;
562
+ failure?: {
563
+ code: FailureReasonFailureReason$1;
564
+ message: string;
565
+ };
566
+ }[];
567
+ };
568
+ }
569
+
570
+ /**
571
+ * A package is group of instances of Wix services that a reseller offers to a
572
+ * customer as part of a single transaction.
573
+ */
574
+ interface Package {
575
+ /**
576
+ * Package ID.
577
+ * @readonly
578
+ */
579
+ _id?: string;
580
+ /**
581
+ * Wix account ID. See
582
+ * [Account Level APIs](https://dev.wix.com/api/rest/account-level-apis/about-account-level-apis)
583
+ * for more details.
584
+ * @readonly
585
+ */
586
+ accountId?: string;
587
+ /**
588
+ * External reference. For example, an external subscription ID.
589
+ * This field isn't validated by Wix.
590
+ *
591
+ * Max: 100 characters
592
+ */
593
+ externalId?: string | null;
594
+ /**
595
+ * Product instances that are included in the package.
596
+ *
597
+ * Min: 1 product instance
598
+ * Max: 1000 product instances
599
+ */
600
+ productInstances?: ProductInstance[];
601
+ /**
602
+ * Date and time the package was created.
603
+ * @readonly
604
+ */
605
+ _createdDate?: Date;
606
+ /**
607
+ * Date and time the package was last updated.
608
+ * @readonly
609
+ */
610
+ _updatedDate?: Date;
611
+ }
612
+ /**
613
+ * A product instance is a specific instance of a Wix service that a reseller
614
+ * offers to one of their customers.
615
+ */
616
+ interface ProductInstance extends ProductInstanceContractDetailsOneOf {
617
+ /** Billing information for the contract between the reseller and Wix. */
618
+ billingInfo?: ProductInstanceCycle;
619
+ /**
620
+ * ID of the instance of the resold Wix service. **Note:** Differs from the
621
+ * `catalogProductId`. Allows you to identify different instances of the same
622
+ * product in a package.
623
+ * @readonly
624
+ */
625
+ instanceId?: string;
626
+ /**
627
+ * ID of the Wix site that the product instance is assigned to.
628
+ * See the [Query Sites API](https://dev.wix.com/api/rest/account-level-apis/sites/query-sites)
629
+ * for more information.
630
+ */
631
+ siteId?: string | null;
632
+ /**
633
+ * Product ID, as defined in the Wix Premium Product Catalog.
634
+ * Contact the [Wix B2B sales team](mailto:bizdev@wix.com)
635
+ * for more details about available Wix services.
636
+ */
637
+ catalogProductId?: string;
638
+ /**
639
+ * Status of the product instance.
640
+ *
641
+ * + `PENDING`: The product instance isn't yet available to the customer.
642
+ * + `ENABLED`: The customer can use the product instance.
643
+ * + `CANCELED`: The product instance isn't any longer available to the customer.
644
+ * + `FAILED`: The product instance couldn't be delivered successfully and has never been available to the customer.
645
+ * + `AWAITING_ACTION`: The product instance isn't yet available to the customer, because an external provider or the customer must take an action.
646
+ * @readonly
647
+ */
648
+ status?: Status;
649
+ /**
650
+ * Failure object. Only present for status `FAILED`. Describes why the product instance `FAILED`.
651
+ * @readonly
652
+ */
653
+ failure?: FailureReason;
654
+ /**
655
+ * Date and time the product instance was created.
656
+ * @readonly
657
+ */
658
+ _createdDate?: Date;
659
+ /**
660
+ * Date and time the product instance was last updated.
661
+ * @readonly
662
+ */
663
+ _updatedDate?: Date;
664
+ /**
665
+ * Two-letter country code in
666
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
667
+ * format. Specifies where customers can claim vouchers that may come with the
668
+ * product. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) to get more
669
+ * information about vouchers and supported locations.
670
+ */
671
+ countryCode?: string | null;
672
+ /**
673
+ * Date and time the product instance expires in `YYYY-MM-DDThh:mm:ss.sssZ` format.
674
+ * Used only for instances that don't auto renew at the end of the current billing cycle.
675
+ * @readonly
676
+ */
677
+ expirationDate?: Date;
678
+ /**
679
+ * Discount code indicating that the reseller provisioned the product instance
680
+ * during a sale. Wix doesn't guarantee that a discount code reduces the
681
+ * price between Wix and the reseller, even when it's valid. Contact the
682
+ * [Wix B2B sales team](mailto:bizdev@wix.com) for more information.
683
+ *
684
+ * Max: 25 characters
685
+ */
686
+ discountCode?: string | null;
687
+ /**
688
+ * ID of a different product instance that you can use to offer your customers
689
+ * time-limited free access to an additional product or service. For example,
690
+ * Wix offers a 1-year free domain registration to all customers who purchase a
691
+ * Premium plan. The referenced product instance must have either status `"PENDING"` or
692
+ * `"ACTIVE"`. You can use each product instance only a single time as reference
693
+ * instance.
694
+ */
695
+ referenceProductInstanceId?: string | null;
696
+ }
697
+ /** @oneof */
698
+ interface ProductInstanceContractDetailsOneOf {
699
+ /** Billing information for the contract between the reseller and Wix. */
700
+ billingInfo?: ProductInstanceCycle;
701
+ }
702
+ declare enum FailureReasonFailureReason {
703
+ UNKNOWN = "UNKNOWN",
704
+ /** The delivery of the product took too long */
705
+ DELIVERY_TIMEOUT = "DELIVERY_TIMEOUT",
706
+ /** An external process failed */
707
+ EXTERNAL_FAILURE = "EXTERNAL_FAILURE"
708
+ }
709
+ declare enum IntervalIntervalUnit {
710
+ /** unknown interval unit */
711
+ UNKNOWN = "UNKNOWN",
712
+ /** day */
713
+ DAY = "DAY",
714
+ /** week */
715
+ WEEK = "WEEK",
716
+ /** month */
717
+ MONTH = "MONTH",
718
+ /** year */
719
+ YEAR = "YEAR"
720
+ }
721
+ declare enum CycleDescriptorType {
722
+ UNKNOWN = "UNKNOWN",
723
+ ONE_TIME = "ONE_TIME",
724
+ RECURRING = "RECURRING"
725
+ }
726
+ interface CycleInterval {
727
+ /** Unit of the billing cycle. */
728
+ unit?: IntervalIntervalUnit;
729
+ /** Count of units that make up the billing cycle. */
730
+ count?: number;
731
+ }
732
+ declare enum Status {
733
+ PENDING = "PENDING",
734
+ ENABLED = "ENABLED",
735
+ CANCELED = "CANCELED",
736
+ FAILED = "FAILED",
737
+ AWAITING_ACTION = "AWAITING_ACTION"
738
+ }
739
+ interface FailureReason {
740
+ /**
741
+ * Failure code.
742
+ *
743
+ * + `DELIVERY_TIMEOUT`: The product instance couldn't be created because the Resellers API timed out.
744
+ * + `EXTERNAL_FAILURE`: The product instance couldn't be created because an external process failed. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more information.
745
+ */
746
+ code?: FailureReasonFailureReason;
747
+ /** Failure message. */
748
+ message?: string;
749
+ }
750
+ interface ProductInstanceCycle {
751
+ /**
752
+ * Payment type.
753
+ * + `UNKNOWN`: The payment type hasn't been set.
754
+ * + `ONE_TIME`: The reseller pays Wix in a single payment.
755
+ * + `RECURRING`: The reseller pays Wix on a recurring schedule.
756
+ */
757
+ type?: CycleDescriptorType;
758
+ /** Duration of the billing cycle. Available only for `RECURRING` payments. */
759
+ cycleDuration?: CycleInterval;
760
+ }
761
+ interface CreatePackageRequest {
762
+ /** Idempotency key. */
763
+ idempotencyKey?: string | null;
764
+ /** External reference. For example, an external subscription ID. **Note:** This field is not validated by Wix. */
765
+ externalId?: string | null;
766
+ /** Wix services that are resold. */
767
+ products: ProductInstance[];
768
+ }
769
+ interface CreatePackageResponse {
770
+ /** Idempotency key. */
771
+ idempotencyKey?: string | null;
772
+ /** Created package. */
773
+ package?: Package;
774
+ }
775
+ interface CancelPackageRequest {
776
+ /** Idempotency key. */
777
+ idempotencyKey?: string | null;
778
+ /** ID of the package to cancel. */
779
+ _id: string;
780
+ }
781
+ interface CancelPackageResponse {
782
+ /** Idempotency key. */
783
+ idempotencyKey?: string | null;
784
+ /** Canceled package. */
785
+ package?: Package;
786
+ }
787
+ interface GetPackageRequest {
788
+ /** Package ID. */
789
+ _id: string;
790
+ }
791
+ interface GetPackageResponse {
792
+ /** Retrieved package. */
793
+ package?: Package;
794
+ }
795
+ interface QueryPackagesRequest {
796
+ /** Query options. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) for more details. */
797
+ query: QueryV2;
798
+ }
799
+ interface QueryV2 extends QueryV2PagingMethodOneOf {
800
+ /** Paging options to limit and skip the number of items. */
801
+ paging?: Paging;
802
+ /** 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`. */
803
+ cursorPaging?: CursorPaging;
804
+ /**
805
+ * Filter object in the following format:
806
+ * `"filter" : {
807
+ * "fieldName1": "value1",
808
+ * "fieldName2":{"$operator":"value2"}
809
+ * }`
810
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
811
+ */
812
+ filter?: Record<string, any> | null;
813
+ /**
814
+ * Sort object in the following format:
815
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
816
+ */
817
+ sort?: Sorting[];
818
+ /** 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. */
819
+ fields?: string[];
820
+ /** 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. */
821
+ fieldsets?: string[];
822
+ }
823
+ /** @oneof */
824
+ interface QueryV2PagingMethodOneOf {
825
+ /** Paging options to limit and skip the number of items. */
826
+ paging?: Paging;
827
+ /** 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`. */
828
+ cursorPaging?: CursorPaging;
829
+ }
830
+ interface Sorting {
831
+ /** Name of the field to sort by. */
832
+ fieldName?: string;
833
+ /** Sort order. */
834
+ order?: SortOrder;
835
+ }
836
+ declare enum SortOrder {
837
+ ASC = "ASC",
838
+ DESC = "DESC"
839
+ }
840
+ interface Paging {
841
+ /** Number of items to load. */
842
+ limit?: number | null;
843
+ /** Number of items to skip in the current sort order. */
844
+ offset?: number | null;
845
+ }
846
+ interface CursorPaging {
847
+ /** Maximum number of items to return in the results. */
848
+ limit?: number | null;
849
+ /**
850
+ * Pointer to the next or previous page in the list of results.
851
+ *
852
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
853
+ * Not relevant for the first request.
854
+ */
855
+ cursor?: string | null;
856
+ }
857
+ interface QueryPackagesResponse {
858
+ /** Paging metadata. */
859
+ metadata?: PagingMetadataV2;
860
+ /**
861
+ * Retrieved packages.
862
+ *
863
+ * Max: 1000 packages
864
+ */
865
+ packages?: Package[];
866
+ }
867
+ interface PagingMetadataV2 {
868
+ /** Number of items returned in the response. */
869
+ count?: number | null;
870
+ /** Offset that was requested. */
871
+ offset?: number | null;
872
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
873
+ total?: number | null;
874
+ /** Flag that indicates the server failed to calculate the `total` field. */
875
+ tooManyToCount?: boolean | null;
876
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
877
+ cursors?: Cursors;
878
+ }
879
+ interface Cursors {
880
+ /** Cursor string pointing to the next page in the list of results. */
881
+ next?: string | null;
882
+ /** Cursor pointing to the previous page in the list of results. */
883
+ prev?: string | null;
884
+ }
885
+ interface AssignProductInstanceToSiteRequest {
886
+ /** Idempotency key. */
887
+ idempotencyKey?: string | null;
888
+ /** ID of the product instance to assign to a site. */
889
+ instanceId: string;
890
+ /** ID of the site to which the product instance is assigned. */
891
+ siteId: string;
892
+ }
893
+ interface AssignProductInstanceToSiteResponse {
894
+ /** Idempotency key. */
895
+ idempotencyKey?: string | null;
896
+ /** Updated package that includes the assigned product instance. */
897
+ package?: Package;
898
+ }
899
+ interface UnassignProductInstanceFromSiteRequest {
900
+ /** Idempotency key. */
901
+ idempotencyKey?: string | null;
902
+ /** ID of the product instance to unassign from a site. */
903
+ instanceId: string;
904
+ }
905
+ interface UnassignProductInstanceFromSiteResponse {
906
+ /** Idempotency key. */
907
+ idempotencyKey?: string | null;
908
+ /** Updated package that includes the unassigned product instance. */
909
+ package?: Package;
910
+ }
911
+ interface CancelProductInstanceRequest {
912
+ /** Idempotency key. */
913
+ idempotencyKey?: string | null;
914
+ /** ID of the product instance to cancel. */
915
+ instanceId: string;
916
+ }
917
+ interface CancelProductInstanceResponse {
918
+ /** Idempotency key. */
919
+ idempotencyKey?: string | null;
920
+ /** Updated package that includes the previously included the canceled product instance. */
921
+ package?: Package;
922
+ }
923
+ interface AdjustProductInstanceSpecificationsRequest {
924
+ /** Idempotency key. */
925
+ idempotencyKey?: string | null;
926
+ /** ID of the product instance to adjust. */
927
+ instanceId: string;
928
+ /**
929
+ * ID of the product to replace the original instance. Required in case you don't
930
+ * provide a new `billingInfo` object.
931
+ */
932
+ catalogProductId?: string | null;
933
+ /**
934
+ * Information about the billing cycle. Required in case you don't provide a new
935
+ * `catalogProductId`. The new billing cycle must be supported for the service.
936
+ * Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for
937
+ * information about a service's supported billing cycles. If
938
+ * you adjust the billing cycle for a product instance with `RECURRING`
939
+ * payments, you must also provide `billingInfo.cycleDuration.unit`.
940
+ */
941
+ billingInfo?: ProductInstanceCycle;
942
+ /**
943
+ * Discount code indicating that the reseller provisioned the product instance
944
+ * during a sale. Ignored when you don't pass a new `catalogProductId` as well.
945
+ * In case you pass a code that isn't valid, the call succeeds and
946
+ * no discount is applied to the product instance. Wix doesn't guarantee that a
947
+ * discount code reduces the price between Wix and the reseller, even when it's
948
+ * valid. You can't add a discount code after you've created the
949
+ * product instance. Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for
950
+ * more information about supported codes.
951
+ *
952
+ * Max: 25 characters
953
+ */
954
+ discountCode?: string | null;
955
+ }
956
+ interface AdjustProductInstanceSpecificationsResponse {
957
+ /** Idempotency key. */
958
+ idempotencyKey?: string | null;
959
+ /** Updated package that includes the adjusted product instance. */
960
+ package?: Package;
961
+ }
962
+ interface CreatePackageResponseNonNullableFields {
963
+ package?: {
964
+ _id: string;
965
+ accountId: string;
966
+ productInstances: {
967
+ billingInfo?: {
968
+ type: CycleDescriptorType;
969
+ cycleDuration?: {
970
+ unit: IntervalIntervalUnit;
971
+ count: number;
972
+ };
973
+ };
974
+ instanceId: string;
975
+ catalogProductId: string;
976
+ status: Status;
977
+ failure?: {
978
+ code: FailureReasonFailureReason;
979
+ message: string;
980
+ };
981
+ }[];
982
+ };
983
+ }
984
+ interface CancelPackageResponseNonNullableFields {
985
+ package?: {
986
+ _id: string;
987
+ accountId: string;
988
+ productInstances: {
989
+ billingInfo?: {
990
+ type: CycleDescriptorType;
991
+ cycleDuration?: {
992
+ unit: IntervalIntervalUnit;
993
+ count: number;
994
+ };
995
+ };
996
+ instanceId: string;
997
+ catalogProductId: string;
998
+ status: Status;
999
+ failure?: {
1000
+ code: FailureReasonFailureReason;
1001
+ message: string;
1002
+ };
1003
+ }[];
1004
+ };
1005
+ }
1006
+ interface GetPackageResponseNonNullableFields {
1007
+ package?: {
1008
+ _id: string;
1009
+ accountId: string;
1010
+ productInstances: {
1011
+ billingInfo?: {
1012
+ type: CycleDescriptorType;
1013
+ cycleDuration?: {
1014
+ unit: IntervalIntervalUnit;
1015
+ count: number;
1016
+ };
1017
+ };
1018
+ instanceId: string;
1019
+ catalogProductId: string;
1020
+ status: Status;
1021
+ failure?: {
1022
+ code: FailureReasonFailureReason;
1023
+ message: string;
1024
+ };
1025
+ }[];
1026
+ };
1027
+ }
1028
+ interface QueryPackagesResponseNonNullableFields {
1029
+ packages: {
1030
+ _id: string;
1031
+ accountId: string;
1032
+ productInstances: {
1033
+ billingInfo?: {
1034
+ type: CycleDescriptorType;
1035
+ cycleDuration?: {
1036
+ unit: IntervalIntervalUnit;
1037
+ count: number;
1038
+ };
1039
+ };
1040
+ instanceId: string;
1041
+ catalogProductId: string;
1042
+ status: Status;
1043
+ failure?: {
1044
+ code: FailureReasonFailureReason;
1045
+ message: string;
1046
+ };
1047
+ }[];
1048
+ }[];
1049
+ }
1050
+ interface AssignProductInstanceToSiteResponseNonNullableFields {
1051
+ package?: {
1052
+ _id: string;
1053
+ accountId: string;
1054
+ productInstances: {
1055
+ billingInfo?: {
1056
+ type: CycleDescriptorType;
1057
+ cycleDuration?: {
1058
+ unit: IntervalIntervalUnit;
1059
+ count: number;
1060
+ };
1061
+ };
1062
+ instanceId: string;
1063
+ catalogProductId: string;
1064
+ status: Status;
1065
+ failure?: {
1066
+ code: FailureReasonFailureReason;
1067
+ message: string;
1068
+ };
1069
+ }[];
1070
+ };
1071
+ }
1072
+ interface UnassignProductInstanceFromSiteResponseNonNullableFields {
1073
+ package?: {
1074
+ _id: string;
1075
+ accountId: string;
1076
+ productInstances: {
1077
+ billingInfo?: {
1078
+ type: CycleDescriptorType;
1079
+ cycleDuration?: {
1080
+ unit: IntervalIntervalUnit;
1081
+ count: number;
1082
+ };
1083
+ };
1084
+ instanceId: string;
1085
+ catalogProductId: string;
1086
+ status: Status;
1087
+ failure?: {
1088
+ code: FailureReasonFailureReason;
1089
+ message: string;
1090
+ };
1091
+ }[];
1092
+ };
1093
+ }
1094
+ interface CancelProductInstanceResponseNonNullableFields {
1095
+ package?: {
1096
+ _id: string;
1097
+ accountId: string;
1098
+ productInstances: {
1099
+ billingInfo?: {
1100
+ type: CycleDescriptorType;
1101
+ cycleDuration?: {
1102
+ unit: IntervalIntervalUnit;
1103
+ count: number;
1104
+ };
1105
+ };
1106
+ instanceId: string;
1107
+ catalogProductId: string;
1108
+ status: Status;
1109
+ failure?: {
1110
+ code: FailureReasonFailureReason;
1111
+ message: string;
1112
+ };
1113
+ }[];
1114
+ };
1115
+ }
1116
+ interface AdjustProductInstanceSpecificationsResponseNonNullableFields {
1117
+ package?: {
1118
+ _id: string;
1119
+ accountId: string;
1120
+ productInstances: {
1121
+ billingInfo?: {
1122
+ type: CycleDescriptorType;
1123
+ cycleDuration?: {
1124
+ unit: IntervalIntervalUnit;
1125
+ count: number;
1126
+ };
1127
+ };
1128
+ instanceId: string;
1129
+ catalogProductId: string;
1130
+ status: Status;
1131
+ failure?: {
1132
+ code: FailureReasonFailureReason;
1133
+ message: string;
1134
+ };
1135
+ }[];
1136
+ };
1137
+ }
1138
+
1139
+ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
1140
+ getUrl: (context: any) => string;
1141
+ httpMethod: K;
1142
+ path: string;
1143
+ pathParams: M;
1144
+ __requestType: T;
1145
+ __originalRequestType: S;
1146
+ __responseType: Q;
1147
+ __originalResponseType: R;
1148
+ };
1149
+ declare function createPackage(): __PublicMethodMetaInfo<'POST', {}, CreatePackageRequest, CreatePackageRequest$1, CreatePackageResponse & CreatePackageResponseNonNullableFields, CreatePackageResponse$1 & CreatePackageResponseNonNullableFields$1>;
1150
+ declare function createPackageV2(): __PublicMethodMetaInfo<'POST', {}, CreatePackageRequest, CreatePackageRequest$1, CreatePackageResponse & CreatePackageResponseNonNullableFields, CreatePackageResponse$1 & CreatePackageResponseNonNullableFields$1>;
1151
+ declare function cancelPackage(): __PublicMethodMetaInfo<'DELETE', {
1152
+ id: string;
1153
+ }, CancelPackageRequest, CancelPackageRequest$1, CancelPackageResponse & CancelPackageResponseNonNullableFields, CancelPackageResponse$1 & CancelPackageResponseNonNullableFields$1>;
1154
+ declare function getPackage(): __PublicMethodMetaInfo<'GET', {
1155
+ id: string;
1156
+ }, GetPackageRequest, GetPackageRequest$1, GetPackageResponse & GetPackageResponseNonNullableFields, GetPackageResponse$1 & GetPackageResponseNonNullableFields$1>;
1157
+ declare function queryPackages(): __PublicMethodMetaInfo<'POST', {}, QueryPackagesRequest, QueryPackagesRequest$1, QueryPackagesResponse & QueryPackagesResponseNonNullableFields, QueryPackagesResponse$1 & QueryPackagesResponseNonNullableFields$1>;
1158
+ declare function assignProductInstanceToSite(): __PublicMethodMetaInfo<'PATCH', {
1159
+ instanceId: string;
1160
+ siteId: string;
1161
+ }, AssignProductInstanceToSiteRequest, AssignProductInstanceToSiteRequest$1, AssignProductInstanceToSiteResponse & AssignProductInstanceToSiteResponseNonNullableFields, AssignProductInstanceToSiteResponse$1 & AssignProductInstanceToSiteResponseNonNullableFields$1>;
1162
+ declare function unassignProductInstanceFromSite(): __PublicMethodMetaInfo<'PATCH', {
1163
+ instanceId: string;
1164
+ }, UnassignProductInstanceFromSiteRequest, UnassignProductInstanceFromSiteRequest$1, UnassignProductInstanceFromSiteResponse & UnassignProductInstanceFromSiteResponseNonNullableFields, UnassignProductInstanceFromSiteResponse$1 & UnassignProductInstanceFromSiteResponseNonNullableFields$1>;
1165
+ declare function cancelProductInstance(): __PublicMethodMetaInfo<'DELETE', {
1166
+ instanceId: string;
1167
+ }, CancelProductInstanceRequest, CancelProductInstanceRequest$1, CancelProductInstanceResponse & CancelProductInstanceResponseNonNullableFields, CancelProductInstanceResponse$1 & CancelProductInstanceResponseNonNullableFields$1>;
1168
+ declare function adjustProductInstanceSpecifications(): __PublicMethodMetaInfo<'PATCH', {
1169
+ instanceId: string;
1170
+ }, AdjustProductInstanceSpecificationsRequest, AdjustProductInstanceSpecificationsRequest$1, AdjustProductInstanceSpecificationsResponse & AdjustProductInstanceSpecificationsResponseNonNullableFields, AdjustProductInstanceSpecificationsResponse$1 & AdjustProductInstanceSpecificationsResponseNonNullableFields$1>;
1171
+
1172
+ type meta___PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = __PublicMethodMetaInfo<K, M, T, S, Q, R>;
1173
+ declare const meta_adjustProductInstanceSpecifications: typeof adjustProductInstanceSpecifications;
1174
+ declare const meta_assignProductInstanceToSite: typeof assignProductInstanceToSite;
1175
+ declare const meta_cancelPackage: typeof cancelPackage;
1176
+ declare const meta_cancelProductInstance: typeof cancelProductInstance;
1177
+ declare const meta_createPackage: typeof createPackage;
1178
+ declare const meta_createPackageV2: typeof createPackageV2;
1179
+ declare const meta_getPackage: typeof getPackage;
1180
+ declare const meta_queryPackages: typeof queryPackages;
1181
+ declare const meta_unassignProductInstanceFromSite: typeof unassignProductInstanceFromSite;
1182
+ declare namespace meta {
1183
+ export { type meta___PublicMethodMetaInfo as __PublicMethodMetaInfo, meta_adjustProductInstanceSpecifications as adjustProductInstanceSpecifications, meta_assignProductInstanceToSite as assignProductInstanceToSite, meta_cancelPackage as cancelPackage, meta_cancelProductInstance as cancelProductInstance, meta_createPackage as createPackage, meta_createPackageV2 as createPackageV2, meta_getPackage as getPackage, meta_queryPackages as queryPackages, meta_unassignProductInstanceFromSite as unassignProductInstanceFromSite };
1184
+ }
1185
+
1186
+ export { meta as packages };