@wix/auto_sdk_ecom_subscription-contracts 1.0.146 → 1.0.147

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.
@@ -6,7 +6,7 @@ import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types';
6
6
  *
7
7
  * A subscription contract is created when a buyer checks out with a subscription item. Each billing cycle, an order is created from the contract's current content. The order's `lineItems.subscriptionInfo.id` holds the contract ID, and `lineItems.subscriptionInfo.cycleNumber` holds the billing cycle the order is for.
8
8
  *
9
- * To change a subscription contract, create a draft subscription contract, edit it, and commit it.
9
+ * To change a subscription contract, create a [draft subscription contract](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/subscriptions/draft-subscription-contracts/introduction), edit it, and commit it.
10
10
  */
11
11
  interface SubscriptionContract {
12
12
  /**
@@ -190,9 +190,13 @@ interface V1SubscriptionSettings {
190
190
  }
191
191
  declare enum SubscriptionFrequency {
192
192
  UNDEFINED = "UNDEFINED",
193
+ /** Day. */
193
194
  DAY = "DAY",
195
+ /** Week. */
194
196
  WEEK = "WEEK",
197
+ /** Month. */
195
198
  MONTH = "MONTH",
199
+ /** Year. */
196
200
  YEAR = "YEAR"
197
201
  }
198
202
  /** @enumType */
@@ -757,10 +761,16 @@ interface DigitalFile {
757
761
  interface SubscriptionInfo {
758
762
  /**
759
763
  * Subscription ID.
764
+ *
765
+ * For a subscription bought through Wix eCommerce, this is the ID of the subscription contract the order was created from.
766
+ * To retrieve the subscription contract, call [Get Subscription Contract](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/subscriptions/subscription-contracts/get-subscription-contract).
760
767
  * @format GUID
761
768
  */
762
769
  _id?: string | null;
763
- /** Subscription cycle. For example, if this order is for the 3rd cycle of a subscription, value will be `3`. */
770
+ /**
771
+ * Billing cycle the order is for. For example, `3` for the third billing cycle of a subscription.
772
+ * When a subscription starts with a free trial, the order created at checkout is for cycle `0`.
773
+ */
764
774
  cycleNumber?: number;
765
775
  /**
766
776
  * Subscription option title. For example, `"Monthly coffee Subscription"`.
@@ -815,7 +825,7 @@ interface SubscriptionDescription {
815
825
  translated?: string | null;
816
826
  }
817
827
  interface SubscriptionSettings {
818
- /** Frequency of recurring payment. */
828
+ /** Frequency unit of the billing cycle. */
819
829
  frequency?: V2SubscriptionFrequencyWithLiterals;
820
830
  /**
821
831
  * Number of frequency units in a billing cycle. For example, frequency `MONTH` with interval `3` means billing every 3 months.
@@ -823,16 +833,20 @@ interface SubscriptionSettings {
823
833
  * @max 3650
824
834
  */
825
835
  interval?: number | null;
826
- /** Whether subscription is renewed automatically at the end of each period. */
836
+ /** Whether the subscription renews automatically at the end of each billing cycle. */
827
837
  autoRenewal?: boolean;
828
838
  /**
829
- * Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`.
839
+ * Number of billing cycles before the subscription ends. Ignored when `autoRenewal` is `true`.
830
840
  * @min 1
831
841
  */
832
842
  billingCycles?: number | null;
833
- /** Whether to allow the customer to cancel the subscription. */
843
+ /** Whether the buyer can cancel the subscription. */
834
844
  enableCustomerCancellation?: boolean;
835
- /** Period until first cycle starts. If None => no free trial */
845
+ /**
846
+ * Free trial period before the first billing cycle starts.
847
+ *
848
+ * Returned only when the subscription has a free trial.
849
+ */
836
850
  freeTrialPeriod?: FreeTrialPeriod;
837
851
  }
838
852
  /** Frequency unit of recurring payment */
@@ -846,7 +860,7 @@ declare enum V2SubscriptionFrequency {
846
860
  /** @enumType */
847
861
  type V2SubscriptionFrequencyWithLiterals = V2SubscriptionFrequency | 'UNDEFINED' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
848
862
  interface FreeTrialPeriod {
849
- /** Frequency of period. Values: DAY, WEEK, MONTH, YEAR */
863
+ /** Frequency unit of the free trial period. */
850
864
  frequency?: V2SubscriptionFrequencyWithLiterals;
851
865
  /**
852
866
  * Number of frequency units in the free trial period. For example, frequency `MONTH` with interval `3` means a 3-month free trial.
@@ -2334,7 +2348,7 @@ interface SubscriptionContractChangesCommitted {
2334
2348
  * @maxLength 200
2335
2349
  */
2336
2350
  reason?: string | null;
2337
- /** Price summary of the contract after the commit. */
2351
+ /** Price summary of the subscription contract after the commit. Same as `changes.priceSummary`. */
2338
2352
  priceSummary?: PriceSummary;
2339
2353
  }
2340
2354
  interface SubscriptionContractDiffs {
@@ -2361,7 +2375,7 @@ interface SubscriptionContractDiffs {
2361
2375
  additionalFees?: AdditionalFeeDelta[];
2362
2376
  /** Price summary after the changes. Replaces the subscription contract's previous price summary. */
2363
2377
  priceSummary?: PriceSummary;
2364
- /** Tax information after the changes. Replaces the subscription contract's previous tax information. */
2378
+ /** Tax information after the changes. */
2365
2379
  taxInfo?: OrderTaxInfo;
2366
2380
  /** Shipping information after the changes. Replaces the subscription contract's previous shipping information. */
2367
2381
  shippingInfo?: ShippingInformation;
@@ -2384,104 +2398,104 @@ interface LineItemDeltaDeltaDetailsOneOf {
2384
2398
  /** Values the line item had before the change. */
2385
2399
  changed?: ItemChangedDetails;
2386
2400
  }
2387
- /** The catalog reference options before the change. */
2401
+ /** Catalog reference options before the change. */
2388
2402
  interface CatalogReferenceOptionsBeforeChange {
2389
- /** The catalog reference options. Absent when the line item had no options. */
2403
+ /** Catalog reference options. Absent when the line item had no options. */
2390
2404
  options?: Record<string, any> | null;
2391
2405
  }
2392
- /** The product name before the change. */
2406
+ /** Product name before the change. */
2393
2407
  interface ProductNameBeforeChange {
2394
- /** The product name. Absent when the line item had no product name. */
2408
+ /** Product name. Absent when the line item had no product name. */
2395
2409
  productName?: ProductName;
2396
2410
  }
2397
- /** The description lines before the change. */
2411
+ /** Description lines before the change. */
2398
2412
  interface DescriptionLinesBeforeChange {
2399
2413
  /**
2400
- * The description lines. Empty when the line item had no description lines.
2414
+ * Description lines. Empty when the line item had no description lines.
2401
2415
  * @maxSize 20
2402
2416
  */
2403
2417
  descriptionLines?: DescriptionLine[];
2404
2418
  }
2405
- /** The image before the change. */
2419
+ /** Image before the change. */
2406
2420
  interface ImageBeforeChange {
2407
- /** The image. Absent when the line item had no image. */
2421
+ /** Image. Absent when the line item had no image. */
2408
2422
  image?: string;
2409
2423
  }
2410
- /** The physical properties before the change. */
2424
+ /** Physical properties before the change. */
2411
2425
  interface PhysicalPropertiesBeforeChange {
2412
- /** The physical properties. Absent when the line item had no physical properties. */
2426
+ /** Physical properties. Absent when the line item had no physical properties. */
2413
2427
  physicalProperties?: PhysicalProperties;
2414
2428
  }
2415
- /** The item type before the change. */
2429
+ /** Item type before the change. */
2416
2430
  interface ItemTypeBeforeChange {
2417
- /** The item type. Absent when the line item had no item type. */
2431
+ /** Item type. Absent when the line item had no item type. */
2418
2432
  itemType?: ItemType;
2419
2433
  }
2420
- /** The fulfiller ID before the change. */
2434
+ /** Fulfiller ID before the change. */
2421
2435
  interface FulfillerIdBeforeChange {
2422
2436
  /**
2423
- * The fulfiller ID. Absent when the line item had no fulfiller.
2437
+ * Fulfiller ID. Absent when the line item had no fulfiller.
2424
2438
  * @format GUID
2425
2439
  */
2426
2440
  fulfillerId?: string | null;
2427
2441
  }
2428
- /** The digital file before the change. */
2442
+ /** Digital file before the change. */
2429
2443
  interface DigitalFileBeforeChange {
2430
- /** The digital file. Absent when the line item had no digital file. */
2444
+ /** Digital file. Absent when the line item had no digital file. */
2431
2445
  digitalFile?: DigitalFile;
2432
2446
  }
2433
- /** The price description before the change. */
2447
+ /** Price description before the change. */
2434
2448
  interface PriceDescriptionBeforeChange {
2435
- /** The price description. Absent when the line item had no price description. */
2449
+ /** Price description. Absent when the line item had no price description. */
2436
2450
  priceDescription?: PriceDescription;
2437
2451
  }
2438
- /** The delivery profile ID before the change. */
2452
+ /** Delivery profile ID before the change. */
2439
2453
  interface DeliveryProfileIdBeforeChange {
2440
2454
  /**
2441
- * The delivery profile ID. Absent when the line item had no delivery profile.
2455
+ * Delivery profile ID. Absent when the line item had no delivery profile.
2442
2456
  * @format GUID
2443
2457
  */
2444
2458
  deliveryProfileId?: string | null;
2445
2459
  }
2446
- /** The shipping group ID before the change. */
2460
+ /** Shipping group ID before the change. */
2447
2461
  interface ShippingGroupIdBeforeChange {
2448
2462
  /**
2449
- * The shipping group ID. Absent when the line item had no shipping group.
2463
+ * Shipping group ID. Absent when the line item had no shipping group.
2450
2464
  * @format GUID
2451
2465
  */
2452
2466
  shippingGroupId?: string | null;
2453
2467
  }
2454
- /** The tax info before the change. */
2468
+ /** Tax info before the change. */
2455
2469
  interface TaxInfoBeforeChange {
2456
- /** The tax info. Absent when the line item had no tax info. */
2470
+ /** Tax info. Absent when the line item had no tax info. */
2457
2471
  taxInfo?: LineItemTaxInfo;
2458
2472
  }
2459
- /** The inventory app ID before the change. */
2473
+ /** Inventory app ID before the change. */
2460
2474
  interface InventoryAppIdBeforeChange {
2461
2475
  /**
2462
- * The inventory app ID. Absent when the line item had no inventory app.
2476
+ * Inventory app ID. Absent when the line item had no inventory app.
2463
2477
  * @format GUID
2464
2478
  */
2465
2479
  inventoryAppId?: string | null;
2466
2480
  }
2467
- /** The root catalog item ID before the change. */
2481
+ /** Root catalog item ID before the change. */
2468
2482
  interface RootCatalogItemIdBeforeChange {
2469
2483
  /**
2470
- * The root catalog item ID. Absent when the line item had no root catalog item.
2484
+ * Root catalog item ID. Absent when the line item had no root catalog item.
2471
2485
  * @minLength 1
2472
2486
  * @maxLength 36
2473
2487
  */
2474
2488
  rootCatalogItemId?: string | null;
2475
2489
  }
2476
- /** The modifier groups before the change. */
2490
+ /** Modifier groups before the change. */
2477
2491
  interface ModifierGroupsBeforeChange {
2478
2492
  /**
2479
- * The modifier groups. Empty when the line item had no modifier groups.
2493
+ * Modifier groups. Empty when the line item had no modifier groups.
2480
2494
  * @maxSize 10
2481
2495
  */
2482
2496
  modifierGroups?: ModifierGroup[];
2483
2497
  }
2484
- /** The price undetermined flag before the change. */
2498
+ /** Price undetermined flag before the change. */
2485
2499
  interface PriceUndeterminedBeforeChange {
2486
2500
  /** Whether the price of the line item was undetermined. */
2487
2501
  priceUndetermined?: boolean;
@@ -2501,36 +2515,36 @@ declare enum ChangeType {
2501
2515
  type ChangeTypeWithLiterals = ChangeType | 'UNKNOWN_CHANGE_TYPE' | 'ADDED' | 'CHANGED' | 'REMOVED';
2502
2516
  interface ItemChangedDetails {
2503
2517
  /**
2504
- * The quantity before the change. Set only when the quantity changed.
2518
+ * Quantity before the change. Set only when the quantity changed.
2505
2519
  * @min 1
2506
2520
  * @max 1000000
2507
2521
  */
2508
2522
  quantityBeforeChange?: number | null;
2509
- /** The price before the change. Set only when the price changed. */
2523
+ /** Price before the change. Set only when the price changed. */
2510
2524
  priceBeforeChange?: Price;
2511
- /** The catalog reference options before the change. Set only when the catalog reference options changed. */
2525
+ /** Catalog reference options before the change. Set only when the catalog reference options changed. */
2512
2526
  catalogReferenceOptionsBeforeChange?: CatalogReferenceOptionsBeforeChange;
2513
- /** The product name before the change. Set only when the product name changed. */
2527
+ /** Product name before the change. Set only when the product name changed. */
2514
2528
  productNameBeforeChange?: ProductNameBeforeChange;
2515
- /** The description lines before the change. Set only when the description lines changed. */
2529
+ /** Description lines before the change. Set only when the description lines changed. */
2516
2530
  descriptionLinesBeforeChange?: DescriptionLinesBeforeChange;
2517
- /** The image before the change. Set only when the image changed. */
2531
+ /** Image before the change. Set only when the image changed. */
2518
2532
  imageBeforeChange?: ImageBeforeChange;
2519
- /** The physical properties before the change. Set only when the physical properties changed. */
2533
+ /** Physical properties before the change. Set only when the physical properties changed. */
2520
2534
  physicalPropertiesBeforeChange?: PhysicalPropertiesBeforeChange;
2521
- /** The item type before the change. Set only when the item type changed. */
2535
+ /** Item type before the change. Set only when the item type changed. */
2522
2536
  itemTypeBeforeChange?: ItemTypeBeforeChange;
2523
- /** The fulfiller ID before the change. Set only when the fulfiller ID changed. */
2537
+ /** Fulfiller ID before the change. Set only when the fulfiller ID changed. */
2524
2538
  fulfillerIdBeforeChange?: FulfillerIdBeforeChange;
2525
- /** The digital file before the change. Set only when the digital file changed. */
2539
+ /** Digital file before the change. Set only when the digital file changed. */
2526
2540
  digitalFileBeforeChange?: DigitalFileBeforeChange;
2527
- /** The price description before the change. Set only when the price description changed. */
2541
+ /** Price description before the change. Set only when the price description changed. */
2528
2542
  priceDescriptionBeforeChange?: PriceDescriptionBeforeChange;
2529
- /** The tax info before the change. Set only when the line item's tax group changed because its catalog options changed. */
2543
+ /** Tax info before the change. Set only when the line item's tax group changed. */
2530
2544
  taxInfoBeforeChange?: TaxInfoBeforeChange;
2531
- /** The modifier groups before the change. Set only when the modifier groups changed. */
2545
+ /** Modifier groups before the change. Set only when the modifier groups changed. */
2532
2546
  modifierGroupsBeforeChange?: ModifierGroupsBeforeChange;
2533
- /** The price undetermined flag before the change. Set only when the price undetermined flag changed. */
2547
+ /** Price undetermined flag before the change. Set only when the price undetermined flag changed. */
2534
2548
  priceUndeterminedBeforeChange?: PriceUndeterminedBeforeChange;
2535
2549
  }
2536
2550
  interface AppliedDiscountDelta extends AppliedDiscountDeltaDeltaDetailsOneOf {