import { NonNullablePaths } from '@wix/sdk-types'; interface SubscriptionOption { /** * Subscription option ID (auto-generated upon subscription option creation). * @format GUID */ _id?: string | null; /** * Subscription option title. * @minLength 1 * @maxLength 20 */ title?: string | null; /** * Subscription option description (optional). * @maxLength 60 */ description?: string | null; /** Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months. */ subscriptionSettings?: SubscriptionSettings; /** * Discount info (optional). * For example, a $20 discount would be `value: 20`, `type: AMOUNT`. */ discount?: Discount; } interface SubscriptionSettings { /** Frequency of recurring payment. */ frequency?: SubscriptionFrequencyWithLiterals; /** Whether subscription is renewed automatically at the end of each period. */ autoRenewal?: boolean; /** * Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`. * @min 2 * @max 999 */ billingCycles?: number | null; } /** Frequency unit of recurring payment */ declare enum SubscriptionFrequency { UNDEFINED = "UNDEFINED", DAY = "DAY", WEEK = "WEEK", MONTH = "MONTH", YEAR = "YEAR" } /** @enumType */ type SubscriptionFrequencyWithLiterals = SubscriptionFrequency | 'UNDEFINED' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'; interface Discount { /** Discount type. */ type?: DiscountTypeWithLiterals; /** Discount value. */ value?: number; } declare enum DiscountType { UNDEFINED = "UNDEFINED", /** No discount */ AMOUNT = "AMOUNT", PERCENT = "PERCENT" } /** @enumType */ type DiscountTypeWithLiterals = DiscountType | 'UNDEFINED' | 'AMOUNT' | 'PERCENT'; interface GetSubscriptionOptionRequest { /** * Subscription option ID. * @minLength 1 * @format GUID */ _id: string; } interface GetSubscriptionOptionResponse { /** Subscription option. */ subscriptionOption?: SubscriptionOption; } interface GetSubscriptionOptionsForProductRequest { /** * Product ID. * @minLength 1 */ productId: string; /** Whether to include hidden subscription options in the results. */ includeHiddenSubscriptionOptions?: boolean; } interface GetSubscriptionOptionsForProductResponse { /** Subscription options. */ subscriptionOptions?: SubscriptionOptionInProduct[]; } interface SubscriptionOptionInProduct { /** * Subscription option ID. * @format GUID */ _id?: string; /** Whether the subscription option is hidden for the product (the default is false). */ hidden?: boolean; /** * Subscription option title. * @minLength 1 * @maxLength 20 * @readonly */ title?: string | null; /** * Subscription option description (optional). * @maxLength 60 * @readonly */ description?: string | null; /** * Subscription payment settings. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months. * @readonly */ subscriptionSettings?: SubscriptionSettings; /** * Discount info (optional). * @readonly */ discount?: Discount; } interface ListSubscriptionOptionsRequest { /** * Subscription option IDs. * @format GUID * @maxSize 100 */ ids?: string[]; } interface ListSubscriptionOptionsResponse { /** Subscription options. */ subscriptionOptions?: SubscriptionOption[]; } interface CalculatePricesRequest { /** original price to which subscription options discount will be applied */ price?: number; /** * ids of subscription options which will be applied to original price * @format GUID * @maxSize 100 */ ids?: string[]; } interface CalculatePricesResponse { /** array of calculated prices */ prices?: SubscriptionOptionPrices[]; /** price to which subscription options discount applied */ originalPrice?: number; } interface SubscriptionOptionPrices { /** Subscription option id */ _id?: string; /** Price data calculated for subscription option */ priceData?: SubscriptionOptionPriceData; /** Price data calculated for subscription option, converted to the currency requested in request header */ convertedPriceData?: SubscriptionOptionPriceData; } interface SubscriptionOptionPriceData { /** Subscription option price currency */ currency?: string; /** Price calculated after subscription option discount applied */ discountedPrice?: number; /** Price calculated after subscription option discount applied, formatted with the currency */ formattedDiscountedPrice?: string; } interface BulkCalculatePricesRequest { /** * Original prices to which subscription options discount will be applied. * Key is identifier unique per price that can be used to match calculated prices with original price * @maxSize 1001 */ prices?: Record; /** * ids of subscription options which will be applied to original price * @format GUID * @maxSize 100 */ ids?: string[]; } interface BulkCalculatePricesResponse { /** * Key is identifier unique per price that can be used to match calculated prices with original price * Value is response with calculated prices for each subscription option */ calculatedPrices?: Record; } interface BulkCalculatePricesRequestV2 { /** * Original prices to be calculated for each corresponding product id with related subscription plan ids * @maxSize 100 */ items?: BulkCalculatePricesRequestItem[]; } interface BulkCalculatePricesRequestItem { /** * Calculation id (product id) * @minLength 1 * @maxLength 36 */ _id?: string; /** * Original prices to which subscription options discount will be applied. * Key is identifier unique per price that can be used to match calculated prices with original price * @maxSize 1001 */ prices?: Record; /** * ids of subscription options which will be applied to original price. * @format GUID * @maxSize 100 */ subscriptionOptionIds?: string[]; } interface BulkCalculatePricesResponseV2 { /** * Key is identifier unique per price that can be used to match calculated prices with original price * Value is response with calculated prices for each subscription option for each product */ calculatedPricesPerProduct?: BulkCalculatePricesResponseItem[]; } interface BulkCalculatePricesResponseItem { /** * Calculation id (product id) * @minLength 1 */ _id?: string; /** * Key is identifier unique per price that can be used to match calculated prices with original price * Value is response with calculated prices for each subscription option */ calculatedPrices?: Record; } interface GetProductIdsForSubscriptionOptionRequest { /** * Subscription option ID. * @minLength 1 * @format GUID */ _id: string; /** Whether to include hidden products in the returned results. */ includeHiddenProducts?: boolean; /** Optional pagination parameters */ paging?: Paging; } interface Paging { /** * Amount of items to load per page. * @max 100 */ limit?: number | null; /** Number of items to skip in the display (relevant for all pages after the first). */ offset?: number | null; } interface GetProductIdsForSubscriptionOptionResponse { /** IDs of products associated with the specified subscription option. */ productIds?: string[]; /** Paging metadata. */ metadata?: PagingMetadata; /** Number of total results. */ totalResults?: number; } interface PagingMetadata { /** Amount of items to load per page. */ items?: number; /** Number of items to skip in the display (relevant for all pages after the first). */ offset?: number; } interface GetOneTimePurchasesStatusRequest { /** * Product ID. * @minLength 1 */ productId: string; } interface GetOneTimePurchasesStatusResponse { /** Whether the specified product is available for one-time purchase */ allowed?: boolean; } interface CreateSubscriptionOptionRequest { /** Subscription option info. */ subscriptionOption: SubscriptionOption; } interface CreateSubscriptionOptionResponse { /** Newly created subscription option. */ subscriptionOption?: SubscriptionOption; } interface UpdateSubscriptionOptionRequest { /** Subscription option info. Only the passed parameters will be updated. */ subscriptionOption: SubscriptionOption; } interface UpdateSubscriptionOptionResponse { /** Updated subscription option. */ subscriptionOption?: SubscriptionOption; } interface DeleteSubscriptionOptionRequest { /** * ID of the subscription option to delete. * @minLength 1 * @format GUID */ _id: string; } interface DeleteSubscriptionOptionResponse { } interface BulkCreateSubscriptionOptionsRequest { /** * Subscription options info. * @maxSize 100 */ subscriptionOptions: SubscriptionOption[]; } interface BulkCreateSubscriptionOptionsResponse { /** Newly created subscription options. */ subscriptionOptions?: SubscriptionOption[]; } interface BulkUpdateSubscriptionOptionsRequest { /** * Subscription options info. Only the passed parameters in each subscription option will be updated. * @maxSize 100 */ subscriptionOptions: SubscriptionOption[]; } interface BulkUpdateSubscriptionOptionsResponse { /** Updated subscription options. */ subscriptionOptions?: SubscriptionOption[]; } interface BulkDeleteSubscriptionOptionsRequest { /** * IDs of the subscription options to delete. * @maxSize 100 * @format GUID */ ids: string[]; } interface BulkDeleteSubscriptionOptionsResponse { } interface AssignSubscriptionOptionsToProductRequest { /** * Product ID. * @minLength 1 */ productId: string; /** * Ordered array of subscription options that will be assigned to the product. Pass an empty array to remove all subscription options from the product. * @maxSize 6 */ assignedSubscriptionOptions?: SubscriptionOptionInProduct[]; } interface AssignSubscriptionOptionsToProductResponse { } interface AllowOneTimePurchasesRequest { /** * Product ID. * @minLength 1 */ productId: string; /** Pass `true` to offer product by subscription and as one-time purchase. Pass `false` to offer product as subscription only. */ allowed: boolean | null; } interface AllowOneTimePurchasesResponse { } /** * Retrieves a subscription option by ID. * @param _id - Subscription option ID. * @public * @documentationMaturity preview * @requiredField _id * @permissionId WIX_STORES.READ_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @returns Subscription option. * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption * @deprecated */ declare function getSubscriptionOption(_id: string): Promise>; /** * Retrieves all subscription options assigned to a specified product. * By default, hidden subscription options are not returned. To retrieve all subscription options you must pass `includeHiddenSubscriptionOptions = true`. * @param productId - Product ID. * @public * @documentationMaturity preview * @requiredField productId * @param options - Options. * @permissionId WIX_STORES.READ_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct * @deprecated */ declare function getSubscriptionOptionsForProduct(productId: string, options?: GetSubscriptionOptionsForProductOptions): Promise>; interface GetSubscriptionOptionsForProductOptions { /** Whether to include hidden subscription options in the results. */ includeHiddenSubscriptionOptions?: boolean; } /** * Retrieves the IDs of products associated with a specified subscription option. * @param _id - Subscription option ID. * @public * @documentationMaturity preview * @requiredField _id * @param options - Paging and other options. * @permissionId WIX_STORES.READ_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption * @deprecated */ declare function getProductIdsForSubscriptionOption(_id: string, options?: GetProductIdsForSubscriptionOptionOptions): Promise>; interface GetProductIdsForSubscriptionOptionOptions { /** Whether to include hidden products in the returned results. */ includeHiddenProducts?: boolean; /** Optional pagination parameters */ paging?: Paging; } /** * Checks whether a specified product (associated with subscription options) is available for one-time purchase. * @param productId - Product ID. * @public * @documentationMaturity preview * @requiredField productId * @permissionId WIX_STORES.READ_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus * @deprecated */ declare function getOneTimePurchasesStatus(productId: string): Promise>; /** * Creates a subscription option. * To assign to a product, call [`assignSubscriptionOptionsToProduct()`](https://www.wix.com/velo/reference/wix-stores-v2/subscriptionoptions/assign-subscription-options-to-product). * Subscription options that are not assigned to a product will not be visible in the Wix business manager. * @param subscriptionOption - Subscription option info. * @public * @documentationMaturity preview * @requiredField subscriptionOption * @requiredField subscriptionOption.subscriptionSettings * @requiredField subscriptionOption.title * @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @returns Newly created subscription option. * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.CreateSubscriptionOption * @deprecated */ declare function createSubscriptionOption(subscriptionOption: NonNullablePaths): Promise>; /** * Updates a subscription option. * Only parameters passed will be updated. * @param _id - Subscription option ID (auto-generated upon subscription option creation). * @public * @documentationMaturity preview * @requiredField _id * @requiredField subscriptionOption * @param subscriptionOption - Subscription option update options. * @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @returns Updated subscription option. * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.UpdateSubscriptionOption * @deprecated */ declare function updateSubscriptionOption(_id: string, subscriptionOption: UpdateSubscriptionOption): Promise>; interface UpdateSubscriptionOption { /** * Subscription option ID (auto-generated upon subscription option creation). * @format GUID */ _id?: string | null; /** * Subscription option title. * @minLength 1 * @maxLength 20 */ title?: string | null; /** * Subscription option description (optional). * @maxLength 60 */ description?: string | null; /** Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months. */ subscriptionSettings?: SubscriptionSettings; /** * Discount info (optional). * For example, a $20 discount would be `value: 20`, `type: AMOUNT`. */ discount?: Discount; } /** * Deletes a subscription option. * @param _id - ID of the subscription option to delete. * @public * @documentationMaturity preview * @requiredField _id * @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.DeleteSubscriptionOption * @deprecated */ declare function deleteSubscriptionOption(_id: string): Promise; /** * Creates multiple subscription options (up to 100). * To assign to a product, call [`assignSubscriptionOptionsToProduct()`](https://www.wix.com/velo/reference/wix-stores-v2/subscriptionoptions/assign-subscription-options-to-product). * Subscription options that are not assigned to a product will not be visible in the Wix business manager. * @param subscriptionOptions - Subscription options info. * @public * @documentationMaturity preview * @requiredField subscriptionOptions * @requiredField subscriptionOptions.subscriptionSettings * @requiredField subscriptionOptions.title * @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkCreateSubscriptionOptions * @deprecated */ declare function bulkCreateSubscriptionOptions(subscriptionOptions: NonNullablePaths[]): Promise>; /** * Updates multiple subscription options. * Only parameters passed will be updated. * @param subscriptionOptions - Subscription options info. Only the passed parameters in each subscription option will be updated. * @public * @documentationMaturity preview * @requiredField subscriptionOptions * @requiredField subscriptionOptions._id * @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkUpdateSubscriptionOptions * @deprecated */ declare function bulkUpdateSubscriptionOptions(subscriptionOptions: NonNullablePaths[]): Promise>; /** * Deletes multiple subscription options. * @param ids - IDs of the subscription options to delete. * @public * @documentationMaturity preview * @requiredField ids * @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkDeleteSubscriptionOptions * @deprecated */ declare function bulkDeleteSubscriptionOptions(ids: string[]): Promise; /** * Assign up to 6 subscription options to a specified product. * Pass an empty array to remove all subscription options assigned to a product. * @param productId - Product ID. * @public * @documentationMaturity preview * @requiredField productId * @param options - Subscription option assignment options. * @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.AssignSubscriptionOptionsToProduct * @deprecated */ declare function assignSubscriptionOptionsToProduct(productId: string, options?: AssignSubscriptionOptionsToProductOptions): Promise; interface AssignSubscriptionOptionsToProductOptions { /** * Ordered array of subscription options that will be assigned to the product. Pass an empty array to remove all subscription options from the product. * @maxSize 6 */ assignedSubscriptionOptions?: SubscriptionOptionInProduct[]; } /** * Allow for one-time purchase of a product. * By default, product can be sold only as part of a subscription, not as a one-time purchase. * @param productId - Product ID. * @param allowed - Pass `true` to offer product by subscription and as one-time purchase. Pass `false` to offer product as subscription only. * @public * @documentationMaturity preview * @requiredField allowed * @requiredField productId * @permissionId WIX_STORES.MODIFY_SUBSCRIPTION_OPTIONS * @applicableIdentity APP * @fqn wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.AllowOneTimePurchases * @deprecated */ declare function allowOneTimePurchases(productId: string, allowed: boolean): Promise; export { type AllowOneTimePurchasesRequest, type AllowOneTimePurchasesResponse, type AssignSubscriptionOptionsToProductOptions, type AssignSubscriptionOptionsToProductRequest, type AssignSubscriptionOptionsToProductResponse, type BulkCalculatePricesRequest, type BulkCalculatePricesRequestItem, type BulkCalculatePricesRequestV2, type BulkCalculatePricesResponse, type BulkCalculatePricesResponseItem, type BulkCalculatePricesResponseV2, type BulkCreateSubscriptionOptionsRequest, type BulkCreateSubscriptionOptionsResponse, type BulkDeleteSubscriptionOptionsRequest, type BulkDeleteSubscriptionOptionsResponse, type BulkUpdateSubscriptionOptionsRequest, type BulkUpdateSubscriptionOptionsResponse, type CalculatePricesRequest, type CalculatePricesResponse, type CreateSubscriptionOptionRequest, type CreateSubscriptionOptionResponse, type DeleteSubscriptionOptionRequest, type DeleteSubscriptionOptionResponse, type Discount, DiscountType, type DiscountTypeWithLiterals, type GetOneTimePurchasesStatusRequest, type GetOneTimePurchasesStatusResponse, type GetProductIdsForSubscriptionOptionOptions, type GetProductIdsForSubscriptionOptionRequest, type GetProductIdsForSubscriptionOptionResponse, type GetSubscriptionOptionRequest, type GetSubscriptionOptionResponse, type GetSubscriptionOptionsForProductOptions, type GetSubscriptionOptionsForProductRequest, type GetSubscriptionOptionsForProductResponse, type ListSubscriptionOptionsRequest, type ListSubscriptionOptionsResponse, type Paging, type PagingMetadata, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionOption, type SubscriptionOptionInProduct, type SubscriptionOptionPriceData, type SubscriptionOptionPrices, type SubscriptionSettings, type UpdateSubscriptionOption, type UpdateSubscriptionOptionRequest, type UpdateSubscriptionOptionResponse, allowOneTimePurchases, assignSubscriptionOptionsToProduct, bulkCreateSubscriptionOptions, bulkDeleteSubscriptionOptions, bulkUpdateSubscriptionOptions, createSubscriptionOption, deleteSubscriptionOption, getOneTimePurchasesStatus, getProductIdsForSubscriptionOption, getSubscriptionOption, getSubscriptionOptionsForProduct, updateSubscriptionOption };