@wix/auto_sdk_ecom_memberships 1.0.55 → 1.0.57
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.d.ts +2 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +2 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/{service-plugins-error-classes-Cx3ud0wD.d.ts → service-plugins-error-classes-C9zIZn1i.d.ts} +41 -9
- package/build/es/index.d.mts +2 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +2 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/{service-plugins-error-classes-Cx3ud0wD.d.mts → service-plugins-error-classes-C9zIZn1i.d.mts} +41 -9
- package/build/internal/cjs/index.d.ts +2 -2
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +2 -2
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/{service-plugins-error-classes-Cx3ud0wD.d.ts → service-plugins-error-classes-C9zIZn1i.d.ts} +41 -9
- package/build/internal/es/index.d.mts +2 -2
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +2 -2
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/{service-plugins-error-classes-Cx3ud0wD.d.mts → service-plugins-error-classes-C9zIZn1i.d.mts} +41 -9
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as provideHandlers$1 } from './service-plugins-error-classes-
|
|
2
|
-
export { B as BalanceType, g as Benefit, h as BenefitQuotaOneOf, C as CatalogReference,
|
|
1
|
+
import { p as provideHandlers$1 } from './service-plugins-error-classes-C9zIZn1i.js';
|
|
2
|
+
export { B as BalanceType, g as Benefit, h as BenefitQuotaOneOf, C as CatalogReference, J as ChargeMembershipRequest, K as ChargeMembershipResponse, a1 as Context, v as CoveredLineItem, W as Ended, y as EnhanceAndValidateSelectionRequest, A as EnhanceAndValidateSelectionResponse, E as ExistingMembership, D as ExistingMembershipEnhanced, z as ExistingMembershipInput, G as FutureMembership, F as FutureMembershipInput, Y as GetMembershipVoidabilityRequest, Z as GetMembershipVoidabilityResponse, a3 as IdentificationData, a4 as IdentificationDataIdOneOf, a2 as IdentityType, a6 as InsufficientBalanceWixError, I as InvalidMembership, a5 as InvalidSelectionWixError, i as LimitedQuota, j as LimitedQuotaType, a as LineItem, u as LineItemCoverage, o as LineItemNotFoundInfo, L as ListEligibleMembershipsRequest, d as ListEligibleMembershipsResponse, s as ListExistingMembershipsRequest, t as ListExistingMembershipsResponse, w as ListPurchasablePlansRequest, x as ListPurchasablePlansResponse, M as Membership, X as MembershipAlreadyChargedError, a9 as MembershipAlreadyChargedWixError, N as MembershipCannotBeChargedError, O as MembershipCannotBeChargedErrorErrorDataOneOf, R as MembershipCannotBeChargedType, r as MembershipCannotBeUsedForLineItemInfo, q as MembershipCannotBeUsedForLineItemsInfo, a8 as MembershipCannotBeUsedWixError, a7 as MembershipDoesNotApplyToItemWixError, n as MembershipErrorType, l as MembershipInvalidSelectionError, m as MembershipInvalidSelectionErrorErrorDataOneOf, k as MembershipInvalidSelectionErrors, e as MembershipName, f as MembershipPaymentCredits, a0 as MembershipsSPIConfig, U as NotStartedYet, T as OutOfCredits, P as PurchasablePlan, Q as QuotaType, c as SelectedMembership, b as SelectedMemberships, S as ServiceProperties, ac as TransactionAlreadyVoidedWixError, ab as TransactionCannotBeVoidedWixError, aa as TransactionNotFoundWixError, V as ValidatedExistingMemberships, H as ValidatedPurchasablePlans, _ as VoidMembershipChargeRequest, $ as VoidMembershipChargeResponse } from './service-plugins-error-classes-C9zIZn1i.js';
|
|
3
3
|
import { BuildServicePluginDefinition } from '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/service-plugins-types.ts","../../src/interfaces-ecom-v1-memberships-provider.public.ts","../../src/interfaces-ecom-v1-memberships-provider.context.ts","../../src/service-plugins-error-classes.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-ecom-v1-memberships-provider.context.js';\nexport * from './src/service-plugins-error-classes.js';\n","export interface ListEligibleMembershipsRequest {\n /**\n * The line items for which to list eligible memberships.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * The selected payment memberships and which line items they apply to.\n *\n * When not provided, your implementation is expected to return the default selection.\n * When provided, your implementation is expected to validate and return it.\n */\n selectedMemberships?: SelectedMemberships;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Catalog and item reference info. */\n catalogReference?: CatalogReference;\n /** Properties of the service. When relevant, contains information such as date and number of participants. */\n serviceProperties?: ServiceProperties;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.\n *\n * For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)\n * or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface ServiceProperties {\n /**\n * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.\n * For example, the start time of a class.\n */\n scheduledDate?: Date | null;\n /**\n * The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room.\n * @min 1\n * @max 10000\n */\n numberOfParticipants?: number | null;\n}\n\nexport interface SelectedMemberships {\n /**\n * Selected memberships.\n * @maxSize 300\n */\n memberships?: SelectedMembership[];\n}\n\nexport interface SelectedMembership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * IDs of the line items this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface ListEligibleMembershipsResponse {\n /**\n * List of memberships that are eligible for the given member and line items.\n * @maxSize 300\n */\n eligibleMemberships?: Membership[];\n /**\n * List of memberships owned by the member, but cannot be used due to the reason provided.\n * @maxSize 300\n */\n invalidMemberships?: InvalidMembership[];\n /**\n * List of selected memberships and which line items they apply to.\n * @maxSize 300\n */\n selectedMemberships?: SelectedMembership[];\n}\n\nexport interface Membership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Membership name. */\n name?: MembershipName;\n /**\n * Deprecated. Use `ExistingMembership.covered_line_items` to see which line items this membership covers.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n * @deprecated\n * @replacedBy ExistingMembership.covered_line_items.line_item_id\n */\n lineItemIds?: string[];\n /**\n * Deprecated. The new flow no longer exposes raw balances on a membership; what a membership can pay\n * for is conveyed by `ExistingMembership.covered_line_items` (per-item redemption cost).\n * @deprecated\n * @replacedBy ExistingMembership.covered_line_items.redemption_cost\n */\n credits?: MembershipPaymentCredits;\n /**\n * Membership expiration date.\n * @deprecated\n * @replacedBy offering_description\n */\n expirationDate?: Date | null;\n /**\n * Deprecated. Use `benefits.additional_data` for benefit-specific provider data.\n * @deprecated\n */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface MembershipName {\n /**\n * Membership name.\n * @maxLength 100\n */\n original?: string;\n /**\n * Translated membership name. Defaults to `original` when not provided.\n * @maxLength 100\n */\n translated?: string | null;\n}\n\nexport interface MembershipPaymentCredits {\n /**\n * Membership's initial value.\n * @min 1\n */\n total?: number;\n /** Membership's remaining value. */\n remaining?: number;\n}\n\nexport enum BalanceType {\n /** Balance is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Balance is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\n/**\n * A single redeemable benefit. A purchasable plan grants one or more benefits (`PurchasablePlan.benefits`);\n * once the plan is paid, each benefit becomes its own membership (charged via `membership_id`).\n * (Also present on the deprecated `Membership.benefits`, retained for backward compatibility.)\n */\nexport interface Benefit extends BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n /**\n * Identifier for this benefit. On a `PurchasablePlan` it must be unique within the response so\n * `coverages` (`LineItemCoverage.benefit_id`) can reference it unambiguously across the plan's benefits.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Human-readable label for this benefit (for example, \"Manicure\" or \"Pedicure\" on multi-set punchcards).\n * @maxLength 200\n */\n label?: string | null;\n /**\n * The kind of quota this benefit grants: a countable amount drawn down on redemption (`LIMITED`),\n * or an unbounded amount that is never drawn down (`UNLIMITED`).\n */\n quotaType?: QuotaType;\n}\n\n/** @oneof */\nexport interface BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n}\n\nexport enum QuotaType {\n /** The benefit grants a countable quota that is drawn down on redemption. */\n LIMITED = 'LIMITED',\n /** The benefit is unlimited (unbounded) and is never drawn down. */\n UNLIMITED = 'UNLIMITED',\n}\n\n/** A limited, countable redeemable amount. */\nexport interface LimitedQuota {\n /**\n * The quota's initial value.\n * @min 1\n */\n total?: number;\n /** The quota's remaining value. */\n remaining?: number;\n /** How the quota is measured. */\n limitedQuotaType?: LimitedQuotaType;\n}\n\nexport enum LimitedQuotaType {\n /** Quota is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Quota is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\nexport interface InvalidMembership {\n /** The membership that is invalid and cannot be used. */\n membership?: Membership;\n /**\n * Reason why this membership is invalid.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string;\n}\n\nexport interface MembershipInvalidSelectionErrors {\n /**\n * Error details for invalid memberships.\n * @maxSize 300\n */\n membershipInvalidSelectionErrors?: MembershipInvalidSelectionError[];\n}\n\nexport interface MembershipInvalidSelectionError\n extends MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n /**\n * Membership ID.\n * @format GUID\n */\n membershipId?: string;\n /** Error type. */\n errorType?: MembershipErrorType;\n}\n\n/** @oneof */\nexport interface MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n}\n\nexport enum MembershipErrorType {\n UNKNOWN = 'UNKNOWN',\n /** Membership not found. */\n MEMBERSHIP_NOT_FOUND = 'MEMBERSHIP_NOT_FOUND',\n /** The selection points to a line item ID that wasn't provided. */\n LINE_ITEM_NOT_FOUND = 'LINE_ITEM_NOT_FOUND',\n /** The membership cannot be used for the specific line items provided. */\n MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS = 'MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS',\n /** The membership can be used for each individual line item, but combining all of them is invalid. */\n MEMBERSHIP_SELECTION_INVALID = 'MEMBERSHIP_SELECTION_INVALID',\n}\n\nexport interface LineItemNotFoundInfo {\n /**\n * Line item IDs that were missing.\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemsInfo {\n /**\n * Line items that cannot be used with this membership, and the reason why.\n * @maxSize 300\n */\n lineItems?: MembershipCannotBeUsedForLineItemInfo[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemInfo {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * Reason why this line item cannot be used with this membership.\n * @maxLength 1000\n */\n reason?: string;\n}\n\nexport interface ListExistingMembershipsRequest {\n /**\n * The line items for which to list memberships the member already owns.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n}\n\nexport interface ListExistingMembershipsResponse {\n /**\n * Deprecated. Use `memberships`, which pairs each membership with the line items it can pay for.\n * @maxSize 300\n * @deprecated\n * @replacedBy memberships.membership\n * @targetRemovalDate 2026-07-30\n */\n existingMemberships?: Membership[];\n /**\n * Deprecated. Coverage is now nested per membership in `memberships` (`ExistingMembership.covered_line_items`).\n * @maxSize 300\n * @deprecated\n * @replacedBy memberships.covered_line_items\n * @targetRemovalDate 2026-07-30\n */\n coverages?: LineItemCoverage[];\n}\n\n/**\n * Maps a benefit to a line item it can cover, and at what cost, linked to a benefit by `benefit_id`.\n * One entry per (benefit, line item). Returned by `ListPurchasablePlans` (alongside `purchasable_plans`)\n * and by the deprecated `ListExistingMembershipsResponse.coverages`. For the current memberships flow the\n * equivalent mapping is `ExistingMembership.covered_line_items`, which needs no `benefit_id` because a\n * membership is a single benefit.\n */\nexport interface LineItemCoverage {\n /**\n * The benefit that covers the line item, as returned in `Benefit.benefit_id`.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * The line item this benefit covers.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the benefit's `limited_quota.remaining` value for this item.\n * Always 0 for an unlimited benefit (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\n/**\n * A membership the member already owns, together with the input line items it can pay for.\n *\n * A membership is a single benefit granted by a plan the member has already paid for, so coverage is\n * nested here per membership (no `benefit_id` linkage is needed, unlike a plan that grants many benefits).\n */\nexport interface ExistingMembership {\n /** The membership the member owns. */\n membership?: Membership;\n /**\n * The input line items this membership can pay for, and the cost to redeem each.\n * @maxSize 300\n */\n coveredLineItems?: CoveredLineItem[];\n}\n\n/** A line item a membership can pay for, and the cost to redeem it. */\nexport interface CoveredLineItem {\n /**\n * The input line item this membership can cover.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the membership's benefit quota (`benefit.limited_quota.remaining`) for this item.\n * Always 0 when the benefit is unlimited (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\nexport interface ListPurchasablePlansRequest {\n /**\n * The line items for which to list plans the member could purchase.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ListPurchasablePlansResponse {\n /**\n * Plans the member could purchase that would cover one or more input line items.\n * @maxSize 300\n */\n purchasablePlans?: PurchasablePlan[];\n /**\n * How the returned plans' benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\nexport interface PurchasablePlan {\n /** Catalog and item reference for the plan that can be purchased. */\n catalogReference?: CatalogReference;\n /** Plan name. */\n name?: MembershipName;\n /**\n * Benefits the plan would grant once purchased. Multiple entries support multi-benefit plans (e.g., a bundle granting separate yoga and pilates credits).\n * @minSize 1\n * @maxSize 50\n */\n benefits?: Benefit[];\n /**\n * Human-readable offering summary for display (for example price and validity text). Provider-supplied.\n * @maxLength 500\n */\n offeringDescription?: string | null;\n /**\n * URL the buyer is redirected to in order to collect additional info required to purchase this plan.\n * @format WEB_URL\n */\n infoCollectionUrl?: string | null;\n /**\n * Plan price.\n * @decimalValue options { gte:0, maxScale:3 }\n */\n price?: string;\n /**\n * Human-readable description of the plan price (for example \"First month free, then $20/month\").\n *\n * `price` is simply the price (useful for sorting or comparison, for example), while this is a\n * descriptive, display-oriented summary of it.\n * @maxLength 500\n */\n priceDescription?: string | null;\n}\n\nexport interface EnhanceAndValidateSelectionRequest {\n /**\n * Memberships the caller has selected from the member's existing memberships pool.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipInput[];\n /**\n * Future memberships the caller intends to purchase as part of this checkout.\n * @maxSize 300\n */\n futureMemberships?: FutureMembershipInput[];\n /**\n * Member ID.\n *\n * Required when `existing_memberships` is not empty; omitted for future-memberships-only selections.\n * Optional (StringValue) so an absent member id is sent unset rather than as an empty string, which would fail GUID validation.\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ExistingMembershipInput {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Line items the caller intends to redeem against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembershipInput {\n /** Catalog reference of the plan that will be purchased. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Line items the caller intends to redeem against the future membership.\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface EnhanceAndValidateSelectionResponse {\n /**\n * Validated and enhanced existing membership selections.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipEnhanced[];\n /**\n * Validated and enhanced future membership selections.\n * @maxSize 300\n */\n futureMemberships?: FutureMembership[];\n}\n\nexport interface ExistingMembershipEnhanced {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n /**\n * Validated line items redeemed against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembership {\n /** Catalog reference of the validated future membership. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n}\n\nexport interface ChargeMembershipRequest {\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value is typically `membershipId` + `orderId` + `rootCatalogItemId`.\n * @minLength 1\n * @maxLength 200\n */\n idempotencyKey: string;\n /**\n * Service properties.\n *\n * When relevant, this contains information such as date and number of participants.\n */\n serviceProperties?: ServiceProperties;\n /** Catalog and item reference info. */\n catalogReference: CatalogReference;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n /** Additional data about this charge. */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface ChargeMembershipResponse {\n /**\n * The transaction ID for this charge.\n *\n * Use this ID to void the charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface MembershipCannotBeChargedError\n extends MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n /** Error type. */\n errorType?: MembershipCannotBeChargedType;\n}\n\n/** @oneof */\nexport interface MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n}\n\nexport enum MembershipCannotBeChargedType {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n OUT_OF_CREDITS = 'OUT_OF_CREDITS',\n /** Membership has not become active yet. */\n NOT_STARTED_YET = 'NOT_STARTED_YET',\n /** Membership has expired or ended. */\n ENDED = 'ENDED',\n /** Not applicable for multiple participants. */\n NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS = 'NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS',\n}\n\nexport interface OutOfCredits {\n /** Required amount of credits. */\n required?: number;\n /** Remaining amount of credits. */\n remaining?: number;\n}\n\nexport interface NotStartedYet {\n /** Start date of the membership. */\n membershipStartDate?: Date | null;\n}\n\nexport interface Ended {\n /** End date of the membership. */\n endDate?: Date | null;\n}\n\nexport interface MembershipAlreadyChargedError {\n /**\n * ID of the transaction that was already used for membership charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface GetMembershipVoidabilityRequest {\n /**\n * Transaction ID to check if it can be voided.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface GetMembershipVoidabilityResponse {\n /** Whether the membership charge can be voided. */\n voidable?: boolean;\n /**\n * Reason why the membership charge cannot be voided.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string | null;\n}\n\nexport interface VoidMembershipChargeRequest {\n /**\n * Transaction ID to void.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface VoidMembershipChargeResponse {}\n\nexport interface MembershipsSPIConfig {\n /**\n * The base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI.\n * For example, to call the Charge Membership endpoint at https://my-memberships.com/v1/charge-membership, the base URI you provide here is https://my-memberships.com/.\n * @format WEB_URL\n */\n deploymentUri?: string;\n /**\n * The app IDs of the catalogs your app supports.\n * @minSize 1\n * @maxSize 300\n * @format GUID\n */\n catalogAppDefIds?: string[];\n /**\n * Set to true once your app implements the updated redemption methods (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`)\n * and the per-balance redemption model. While false, Wix eCommerce keeps calling the legacy `ListEligibleMemberships` flow.\n * This toggle lets providers migrate without a synchronized deploy and is removed once migration completes.\n */\n toggleUpdatedMethodsEnabled?: boolean;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n ListEligibleMembershipsRequest,\n ListEligibleMembershipsResponse,\n ChargeMembershipRequest,\n ChargeMembershipResponse,\n GetMembershipVoidabilityRequest,\n GetMembershipVoidabilityResponse,\n VoidMembershipChargeRequest,\n VoidMembershipChargeResponse,\n} from './service-plugins-types.js';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface ListEligibleMembershipsEnvelope {\n request: ListEligibleMembershipsRequest;\n metadata: Context;\n}\n\nexport interface ChargeMembershipEnvelope {\n request: ChargeMembershipRequest;\n metadata: Context;\n}\n\nexport interface GetMembershipVoidabilityEnvelope {\n request: GetMembershipVoidabilityRequest;\n metadata: Context;\n}\n\nexport interface VoidMembershipChargeEnvelope {\n request: VoidMembershipChargeRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Deprecated. Use `ListExistingMemberships` + `ListPurchasablePlans` for read, and `EnhanceAndValidateSelection` for selection validation. */\n listEligibleMemberships(\n payload: ListEligibleMembershipsEnvelope\n ): ListEligibleMembershipsResponse | Promise<ListEligibleMembershipsResponse>;\n\n /**\n *\n * This method requests that a membership be charged by your app. */\n chargeMembership(\n payload: ChargeMembershipEnvelope\n ): ChargeMembershipResponse | Promise<ChargeMembershipResponse>;\n\n /**\n *\n * This method retrieves from your app whether a membership can be voided. */\n getMembershipVoidability(\n payload: GetMembershipVoidabilityEnvelope\n ):\n | GetMembershipVoidabilityResponse\n | Promise<GetMembershipVoidabilityResponse>;\n\n /**\n *\n * This method requests that a membership charge be voided by your app. */\n voidMembershipCharge(\n payload: VoidMembershipChargeEnvelope\n ): VoidMembershipChargeResponse | Promise<VoidMembershipChargeResponse>;\n}>('ECOM_MEMBERSHIPS', [\n {\n name: 'listEligibleMemberships',\n primaryHttpMappingPath: '/v1/list-eligible-memberships',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'eligibleMemberships.expirationDate' },\n { path: 'invalidMemberships.membership.expirationDate' },\n ],\n },\n ]);\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.lineItems.serviceProperties.scheduledDate' },\n { path: 'request.lineItems.serviceProperties.endDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'chargeMembership',\n primaryHttpMappingPath: '/v1/charge-membership',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.serviceProperties.scheduledDate' },\n { path: 'request.serviceProperties.endDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'getMembershipVoidability',\n primaryHttpMappingPath: '/v1/get-voidability',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'voidMembershipCharge',\n primaryHttpMappingPath: '/v1/void-membership-charge',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-ecom-v1-memberships-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-ecom-v1-memberships-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","import {\n MembershipInvalidSelectionErrors,\n MembershipCannotBeChargedError,\n MembershipAlreadyChargedError,\n} from './service-plugins-types.js';\n\n/**\n * The provided membership selection is invalid\n */\nexport class InvalidSelectionWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipInvalidSelectionErrors;\n\n constructor(data: MembershipInvalidSelectionErrors = {}) {\n super('InvalidSelection');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_SELECTION';\n this.name = 'InvalidSelection';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipInvalidSelectionErrors';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidSelection',\n applicationCode: 'INVALID_SELECTION',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The selected memberships do not have enough balance to cover the line items.\n */\nexport class InsufficientBalanceWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InsufficientBalance');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'INSUFFICIENT_BALANCE';\n this.name = 'InsufficientBalance';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InsufficientBalance',\n applicationCode: 'INSUFFICIENT_BALANCE',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, but does not apply for the provided item\n */\nexport class MembershipDoesNotApplyToItemWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('MembershipDoesNotApplyToItem');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM';\n this.name = 'MembershipDoesNotApplyToItem';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipDoesNotApplyToItem',\n applicationCode: 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, applied to the provided item but cannot be charged. For example because a limited membership doesn't have enough credits\n */\nexport class MembershipCannotBeUsedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipCannotBeChargedError;\n\n constructor(data: MembershipCannotBeChargedError = {}) {\n super('MembershipCannotBeUsed');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'MEMBERSHIP_CANNOT_BE_CHARGED';\n this.name = 'MembershipCannotBeUsed';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipCannotBeChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipCannotBeUsed',\n applicationCode: 'MEMBERSHIP_CANNOT_BE_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * This charge was already done, per the idempotency key of membershipId + orderId + rootCatalogItemId\n */\nexport class MembershipAlreadyChargedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipAlreadyChargedError;\n\n constructor(data: MembershipAlreadyChargedError = {}) {\n super('MembershipAlreadyCharged');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'MEMBERSHIP_ALREADY_CHARGED';\n this.name = 'MembershipAlreadyCharged';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipAlreadyChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipAlreadyCharged',\n applicationCode: 'MEMBERSHIP_ALREADY_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction not found\n */\nexport class TransactionNotFoundWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionNotFound');\n\n this.httpCode = 404;\n this.statusCode = 'NOT_FOUND';\n this.applicationCode = 'TRANSACTION_NOT_FOUND';\n this.name = 'TransactionNotFound';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionNotFound',\n applicationCode: 'TRANSACTION_NOT_FOUND',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction exists but cannot be voided\n */\nexport class TransactionCannotBeVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionCannotBeVoided');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'TRANSACTION_CANNOT_BE_VOIDED';\n this.name = 'TransactionCannotBeVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionCannotBeVoided',\n applicationCode: 'TRANSACTION_CANNOT_BE_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction was already voided\n */\nexport class TransactionAlreadyVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionAlreadyVoided');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'TRANSACTION_ALREADY_VOIDED';\n this.name = 'TransactionAlreadyVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionAlreadyVoided',\n applicationCode: 'TRANSACTION_ALREADY_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACoMO,IAAK,cAAL,kBAAKC,iBAAL;AAEL,EAAAA,aAAA,gBAAa;AAEb,EAAAA,aAAA,YAAS;AAJC,SAAAA;AAAA,GAAA;AAsCL,IAAK,YAAL,kBAAKC,eAAL;AAEL,EAAAA,WAAA,aAAU;AAEV,EAAAA,WAAA,eAAY;AAJF,SAAA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embershipErrorType","MembershipCannotBeChargedType","IdentityType","import_timestamp","provideHandlers"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/service-plugins-types.ts","../../src/interfaces-ecom-v1-memberships-provider.public.ts","../../src/interfaces-ecom-v1-memberships-provider.context.ts","../../src/service-plugins-error-classes.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-ecom-v1-memberships-provider.context.js';\nexport * from './src/service-plugins-error-classes.js';\n","export interface ListEligibleMembershipsRequest {\n /**\n * The line items for which to list eligible memberships.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * The selected payment memberships and which line items they apply to.\n *\n * When not provided, your implementation is expected to return the default selection.\n * When provided, your implementation is expected to validate and return it.\n */\n selectedMemberships?: SelectedMemberships;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Catalog and item reference info. */\n catalogReference?: CatalogReference;\n /** Properties of the service. When relevant, contains information such as date and number of participants. */\n serviceProperties?: ServiceProperties;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.\n *\n * For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)\n * or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface ServiceProperties {\n /**\n * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.\n * For example, the start time of a class.\n */\n scheduledDate?: Date | null;\n /**\n * The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room.\n * @min 1\n * @max 10000\n */\n numberOfParticipants?: number | null;\n}\n\nexport interface SelectedMemberships {\n /**\n * Selected memberships.\n * @maxSize 300\n */\n memberships?: SelectedMembership[];\n}\n\nexport interface SelectedMembership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * IDs of the line items this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface ListEligibleMembershipsResponse {\n /**\n * List of memberships that are eligible for the given member and line items.\n * @maxSize 300\n */\n eligibleMemberships?: Membership[];\n /**\n * List of memberships owned by the member, but cannot be used due to the reason provided.\n * @maxSize 300\n */\n invalidMemberships?: InvalidMembership[];\n /**\n * List of selected memberships and which line items they apply to.\n * @maxSize 300\n */\n selectedMemberships?: SelectedMembership[];\n}\n\nexport interface Membership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Membership name. */\n name?: MembershipName;\n /**\n * Deprecated. Use `ExistingMembership.covered_line_items` to see which line items this membership covers.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n * @deprecated\n * @replacedBy ExistingMembership.covered_line_items.line_item_id\n * @targetRemovalDate 2026-07-30\n */\n lineItemIds?: string[];\n /** Membership's payment credits (balance information). */\n credits?: MembershipPaymentCredits;\n /**\n * Membership expiration date.\n * @deprecated\n * @replacedBy offering_description\n * @targetRemovalDate 2026-07-30\n */\n expirationDate?: Date | null;\n /**\n * Deprecated. Use `benefits.additional_data` for benefit-specific provider data.\n * @deprecated\n * @replacedBy benefits.additional_data\n * @targetRemovalDate 2026-07-30\n */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface MembershipName {\n /**\n * Membership name.\n * @maxLength 100\n */\n original?: string;\n /**\n * Translated membership name. Defaults to `original` when not provided.\n * @maxLength 100\n */\n translated?: string | null;\n}\n\nexport interface MembershipPaymentCredits {\n /**\n * Membership's initial value.\n * @min 1\n */\n total?: number;\n /** Membership's remaining value. */\n remaining?: number;\n}\n\nexport enum BalanceType {\n /** Balance is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Balance is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\n/**\n * A single redeemable benefit. A purchasable plan grants one or more benefits (`PurchasablePlan.benefits`);\n * once the plan is paid, each benefit becomes its own membership (charged via `membership_id`).\n * (Also present on the deprecated `Membership.benefits`, retained for backward compatibility.)\n */\nexport interface Benefit extends BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n /**\n * Identifier for this benefit. On a `PurchasablePlan` it must be unique within the response so\n * `coverages` (`LineItemCoverage.benefit_id`) can reference it unambiguously across the plan's benefits.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Human-readable label for this benefit (for example, \"Manicure\" or \"Pedicure\" on multi-set punchcards).\n * @maxLength 200\n */\n label?: string | null;\n /**\n * The kind of quota this benefit grants: a countable amount drawn down on redemption (`LIMITED`),\n * or an unbounded amount that is never drawn down (`UNLIMITED`).\n */\n quotaType?: QuotaType;\n}\n\n/** @oneof */\nexport interface BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n}\n\nexport enum QuotaType {\n /** The benefit grants a countable quota that is drawn down on redemption. */\n LIMITED = 'LIMITED',\n /** The benefit is unlimited (unbounded) and is never drawn down. */\n UNLIMITED = 'UNLIMITED',\n}\n\n/** A limited, countable redeemable amount. */\nexport interface LimitedQuota {\n /**\n * The quota's initial value.\n * @min 1\n */\n total?: number;\n /** The quota's remaining value. */\n remaining?: number;\n /** How the quota is measured. */\n limitedQuotaType?: LimitedQuotaType;\n}\n\nexport enum LimitedQuotaType {\n /** Quota is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Quota is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\nexport interface InvalidMembership {\n /** The membership that is invalid and cannot be used. */\n membership?: Membership;\n /**\n * Reason why this membership is invalid.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string;\n}\n\nexport interface MembershipInvalidSelectionErrors {\n /**\n * Error details for invalid memberships.\n * @maxSize 300\n */\n membershipInvalidSelectionErrors?: MembershipInvalidSelectionError[];\n}\n\nexport interface MembershipInvalidSelectionError\n extends MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n /**\n * Membership ID.\n * @format GUID\n */\n membershipId?: string;\n /** Error type. */\n errorType?: MembershipErrorType;\n}\n\n/** @oneof */\nexport interface MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n}\n\nexport enum MembershipErrorType {\n UNKNOWN = 'UNKNOWN',\n /** Membership not found. */\n MEMBERSHIP_NOT_FOUND = 'MEMBERSHIP_NOT_FOUND',\n /** The selection points to a line item ID that wasn't provided. */\n LINE_ITEM_NOT_FOUND = 'LINE_ITEM_NOT_FOUND',\n /** The membership cannot be used for the specific line items provided. */\n MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS = 'MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS',\n /** The membership can be used for each individual line item, but combining all of them is invalid. */\n MEMBERSHIP_SELECTION_INVALID = 'MEMBERSHIP_SELECTION_INVALID',\n}\n\nexport interface LineItemNotFoundInfo {\n /**\n * Line item IDs that were missing.\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemsInfo {\n /**\n * Line items that cannot be used with this membership, and the reason why.\n * @maxSize 300\n */\n lineItems?: MembershipCannotBeUsedForLineItemInfo[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemInfo {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * Reason why this line item cannot be used with this membership.\n * @maxLength 1000\n */\n reason?: string;\n}\n\nexport interface ListExistingMembershipsRequest {\n /**\n * The line items for which to list memberships the member already owns.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n}\n\nexport interface ListExistingMembershipsResponse {\n /**\n * Deprecated. Use `memberships`, which pairs each membership with the line items it can pay for.\n * @maxSize 300\n * @deprecated\n * @replacedBy memberships.membership\n * @targetRemovalDate 2026-07-30\n */\n existingMemberships?: Membership[];\n /**\n * Deprecated. Coverage is now nested per membership in `memberships` (`ExistingMembership.covered_line_items`).\n * @maxSize 300\n * @deprecated\n * @replacedBy memberships.covered_line_items\n * @targetRemovalDate 2026-07-30\n */\n coverages?: LineItemCoverage[];\n}\n\n/**\n * Maps a benefit to a line item it can cover, and at what cost, linked to a benefit by `benefit_id`.\n * One entry per (benefit, line item). Returned by `ListPurchasablePlans` (alongside `purchasable_plans`)\n * and by the deprecated `ListExistingMembershipsResponse.coverages`. For the current memberships flow the\n * equivalent mapping is `ExistingMembership.covered_line_items`, which needs no `benefit_id` because a\n * membership is a single benefit.\n */\nexport interface LineItemCoverage {\n /**\n * The benefit that covers the line item, as returned in `Benefit.benefit_id`.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * The line item this benefit covers.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the benefit's `limited_quota.remaining` value for this item.\n * Always 0 for an unlimited benefit (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\n/**\n * A membership the member already owns, together with the input line items it can pay for.\n *\n * A membership is a single benefit granted by a plan the member has already paid for, so coverage is\n * nested here per membership (no `benefit_id` linkage is needed, unlike a plan that grants many benefits).\n */\nexport interface ExistingMembership {\n /** The membership the member owns. */\n membership?: Membership;\n /**\n * The input line items this membership can pay for, and the cost to redeem each.\n * @maxSize 300\n */\n coveredLineItems?: CoveredLineItem[];\n}\n\n/** A line item a membership can pay for, and the cost to redeem it. */\nexport interface CoveredLineItem {\n /**\n * The input line item this membership can cover.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the membership's benefit quota (`benefit.limited_quota.remaining`) for this item.\n * Always 0 when the benefit is unlimited (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\nexport interface ListPurchasablePlansRequest {\n /**\n * The line items for which to list plans the member could purchase.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ListPurchasablePlansResponse {\n /**\n * Plans the member could purchase that would cover one or more input line items.\n * @maxSize 300\n */\n purchasablePlans?: PurchasablePlan[];\n /**\n * How the returned plans' benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\nexport interface PurchasablePlan {\n /** Catalog and item reference for the plan that can be purchased. */\n catalogReference?: CatalogReference;\n /** Plan name. */\n name?: MembershipName;\n /**\n * Benefits the plan would grant once purchased. Multiple entries support multi-benefit plans (e.g., a bundle granting separate yoga and pilates credits).\n * @minSize 1\n * @maxSize 50\n */\n benefits?: Benefit[];\n /**\n * Human-readable offering summary for display (for example price and validity text). Provider-supplied.\n * @maxLength 500\n */\n offeringDescription?: string | null;\n /**\n * URL the buyer is redirected to in order to collect additional info required to purchase this plan.\n * @format WEB_URL\n */\n infoCollectionUrl?: string | null;\n /**\n * Plan price.\n * @decimalValue options { gte:0, maxScale:3 }\n */\n price?: string;\n /**\n * Human-readable description of the plan price (for example \"First month free, then $20/month\").\n *\n * `price` is simply the price (useful for sorting or comparison, for example), while this is a\n * descriptive, display-oriented summary of it.\n * @maxLength 500\n */\n priceDescription?: string | null;\n}\n\nexport interface EnhanceAndValidateSelectionRequest {\n /**\n * Memberships the caller has selected from the member's existing memberships pool.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipInput[];\n /**\n * Future memberships the caller intends to purchase as part of this checkout.\n * @maxSize 300\n */\n futureMemberships?: FutureMembershipInput[];\n /**\n * Member ID.\n *\n * Required when `existing_memberships` is not empty; omitted for future-memberships-only selections.\n * Optional (StringValue) so an absent member id is sent unset rather than as an empty string, which would fail GUID validation.\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ExistingMembershipInput {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Line items the caller intends to redeem against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembershipInput {\n /** Catalog reference of the plan that will be purchased. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Line items the caller intends to redeem against the future membership.\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface EnhanceAndValidateSelectionResponse {\n /**\n * Deprecated. Use `existing`.\n * @maxSize 300\n * @deprecated\n * @replacedBy existing.memberships\n * @targetRemovalDate 2026-09-30\n */\n existingMemberships?: ExistingMembershipEnhanced[];\n /**\n * Deprecated. Use `purchasable`.\n * @maxSize 300\n * @deprecated\n * @replacedBy purchasable.purchasable_plans\n * @targetRemovalDate 2026-09-30\n */\n futureMemberships?: FutureMembership[];\n /** The validated existing memberships in the selection. */\n existing?: ValidatedExistingMemberships;\n /** The validated future plans in the selection. */\n purchasable?: ValidatedPurchasablePlans;\n}\n\n/** Deprecated. Use `ExistingMembership` (via `ValidatedExistingMemberships`). */\nexport interface ExistingMembershipEnhanced {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n /**\n * Validated line items redeemed against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\n/** Deprecated. Use `PurchasablePlan` (via `ValidatedPurchasablePlans`). */\nexport interface FutureMembership {\n /** Catalog reference of the validated future membership. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n}\n\n/** Same shape as `ListExistingMembershipsResponse.memberships`. */\nexport interface ValidatedExistingMemberships {\n /**\n * The selected memberships, each paired with the line items it can redeem and the cost to redeem each.\n * @maxSize 300\n */\n memberships?: ExistingMembership[];\n}\n\n/** Same shape as `ListPurchasablePlansResponse`. */\nexport interface ValidatedPurchasablePlans {\n /**\n * The selected plans.\n * @maxSize 300\n */\n purchasablePlans?: PurchasablePlan[];\n /**\n * How the plans' benefits cover the line items, linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\nexport interface ChargeMembershipRequest {\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value is typically `membershipId` + `orderId` + `rootCatalogItemId`.\n * @minLength 1\n * @maxLength 200\n */\n idempotencyKey: string;\n /**\n * Service properties.\n *\n * When relevant, this contains information such as date and number of participants.\n */\n serviceProperties?: ServiceProperties;\n /** Catalog and item reference info. */\n catalogReference: CatalogReference;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n /** Additional data about this charge. */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface ChargeMembershipResponse {\n /**\n * The transaction ID for this charge.\n *\n * Use this ID to void the charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface MembershipCannotBeChargedError\n extends MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n /** Error type. */\n errorType?: MembershipCannotBeChargedType;\n}\n\n/** @oneof */\nexport interface MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n}\n\nexport enum MembershipCannotBeChargedType {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n OUT_OF_CREDITS = 'OUT_OF_CREDITS',\n /** Membership has not become active yet. */\n NOT_STARTED_YET = 'NOT_STARTED_YET',\n /** Membership has expired or ended. */\n ENDED = 'ENDED',\n /** Not applicable for multiple participants. */\n NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS = 'NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS',\n}\n\nexport interface OutOfCredits {\n /** Required amount of credits. */\n required?: number;\n /** Remaining amount of credits. */\n remaining?: number;\n}\n\nexport interface NotStartedYet {\n /** Start date of the membership. */\n membershipStartDate?: Date | null;\n}\n\nexport interface Ended {\n /** End date of the membership. */\n endDate?: Date | null;\n}\n\nexport interface MembershipAlreadyChargedError {\n /**\n * ID of the transaction that was already used for membership charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface GetMembershipVoidabilityRequest {\n /**\n * Transaction ID to check if it can be voided.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface GetMembershipVoidabilityResponse {\n /** Whether the membership charge can be voided. */\n voidable?: boolean;\n /**\n * Reason why the membership charge cannot be voided.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string | null;\n}\n\nexport interface VoidMembershipChargeRequest {\n /**\n * Transaction ID to void.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface VoidMembershipChargeResponse {}\n\nexport interface MembershipsSPIConfig {\n /**\n * The base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI.\n * For example, to call the Charge Membership endpoint at https://my-memberships.com/v1/charge-membership, the base URI you provide here is https://my-memberships.com/.\n * @format WEB_URL\n */\n deploymentUri?: string;\n /**\n * The app IDs of the catalogs your app supports.\n * @minSize 1\n * @maxSize 300\n * @format GUID\n */\n catalogAppDefIds?: string[];\n /**\n * Set to true once your app implements the updated redemption methods (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`)\n * and the per-balance redemption model. While false, Wix eCommerce keeps calling the legacy `ListEligibleMemberships` flow.\n * This toggle lets providers migrate without a synchronized deploy and is removed once migration completes.\n */\n toggleUpdatedMethodsEnabled?: boolean;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n ListEligibleMembershipsRequest,\n ListEligibleMembershipsResponse,\n ChargeMembershipRequest,\n ChargeMembershipResponse,\n GetMembershipVoidabilityRequest,\n GetMembershipVoidabilityResponse,\n VoidMembershipChargeRequest,\n VoidMembershipChargeResponse,\n} from './service-plugins-types.js';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface ListEligibleMembershipsEnvelope {\n request: ListEligibleMembershipsRequest;\n metadata: Context;\n}\n\nexport interface ChargeMembershipEnvelope {\n request: ChargeMembershipRequest;\n metadata: Context;\n}\n\nexport interface GetMembershipVoidabilityEnvelope {\n request: GetMembershipVoidabilityRequest;\n metadata: Context;\n}\n\nexport interface VoidMembershipChargeEnvelope {\n request: VoidMembershipChargeRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Deprecated. Use `ListExistingMemberships` + `ListPurchasablePlans` for read, and `EnhanceAndValidateSelection` for selection validation. */\n listEligibleMemberships(\n payload: ListEligibleMembershipsEnvelope\n ): ListEligibleMembershipsResponse | Promise<ListEligibleMembershipsResponse>;\n\n /**\n *\n * This method requests that a membership be charged by your app. */\n chargeMembership(\n payload: ChargeMembershipEnvelope\n ): ChargeMembershipResponse | Promise<ChargeMembershipResponse>;\n\n /**\n *\n * This method retrieves from your app whether a membership can be voided. */\n getMembershipVoidability(\n payload: GetMembershipVoidabilityEnvelope\n ):\n | GetMembershipVoidabilityResponse\n | Promise<GetMembershipVoidabilityResponse>;\n\n /**\n *\n * This method requests that a membership charge be voided by your app. */\n voidMembershipCharge(\n payload: VoidMembershipChargeEnvelope\n ): VoidMembershipChargeResponse | Promise<VoidMembershipChargeResponse>;\n}>('ECOM_MEMBERSHIPS', [\n {\n name: 'listEligibleMemberships',\n primaryHttpMappingPath: '/v1/list-eligible-memberships',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'eligibleMemberships.expirationDate' },\n { path: 'invalidMemberships.membership.expirationDate' },\n ],\n },\n ]);\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.lineItems.serviceProperties.scheduledDate' },\n { path: 'request.lineItems.serviceProperties.endDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'chargeMembership',\n primaryHttpMappingPath: '/v1/charge-membership',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.serviceProperties.scheduledDate' },\n { path: 'request.serviceProperties.endDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'getMembershipVoidability',\n primaryHttpMappingPath: '/v1/get-voidability',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'voidMembershipCharge',\n primaryHttpMappingPath: '/v1/void-membership-charge',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-ecom-v1-memberships-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-ecom-v1-memberships-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","import {\n MembershipInvalidSelectionErrors,\n MembershipCannotBeChargedError,\n MembershipAlreadyChargedError,\n} from './service-plugins-types.js';\n\n/**\n * The provided membership selection is invalid\n */\nexport class InvalidSelectionWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipInvalidSelectionErrors;\n\n constructor(data: MembershipInvalidSelectionErrors = {}) {\n super('InvalidSelection');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_SELECTION';\n this.name = 'InvalidSelection';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipInvalidSelectionErrors';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidSelection',\n applicationCode: 'INVALID_SELECTION',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The selected memberships do not have enough balance to cover the line items.\n */\nexport class InsufficientBalanceWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InsufficientBalance');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'INSUFFICIENT_BALANCE';\n this.name = 'InsufficientBalance';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InsufficientBalance',\n applicationCode: 'INSUFFICIENT_BALANCE',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, but does not apply for the provided item\n */\nexport class MembershipDoesNotApplyToItemWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('MembershipDoesNotApplyToItem');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM';\n this.name = 'MembershipDoesNotApplyToItem';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipDoesNotApplyToItem',\n applicationCode: 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, applied to the provided item but cannot be charged. For example because a limited membership doesn't have enough credits\n */\nexport class MembershipCannotBeUsedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipCannotBeChargedError;\n\n constructor(data: MembershipCannotBeChargedError = {}) {\n super('MembershipCannotBeUsed');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'MEMBERSHIP_CANNOT_BE_CHARGED';\n this.name = 'MembershipCannotBeUsed';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipCannotBeChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipCannotBeUsed',\n applicationCode: 'MEMBERSHIP_CANNOT_BE_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * This charge was already done, per the idempotency key of membershipId + orderId + rootCatalogItemId\n */\nexport class MembershipAlreadyChargedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipAlreadyChargedError;\n\n constructor(data: MembershipAlreadyChargedError = {}) {\n super('MembershipAlreadyCharged');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'MEMBERSHIP_ALREADY_CHARGED';\n this.name = 'MembershipAlreadyCharged';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipAlreadyChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipAlreadyCharged',\n applicationCode: 'MEMBERSHIP_ALREADY_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction not found\n */\nexport class TransactionNotFoundWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionNotFound');\n\n this.httpCode = 404;\n this.statusCode = 'NOT_FOUND';\n this.applicationCode = 'TRANSACTION_NOT_FOUND';\n this.name = 'TransactionNotFound';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionNotFound',\n applicationCode: 'TRANSACTION_NOT_FOUND',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction exists but cannot be voided\n */\nexport class TransactionCannotBeVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionCannotBeVoided');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'TRANSACTION_CANNOT_BE_VOIDED';\n this.name = 'TransactionCannotBeVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionCannotBeVoided',\n applicationCode: 'TRANSACTION_CANNOT_BE_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction was already voided\n */\nexport class TransactionAlreadyVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionAlreadyVoided');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'TRANSACTION_ALREADY_VOIDED';\n this.name = 'TransactionAlreadyVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionAlreadyVoided',\n applicationCode: 'TRANSACTION_ALREADY_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACmMO,IAAK,cAAL,kBAAKC,iBAAL;AAEL,EAAAA,aAAA,gBAAa;AAEb,EAAAA,aAAA,YAAS;AAJC,SAAAA;AAAA,GAAA;AAsCL,IAAK,YAAL,kBAAKC,eAAL;AAEL,EAAAA,WAAA,aAAU;AAEV,EAAAA,WAAA,eAAY;AAJF,SAAAA;AAAA,GAAA;AAoBL,IAAK,mBAAL,kBAAKC,sBAAL;AAEL,EAAAA,kBAAA,gBAAa;AAEb,EAAAA,kBAAA,YAAS;AAJC,SAAAA;AAAA,GAAA;AA2DL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,aAAU;AAEV,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,8CAA2C;AAE3C,EAAAA,qBAAA,kCAA+B;AATrB,SAAAA;AAAA,GAAA;AAwZL,IAAK,gCAAL,kBAAKC,mCAAL;AAEL,EAAAA,+BAAA,oBAAiB;AAEjB,EAAAA,+BAAA,qBAAkB;AAElB,EAAAA,+BAAA,WAAQ;AAER,EAAAA,+BAAA,8CAA2C;AARjC,SAAAA;AAAA,GAAA;AA0HL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AAC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;AAAA;AA9Ba,4BA6BK,SAAS;AAMpB,IAAM,oCAAN,cAAgD,MAAM;AAAA,EAc3D,cAAc;AACZ,UAAM,2BAA2B;AAEjC,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,kCA6BK,SAAS;AAMpB,IAAM,mCAAN,cAA+C,MAAM;AAAA,EAc1D,cAAc;AACZ,UAAM,0BAA0B;AAEhC,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,iCA6BK,SAAS;","names":["provideHandlers","BalanceType","QuotaType","LimitedQuotaType","MembershipErrorType","MembershipCannotBeChargedType","IdentityType","import_timestamp","provideHandlers"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { B as BalanceType, g as Benefit, h as BenefitQuotaOneOf, C as CatalogReference,
|
|
1
|
+
import { ad as ListEligibleMembershipsEnvelope, d as ListEligibleMembershipsResponse, ae as ChargeMembershipEnvelope, K as ChargeMembershipResponse, af as GetMembershipVoidabilityEnvelope, Z as GetMembershipVoidabilityResponse, ag as VoidMembershipChargeEnvelope, $ as VoidMembershipChargeResponse } from './service-plugins-error-classes-C9zIZn1i.js';
|
|
2
|
+
export { B as BalanceType, g as Benefit, h as BenefitQuotaOneOf, C as CatalogReference, J as ChargeMembershipRequest, a1 as Context, v as CoveredLineItem, W as Ended, y as EnhanceAndValidateSelectionRequest, A as EnhanceAndValidateSelectionResponse, E as ExistingMembership, D as ExistingMembershipEnhanced, z as ExistingMembershipInput, G as FutureMembership, F as FutureMembershipInput, Y as GetMembershipVoidabilityRequest, a3 as IdentificationData, a4 as IdentificationDataIdOneOf, a2 as IdentityType, a6 as InsufficientBalanceWixError, I as InvalidMembership, a5 as InvalidSelectionWixError, i as LimitedQuota, j as LimitedQuotaType, a as LineItem, u as LineItemCoverage, o as LineItemNotFoundInfo, L as ListEligibleMembershipsRequest, s as ListExistingMembershipsRequest, t as ListExistingMembershipsResponse, w as ListPurchasablePlansRequest, x as ListPurchasablePlansResponse, M as Membership, X as MembershipAlreadyChargedError, a9 as MembershipAlreadyChargedWixError, N as MembershipCannotBeChargedError, O as MembershipCannotBeChargedErrorErrorDataOneOf, R as MembershipCannotBeChargedType, r as MembershipCannotBeUsedForLineItemInfo, q as MembershipCannotBeUsedForLineItemsInfo, a8 as MembershipCannotBeUsedWixError, a7 as MembershipDoesNotApplyToItemWixError, n as MembershipErrorType, l as MembershipInvalidSelectionError, m as MembershipInvalidSelectionErrorErrorDataOneOf, k as MembershipInvalidSelectionErrors, e as MembershipName, f as MembershipPaymentCredits, a0 as MembershipsSPIConfig, U as NotStartedYet, T as OutOfCredits, P as PurchasablePlan, Q as QuotaType, c as SelectedMembership, b as SelectedMemberships, S as ServiceProperties, ac as TransactionAlreadyVoidedWixError, ab as TransactionCannotBeVoidedWixError, aa as TransactionNotFoundWixError, V as ValidatedExistingMemberships, H as ValidatedPurchasablePlans, _ as VoidMembershipChargeRequest } from './service-plugins-error-classes-C9zIZn1i.js';
|
|
3
3
|
import '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.typings.ts","../../src/service-plugins-error-classes.ts","../../src/service-plugins-types.ts"],"sourcesContent":["import {\n ListEligibleMembershipsResponse,\n ChargeMembershipResponse,\n GetMembershipVoidabilityResponse,\n VoidMembershipChargeResponse,\n} from './src/service-plugins-types.js';\nimport {\n ListEligibleMembershipsEnvelope,\n ChargeMembershipEnvelope,\n GetMembershipVoidabilityEnvelope,\n VoidMembershipChargeEnvelope,\n} from './src/interfaces-ecom-v1-memberships-provider.public.js';\n\nexport * from './src/service-plugins-error-classes';\nexport * from './src/service-plugins-types';\nexport {\n ListEligibleMembershipsEnvelope,\n ChargeMembershipEnvelope,\n GetMembershipVoidabilityEnvelope,\n VoidMembershipChargeEnvelope,\n};\n\n/**\n * Deprecated. Use `ListExistingMemberships` + `ListPurchasablePlans` for read, and `EnhanceAndValidateSelection` for selection validation.\n * @throws InvalidSelectionWixError\n * @throws InsufficientBalanceWixError\n */\nexport declare function listEligibleMemberships(\n payload: ListEligibleMembershipsEnvelope\n): ListEligibleMembershipsResponse | Promise<ListEligibleMembershipsResponse>;\n/**\n * This method requests that a membership be charged by your app.\n * @throws MembershipDoesNotApplyToItemWixError\n * @throws MembershipCannotBeUsedWixError\n * @throws MembershipAlreadyChargedWixError\n */\nexport declare function chargeMembership(\n payload: ChargeMembershipEnvelope\n): ChargeMembershipResponse | Promise<ChargeMembershipResponse>;\n/**\n * This method retrieves from your app whether a membership can be voided.\n * @throws TransactionNotFoundWixError\n */\nexport declare function getMembershipVoidability(\n payload: GetMembershipVoidabilityEnvelope\n): GetMembershipVoidabilityResponse | Promise<GetMembershipVoidabilityResponse>;\n/**\n * This method requests that a membership charge be voided by your app.\n * @throws TransactionNotFoundWixError\n * @throws TransactionCannotBeVoidedWixError\n * @throws TransactionAlreadyVoidedWixError\n */\nexport declare function voidMembershipCharge(\n payload: VoidMembershipChargeEnvelope\n): VoidMembershipChargeResponse | Promise<VoidMembershipChargeResponse>;\n","import {\n MembershipInvalidSelectionErrors,\n MembershipCannotBeChargedError,\n MembershipAlreadyChargedError,\n} from './service-plugins-types.js';\n\n/**\n * The provided membership selection is invalid\n */\nexport class InvalidSelectionWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipInvalidSelectionErrors;\n\n constructor(data: MembershipInvalidSelectionErrors = {}) {\n super('InvalidSelection');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_SELECTION';\n this.name = 'InvalidSelection';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipInvalidSelectionErrors';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidSelection',\n applicationCode: 'INVALID_SELECTION',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The selected memberships do not have enough balance to cover the line items.\n */\nexport class InsufficientBalanceWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InsufficientBalance');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'INSUFFICIENT_BALANCE';\n this.name = 'InsufficientBalance';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InsufficientBalance',\n applicationCode: 'INSUFFICIENT_BALANCE',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, but does not apply for the provided item\n */\nexport class MembershipDoesNotApplyToItemWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('MembershipDoesNotApplyToItem');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM';\n this.name = 'MembershipDoesNotApplyToItem';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipDoesNotApplyToItem',\n applicationCode: 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, applied to the provided item but cannot be charged. For example because a limited membership doesn't have enough credits\n */\nexport class MembershipCannotBeUsedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipCannotBeChargedError;\n\n constructor(data: MembershipCannotBeChargedError = {}) {\n super('MembershipCannotBeUsed');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'MEMBERSHIP_CANNOT_BE_CHARGED';\n this.name = 'MembershipCannotBeUsed';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipCannotBeChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipCannotBeUsed',\n applicationCode: 'MEMBERSHIP_CANNOT_BE_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * This charge was already done, per the idempotency key of membershipId + orderId + rootCatalogItemId\n */\nexport class MembershipAlreadyChargedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipAlreadyChargedError;\n\n constructor(data: MembershipAlreadyChargedError = {}) {\n super('MembershipAlreadyCharged');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'MEMBERSHIP_ALREADY_CHARGED';\n this.name = 'MembershipAlreadyCharged';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipAlreadyChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipAlreadyCharged',\n applicationCode: 'MEMBERSHIP_ALREADY_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction not found\n */\nexport class TransactionNotFoundWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionNotFound');\n\n this.httpCode = 404;\n this.statusCode = 'NOT_FOUND';\n this.applicationCode = 'TRANSACTION_NOT_FOUND';\n this.name = 'TransactionNotFound';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionNotFound',\n applicationCode: 'TRANSACTION_NOT_FOUND',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction exists but cannot be voided\n */\nexport class TransactionCannotBeVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionCannotBeVoided');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'TRANSACTION_CANNOT_BE_VOIDED';\n this.name = 'TransactionCannotBeVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionCannotBeVoided',\n applicationCode: 'TRANSACTION_CANNOT_BE_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction was already voided\n */\nexport class TransactionAlreadyVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionAlreadyVoided');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'TRANSACTION_ALREADY_VOIDED';\n this.name = 'TransactionAlreadyVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionAlreadyVoided',\n applicationCode: 'TRANSACTION_ALREADY_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","export interface ListEligibleMembershipsRequest {\n /**\n * The line items for which to list eligible memberships.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * The selected payment memberships and which line items they apply to.\n *\n * When not provided, your implementation is expected to return the default selection.\n * When provided, your implementation is expected to validate and return it.\n */\n selectedMemberships?: SelectedMemberships;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Catalog and item reference info. */\n catalogReference?: CatalogReference;\n /** Properties of the service. When relevant, contains information such as date and number of participants. */\n serviceProperties?: ServiceProperties;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.\n *\n * For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)\n * or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface ServiceProperties {\n /**\n * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.\n * For example, the start time of a class.\n */\n scheduledDate?: Date | null;\n /**\n * The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room.\n * @min 1\n * @max 10000\n */\n numberOfParticipants?: number | null;\n}\n\nexport interface SelectedMemberships {\n /**\n * Selected memberships.\n * @maxSize 300\n */\n memberships?: SelectedMembership[];\n}\n\nexport interface SelectedMembership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * IDs of the line items this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface ListEligibleMembershipsResponse {\n /**\n * List of memberships that are eligible for the given member and line items.\n * @maxSize 300\n */\n eligibleMemberships?: Membership[];\n /**\n * List of memberships owned by the member, but cannot be used due to the reason provided.\n * @maxSize 300\n */\n invalidMemberships?: InvalidMembership[];\n /**\n * List of selected memberships and which line items they apply to.\n * @maxSize 300\n */\n selectedMemberships?: SelectedMembership[];\n}\n\nexport interface Membership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Membership name. */\n name?: MembershipName;\n /**\n * Deprecated. Use `ExistingMembership.covered_line_items` to see which line items this membership covers.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n * @deprecated\n * @replacedBy ExistingMembership.covered_line_items.line_item_id\n */\n lineItemIds?: string[];\n /**\n * Deprecated. The new flow no longer exposes raw balances on a membership; what a membership can pay\n * for is conveyed by `ExistingMembership.covered_line_items` (per-item redemption cost).\n * @deprecated\n * @replacedBy ExistingMembership.covered_line_items.redemption_cost\n */\n credits?: MembershipPaymentCredits;\n /**\n * Membership expiration date.\n * @deprecated\n * @replacedBy offering_description\n */\n expirationDate?: Date | null;\n /**\n * Deprecated. Use `benefits.additional_data` for benefit-specific provider data.\n * @deprecated\n */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface MembershipName {\n /**\n * Membership name.\n * @maxLength 100\n */\n original?: string;\n /**\n * Translated membership name. Defaults to `original` when not provided.\n * @maxLength 100\n */\n translated?: string | null;\n}\n\nexport interface MembershipPaymentCredits {\n /**\n * Membership's initial value.\n * @min 1\n */\n total?: number;\n /** Membership's remaining value. */\n remaining?: number;\n}\n\nexport enum BalanceType {\n /** Balance is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Balance is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\n/**\n * A single redeemable benefit. A purchasable plan grants one or more benefits (`PurchasablePlan.benefits`);\n * once the plan is paid, each benefit becomes its own membership (charged via `membership_id`).\n * (Also present on the deprecated `Membership.benefits`, retained for backward compatibility.)\n */\nexport interface Benefit extends BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n /**\n * Identifier for this benefit. On a `PurchasablePlan` it must be unique within the response so\n * `coverages` (`LineItemCoverage.benefit_id`) can reference it unambiguously across the plan's benefits.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Human-readable label for this benefit (for example, \"Manicure\" or \"Pedicure\" on multi-set punchcards).\n * @maxLength 200\n */\n label?: string | null;\n /**\n * The kind of quota this benefit grants: a countable amount drawn down on redemption (`LIMITED`),\n * or an unbounded amount that is never drawn down (`UNLIMITED`).\n */\n quotaType?: QuotaType;\n}\n\n/** @oneof */\nexport interface BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n}\n\nexport enum QuotaType {\n /** The benefit grants a countable quota that is drawn down on redemption. */\n LIMITED = 'LIMITED',\n /** The benefit is unlimited (unbounded) and is never drawn down. */\n UNLIMITED = 'UNLIMITED',\n}\n\n/** A limited, countable redeemable amount. */\nexport interface LimitedQuota {\n /**\n * The quota's initial value.\n * @min 1\n */\n total?: number;\n /** The quota's remaining value. */\n remaining?: number;\n /** How the quota is measured. */\n limitedQuotaType?: LimitedQuotaType;\n}\n\nexport enum LimitedQuotaType {\n /** Quota is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Quota is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\nexport interface InvalidMembership {\n /** The membership that is invalid and cannot be used. */\n membership?: Membership;\n /**\n * Reason why this membership is invalid.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string;\n}\n\nexport interface MembershipInvalidSelectionErrors {\n /**\n * Error details for invalid memberships.\n * @maxSize 300\n */\n membershipInvalidSelectionErrors?: MembershipInvalidSelectionError[];\n}\n\nexport interface MembershipInvalidSelectionError\n extends MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n /**\n * Membership ID.\n * @format GUID\n */\n membershipId?: string;\n /** Error type. */\n errorType?: MembershipErrorType;\n}\n\n/** @oneof */\nexport interface MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n}\n\nexport enum MembershipErrorType {\n UNKNOWN = 'UNKNOWN',\n /** Membership not found. */\n MEMBERSHIP_NOT_FOUND = 'MEMBERSHIP_NOT_FOUND',\n /** The selection points to a line item ID that wasn't provided. */\n LINE_ITEM_NOT_FOUND = 'LINE_ITEM_NOT_FOUND',\n /** The membership cannot be used for the specific line items provided. */\n MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS = 'MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS',\n /** The membership can be used for each individual line item, but combining all of them is invalid. */\n MEMBERSHIP_SELECTION_INVALID = 'MEMBERSHIP_SELECTION_INVALID',\n}\n\nexport interface LineItemNotFoundInfo {\n /**\n * Line item IDs that were missing.\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemsInfo {\n /**\n * Line items that cannot be used with this membership, and the reason why.\n * @maxSize 300\n */\n lineItems?: MembershipCannotBeUsedForLineItemInfo[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemInfo {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * Reason why this line item cannot be used with this membership.\n * @maxLength 1000\n */\n reason?: string;\n}\n\nexport interface ListExistingMembershipsRequest {\n /**\n * The line items for which to list memberships the member already owns.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n}\n\nexport interface ListExistingMembershipsResponse {\n /**\n * Deprecated. Use `memberships`, which pairs each membership with the line items it can pay for.\n * @maxSize 300\n * @deprecated\n * @replacedBy memberships.membership\n * @targetRemovalDate 2026-07-30\n */\n existingMemberships?: Membership[];\n /**\n * Deprecated. Coverage is now nested per membership in `memberships` (`ExistingMembership.covered_line_items`).\n * @maxSize 300\n * @deprecated\n * @replacedBy memberships.covered_line_items\n * @targetRemovalDate 2026-07-30\n */\n coverages?: LineItemCoverage[];\n}\n\n/**\n * Maps a benefit to a line item it can cover, and at what cost, linked to a benefit by `benefit_id`.\n * One entry per (benefit, line item). Returned by `ListPurchasablePlans` (alongside `purchasable_plans`)\n * and by the deprecated `ListExistingMembershipsResponse.coverages`. For the current memberships flow the\n * equivalent mapping is `ExistingMembership.covered_line_items`, which needs no `benefit_id` because a\n * membership is a single benefit.\n */\nexport interface LineItemCoverage {\n /**\n * The benefit that covers the line item, as returned in `Benefit.benefit_id`.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * The line item this benefit covers.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the benefit's `limited_quota.remaining` value for this item.\n * Always 0 for an unlimited benefit (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\n/**\n * A membership the member already owns, together with the input line items it can pay for.\n *\n * A membership is a single benefit granted by a plan the member has already paid for, so coverage is\n * nested here per membership (no `benefit_id` linkage is needed, unlike a plan that grants many benefits).\n */\nexport interface ExistingMembership {\n /** The membership the member owns. */\n membership?: Membership;\n /**\n * The input line items this membership can pay for, and the cost to redeem each.\n * @maxSize 300\n */\n coveredLineItems?: CoveredLineItem[];\n}\n\n/** A line item a membership can pay for, and the cost to redeem it. */\nexport interface CoveredLineItem {\n /**\n * The input line item this membership can cover.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the membership's benefit quota (`benefit.limited_quota.remaining`) for this item.\n * Always 0 when the benefit is unlimited (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\nexport interface ListPurchasablePlansRequest {\n /**\n * The line items for which to list plans the member could purchase.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ListPurchasablePlansResponse {\n /**\n * Plans the member could purchase that would cover one or more input line items.\n * @maxSize 300\n */\n purchasablePlans?: PurchasablePlan[];\n /**\n * How the returned plans' benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\nexport interface PurchasablePlan {\n /** Catalog and item reference for the plan that can be purchased. */\n catalogReference?: CatalogReference;\n /** Plan name. */\n name?: MembershipName;\n /**\n * Benefits the plan would grant once purchased. Multiple entries support multi-benefit plans (e.g., a bundle granting separate yoga and pilates credits).\n * @minSize 1\n * @maxSize 50\n */\n benefits?: Benefit[];\n /**\n * Human-readable offering summary for display (for example price and validity text). Provider-supplied.\n * @maxLength 500\n */\n offeringDescription?: string | null;\n /**\n * URL the buyer is redirected to in order to collect additional info required to purchase this plan.\n * @format WEB_URL\n */\n infoCollectionUrl?: string | null;\n /**\n * Plan price.\n * @decimalValue options { gte:0, maxScale:3 }\n */\n price?: string;\n /**\n * Human-readable description of the plan price (for example \"First month free, then $20/month\").\n *\n * `price` is simply the price (useful for sorting or comparison, for example), while this is a\n * descriptive, display-oriented summary of it.\n * @maxLength 500\n */\n priceDescription?: string | null;\n}\n\nexport interface EnhanceAndValidateSelectionRequest {\n /**\n * Memberships the caller has selected from the member's existing memberships pool.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipInput[];\n /**\n * Future memberships the caller intends to purchase as part of this checkout.\n * @maxSize 300\n */\n futureMemberships?: FutureMembershipInput[];\n /**\n * Member ID.\n *\n * Required when `existing_memberships` is not empty; omitted for future-memberships-only selections.\n * Optional (StringValue) so an absent member id is sent unset rather than as an empty string, which would fail GUID validation.\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ExistingMembershipInput {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Line items the caller intends to redeem against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembershipInput {\n /** Catalog reference of the plan that will be purchased. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Line items the caller intends to redeem against the future membership.\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface EnhanceAndValidateSelectionResponse {\n /**\n * Validated and enhanced existing membership selections.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipEnhanced[];\n /**\n * Validated and enhanced future membership selections.\n * @maxSize 300\n */\n futureMemberships?: FutureMembership[];\n}\n\nexport interface ExistingMembershipEnhanced {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n /**\n * Validated line items redeemed against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembership {\n /** Catalog reference of the validated future membership. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n}\n\nexport interface ChargeMembershipRequest {\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value is typically `membershipId` + `orderId` + `rootCatalogItemId`.\n * @minLength 1\n * @maxLength 200\n */\n idempotencyKey: string;\n /**\n * Service properties.\n *\n * When relevant, this contains information such as date and number of participants.\n */\n serviceProperties?: ServiceProperties;\n /** Catalog and item reference info. */\n catalogReference: CatalogReference;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n /** Additional data about this charge. */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface ChargeMembershipResponse {\n /**\n * The transaction ID for this charge.\n *\n * Use this ID to void the charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface MembershipCannotBeChargedError\n extends MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n /** Error type. */\n errorType?: MembershipCannotBeChargedType;\n}\n\n/** @oneof */\nexport interface MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n}\n\nexport enum MembershipCannotBeChargedType {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n OUT_OF_CREDITS = 'OUT_OF_CREDITS',\n /** Membership has not become active yet. */\n NOT_STARTED_YET = 'NOT_STARTED_YET',\n /** Membership has expired or ended. */\n ENDED = 'ENDED',\n /** Not applicable for multiple participants. */\n NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS = 'NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS',\n}\n\nexport interface OutOfCredits {\n /** Required amount of credits. */\n required?: number;\n /** Remaining amount of credits. */\n remaining?: number;\n}\n\nexport interface NotStartedYet {\n /** Start date of the membership. */\n membershipStartDate?: Date | null;\n}\n\nexport interface Ended {\n /** End date of the membership. */\n endDate?: Date | null;\n}\n\nexport interface MembershipAlreadyChargedError {\n /**\n * ID of the transaction that was already used for membership charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface GetMembershipVoidabilityRequest {\n /**\n * Transaction ID to check if it can be voided.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface GetMembershipVoidabilityResponse {\n /** Whether the membership charge can be voided. */\n voidable?: boolean;\n /**\n * Reason why the membership charge cannot be voided.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string | null;\n}\n\nexport interface VoidMembershipChargeRequest {\n /**\n * Transaction ID to void.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface VoidMembershipChargeResponse {}\n\nexport interface MembershipsSPIConfig {\n /**\n * The base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI.\n * For example, to call the Charge Membership endpoint at https://my-memberships.com/v1/charge-membership, the base URI you provide here is https://my-memberships.com/.\n * @format WEB_URL\n */\n deploymentUri?: string;\n /**\n * The app IDs of the catalogs your app supports.\n * @minSize 1\n * @maxSize 300\n * @format GUID\n */\n catalogAppDefIds?: string[];\n /**\n * Set to true once your app implements the updated redemption methods (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`)\n * and the per-balance redemption model. While false, Wix eCommerce keeps calling the legacy `ListEligibleMemberships` flow.\n * This toggle lets providers migrate without a synchronized deploy and is removed once migration completes.\n */\n toggleUpdatedMethodsEnabled?: boolean;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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AEL,EAAAA,aAAA,gBAAa;AAEb,EAAAA,aAAA,YAAS;AAJC,SAAAA;AAAA,GAAA;AAsCL,IAAK,YAAL,kBAAKC,eAAL;AAEL,EAAAA,WAAA,aAAU;AAEV,EAAAA,WAAA,eAAY;AAJF,SAAAA;AAAA,GAAA;AAoBL,IAAK,mBAAL,kBAAKC,sBAAL;AAEL,EAAAA,kBAAA,gBAAa;AAEb,EAAAA,kBAAA,YAAS;AAJC,SAAAA;AAAA,GAAA;AA2DL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,aAAU;AAEV,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,8CAA2C;AAE3C,EAAAA,qBAAA,kCAA+B;AATrB,SAAAA;AAAA,GAAA;AAqXL,IAAK,gCAAL,kBAAKC,mCAAL;AAEL,EAAAA,+BAAA,oBAAiB;AAEjB,EAAAA,+BAAA,qBAAkB;AAElB,EAAAA,+BAAA,WAAQ;AAER,EAAAA,+BAAA,8CAA2C;AARjC,SAAAA;AAAA,GAAA;AA0HL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["BalanceType","QuotaType","LimitedQuotaType","MembershipErrorType","MembershipCannotBeChargedType","IdentityType"]}
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/service-plugins-error-classes.ts","../../src/service-plugins-types.ts"],"sourcesContent":["import {\n ListEligibleMembershipsResponse,\n ChargeMembershipResponse,\n GetMembershipVoidabilityResponse,\n VoidMembershipChargeResponse,\n} from './src/service-plugins-types.js';\nimport {\n ListEligibleMembershipsEnvelope,\n ChargeMembershipEnvelope,\n GetMembershipVoidabilityEnvelope,\n VoidMembershipChargeEnvelope,\n} from './src/interfaces-ecom-v1-memberships-provider.public.js';\n\nexport * from './src/service-plugins-error-classes';\nexport * from './src/service-plugins-types';\nexport {\n ListEligibleMembershipsEnvelope,\n ChargeMembershipEnvelope,\n GetMembershipVoidabilityEnvelope,\n VoidMembershipChargeEnvelope,\n};\n\n/**\n * Deprecated. Use `ListExistingMemberships` + `ListPurchasablePlans` for read, and `EnhanceAndValidateSelection` for selection validation.\n * @throws InvalidSelectionWixError\n * @throws InsufficientBalanceWixError\n */\nexport declare function listEligibleMemberships(\n payload: ListEligibleMembershipsEnvelope\n): ListEligibleMembershipsResponse | Promise<ListEligibleMembershipsResponse>;\n/**\n * This method requests that a membership be charged by your app.\n * @throws MembershipDoesNotApplyToItemWixError\n * @throws MembershipCannotBeUsedWixError\n * @throws MembershipAlreadyChargedWixError\n */\nexport declare function chargeMembership(\n payload: ChargeMembershipEnvelope\n): ChargeMembershipResponse | Promise<ChargeMembershipResponse>;\n/**\n * This method retrieves from your app whether a membership can be voided.\n * @throws TransactionNotFoundWixError\n */\nexport declare function getMembershipVoidability(\n payload: GetMembershipVoidabilityEnvelope\n): GetMembershipVoidabilityResponse | Promise<GetMembershipVoidabilityResponse>;\n/**\n * This method requests that a membership charge be voided by your app.\n * @throws TransactionNotFoundWixError\n * @throws TransactionCannotBeVoidedWixError\n * @throws TransactionAlreadyVoidedWixError\n */\nexport declare function voidMembershipCharge(\n payload: VoidMembershipChargeEnvelope\n): VoidMembershipChargeResponse | Promise<VoidMembershipChargeResponse>;\n","import {\n MembershipInvalidSelectionErrors,\n MembershipCannotBeChargedError,\n MembershipAlreadyChargedError,\n} from './service-plugins-types.js';\n\n/**\n * The provided membership selection is invalid\n */\nexport class InvalidSelectionWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipInvalidSelectionErrors;\n\n constructor(data: MembershipInvalidSelectionErrors = {}) {\n super('InvalidSelection');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_SELECTION';\n this.name = 'InvalidSelection';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipInvalidSelectionErrors';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidSelection',\n applicationCode: 'INVALID_SELECTION',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The selected memberships do not have enough balance to cover the line items.\n */\nexport class InsufficientBalanceWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InsufficientBalance');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'INSUFFICIENT_BALANCE';\n this.name = 'InsufficientBalance';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InsufficientBalance',\n applicationCode: 'INSUFFICIENT_BALANCE',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, but does not apply for the provided item\n */\nexport class MembershipDoesNotApplyToItemWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('MembershipDoesNotApplyToItem');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM';\n this.name = 'MembershipDoesNotApplyToItem';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipDoesNotApplyToItem',\n applicationCode: 'MEMBERSHIP_DOES_NOT_APPLY_TO_ITEM',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * The membership was found, applied to the provided item but cannot be charged. For example because a limited membership doesn't have enough credits\n */\nexport class MembershipCannotBeUsedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipCannotBeChargedError;\n\n constructor(data: MembershipCannotBeChargedError = {}) {\n super('MembershipCannotBeUsed');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'MEMBERSHIP_CANNOT_BE_CHARGED';\n this.name = 'MembershipCannotBeUsed';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipCannotBeChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipCannotBeUsed',\n applicationCode: 'MEMBERSHIP_CANNOT_BE_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * This charge was already done, per the idempotency key of membershipId + orderId + rootCatalogItemId\n */\nexport class MembershipAlreadyChargedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorSchemaName: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n data: MembershipAlreadyChargedError;\n\n constructor(data: MembershipAlreadyChargedError = {}) {\n super('MembershipAlreadyCharged');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'MEMBERSHIP_ALREADY_CHARGED';\n this.name = 'MembershipAlreadyCharged';\n this.errorSchemaName =\n 'com.wix.ecom.memberships_spi.v1.MembershipAlreadyChargedError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MembershipAlreadyCharged',\n applicationCode: 'MEMBERSHIP_ALREADY_CHARGED',\n };\n\n this.data = data;\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction not found\n */\nexport class TransactionNotFoundWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionNotFound');\n\n this.httpCode = 404;\n this.statusCode = 'NOT_FOUND';\n this.applicationCode = 'TRANSACTION_NOT_FOUND';\n this.name = 'TransactionNotFound';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionNotFound',\n applicationCode: 'TRANSACTION_NOT_FOUND',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction exists but cannot be voided\n */\nexport class TransactionCannotBeVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionCannotBeVoided');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'TRANSACTION_CANNOT_BE_VOIDED';\n this.name = 'TransactionCannotBeVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionCannotBeVoided',\n applicationCode: 'TRANSACTION_CANNOT_BE_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Transaction was already voided\n */\nexport class TransactionAlreadyVoidedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('TransactionAlreadyVoided');\n\n this.httpCode = 409;\n this.statusCode = 'ALREADY_EXISTS';\n this.applicationCode = 'TRANSACTION_ALREADY_VOIDED';\n this.name = 'TransactionAlreadyVoided';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'TransactionAlreadyVoided',\n applicationCode: 'TRANSACTION_ALREADY_VOIDED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","export interface ListEligibleMembershipsRequest {\n /**\n * The line items for which to list eligible memberships.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * The selected payment memberships and which line items they apply to.\n *\n * When not provided, your implementation is expected to return the default selection.\n * When provided, your implementation is expected to validate and return it.\n */\n selectedMemberships?: SelectedMemberships;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Catalog and item reference info. */\n catalogReference?: CatalogReference;\n /** Properties of the service. When relevant, contains information such as date and number of participants. */\n serviceProperties?: ServiceProperties;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.\n *\n * For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)\n * or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface ServiceProperties {\n /**\n * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.\n * For example, the start time of a class.\n */\n scheduledDate?: Date | null;\n /**\n * The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room.\n * @min 1\n * @max 10000\n */\n numberOfParticipants?: number | null;\n}\n\nexport interface SelectedMemberships {\n /**\n * Selected memberships.\n * @maxSize 300\n */\n memberships?: SelectedMembership[];\n}\n\nexport interface SelectedMembership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * IDs of the line items this membership applies to.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface ListEligibleMembershipsResponse {\n /**\n * List of memberships that are eligible for the given member and line items.\n * @maxSize 300\n */\n eligibleMemberships?: Membership[];\n /**\n * List of memberships owned by the member, but cannot be used due to the reason provided.\n * @maxSize 300\n */\n invalidMemberships?: InvalidMembership[];\n /**\n * List of selected memberships and which line items they apply to.\n * @maxSize 300\n */\n selectedMemberships?: SelectedMembership[];\n}\n\nexport interface Membership {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Membership name. */\n name?: MembershipName;\n /**\n * Deprecated. Use `ExistingMembership.covered_line_items` to see which line items this membership covers.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n * @deprecated\n * @replacedBy ExistingMembership.covered_line_items.line_item_id\n * @targetRemovalDate 2026-07-30\n */\n lineItemIds?: string[];\n /** Membership's payment credits (balance information). */\n credits?: MembershipPaymentCredits;\n /**\n * Membership expiration date.\n * @deprecated\n * @replacedBy offering_description\n * @targetRemovalDate 2026-07-30\n */\n expirationDate?: Date | null;\n /**\n * Deprecated. Use `benefits.additional_data` for benefit-specific provider data.\n * @deprecated\n * @replacedBy benefits.additional_data\n * @targetRemovalDate 2026-07-30\n */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface MembershipName {\n /**\n * Membership name.\n * @maxLength 100\n */\n original?: string;\n /**\n * Translated membership name. Defaults to `original` when not provided.\n * @maxLength 100\n */\n translated?: string | null;\n}\n\nexport interface MembershipPaymentCredits {\n /**\n * Membership's initial value.\n * @min 1\n */\n total?: number;\n /** Membership's remaining value. */\n remaining?: number;\n}\n\nexport enum BalanceType {\n /** Balance is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Balance is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\n/**\n * A single redeemable benefit. A purchasable plan grants one or more benefits (`PurchasablePlan.benefits`);\n * once the plan is paid, each benefit becomes its own membership (charged via `membership_id`).\n * (Also present on the deprecated `Membership.benefits`, retained for backward compatibility.)\n */\nexport interface Benefit extends BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n /**\n * Identifier for this benefit. On a `PurchasablePlan` it must be unique within the response so\n * `coverages` (`LineItemCoverage.benefit_id`) can reference it unambiguously across the plan's benefits.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Human-readable label for this benefit (for example, \"Manicure\" or \"Pedicure\" on multi-set punchcards).\n * @maxLength 200\n */\n label?: string | null;\n /**\n * The kind of quota this benefit grants: a countable amount drawn down on redemption (`LIMITED`),\n * or an unbounded amount that is never drawn down (`UNLIMITED`).\n */\n quotaType?: QuotaType;\n}\n\n/** @oneof */\nexport interface BenefitQuotaOneOf {\n limitedQuota?: LimitedQuota;\n}\n\nexport enum QuotaType {\n /** The benefit grants a countable quota that is drawn down on redemption. */\n LIMITED = 'LIMITED',\n /** The benefit is unlimited (unbounded) and is never drawn down. */\n UNLIMITED = 'UNLIMITED',\n}\n\n/** A limited, countable redeemable amount. */\nexport interface LimitedQuota {\n /**\n * The quota's initial value.\n * @min 1\n */\n total?: number;\n /** The quota's remaining value. */\n remaining?: number;\n /** How the quota is measured. */\n limitedQuotaType?: LimitedQuotaType;\n}\n\nexport enum LimitedQuotaType {\n /** Quota is measured in discrete uses (e.g., sessions, visits). */\n PUNCH_CARD = 'PUNCH_CARD',\n /** Quota is measured in a currency-like value (e.g., points). */\n CREDIT = 'CREDIT',\n}\n\nexport interface InvalidMembership {\n /** The membership that is invalid and cannot be used. */\n membership?: Membership;\n /**\n * Reason why this membership is invalid.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string;\n}\n\nexport interface MembershipInvalidSelectionErrors {\n /**\n * Error details for invalid memberships.\n * @maxSize 300\n */\n membershipInvalidSelectionErrors?: MembershipInvalidSelectionError[];\n}\n\nexport interface MembershipInvalidSelectionError\n extends MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n /**\n * Membership ID.\n * @format GUID\n */\n membershipId?: string;\n /** Error type. */\n errorType?: MembershipErrorType;\n}\n\n/** @oneof */\nexport interface MembershipInvalidSelectionErrorErrorDataOneOf {\n /** Line item IDs that were missing. */\n lineItemNotFoundInfo?: LineItemNotFoundInfo;\n /** Error details for line items that cannot be used with this membership. */\n membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;\n /**\n * Reason why this membership selection is invalid.\n * @maxLength 1000\n */\n membershipSelectionInvalidReason?: string | null;\n}\n\nexport enum MembershipErrorType {\n UNKNOWN = 'UNKNOWN',\n /** Membership not found. */\n MEMBERSHIP_NOT_FOUND = 'MEMBERSHIP_NOT_FOUND',\n /** The selection points to a line item ID that wasn't provided. */\n LINE_ITEM_NOT_FOUND = 'LINE_ITEM_NOT_FOUND',\n /** The membership cannot be used for the specific line items provided. */\n MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS = 'MEMBERSHIP_CANNOT_BE_USED_FOR_LINE_ITEMS',\n /** The membership can be used for each individual line item, but combining all of them is invalid. */\n MEMBERSHIP_SELECTION_INVALID = 'MEMBERSHIP_SELECTION_INVALID',\n}\n\nexport interface LineItemNotFoundInfo {\n /**\n * Line item IDs that were missing.\n * @maxSize 300\n * @minLength 1\n * @maxLength 100\n */\n lineItemIds?: string[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemsInfo {\n /**\n * Line items that cannot be used with this membership, and the reason why.\n * @maxSize 300\n */\n lineItems?: MembershipCannotBeUsedForLineItemInfo[];\n}\n\nexport interface MembershipCannotBeUsedForLineItemInfo {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * Reason why this line item cannot be used with this membership.\n * @maxLength 1000\n */\n reason?: string;\n}\n\nexport interface ListExistingMembershipsRequest {\n /**\n * The line items for which to list memberships the member already owns.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n}\n\nexport interface ListExistingMembershipsResponse {\n /**\n * Deprecated. Use `memberships`, which pairs each membership with the line items it can pay for.\n * @maxSize 300\n * @deprecated\n * @replacedBy memberships.membership\n * @targetRemovalDate 2026-07-30\n */\n existingMemberships?: Membership[];\n /**\n * Deprecated. Coverage is now nested per membership in `memberships` (`ExistingMembership.covered_line_items`).\n * @maxSize 300\n * @deprecated\n * @replacedBy memberships.covered_line_items\n * @targetRemovalDate 2026-07-30\n */\n coverages?: LineItemCoverage[];\n}\n\n/**\n * Maps a benefit to a line item it can cover, and at what cost, linked to a benefit by `benefit_id`.\n * One entry per (benefit, line item). Returned by `ListPurchasablePlans` (alongside `purchasable_plans`)\n * and by the deprecated `ListExistingMembershipsResponse.coverages`. For the current memberships flow the\n * equivalent mapping is `ExistingMembership.covered_line_items`, which needs no `benefit_id` because a\n * membership is a single benefit.\n */\nexport interface LineItemCoverage {\n /**\n * The benefit that covers the line item, as returned in `Benefit.benefit_id`.\n * @minLength 1\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * The line item this benefit covers.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the benefit's `limited_quota.remaining` value for this item.\n * Always 0 for an unlimited benefit (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\n/**\n * A membership the member already owns, together with the input line items it can pay for.\n *\n * A membership is a single benefit granted by a plan the member has already paid for, so coverage is\n * nested here per membership (no `benefit_id` linkage is needed, unlike a plan that grants many benefits).\n */\nexport interface ExistingMembership {\n /** The membership the member owns. */\n membership?: Membership;\n /**\n * The input line items this membership can pay for, and the cost to redeem each.\n * @maxSize 300\n */\n coveredLineItems?: CoveredLineItem[];\n}\n\n/** A line item a membership can pay for, and the cost to redeem it. */\nexport interface CoveredLineItem {\n /**\n * The input line item this membership can cover.\n * @minLength 1\n * @maxLength 100\n */\n lineItemId?: string;\n /**\n * The amount to redeem from the membership's benefit quota (`benefit.limited_quota.remaining`) for this item.\n * Always 0 when the benefit is unlimited (nothing is decremented).\n */\n redemptionCost?: number;\n}\n\nexport interface ListPurchasablePlansRequest {\n /**\n * The line items for which to list plans the member could purchase.\n * @minSize 1\n * @maxSize 300\n */\n lineItems: LineItem[];\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ListPurchasablePlansResponse {\n /**\n * Plans the member could purchase that would cover one or more input line items.\n * @maxSize 300\n */\n purchasablePlans?: PurchasablePlan[];\n /**\n * How the returned plans' benefits apply to the requested line items (coverage + per-item cost),\n * linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\nexport interface PurchasablePlan {\n /** Catalog and item reference for the plan that can be purchased. */\n catalogReference?: CatalogReference;\n /** Plan name. */\n name?: MembershipName;\n /**\n * Benefits the plan would grant once purchased. Multiple entries support multi-benefit plans (e.g., a bundle granting separate yoga and pilates credits).\n * @minSize 1\n * @maxSize 50\n */\n benefits?: Benefit[];\n /**\n * Human-readable offering summary for display (for example price and validity text). Provider-supplied.\n * @maxLength 500\n */\n offeringDescription?: string | null;\n /**\n * URL the buyer is redirected to in order to collect additional info required to purchase this plan.\n * @format WEB_URL\n */\n infoCollectionUrl?: string | null;\n /**\n * Plan price.\n * @decimalValue options { gte:0, maxScale:3 }\n */\n price?: string;\n /**\n * Human-readable description of the plan price (for example \"First month free, then $20/month\").\n *\n * `price` is simply the price (useful for sorting or comparison, for example), while this is a\n * descriptive, display-oriented summary of it.\n * @maxLength 500\n */\n priceDescription?: string | null;\n}\n\nexport interface EnhanceAndValidateSelectionRequest {\n /**\n * Memberships the caller has selected from the member's existing memberships pool.\n * @maxSize 300\n */\n existingMemberships?: ExistingMembershipInput[];\n /**\n * Future memberships the caller intends to purchase as part of this checkout.\n * @maxSize 300\n */\n futureMemberships?: FutureMembershipInput[];\n /**\n * Member ID.\n *\n * Required when `existing_memberships` is not empty; omitted for future-memberships-only selections.\n * Optional (StringValue) so an absent member id is sent unset rather than as an empty string, which would fail GUID validation.\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ExistingMembershipInput {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Line items the caller intends to redeem against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface FutureMembershipInput {\n /** Catalog reference of the plan that will be purchased. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /**\n * Line items the caller intends to redeem against the future membership.\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\nexport interface EnhanceAndValidateSelectionResponse {\n /**\n * Deprecated. Use `existing`.\n * @maxSize 300\n * @deprecated\n * @replacedBy existing.memberships\n * @targetRemovalDate 2026-09-30\n */\n existingMemberships?: ExistingMembershipEnhanced[];\n /**\n * Deprecated. Use `purchasable`.\n * @maxSize 300\n * @deprecated\n * @replacedBy purchasable.purchasable_plans\n * @targetRemovalDate 2026-09-30\n */\n futureMemberships?: FutureMembership[];\n /** The validated existing memberships in the selection. */\n existing?: ValidatedExistingMemberships;\n /** The validated future plans in the selection. */\n purchasable?: ValidatedPurchasablePlans;\n}\n\n/** Deprecated. Use `ExistingMembership` (via `ValidatedExistingMemberships`). */\nexport interface ExistingMembershipEnhanced {\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n /**\n * Validated line items redeemed against this membership.\n * @minSize 1\n * @maxSize 300\n */\n lineItems?: LineItem[];\n}\n\n/** Deprecated. Use `PurchasablePlan` (via `ValidatedPurchasablePlans`). */\nexport interface FutureMembership {\n /** Catalog reference of the validated future membership. */\n catalogReference?: CatalogReference;\n /**\n * ID of the benefit that the line items will be redeemed against.\n * @maxLength 200\n */\n benefitId?: string;\n /** Membership name as displayed to the buyer. */\n name?: MembershipName;\n}\n\n/** Same shape as `ListExistingMembershipsResponse.memberships`. */\nexport interface ValidatedExistingMemberships {\n /**\n * The selected memberships, each paired with the line items it can redeem and the cost to redeem each.\n * @maxSize 300\n */\n memberships?: ExistingMembership[];\n}\n\n/** Same shape as `ListPurchasablePlansResponse`. */\nexport interface ValidatedPurchasablePlans {\n /**\n * The selected plans.\n * @maxSize 300\n */\n purchasablePlans?: PurchasablePlan[];\n /**\n * How the plans' benefits cover the line items, linked to a benefit by `benefit_id`.\n * @maxSize 300\n */\n coverages?: LineItemCoverage[];\n}\n\nexport interface ChargeMembershipRequest {\n /**\n * Member ID.\n *\n * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.\n * @format GUID\n */\n memberId: string;\n /**\n * Membership ID.\n * @minLength 1\n * @maxLength 100\n */\n membershipId?: string;\n /**\n * Idempotency key to avoid duplicate charge.\n * The value is typically `membershipId` + `orderId` + `rootCatalogItemId`.\n * @minLength 1\n * @maxLength 200\n */\n idempotencyKey: string;\n /**\n * Service properties.\n *\n * When relevant, this contains information such as date and number of participants.\n */\n serviceProperties?: ServiceProperties;\n /** Catalog and item reference info. */\n catalogReference: CatalogReference;\n /**\n * Root catalog item ID.\n *\n * The value will usually be the same as `catalogReference.catalogItemId`.\n * In cases when these are not the same, this field will return the actual ID of the item in the catalog.\n * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n /** Additional data about this charge. */\n additionalData?: Record<string, any> | null;\n}\n\nexport interface ChargeMembershipResponse {\n /**\n * The transaction ID for this charge.\n *\n * Use this ID to void the charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface MembershipCannotBeChargedError\n extends MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n /** Error type. */\n errorType?: MembershipCannotBeChargedType;\n}\n\n/** @oneof */\nexport interface MembershipCannotBeChargedErrorErrorDataOneOf {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n outOfCredits?: OutOfCredits;\n /** Membership has not become active yet. */\n notStartedYet?: NotStartedYet;\n /** Membership has expired or ended. */\n ended?: Ended;\n}\n\nexport enum MembershipCannotBeChargedType {\n /** Membership is out of credits. For example, 5 are required, but only 4 remain. */\n OUT_OF_CREDITS = 'OUT_OF_CREDITS',\n /** Membership has not become active yet. */\n NOT_STARTED_YET = 'NOT_STARTED_YET',\n /** Membership has expired or ended. */\n ENDED = 'ENDED',\n /** Not applicable for multiple participants. */\n NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS = 'NOT_APPLICABLE_FOR_MULTIPLE_PARTICIPANTS',\n}\n\nexport interface OutOfCredits {\n /** Required amount of credits. */\n required?: number;\n /** Remaining amount of credits. */\n remaining?: number;\n}\n\nexport interface NotStartedYet {\n /** Start date of the membership. */\n membershipStartDate?: Date | null;\n}\n\nexport interface Ended {\n /** End date of the membership. */\n endDate?: Date | null;\n}\n\nexport interface MembershipAlreadyChargedError {\n /**\n * ID of the transaction that was already used for membership charge.\n * @minLength 1\n * @maxLength 100\n */\n transactionId?: string;\n}\n\nexport interface GetMembershipVoidabilityRequest {\n /**\n * Transaction ID to check if it can be voided.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface GetMembershipVoidabilityResponse {\n /** Whether the membership charge can be voided. */\n voidable?: boolean;\n /**\n * Reason why the membership charge cannot be voided.\n * @minLength 1\n * @maxLength 200\n */\n reason?: string | null;\n}\n\nexport interface VoidMembershipChargeRequest {\n /**\n * Transaction ID to void.\n * @minLength 1\n * @maxLength 100\n */\n transactionId: string;\n}\n\nexport interface VoidMembershipChargeResponse {}\n\nexport interface MembershipsSPIConfig {\n /**\n * The base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI.\n * For example, to call the Charge Membership endpoint at https://my-memberships.com/v1/charge-membership, the base URI you provide here is https://my-memberships.com/.\n * @format WEB_URL\n */\n deploymentUri?: string;\n /**\n * The app IDs of the catalogs your app supports.\n * @minSize 1\n * @maxSize 300\n * @format GUID\n */\n catalogAppDefIds?: string[];\n /**\n * Set to true once your app implements the updated redemption methods (`ListExistingMemberships`, `ListPurchasablePlans`, `EnhanceAndValidateSelection`)\n * and the per-balance redemption model. While false, Wix eCommerce keeps calling the legacy `ListEligibleMemberships` flow.\n * This toggle lets providers migrate without a synchronized deploy and is removed once migration completes.\n */\n toggleUpdatedMethodsEnabled?: boolean;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,2BAAN,cAAuC,MAAM;AAAA,EAkBlD,YAAY,OAAyC,CAAC,GAAG;AACvD,UAAM,kBAAkB;AAExB,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,kBACH;AACF,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAEA,SAAK,OAAO;AAAA,EACd;AAIF;AAAA;AAtCa,yBAqCK,SAAS;AAMpB,IAAM,8BAAN,cAA0C,MAAM;AAAA,EAcrD,cAAc;AACZ,UAAM,qBAAqB;AAE3B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,4BA6BK,SAAS;AAMpB,IAAM,uCAAN,cAA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jC,SAAAA;AAAA,GAAA;AA0HL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["BalanceType","QuotaType","LimitedQuotaType","MembershipErrorType","MembershipCannotBeChargedType","IdentityType"]}
|
|
@@ -144,24 +144,23 @@ interface Membership {
|
|
|
144
144
|
* @maxLength 100
|
|
145
145
|
* @deprecated
|
|
146
146
|
* @replacedBy ExistingMembership.covered_line_items.line_item_id
|
|
147
|
+
* @targetRemovalDate 2026-07-30
|
|
147
148
|
*/
|
|
148
149
|
lineItemIds?: string[];
|
|
149
|
-
/**
|
|
150
|
-
* Deprecated. The new flow no longer exposes raw balances on a membership; what a membership can pay
|
|
151
|
-
* for is conveyed by `ExistingMembership.covered_line_items` (per-item redemption cost).
|
|
152
|
-
* @deprecated
|
|
153
|
-
* @replacedBy ExistingMembership.covered_line_items.redemption_cost
|
|
154
|
-
*/
|
|
150
|
+
/** Membership's payment credits (balance information). */
|
|
155
151
|
credits?: MembershipPaymentCredits;
|
|
156
152
|
/**
|
|
157
153
|
* Membership expiration date.
|
|
158
154
|
* @deprecated
|
|
159
155
|
* @replacedBy offering_description
|
|
156
|
+
* @targetRemovalDate 2026-07-30
|
|
160
157
|
*/
|
|
161
158
|
expirationDate?: Date | null;
|
|
162
159
|
/**
|
|
163
160
|
* Deprecated. Use `benefits.additional_data` for benefit-specific provider data.
|
|
164
161
|
* @deprecated
|
|
162
|
+
* @replacedBy benefits.additional_data
|
|
163
|
+
* @targetRemovalDate 2026-07-30
|
|
165
164
|
*/
|
|
166
165
|
additionalData?: Record<string, any> | null;
|
|
167
166
|
}
|
|
@@ -534,16 +533,27 @@ interface FutureMembershipInput {
|
|
|
534
533
|
}
|
|
535
534
|
interface EnhanceAndValidateSelectionResponse {
|
|
536
535
|
/**
|
|
537
|
-
*
|
|
536
|
+
* Deprecated. Use `existing`.
|
|
538
537
|
* @maxSize 300
|
|
538
|
+
* @deprecated
|
|
539
|
+
* @replacedBy existing.memberships
|
|
540
|
+
* @targetRemovalDate 2026-09-30
|
|
539
541
|
*/
|
|
540
542
|
existingMemberships?: ExistingMembershipEnhanced[];
|
|
541
543
|
/**
|
|
542
|
-
*
|
|
544
|
+
* Deprecated. Use `purchasable`.
|
|
543
545
|
* @maxSize 300
|
|
546
|
+
* @deprecated
|
|
547
|
+
* @replacedBy purchasable.purchasable_plans
|
|
548
|
+
* @targetRemovalDate 2026-09-30
|
|
544
549
|
*/
|
|
545
550
|
futureMemberships?: FutureMembership[];
|
|
551
|
+
/** The validated existing memberships in the selection. */
|
|
552
|
+
existing?: ValidatedExistingMemberships;
|
|
553
|
+
/** The validated future plans in the selection. */
|
|
554
|
+
purchasable?: ValidatedPurchasablePlans;
|
|
546
555
|
}
|
|
556
|
+
/** Deprecated. Use `ExistingMembership` (via `ValidatedExistingMemberships`). */
|
|
547
557
|
interface ExistingMembershipEnhanced {
|
|
548
558
|
/**
|
|
549
559
|
* Membership ID.
|
|
@@ -560,6 +570,7 @@ interface ExistingMembershipEnhanced {
|
|
|
560
570
|
*/
|
|
561
571
|
lineItems?: LineItem[];
|
|
562
572
|
}
|
|
573
|
+
/** Deprecated. Use `PurchasablePlan` (via `ValidatedPurchasablePlans`). */
|
|
563
574
|
interface FutureMembership {
|
|
564
575
|
/** Catalog reference of the validated future membership. */
|
|
565
576
|
catalogReference?: CatalogReference;
|
|
@@ -571,6 +582,27 @@ interface FutureMembership {
|
|
|
571
582
|
/** Membership name as displayed to the buyer. */
|
|
572
583
|
name?: MembershipName;
|
|
573
584
|
}
|
|
585
|
+
/** Same shape as `ListExistingMembershipsResponse.memberships`. */
|
|
586
|
+
interface ValidatedExistingMemberships {
|
|
587
|
+
/**
|
|
588
|
+
* The selected memberships, each paired with the line items it can redeem and the cost to redeem each.
|
|
589
|
+
* @maxSize 300
|
|
590
|
+
*/
|
|
591
|
+
memberships?: ExistingMembership[];
|
|
592
|
+
}
|
|
593
|
+
/** Same shape as `ListPurchasablePlansResponse`. */
|
|
594
|
+
interface ValidatedPurchasablePlans {
|
|
595
|
+
/**
|
|
596
|
+
* The selected plans.
|
|
597
|
+
* @maxSize 300
|
|
598
|
+
*/
|
|
599
|
+
purchasablePlans?: PurchasablePlan[];
|
|
600
|
+
/**
|
|
601
|
+
* How the plans' benefits cover the line items, linked to a benefit by `benefit_id`.
|
|
602
|
+
* @maxSize 300
|
|
603
|
+
*/
|
|
604
|
+
coverages?: LineItemCoverage[];
|
|
605
|
+
}
|
|
574
606
|
interface ChargeMembershipRequest {
|
|
575
607
|
/**
|
|
576
608
|
* Member ID.
|
|
@@ -1014,4 +1046,4 @@ declare class TransactionAlreadyVoidedWixError extends Error {
|
|
|
1014
1046
|
static readonly __type = "wix_spi_error";
|
|
1015
1047
|
}
|
|
1016
1048
|
|
|
1017
|
-
export { type
|
|
1049
|
+
export { type VoidMembershipChargeResponse as $, type EnhanceAndValidateSelectionResponse as A, BalanceType as B, type CatalogReference as C, type ExistingMembershipEnhanced as D, type ExistingMembership as E, type FutureMembershipInput as F, type FutureMembership as G, type ValidatedPurchasablePlans as H, type InvalidMembership as I, type ChargeMembershipRequest as J, type ChargeMembershipResponse as K, type ListEligibleMembershipsRequest as L, type Membership as M, type MembershipCannotBeChargedError as N, type MembershipCannotBeChargedErrorErrorDataOneOf as O, type PurchasablePlan as P, QuotaType as Q, MembershipCannotBeChargedType as R, type ServiceProperties as S, type OutOfCredits as T, type NotStartedYet as U, type ValidatedExistingMemberships as V, type Ended as W, type MembershipAlreadyChargedError as X, type GetMembershipVoidabilityRequest as Y, type GetMembershipVoidabilityResponse as Z, type VoidMembershipChargeRequest as _, type LineItem as a, type MembershipsSPIConfig as a0, type Context as a1, IdentityType as a2, type IdentificationData as a3, type IdentificationDataIdOneOf as a4, InvalidSelectionWixError as a5, InsufficientBalanceWixError as a6, MembershipDoesNotApplyToItemWixError as a7, MembershipCannotBeUsedWixError as a8, MembershipAlreadyChargedWixError as a9, TransactionNotFoundWixError as aa, TransactionCannotBeVoidedWixError as ab, TransactionAlreadyVoidedWixError as ac, type ListEligibleMembershipsEnvelope as ad, type ChargeMembershipEnvelope as ae, type GetMembershipVoidabilityEnvelope as af, type VoidMembershipChargeEnvelope as ag, type SelectedMemberships as b, type SelectedMembership as c, type ListEligibleMembershipsResponse as d, type MembershipName as e, type MembershipPaymentCredits as f, type Benefit as g, type BenefitQuotaOneOf as h, type LimitedQuota as i, LimitedQuotaType as j, type MembershipInvalidSelectionErrors as k, type MembershipInvalidSelectionError as l, type MembershipInvalidSelectionErrorErrorDataOneOf as m, MembershipErrorType as n, type LineItemNotFoundInfo as o, provideHandlers as p, type MembershipCannotBeUsedForLineItemsInfo as q, type MembershipCannotBeUsedForLineItemInfo as r, type ListExistingMembershipsRequest as s, type ListExistingMembershipsResponse as t, type LineItemCoverage as u, type CoveredLineItem as v, type ListPurchasablePlansRequest as w, type ListPurchasablePlansResponse as x, type EnhanceAndValidateSelectionRequest as y, type ExistingMembershipInput as z };
|