@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
|
@@ -2872,27 +2872,29 @@ interface Membership {
|
|
|
2872
2872
|
}
|
|
2873
2873
|
interface MembershipName {
|
|
2874
2874
|
/**
|
|
2875
|
-
* Membership name.
|
|
2875
|
+
* Membership name in the site's original language.
|
|
2876
2876
|
* @maxLength 100
|
|
2877
2877
|
*/
|
|
2878
2878
|
original?: string;
|
|
2879
2879
|
/**
|
|
2880
|
-
*
|
|
2880
|
+
* Membership name translated into the buyer's language.
|
|
2881
|
+
*
|
|
2882
|
+
* Default: The value of `original`
|
|
2881
2883
|
* @maxLength 100
|
|
2882
2884
|
*/
|
|
2883
2885
|
translated?: string | null;
|
|
2884
2886
|
}
|
|
2885
2887
|
interface MembershipPaymentCredits {
|
|
2886
2888
|
/**
|
|
2887
|
-
* Membership's initial
|
|
2889
|
+
* Membership's initial balance.
|
|
2888
2890
|
* @min 1
|
|
2889
2891
|
*/
|
|
2890
2892
|
total?: number;
|
|
2891
|
-
/** Membership's remaining
|
|
2893
|
+
/** Membership's remaining balance. */
|
|
2892
2894
|
remaining?: number;
|
|
2893
2895
|
/**
|
|
2894
|
-
* Deprecated.
|
|
2895
|
-
*
|
|
2896
|
+
* Deprecated. Use `ExistingMembership.coveredLineItems`, which carries the redemption cost per line
|
|
2897
|
+
* item. A membership's balance no longer states a per-item cost of its own.
|
|
2896
2898
|
* @internal
|
|
2897
2899
|
* @deprecated
|
|
2898
2900
|
* @replacedBy ExistingMembership.covered_line_items.redemption_cost
|
|
@@ -2900,15 +2902,19 @@ interface MembershipPaymentCredits {
|
|
|
2900
2902
|
*/
|
|
2901
2903
|
redemptionCost?: number;
|
|
2902
2904
|
/**
|
|
2903
|
-
*
|
|
2905
|
+
* How the membership's balance is measured.
|
|
2906
|
+
*
|
|
2907
|
+
* The same vocabulary as `LimitedQuota.limitedQuotaType` on the purchasable-plan side. The two are
|
|
2908
|
+
* separate types only because this one serves the legacy flow and is left untouched until List
|
|
2909
|
+
* Eligible Memberships is removed.
|
|
2904
2910
|
* @internal
|
|
2905
2911
|
*/
|
|
2906
2912
|
balanceType?: BalanceTypeWithLiterals;
|
|
2907
2913
|
}
|
|
2908
2914
|
declare enum BalanceType {
|
|
2909
|
-
/** Balance is measured in discrete uses
|
|
2915
|
+
/** Balance is measured in discrete uses, such as sessions or visits. */
|
|
2910
2916
|
PUNCH_CARD = "PUNCH_CARD",
|
|
2911
|
-
/** Balance is measured in a currency-like value
|
|
2917
|
+
/** Balance is measured in a currency-like value, such as points. */
|
|
2912
2918
|
CREDIT = "CREDIT"
|
|
2913
2919
|
}
|
|
2914
2920
|
/** @enumType */
|
|
@@ -2923,25 +2929,26 @@ interface InvalidMembership {
|
|
|
2923
2929
|
*/
|
|
2924
2930
|
reason?: string;
|
|
2925
2931
|
}
|
|
2926
|
-
/** Same shape as `ListExistingMembershipsResponse.memberships`. */
|
|
2932
|
+
/** The validated existing memberships. Same shape as `ListExistingMembershipsResponse.memberships`. */
|
|
2927
2933
|
interface ValidatedExistingMemberships {
|
|
2928
2934
|
/**
|
|
2929
|
-
* The selected memberships, each paired with the line items it can
|
|
2935
|
+
* The selected memberships, each paired with the line items it can pay for and the cost to redeem
|
|
2936
|
+
* each.
|
|
2930
2937
|
* @maxSize 300
|
|
2931
2938
|
*/
|
|
2932
2939
|
memberships?: ExistingMembership[];
|
|
2933
2940
|
}
|
|
2934
2941
|
/**
|
|
2935
|
-
* A membership the member
|
|
2942
|
+
* A membership the member owns, together with the given line items it can pay for.
|
|
2936
2943
|
*
|
|
2937
|
-
* A membership is a single benefit granted by a plan the member has already paid for, so coverage
|
|
2938
|
-
* nested here
|
|
2944
|
+
* A membership is a single benefit granted by a plan the member has already paid for, so its coverage
|
|
2945
|
+
* is nested directly here. No `benefitId` link is needed, unlike a plan that grants several benefits.
|
|
2939
2946
|
*/
|
|
2940
2947
|
interface ExistingMembership {
|
|
2941
2948
|
/** The membership the member owns. */
|
|
2942
2949
|
membership?: V1Membership;
|
|
2943
2950
|
/**
|
|
2944
|
-
*
|
|
2951
|
+
* Line items this membership can pay for, and the cost to redeem each.
|
|
2945
2952
|
* @maxSize 300
|
|
2946
2953
|
*/
|
|
2947
2954
|
coveredLineItems?: CoveredLineItem[];
|
|
@@ -2956,11 +2963,10 @@ interface V1Membership {
|
|
|
2956
2963
|
/** Membership name. */
|
|
2957
2964
|
name?: MembershipName;
|
|
2958
2965
|
/**
|
|
2959
|
-
* Deprecated. Use `ExistingMembership.
|
|
2966
|
+
* Deprecated. Use `ExistingMembership.coveredLineItems` to see which line items this membership
|
|
2967
|
+
* covers.
|
|
2960
2968
|
*
|
|
2961
|
-
* Populate this only in the legacy
|
|
2962
|
-
* membership that omits it. Leave it empty everywhere else - `ListMembershipsByIds` receives no line items
|
|
2963
|
-
* at all, so there is nothing to report there.
|
|
2969
|
+
* 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.
|
|
2964
2970
|
* @maxSize 300
|
|
2965
2971
|
* @minLength 1
|
|
2966
2972
|
* @maxLength 100
|
|
@@ -2969,19 +2975,25 @@ interface V1Membership {
|
|
|
2969
2975
|
* @targetRemovalDate 2026-08-30
|
|
2970
2976
|
*/
|
|
2971
2977
|
lineItemIds?: string[];
|
|
2972
|
-
/**
|
|
2978
|
+
/**
|
|
2979
|
+
* Membership's balance.
|
|
2980
|
+
*
|
|
2981
|
+
* Omit this field for an unlimited membership, which has no balance to draw down. Every
|
|
2982
|
+
* `ExistingMembership.coveredLineItems.redemptionCost` is then `0`. Unlike a plan's benefit, a
|
|
2983
|
+
* membership carries no explicit unlimited marker: the absence of a balance is the marker.
|
|
2984
|
+
*/
|
|
2973
2985
|
credits?: MembershipPaymentCredits;
|
|
2974
|
-
/**
|
|
2986
|
+
/** Date and time the membership expires. */
|
|
2975
2987
|
expirationDate?: Date | null;
|
|
2976
2988
|
/**
|
|
2977
|
-
* Deprecated. Use `
|
|
2989
|
+
* Deprecated. Use `offeringDescription` for human-readable data about the offering.
|
|
2978
2990
|
* @deprecated
|
|
2979
2991
|
* @replacedBy offering_description
|
|
2980
2992
|
* @targetRemovalDate 2026-08-30
|
|
2981
2993
|
*/
|
|
2982
2994
|
additionalData?: Record<string, any> | null;
|
|
2983
2995
|
/**
|
|
2984
|
-
* Human-readable offering
|
|
2996
|
+
* Human-readable summary of the offering, for display. For example, its price and validity text.
|
|
2985
2997
|
* @internal
|
|
2986
2998
|
* @maxLength 500
|
|
2987
2999
|
*/
|
|
@@ -2990,18 +3002,21 @@ interface V1Membership {
|
|
|
2990
3002
|
/** A line item a membership can pay for, and the cost to redeem it. */
|
|
2991
3003
|
interface CoveredLineItem {
|
|
2992
3004
|
/**
|
|
2993
|
-
*
|
|
3005
|
+
* ID of the line item this membership can pay for. Matches the `id` of one of the given line items.
|
|
2994
3006
|
* @minLength 1
|
|
2995
3007
|
* @maxLength 100
|
|
2996
3008
|
*/
|
|
2997
3009
|
lineItemId?: string;
|
|
2998
3010
|
/**
|
|
2999
|
-
*
|
|
3000
|
-
*
|
|
3011
|
+
* Amount deducted from the membership's remaining balance (`credits.remaining`) when this line item
|
|
3012
|
+
* is redeemed.
|
|
3013
|
+
*
|
|
3014
|
+
* Always `0` for an unlimited membership, which is expressed by omitting `credits` and decrements
|
|
3015
|
+
* nothing.
|
|
3001
3016
|
*/
|
|
3002
3017
|
redemptionCost?: number;
|
|
3003
3018
|
}
|
|
3004
|
-
/** Same shape as `ListPurchasablePlansResponse`. */
|
|
3019
|
+
/** The validated purchasable plans. Same shape as `ListPurchasablePlansResponse`. */
|
|
3005
3020
|
interface ValidatedPurchasablePlans {
|
|
3006
3021
|
/**
|
|
3007
3022
|
* The selected plans.
|
|
@@ -3009,68 +3024,109 @@ interface ValidatedPurchasablePlans {
|
|
|
3009
3024
|
*/
|
|
3010
3025
|
purchasablePlans?: PurchasablePlan[];
|
|
3011
3026
|
/**
|
|
3012
|
-
* How the plans' benefits cover the line items,
|
|
3027
|
+
* How the plans' benefits cover the line items, each entry naming its benefit by `benefitId`.
|
|
3013
3028
|
* @maxSize 300
|
|
3014
3029
|
*/
|
|
3015
3030
|
coverages?: LineItemCoverage[];
|
|
3016
3031
|
}
|
|
3017
3032
|
interface PurchasablePlan {
|
|
3018
|
-
/**
|
|
3033
|
+
/**
|
|
3034
|
+
* Catalog and item reference identifying both the plan and the pricing variant.
|
|
3035
|
+
*
|
|
3036
|
+
* A purchasable plan has no ID of its own. The reference carries the plan in `catalogItemId` and
|
|
3037
|
+
* the chosen pricing variant in `options`, so the same plan appears once per variant with a
|
|
3038
|
+
* different reference each time. The plan ID alone repeats across entries; the full reference
|
|
3039
|
+
* doesn't.
|
|
3040
|
+
*
|
|
3041
|
+
* When the plan needs nothing further from the buyer, the reference can be added to the cart as it
|
|
3042
|
+
* stands. When it does, for example a plan carrying a form, a custom start date, or a buyer-chosen
|
|
3043
|
+
* price, the reference has to be completed with that input first. See `infoCollectionUrl`.
|
|
3044
|
+
*/
|
|
3019
3045
|
catalogReference?: CatalogReference;
|
|
3020
3046
|
/** Plan name. */
|
|
3021
3047
|
name?: MembershipName;
|
|
3022
3048
|
/**
|
|
3023
|
-
* Benefits the plan
|
|
3049
|
+
* Benefits the plan grants once purchased.
|
|
3050
|
+
*
|
|
3051
|
+
* A plan can grant several, for example a bundle granting separate yoga and pilates credits. Each
|
|
3052
|
+
* benefit becomes its own membership after purchase.
|
|
3024
3053
|
* @minSize 1
|
|
3025
3054
|
* @maxSize 50
|
|
3026
3055
|
*/
|
|
3027
3056
|
benefits?: Benefit[];
|
|
3028
3057
|
/**
|
|
3029
|
-
* Human-readable
|
|
3058
|
+
* Human-readable summary of what the plan offers, for display. For example, `8 yoga classes and 4
|
|
3059
|
+
* pilates classes, billed monthly`.
|
|
3060
|
+
*
|
|
3061
|
+
* Describe the offering here and the price in `priceDescription`.
|
|
3030
3062
|
* @maxLength 500
|
|
3031
3063
|
*/
|
|
3032
3064
|
offeringDescription?: string | null;
|
|
3033
3065
|
/**
|
|
3034
|
-
* URL the
|
|
3066
|
+
* URL of the page that collects the extra input this plan needs before it can be purchased.
|
|
3067
|
+
*
|
|
3068
|
+
* Return it only for a plan that needs more from the buyer, such as one carrying a form, a custom
|
|
3069
|
+
* start date, or a buyer-chosen price. Omitting it means the plan needs nothing further, and the
|
|
3070
|
+
* caller builds the cart itself.
|
|
3071
|
+
*
|
|
3072
|
+
* The buyer reaches this page before any cart exists, rather than from the checkout page, and
|
|
3073
|
+
* there's no return trip. The page receives the caller's already-created items, then builds the
|
|
3074
|
+
* cart and checkout from the plan plus those items. There's no return URL, no cart ID, no
|
|
3075
|
+
* preserved selection, and no completion signal: the purchase reaches Wix through the ordinary
|
|
3076
|
+
* checkout and order flow, and the membership through Membership Ready To Be Charged.
|
|
3077
|
+
*
|
|
3078
|
+
* The page covers a single plan. Items that plan covers can be mixed with directly-paid ones, but
|
|
3079
|
+
* a selection spanning two plans isn't supported here.
|
|
3035
3080
|
* @format WEB_URL
|
|
3036
3081
|
*/
|
|
3037
3082
|
infoCollectionUrl?: string | null;
|
|
3038
3083
|
/**
|
|
3039
|
-
* Plan price.
|
|
3084
|
+
* Plan price, in the plan's own configured currency.
|
|
3085
|
+
*
|
|
3086
|
+
* No currency accompanies the amount and none is converted, so prices from different plans aren't
|
|
3087
|
+
* comparable and the currency reaches the buyer only through `priceDescription`. Name the currency
|
|
3088
|
+
* there.
|
|
3040
3089
|
* @decimalValue options { gte:0, maxScale:3 }
|
|
3041
3090
|
*/
|
|
3042
3091
|
price?: string;
|
|
3043
3092
|
/**
|
|
3044
|
-
* Human-readable
|
|
3093
|
+
* Human-readable summary of the plan price, for display. For example, `First month free, then
|
|
3094
|
+
* $20/month`.
|
|
3045
3095
|
*
|
|
3046
|
-
* `price`
|
|
3047
|
-
*
|
|
3096
|
+
* Use `price` for the bare amount, which is what sorting and comparison rely on, and this field for
|
|
3097
|
+
* pricing a buyer needs prose to understand.
|
|
3048
3098
|
* @maxLength 500
|
|
3049
3099
|
*/
|
|
3050
3100
|
priceDescription?: string | null;
|
|
3051
3101
|
}
|
|
3052
3102
|
/**
|
|
3053
|
-
* A single redeemable benefit
|
|
3054
|
-
*
|
|
3103
|
+
* A single redeemable benefit granted by a plan.
|
|
3104
|
+
*
|
|
3105
|
+
* A purchasable plan grants one or more benefits in `benefits`. Once the plan is paid for, each benefit
|
|
3106
|
+
* becomes its own membership, charged by `membershipId`.
|
|
3055
3107
|
*/
|
|
3056
3108
|
interface Benefit extends BenefitQuotaOneOf {
|
|
3057
3109
|
limitedQuota?: LimitedQuota;
|
|
3058
3110
|
/**
|
|
3059
|
-
* Identifier for this benefit
|
|
3060
|
-
*
|
|
3111
|
+
* Identifier for this benefit, unique within its plan.
|
|
3112
|
+
*
|
|
3113
|
+
* Not unique across the response. A plan is returned once per pricing variant, and every variant
|
|
3114
|
+
* repeats that plan's benefit IDs. Two different plans can also share an ID when they grant the
|
|
3115
|
+
* same benefit, and a coverage entry naming it is then true for both.
|
|
3116
|
+
*
|
|
3117
|
+
* Never give two different benefits the same ID. That's the one case a caller can't recover from,
|
|
3118
|
+
* because a cost computed for one benefit would be applied to the other.
|
|
3061
3119
|
* @minLength 1
|
|
3062
3120
|
* @maxLength 200
|
|
3063
3121
|
*/
|
|
3064
3122
|
benefitId?: string;
|
|
3065
3123
|
/**
|
|
3066
|
-
* Human-readable label for this benefit
|
|
3124
|
+
* Human-readable label for this benefit. For example, `Manicure` or `Pedicure` on a multi-set
|
|
3125
|
+
* punch card.
|
|
3067
3126
|
* @maxLength 200
|
|
3068
3127
|
*/
|
|
3069
3128
|
label?: string | null;
|
|
3070
|
-
/**
|
|
3071
|
-
* The kind of quota this benefit grants: a countable amount drawn down on redemption (`LIMITED`),
|
|
3072
|
-
* or an unbounded amount that is never drawn down (`UNLIMITED`).
|
|
3073
|
-
*/
|
|
3129
|
+
/** Kind of quota this benefit grants. */
|
|
3074
3130
|
quotaType?: QuotaTypeWithLiterals;
|
|
3075
3131
|
}
|
|
3076
3132
|
/** @oneof */
|
|
@@ -3078,9 +3134,9 @@ interface BenefitQuotaOneOf {
|
|
|
3078
3134
|
limitedQuota?: LimitedQuota;
|
|
3079
3135
|
}
|
|
3080
3136
|
declare enum QuotaType {
|
|
3081
|
-
/** The benefit grants a countable quota that
|
|
3137
|
+
/** The benefit grants a countable quota that's drawn down on redemption. */
|
|
3082
3138
|
LIMITED = "LIMITED",
|
|
3083
|
-
/** The benefit is unlimited
|
|
3139
|
+
/** The benefit is unlimited and is never drawn down. */
|
|
3084
3140
|
UNLIMITED = "UNLIMITED"
|
|
3085
3141
|
}
|
|
3086
3142
|
/** @enumType */
|
|
@@ -3088,45 +3144,64 @@ type QuotaTypeWithLiterals = QuotaType | 'LIMITED' | 'UNLIMITED';
|
|
|
3088
3144
|
/** A limited, countable redeemable amount. */
|
|
3089
3145
|
interface LimitedQuota {
|
|
3090
3146
|
/**
|
|
3091
|
-
*
|
|
3147
|
+
* Quota's initial value.
|
|
3092
3148
|
* @min 1
|
|
3093
3149
|
*/
|
|
3094
3150
|
total?: number;
|
|
3095
|
-
/**
|
|
3151
|
+
/** Quota's remaining value. */
|
|
3096
3152
|
remaining?: number;
|
|
3097
|
-
/**
|
|
3153
|
+
/**
|
|
3154
|
+
* How the quota is measured.
|
|
3155
|
+
*
|
|
3156
|
+
* The same vocabulary as `MembershipPaymentCredits.balanceType` on the existing-membership side.
|
|
3157
|
+
*/
|
|
3098
3158
|
limitedQuotaType?: LimitedQuotaTypeWithLiterals;
|
|
3099
3159
|
}
|
|
3100
3160
|
declare enum LimitedQuotaType {
|
|
3101
|
-
/** Quota is measured in discrete uses
|
|
3161
|
+
/** Quota is measured in discrete uses, such as sessions or visits. */
|
|
3102
3162
|
PUNCH_CARD = "PUNCH_CARD",
|
|
3103
|
-
/** Quota is measured in a currency-like value
|
|
3163
|
+
/** Quota is measured in a currency-like value, such as points. */
|
|
3104
3164
|
CREDIT = "CREDIT"
|
|
3105
3165
|
}
|
|
3106
3166
|
/** @enumType */
|
|
3107
3167
|
type LimitedQuotaTypeWithLiterals = LimitedQuotaType | 'PUNCH_CARD' | 'CREDIT';
|
|
3108
3168
|
/**
|
|
3109
|
-
* Maps a
|
|
3110
|
-
*
|
|
3111
|
-
*
|
|
3112
|
-
*
|
|
3169
|
+
* Maps one of a plan's benefits to a line item it can cover, and at what cost.
|
|
3170
|
+
*
|
|
3171
|
+
* 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`.
|
|
3172
|
+
*
|
|
3173
|
+
* An entry names a benefit and carries no plan identity, so match its `benefitId` against the
|
|
3174
|
+
* `benefits` of the returned plans and apply it to every entry that grants that benefit. Entries for
|
|
3175
|
+
* the same plan repeat it once per pricing variant, and two different plans sharing a benefit ID
|
|
3176
|
+
* grant the same benefit, so the entry holds for each of them. A caller that stops at the first
|
|
3177
|
+
* match shows nothing incorrect, but hides the other entries, which cover the item too.
|
|
3178
|
+
*
|
|
3179
|
+
* The cost is identical across a plan's variants, so there's one entry per benefit rather than one
|
|
3180
|
+
* per variant.
|
|
3181
|
+
*
|
|
3182
|
+
* For memberships the member already owns, the equivalent mapping is
|
|
3183
|
+
* `ExistingMembership.coveredLineItems`, which needs no `benefitId` because a membership is a single
|
|
3184
|
+
* benefit.
|
|
3113
3185
|
*/
|
|
3114
3186
|
interface LineItemCoverage {
|
|
3115
3187
|
/**
|
|
3116
|
-
*
|
|
3188
|
+
* ID of the benefit that covers the line item, as returned in `Benefit.benefitId`.
|
|
3189
|
+
*
|
|
3190
|
+
* Identifies a benefit within its plan, and repeats across that plan's pricing variants.
|
|
3117
3191
|
* @minLength 1
|
|
3118
3192
|
* @maxLength 200
|
|
3119
3193
|
*/
|
|
3120
3194
|
benefitId?: string;
|
|
3121
3195
|
/**
|
|
3122
|
-
*
|
|
3196
|
+
* ID of the line item this benefit covers.
|
|
3123
3197
|
* @minLength 1
|
|
3124
3198
|
* @maxLength 100
|
|
3125
3199
|
*/
|
|
3126
3200
|
lineItemId?: string;
|
|
3127
3201
|
/**
|
|
3128
|
-
*
|
|
3129
|
-
*
|
|
3202
|
+
* Amount deducted from the benefit's `limitedQuota.remaining` value when this line item is redeemed.
|
|
3203
|
+
*
|
|
3204
|
+
* Always `0` for an unlimited benefit, which decrements nothing.
|
|
3130
3205
|
*/
|
|
3131
3206
|
redemptionCost?: number;
|
|
3132
3207
|
}
|