@wix/auto_sdk_ecom_cart 1.0.180 → 1.0.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +331 -526
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +127 -56
- package/build/cjs/index.typings.js +235 -439
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +127 -56
- package/build/cjs/meta.js +154 -337
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.mjs +331 -526
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +127 -56
- package/build/es/index.typings.mjs +235 -439
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +127 -56
- package/build/es/meta.mjs +154 -337
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +135 -60
- package/build/internal/cjs/meta.d.ts +135 -60
- package/build/internal/es/index.typings.d.mts +135 -60
- package/build/internal/es/meta.d.mts +135 -60
- package/package.json +2 -2
|
@@ -2407,29 +2407,31 @@ interface Membership {
|
|
|
2407
2407
|
}
|
|
2408
2408
|
interface MembershipName {
|
|
2409
2409
|
/**
|
|
2410
|
-
* Membership name.
|
|
2410
|
+
* Membership name in the site's original language.
|
|
2411
2411
|
* @maxLength 100
|
|
2412
2412
|
*/
|
|
2413
2413
|
original?: string;
|
|
2414
2414
|
/**
|
|
2415
|
-
*
|
|
2415
|
+
* Membership name translated into the buyer's language.
|
|
2416
|
+
*
|
|
2417
|
+
* Default: The value of `original`
|
|
2416
2418
|
* @maxLength 100
|
|
2417
2419
|
*/
|
|
2418
2420
|
translated?: string | null;
|
|
2419
2421
|
}
|
|
2420
2422
|
interface MembershipPaymentCredits {
|
|
2421
2423
|
/**
|
|
2422
|
-
* Membership's initial
|
|
2424
|
+
* Membership's initial balance.
|
|
2423
2425
|
* @min 1
|
|
2424
2426
|
*/
|
|
2425
2427
|
total?: number;
|
|
2426
|
-
/** Membership's remaining
|
|
2428
|
+
/** Membership's remaining balance. */
|
|
2427
2429
|
remaining?: number;
|
|
2428
2430
|
}
|
|
2429
2431
|
declare enum BalanceType {
|
|
2430
|
-
/** Balance is measured in discrete uses
|
|
2432
|
+
/** Balance is measured in discrete uses, such as sessions or visits. */
|
|
2431
2433
|
PUNCH_CARD = "PUNCH_CARD",
|
|
2432
|
-
/** Balance is measured in a currency-like value
|
|
2434
|
+
/** Balance is measured in a currency-like value, such as points. */
|
|
2433
2435
|
CREDIT = "CREDIT"
|
|
2434
2436
|
}
|
|
2435
2437
|
/** @enumType */
|
|
@@ -2444,25 +2446,26 @@ interface InvalidMembership {
|
|
|
2444
2446
|
*/
|
|
2445
2447
|
reason?: string;
|
|
2446
2448
|
}
|
|
2447
|
-
/** Same shape as `ListExistingMembershipsResponse.memberships`. */
|
|
2449
|
+
/** The validated existing memberships. Same shape as `ListExistingMembershipsResponse.memberships`. */
|
|
2448
2450
|
interface ValidatedExistingMemberships {
|
|
2449
2451
|
/**
|
|
2450
|
-
* The selected memberships, each paired with the line items it can
|
|
2452
|
+
* The selected memberships, each paired with the line items it can pay for and the cost to redeem
|
|
2453
|
+
* each.
|
|
2451
2454
|
* @maxSize 300
|
|
2452
2455
|
*/
|
|
2453
2456
|
memberships?: ExistingMembership[];
|
|
2454
2457
|
}
|
|
2455
2458
|
/**
|
|
2456
|
-
* A membership the member
|
|
2459
|
+
* A membership the member owns, together with the given line items it can pay for.
|
|
2457
2460
|
*
|
|
2458
|
-
* A membership is a single benefit granted by a plan the member has already paid for, so coverage
|
|
2459
|
-
* nested here
|
|
2461
|
+
* A membership is a single benefit granted by a plan the member has already paid for, so its coverage
|
|
2462
|
+
* is nested directly here. No `benefitId` link is needed, unlike a plan that grants several benefits.
|
|
2460
2463
|
*/
|
|
2461
2464
|
interface ExistingMembership {
|
|
2462
2465
|
/** The membership the member owns. */
|
|
2463
2466
|
membership?: V1Membership;
|
|
2464
2467
|
/**
|
|
2465
|
-
*
|
|
2468
|
+
* Line items this membership can pay for, and the cost to redeem each.
|
|
2466
2469
|
* @maxSize 300
|
|
2467
2470
|
*/
|
|
2468
2471
|
coveredLineItems?: CoveredLineItem[];
|
|
@@ -2477,11 +2480,10 @@ interface V1Membership {
|
|
|
2477
2480
|
/** Membership name. */
|
|
2478
2481
|
name?: MembershipName;
|
|
2479
2482
|
/**
|
|
2480
|
-
* Deprecated. Use `ExistingMembership.
|
|
2483
|
+
* Deprecated. Use `ExistingMembership.coveredLineItems` to see which line items this membership
|
|
2484
|
+
* covers.
|
|
2481
2485
|
*
|
|
2482
|
-
* Populate this only in the legacy
|
|
2483
|
-
* membership that omits it. Leave it empty everywhere else - `ListMembershipsByIds` receives no line items
|
|
2484
|
-
* at all, so there is nothing to report there.
|
|
2486
|
+
* Populate this only in the legacy [List Eligible Memberships](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/memberships/memberships-service-plugin/list-eligible-memberships) flow, which still requires it and rejects a membership that omits it. Leave it empty everywhere else. [List Memberships By IDs](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/memberships/memberships-service-plugin/list-memberships-by-ids) receives no line items at all, so there's nothing to report there.
|
|
2485
2487
|
* @maxSize 300
|
|
2486
2488
|
* @minLength 1
|
|
2487
2489
|
* @maxLength 100
|
|
@@ -2490,12 +2492,18 @@ interface V1Membership {
|
|
|
2490
2492
|
* @targetRemovalDate 2026-08-30
|
|
2491
2493
|
*/
|
|
2492
2494
|
lineItemIds?: string[];
|
|
2493
|
-
/**
|
|
2495
|
+
/**
|
|
2496
|
+
* Membership's balance.
|
|
2497
|
+
*
|
|
2498
|
+
* Omit this field for an unlimited membership, which has no balance to draw down. Every
|
|
2499
|
+
* `ExistingMembership.coveredLineItems.redemptionCost` is then `0`. Unlike a plan's benefit, a
|
|
2500
|
+
* membership carries no explicit unlimited marker: the absence of a balance is the marker.
|
|
2501
|
+
*/
|
|
2494
2502
|
credits?: MembershipPaymentCredits;
|
|
2495
|
-
/**
|
|
2503
|
+
/** Date and time the membership expires. */
|
|
2496
2504
|
expirationDate?: Date | null;
|
|
2497
2505
|
/**
|
|
2498
|
-
* Deprecated. Use `
|
|
2506
|
+
* Deprecated. Use `offeringDescription` for human-readable data about the offering.
|
|
2499
2507
|
* @deprecated
|
|
2500
2508
|
* @replacedBy offering_description
|
|
2501
2509
|
* @targetRemovalDate 2026-08-30
|
|
@@ -2505,18 +2513,21 @@ interface V1Membership {
|
|
|
2505
2513
|
/** A line item a membership can pay for, and the cost to redeem it. */
|
|
2506
2514
|
interface CoveredLineItem {
|
|
2507
2515
|
/**
|
|
2508
|
-
*
|
|
2516
|
+
* ID of the line item this membership can pay for. Matches the `id` of one of the given line items.
|
|
2509
2517
|
* @minLength 1
|
|
2510
2518
|
* @maxLength 100
|
|
2511
2519
|
*/
|
|
2512
2520
|
lineItemId?: string;
|
|
2513
2521
|
/**
|
|
2514
|
-
*
|
|
2515
|
-
*
|
|
2522
|
+
* Amount deducted from the membership's remaining balance (`credits.remaining`) when this line item
|
|
2523
|
+
* is redeemed.
|
|
2524
|
+
*
|
|
2525
|
+
* Always `0` for an unlimited membership, which is expressed by omitting `credits` and decrements
|
|
2526
|
+
* nothing.
|
|
2516
2527
|
*/
|
|
2517
2528
|
redemptionCost?: number;
|
|
2518
2529
|
}
|
|
2519
|
-
/** Same shape as `ListPurchasablePlansResponse`. */
|
|
2530
|
+
/** The validated purchasable plans. Same shape as `ListPurchasablePlansResponse`. */
|
|
2520
2531
|
interface ValidatedPurchasablePlans {
|
|
2521
2532
|
/**
|
|
2522
2533
|
* The selected plans.
|
|
@@ -2524,68 +2535,109 @@ interface ValidatedPurchasablePlans {
|
|
|
2524
2535
|
*/
|
|
2525
2536
|
purchasablePlans?: PurchasablePlan[];
|
|
2526
2537
|
/**
|
|
2527
|
-
* How the plans' benefits cover the line items,
|
|
2538
|
+
* How the plans' benefits cover the line items, each entry naming its benefit by `benefitId`.
|
|
2528
2539
|
* @maxSize 300
|
|
2529
2540
|
*/
|
|
2530
2541
|
coverages?: LineItemCoverage[];
|
|
2531
2542
|
}
|
|
2532
2543
|
interface PurchasablePlan {
|
|
2533
|
-
/**
|
|
2544
|
+
/**
|
|
2545
|
+
* Catalog and item reference identifying both the plan and the pricing variant.
|
|
2546
|
+
*
|
|
2547
|
+
* A purchasable plan has no ID of its own. The reference carries the plan in `catalogItemId` and
|
|
2548
|
+
* the chosen pricing variant in `options`, so the same plan appears once per variant with a
|
|
2549
|
+
* different reference each time. The plan ID alone repeats across entries; the full reference
|
|
2550
|
+
* doesn't.
|
|
2551
|
+
*
|
|
2552
|
+
* When the plan needs nothing further from the buyer, the reference can be added to the cart as it
|
|
2553
|
+
* stands. When it does, for example a plan carrying a form, a custom start date, or a buyer-chosen
|
|
2554
|
+
* price, the reference has to be completed with that input first. See `infoCollectionUrl`.
|
|
2555
|
+
*/
|
|
2534
2556
|
catalogReference?: CatalogReference;
|
|
2535
2557
|
/** Plan name. */
|
|
2536
2558
|
name?: MembershipName;
|
|
2537
2559
|
/**
|
|
2538
|
-
* Benefits the plan
|
|
2560
|
+
* Benefits the plan grants once purchased.
|
|
2561
|
+
*
|
|
2562
|
+
* A plan can grant several, for example a bundle granting separate yoga and pilates credits. Each
|
|
2563
|
+
* benefit becomes its own membership after purchase.
|
|
2539
2564
|
* @minSize 1
|
|
2540
2565
|
* @maxSize 50
|
|
2541
2566
|
*/
|
|
2542
2567
|
benefits?: Benefit[];
|
|
2543
2568
|
/**
|
|
2544
|
-
* Human-readable
|
|
2569
|
+
* Human-readable summary of what the plan offers, for display. For example, `8 yoga classes and 4
|
|
2570
|
+
* pilates classes, billed monthly`.
|
|
2571
|
+
*
|
|
2572
|
+
* Describe the offering here and the price in `priceDescription`.
|
|
2545
2573
|
* @maxLength 500
|
|
2546
2574
|
*/
|
|
2547
2575
|
offeringDescription?: string | null;
|
|
2548
2576
|
/**
|
|
2549
|
-
* URL the
|
|
2577
|
+
* URL of the page that collects the extra input this plan needs before it can be purchased.
|
|
2578
|
+
*
|
|
2579
|
+
* Return it only for a plan that needs more from the buyer, such as one carrying a form, a custom
|
|
2580
|
+
* start date, or a buyer-chosen price. Omitting it means the plan needs nothing further, and the
|
|
2581
|
+
* caller builds the cart itself.
|
|
2582
|
+
*
|
|
2583
|
+
* The buyer reaches this page before any cart exists, rather than from the checkout page, and
|
|
2584
|
+
* there's no return trip. The page receives the caller's already-created items, then builds the
|
|
2585
|
+
* cart and checkout from the plan plus those items. There's no return URL, no cart ID, no
|
|
2586
|
+
* preserved selection, and no completion signal: the purchase reaches Wix through the ordinary
|
|
2587
|
+
* checkout and order flow, and the membership through Membership Ready To Be Charged.
|
|
2588
|
+
*
|
|
2589
|
+
* The page covers a single plan. Items that plan covers can be mixed with directly-paid ones, but
|
|
2590
|
+
* a selection spanning two plans isn't supported here.
|
|
2550
2591
|
* @format WEB_URL
|
|
2551
2592
|
*/
|
|
2552
2593
|
infoCollectionUrl?: string | null;
|
|
2553
2594
|
/**
|
|
2554
|
-
* Plan price.
|
|
2595
|
+
* Plan price, in the plan's own configured currency.
|
|
2596
|
+
*
|
|
2597
|
+
* No currency accompanies the amount and none is converted, so prices from different plans aren't
|
|
2598
|
+
* comparable and the currency reaches the buyer only through `priceDescription`. Name the currency
|
|
2599
|
+
* there.
|
|
2555
2600
|
* @decimalValue options { gte:0, maxScale:3 }
|
|
2556
2601
|
*/
|
|
2557
2602
|
price?: string;
|
|
2558
2603
|
/**
|
|
2559
|
-
* Human-readable
|
|
2604
|
+
* Human-readable summary of the plan price, for display. For example, `First month free, then
|
|
2605
|
+
* $20/month`.
|
|
2560
2606
|
*
|
|
2561
|
-
* `price`
|
|
2562
|
-
*
|
|
2607
|
+
* Use `price` for the bare amount, which is what sorting and comparison rely on, and this field for
|
|
2608
|
+
* pricing a buyer needs prose to understand.
|
|
2563
2609
|
* @maxLength 500
|
|
2564
2610
|
*/
|
|
2565
2611
|
priceDescription?: string | null;
|
|
2566
2612
|
}
|
|
2567
2613
|
/**
|
|
2568
|
-
* A single redeemable benefit
|
|
2569
|
-
*
|
|
2614
|
+
* A single redeemable benefit granted by a plan.
|
|
2615
|
+
*
|
|
2616
|
+
* A purchasable plan grants one or more benefits in `benefits`. Once the plan is paid for, each benefit
|
|
2617
|
+
* becomes its own membership, charged by `membershipId`.
|
|
2570
2618
|
*/
|
|
2571
2619
|
interface Benefit extends BenefitQuotaOneOf {
|
|
2572
2620
|
limitedQuota?: LimitedQuota;
|
|
2573
2621
|
/**
|
|
2574
|
-
* Identifier for this benefit
|
|
2575
|
-
*
|
|
2622
|
+
* Identifier for this benefit, unique within its plan.
|
|
2623
|
+
*
|
|
2624
|
+
* Not unique across the response. A plan is returned once per pricing variant, and every variant
|
|
2625
|
+
* repeats that plan's benefit IDs. Two different plans can also share an ID when they grant the
|
|
2626
|
+
* same benefit, and a coverage entry naming it is then true for both.
|
|
2627
|
+
*
|
|
2628
|
+
* Never give two different benefits the same ID. That's the one case a caller can't recover from,
|
|
2629
|
+
* because a cost computed for one benefit would be applied to the other.
|
|
2576
2630
|
* @minLength 1
|
|
2577
2631
|
* @maxLength 200
|
|
2578
2632
|
*/
|
|
2579
2633
|
benefitId?: string;
|
|
2580
2634
|
/**
|
|
2581
|
-
* Human-readable label for this benefit
|
|
2635
|
+
* Human-readable label for this benefit. For example, `Manicure` or `Pedicure` on a multi-set
|
|
2636
|
+
* punch card.
|
|
2582
2637
|
* @maxLength 200
|
|
2583
2638
|
*/
|
|
2584
2639
|
label?: string | null;
|
|
2585
|
-
/**
|
|
2586
|
-
* The kind of quota this benefit grants: a countable amount drawn down on redemption (`LIMITED`),
|
|
2587
|
-
* or an unbounded amount that is never drawn down (`UNLIMITED`).
|
|
2588
|
-
*/
|
|
2640
|
+
/** Kind of quota this benefit grants. */
|
|
2589
2641
|
quotaType?: QuotaTypeWithLiterals;
|
|
2590
2642
|
}
|
|
2591
2643
|
/** @oneof */
|
|
@@ -2593,9 +2645,9 @@ interface BenefitQuotaOneOf {
|
|
|
2593
2645
|
limitedQuota?: LimitedQuota;
|
|
2594
2646
|
}
|
|
2595
2647
|
declare enum QuotaType {
|
|
2596
|
-
/** The benefit grants a countable quota that
|
|
2648
|
+
/** The benefit grants a countable quota that's drawn down on redemption. */
|
|
2597
2649
|
LIMITED = "LIMITED",
|
|
2598
|
-
/** The benefit is unlimited
|
|
2650
|
+
/** The benefit is unlimited and is never drawn down. */
|
|
2599
2651
|
UNLIMITED = "UNLIMITED"
|
|
2600
2652
|
}
|
|
2601
2653
|
/** @enumType */
|
|
@@ -2603,45 +2655,64 @@ type QuotaTypeWithLiterals = QuotaType | 'LIMITED' | 'UNLIMITED';
|
|
|
2603
2655
|
/** A limited, countable redeemable amount. */
|
|
2604
2656
|
interface LimitedQuota {
|
|
2605
2657
|
/**
|
|
2606
|
-
*
|
|
2658
|
+
* Quota's initial value.
|
|
2607
2659
|
* @min 1
|
|
2608
2660
|
*/
|
|
2609
2661
|
total?: number;
|
|
2610
|
-
/**
|
|
2662
|
+
/** Quota's remaining value. */
|
|
2611
2663
|
remaining?: number;
|
|
2612
|
-
/**
|
|
2664
|
+
/**
|
|
2665
|
+
* How the quota is measured.
|
|
2666
|
+
*
|
|
2667
|
+
* The same vocabulary as `MembershipPaymentCredits.balanceType` on the existing-membership side.
|
|
2668
|
+
*/
|
|
2613
2669
|
limitedQuotaType?: LimitedQuotaTypeWithLiterals;
|
|
2614
2670
|
}
|
|
2615
2671
|
declare enum LimitedQuotaType {
|
|
2616
|
-
/** Quota is measured in discrete uses
|
|
2672
|
+
/** Quota is measured in discrete uses, such as sessions or visits. */
|
|
2617
2673
|
PUNCH_CARD = "PUNCH_CARD",
|
|
2618
|
-
/** Quota is measured in a currency-like value
|
|
2674
|
+
/** Quota is measured in a currency-like value, such as points. */
|
|
2619
2675
|
CREDIT = "CREDIT"
|
|
2620
2676
|
}
|
|
2621
2677
|
/** @enumType */
|
|
2622
2678
|
type LimitedQuotaTypeWithLiterals = LimitedQuotaType | 'PUNCH_CARD' | 'CREDIT';
|
|
2623
2679
|
/**
|
|
2624
|
-
* Maps a
|
|
2625
|
-
*
|
|
2626
|
-
*
|
|
2627
|
-
*
|
|
2680
|
+
* Maps one of a plan's benefits to a line item it can cover, and at what cost.
|
|
2681
|
+
*
|
|
2682
|
+
* One entry per benefit and line item pair, returned by [List Purchasable Plans](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/memberships/memberships-service-plugin/list-purchasable-plans) alongside `purchasablePlans`.
|
|
2683
|
+
*
|
|
2684
|
+
* An entry names a benefit and carries no plan identity, so match its `benefitId` against the
|
|
2685
|
+
* `benefits` of the returned plans and apply it to every entry that grants that benefit. Entries for
|
|
2686
|
+
* the same plan repeat it once per pricing variant, and two different plans sharing a benefit ID
|
|
2687
|
+
* grant the same benefit, so the entry holds for each of them. A caller that stops at the first
|
|
2688
|
+
* match shows nothing incorrect, but hides the other entries, which cover the item too.
|
|
2689
|
+
*
|
|
2690
|
+
* The cost is identical across a plan's variants, so there's one entry per benefit rather than one
|
|
2691
|
+
* per variant.
|
|
2692
|
+
*
|
|
2693
|
+
* For memberships the member already owns, the equivalent mapping is
|
|
2694
|
+
* `ExistingMembership.coveredLineItems`, which needs no `benefitId` because a membership is a single
|
|
2695
|
+
* benefit.
|
|
2628
2696
|
*/
|
|
2629
2697
|
interface LineItemCoverage {
|
|
2630
2698
|
/**
|
|
2631
|
-
*
|
|
2699
|
+
* ID of the benefit that covers the line item, as returned in `Benefit.benefitId`.
|
|
2700
|
+
*
|
|
2701
|
+
* Identifies a benefit within its plan, and repeats across that plan's pricing variants.
|
|
2632
2702
|
* @minLength 1
|
|
2633
2703
|
* @maxLength 200
|
|
2634
2704
|
*/
|
|
2635
2705
|
benefitId?: string;
|
|
2636
2706
|
/**
|
|
2637
|
-
*
|
|
2707
|
+
* ID of the line item this benefit covers.
|
|
2638
2708
|
* @minLength 1
|
|
2639
2709
|
* @maxLength 100
|
|
2640
2710
|
*/
|
|
2641
2711
|
lineItemId?: string;
|
|
2642
2712
|
/**
|
|
2643
|
-
*
|
|
2644
|
-
*
|
|
2713
|
+
* Amount deducted from the benefit's `limitedQuota.remaining` value when this line item is redeemed.
|
|
2714
|
+
*
|
|
2715
|
+
* Always `0` for an unlimited benefit, which decrements nothing.
|
|
2645
2716
|
*/
|
|
2646
2717
|
redemptionCost?: number;
|
|
2647
2718
|
}
|