import { GetPlanSubscriptionRequest as GetPlanSubscriptionRequest$1, GetPlanSubscriptionResponse as GetPlanSubscriptionResponse$1, GetBySubscriptionContractIdRequest as GetBySubscriptionContractIdRequest$1, GetBySubscriptionContractIdResponse as GetBySubscriptionContractIdResponse$1, QueryPlanSubscriptionsRequest as QueryPlanSubscriptionsRequest$1, QueryPlanSubscriptionsResponse as QueryPlanSubscriptionsResponse$1 } from './index.typings.js'; import '@wix/sdk-types'; /** * A plan subscription is created when a buyer purchases a Pricing Plans plan through eCommerce. * It links the purchase to the plan and the buyer. * Plan subscriptions are read-only. */ interface PlanSubscription { /** * Plan subscription ID. * @format GUID * @readonly */ id?: string; /** * ID of the member who holds the plan subscription. * @format GUID * @readonly */ memberId?: string; /** * Form submission the buyer made when purchasing the plan. * @readonly */ formSubmission?: FormSubmission; /** * ID of the eCommerce subscription contract behind the plan subscription. * * Available in the eCommerce order as `lineItems.subscriptionInfo.id`. * @format GUID * @readonly */ subscriptionContractId?: string | null; /** * Benefit cycle details. The plan's benefits are distributed per cycle, according to `settings`. * @readonly */ benefitDistribution?: BenefitDistribution; /** * ID of the plan the subscription is for. * * Changes when the subscription moves to another plan. The plan at purchase time isn't available. * @format GUID * @readonly */ planId?: string; /** * ID of the plan's pricing variant the subscription is for. * * Empty for some older plan subscriptions. Changes when the subscription moves to another pricing variant. * @format GUID * @readonly */ pricingVariantId?: string | null; } /** Billing subscription is a read only subset of data exposed by BASS subscriptions */ interface BillingSubscription { /** * Subscription's unique id. Automatically generated and read-only. * @format GUID */ id?: string; /** Date when subscription was created */ createdDate?: Date | null; /** Date when subscription was updated */ updatedDate?: Date | null; /** Revision of subscription. Increments upon changes */ revision?: string | null; /** Status of subscription */ status?: SubscriptionStatusEnumSubscriptionStatusWithLiterals; /** Information related to cancellation for already canceled subscription or scheduled for cancel */ cancellationInfo?: BillingSubscriptionCancellationInfo; /** Billing details parameters including schedule, currency, etc. */ billingSettings?: BillingSubscriptionBillingSettings; /** * If start_date is set in the future: custom_billing_schedule.cycles_to_pay_on_creation should be set to 1 * in order to pay on creation for first cycle, Subscription will be then activated in the future. * Future start_date is not supported for `SEND_INVOICE` CollectionMethod * If start_date is set in past, it means subscription was already started. */ startDate?: Date | null; /** * Represents when the subscription will end, relevant for subscriptions with a termed period. * If not provided, will be calculated based on billing schedule. Should be empty for evergreen subscription. * Note: A 13-hour tolerance is applied when validating the end date to handle for time zone differences and minor discrepancies. */ endDate?: Date | null; /** Information related to either paused subscription or scheduled for future pause */ pauseInfo?: BillingSubscriptionPauseInfo; /** The plan line item in the subscription. This is a subset of the line items on the subscription. */ planLineItem?: PlanLineItem; /** Includes many attributes about billing status of the subscription */ billingStatus?: BillingSubscriptionBillingStatus; /** * ChangesCounter of subscription. Increments upon every change to the domain * @readonly */ changesCounter?: string | null; /** Platform origin subscription is coming from */ platformOrigin?: BillingSubscriptionPlatformOrigin; /** * Pending update for the next billing cycle. * @readonly */ pendingUpdateData?: BillingSubscriptionSubscriptionUpdateData; /** * Pending update for a specific date. * @readonly */ specificDatePendingUpdateData?: BillingSubscriptionSpecificDateSubscriptionUpdateData; } interface BillingSubscriptionPaymentData { /** * See BASS documentation * @format GUID */ invoiceId?: string; /** See BASS documentation */ paymentStatus?: PaymentDataPaymentStatusWithLiterals; /** See BASS documentation */ totals?: BillingSubscriptionTotals; /** See BASS documentation */ initialFailedPaymentDate?: Date | null; } declare enum PaymentDataPaymentStatus { /** Payment status unknown */ UNKNOWN = "UNKNOWN", /** Payment has not been paid */ UNPAID = "UNPAID", /** Payment has been paid */ PAID = "PAID", /** Payment failed */ FAILED = "FAILED" } /** @enumType */ type PaymentDataPaymentStatusWithLiterals = PaymentDataPaymentStatus | 'UNKNOWN' | 'UNPAID' | 'PAID' | 'FAILED'; interface BillingSubscriptionTotals { /** * Total price of the subscription that the customer must pay per billing * cycle. Calculated as: `subtotal + tax + shippingFee + applicationFee + extraCharge - discount - credit` * @format DECIMAL_VALUE * @readonly */ totalPrice?: string; /** * Subtotal of all line items that belong to the subscription. * Calculated as: `sum_{i=1}^{n} (itemPrice[i] * quantity[i])` * @format DECIMAL_VALUE * @readonly */ subtotal?: string; /** * Total tax. * @format DECIMAL_VALUE * @readonly */ tax?: string | null; /** * Total discount. * @format DECIMAL_VALUE * @readonly */ discount?: string | null; /** * Total application fee. * @format DECIMAL_VALUE * @readonly */ applicationFee?: string | null; /** * Total shipping fee. * @format DECIMAL_VALUE * @readonly */ shippingFee?: string | null; /** * Total charges. * @format DECIMAL_VALUE * @readonly */ extraCharge?: string | null; /** * Total credits. * @format DECIMAL_VALUE * @readonly */ credit?: string | null; /** * The tax amount of the proration. * @format DECIMAL_VALUE * @readonly */ prorationTax?: string | null; } interface BillingSubscriptionDuration { /** Duration unit: DAY, WEEK, MONTH, YEAR */ unit?: DurationDurationUnitWithLiterals; /** * Amount of units. For example, 1 MONTH, 1 YEAR, 2 WEEKS, etc. Optional. Default is 1. * @min 1 */ count?: number | null; } declare enum DurationDurationUnit { UNKNOWN = "UNKNOWN", DAY = "DAY", WEEK = "WEEK", MONTH = "MONTH", YEAR = "YEAR" } /** @enumType */ type DurationDurationUnitWithLiterals = DurationDurationUnit | 'UNKNOWN' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'; declare enum CollectionMethodEnumCollectionMethod { UNKNOWN = "UNKNOWN", /** Subscriber automatically charged */ AUTO_CHARGE = "AUTO_CHARGE", /** Payments manually collected and managed by owner */ OFFLINE = "OFFLINE", /** Payment will be collected somehow. Billing only issues invoice per cycle. */ SEND_INVOICE = "SEND_INVOICE", /** Payment will be collected externally */ EXTERNAL = "EXTERNAL", /** Subscription is free */ FREE = "FREE" } /** @enumType */ type CollectionMethodEnumCollectionMethodWithLiterals = CollectionMethodEnumCollectionMethod | 'UNKNOWN' | 'AUTO_CHARGE' | 'OFFLINE' | 'SEND_INVOICE' | 'EXTERNAL' | 'FREE'; interface BillingSubscriptionTaxSettings { /** If true then taxes are included in given prices */ inclusive?: boolean; } interface BillingSubscriptionAdditionalFee { /** * Name of the conditional fee. * * Max: 500 characters * @maxLength 500 */ name?: string; /** * Amount of the conditional fee. * * Min: `0.01` * @decimalValue options { gt:0.00, maxScale:4 } */ amount?: string; /** * Specifies the cycles during which the fee will be applied. If this field is provided, * it determines the exact range of cycles the fee applies to. The logic is as follows: * * - `cycle_from`: The first cycle the fee will be added to. Must be greater than 0. * - `number_of_cycles`: The number of consecutive cycles the fee will be applied to, * starting from `cycle_from`. If not specified, the fee applies to all cycles starting * from `cycle_from`. * * Example: * - `cycle_from = 1, number_of_cycles = 3`: Fee applies to cycles 1, 2, and 3. * - `cycle_from = 2, number_of_cycles = None`: Fee applies to cycles 2 and onward indefinitely. * * If `cycles` is not specified (`None`), the fee will be applied on all cycles. */ cycles?: BillingSubscriptionCycles; } interface BillingSubscriptionCycles { /** * The cycle will start. Minimum cycle number is 1 * @min 1 */ cycleFrom?: number; /** * Number of cycles to be applied on. In order to apply a on all cycles until the end of the subscription, this field should be empty. * @min 1 */ numberOfCycles?: number | null; } /** A subset of BASS's `Discount`. Presence indicates the subscription is discounted. */ interface BillingSubscriptionDiscount extends BillingSubscriptionDiscountValueOneOf { /** * Discount amount. * Available when the discount is an amount. * * Min: `0.01` * @decimalValue options { gt:0.00, maxScale:4 } */ amount?: string; /** * Discount percentage. * Available when the discount is a percentage value. * * Min: `0.01` * Max: `100` * @decimalValue options { gt:0.00, lte:100, maxScale:4 } */ percentage?: string; /** The cycles the discount is applied on. Empty means all cycles. */ cycles?: BillingSubscriptionDiscountCycles; /** Origin the discount is coming from */ origin?: BillingSubscriptionDiscountOrigin; } /** @oneof */ interface BillingSubscriptionDiscountValueOneOf { /** * Discount amount. * Available when the discount is an amount. * * Min: `0.01` * @decimalValue options { gt:0.00, maxScale:4 } */ amount?: string; /** * Discount percentage. * Available when the discount is a percentage value. * * Min: `0.01` * Max: `100` * @decimalValue options { gt:0.00, lte:100, maxScale:4 } */ percentage?: string; } interface BillingSubscriptionDiscountCycles { /** * The cycle from which the discount will start. Minimum cycle number is 1 * @min 1 */ cycleFrom?: number; /** * Number of cycles the discount is applied on. Empty means all cycles until the end of the subscription. * @min 1 */ numberOfCycles?: number | null; } interface BillingSubscriptionDiscountOrigin { /** * ID of the app the discount is coming from * @format GUID */ appId?: string; /** * ID of the entity the discount is coming from * @format GUID */ entityId?: string; } interface BillingSubscriptionPricingModel extends BillingSubscriptionPricingModelModelOneOf { /** Details about the fixed item price. */ fixedPrice?: PricingModelFixedPrice; } /** @oneof */ interface BillingSubscriptionPricingModelModelOneOf { /** Details about the fixed item price. */ fixedPrice?: PricingModelFixedPrice; } interface PricingModelFixedPrice { /** * Fixed item price with a period as a decimal separator. For example, `3.99`. * Price doesn't include tax, discounts, or application fee. * * Min: `0.01` * @decimalValue options { gte:0.00, maxScale:4 } */ itemPrice?: string; } /** A subset of BASS's `ItemChange`. A pending change to a single subscription item. */ interface BillingSubscriptionItemChange { /** * ID of the subscription item the change applies to * @format GUID */ id?: string; /** The new pricing model of the item */ pricingModel?: BillingSubscriptionPricingModel; } /** A subset of BASS's `SubscriptionUpdateData`. Pending changes to subscription items. */ interface BillingSubscriptionSubscriptionUpdateData { /** * Pending item changes * @maxSize 100 */ itemsToUpdate?: BillingSubscriptionItemChange[]; } declare enum CancellationInfoHistoryActionInitiator { UNDEFINED = "UNDEFINED", BUSINESS = "BUSINESS", CUSTOMER = "CUSTOMER", SYSTEM = "SYSTEM", PAYMENT_FAILURE = "PAYMENT_FAILURE" } /** @enumType */ type CancellationInfoHistoryActionInitiatorWithLiterals = CancellationInfoHistoryActionInitiator | 'UNDEFINED' | 'BUSINESS' | 'CUSTOMER' | 'SYSTEM' | 'PAYMENT_FAILURE'; declare enum PausePolicyEnumPausePolicy { NONE = "NONE", /** Pause the payment and the service. When resuming, the subscription end date is extended by the number of cycles postponed, and if the pause happened in a middle of a cycle, the payment date is postponed by the amount of days that already paid. */ SERVICE_AND_PAYMENTS = "SERVICE_AND_PAYMENTS", /** Pause the service and continue the billing. When resuming, extend the service by the time that was paused */ SERVICE_ONLY = "SERVICE_ONLY" } /** @enumType */ type PausePolicyEnumPausePolicyWithLiterals = PausePolicyEnumPausePolicy | 'NONE' | 'SERVICE_AND_PAYMENTS' | 'SERVICE_ONLY'; declare enum PauseAtEnumPauseAt { /** Cancel scheduled pause */ NONE = "NONE", /** Pause the subscription now */ IMMEDIATELY = "IMMEDIATELY", /** Pause the subscription at the next billing date */ NEXT_BILLING_DATE = "NEXT_BILLING_DATE", /** A specific date must be defined in Schedule.specific_date */ SPECIFIC_DATE = "SPECIFIC_DATE", /** The number of cycles must be defined in Schedule.number_of_cycles */ NUMBER_OF_CYCLES_FROM_TODAY = "NUMBER_OF_CYCLES_FROM_TODAY", /** NEW: Clearer semantics for skip-cycle - counts from next billing cycle */ NUMBER_OF_CYCLES_FROM_NEXT_BILLING_DATE = "NUMBER_OF_CYCLES_FROM_NEXT_BILLING_DATE" } /** @enumType */ type PauseAtEnumPauseAtWithLiterals = PauseAtEnumPauseAt | 'NONE' | 'IMMEDIATELY' | 'NEXT_BILLING_DATE' | 'SPECIFIC_DATE' | 'NUMBER_OF_CYCLES_FROM_TODAY' | 'NUMBER_OF_CYCLES_FROM_NEXT_BILLING_DATE'; declare enum ResumeAtEnumResumeAt { /** Cancel scheduled resume */ NONE = "NONE", /** Resume the subscription now */ IMMEDIATELY = "IMMEDIATELY", /** Resume the subscription at the next billing date */ NEXT_BILLING_DATE = "NEXT_BILLING_DATE", /** A specific date must be defined in Schedule.specific_date */ SPECIFIC_DATE = "SPECIFIC_DATE", /** NEW: For cycle-based auto-resume - counts cycles to skip from pause start */ NUMBER_OF_CYCLES_FROM_PAUSE_START = "NUMBER_OF_CYCLES_FROM_PAUSE_START" } /** @enumType */ type ResumeAtEnumResumeAtWithLiterals = ResumeAtEnumResumeAt | 'NONE' | 'IMMEDIATELY' | 'NEXT_BILLING_DATE' | 'SPECIFIC_DATE' | 'NUMBER_OF_CYCLES_FROM_PAUSE_START'; declare enum SubscriptionStatusEnumSubscriptionStatus { UNKNOWN = "UNKNOWN", /** Subscription created in this status, but hasn't been paid for yet. Filtered out from subscriptions querying. */ DRAFT = "DRAFT", /** Subscription that will be active in future. */ PENDING = "PENDING", /** Subscription is active */ ACTIVE = "ACTIVE", /** Subscription is paused */ PAUSED = "PAUSED", /** Subscription was ended */ ENDED = "ENDED", /** Subscription was canceled or auto-renew off. Ended before its time. */ CANCELED = "CANCELED" } /** @enumType */ type SubscriptionStatusEnumSubscriptionStatusWithLiterals = SubscriptionStatusEnumSubscriptionStatus | 'UNKNOWN' | 'DRAFT' | 'PENDING' | 'ACTIVE' | 'PAUSED' | 'ENDED' | 'CANCELED'; interface BillingSubscriptionCancellationInfo { /** Subscription cancel date. Can contain a future or past date */ cancellationDate?: Date | null; /** Initiator for cancellation */ initiator?: CancellationInfoHistoryActionInitiatorWithLiterals; /** * Reason for cancellation. Optional. * NOTE: the max length is not defined on BASS, so this is just a guess * @maxLength 1000 */ reason?: string | null; } interface BillingSubscriptionBillingSettings { /** * Duration of cycle. For example, 1 MONTH, 2 WEEKS, 7 DAYS, 1 YEAR etc. * Shortest supported cycle duration is 7 days. */ cycleDuration?: BillingSubscriptionDuration; /** * Number of billing cycles. If not set subscription auto-renewed until cycle-auto-renew will be disabled. * @min 1 */ totalCycles?: number | null; /** If set to false, subscription will be canceled at the next billing cycle. */ cycleAutoRenew?: boolean; /** Instructs how payments will be collected. */ collectionMethod?: CollectionMethodEnumCollectionMethodWithLiterals; /** Definition of trial period */ freeTrialDuration?: BillingSubscriptionDuration; /** * Currency of all subscription items prices. Three letter ISO currency code. https://en.wikipedia.org/wiki/ISO_4217 * @format CURRENCY */ currency?: string; /** Tax settings information for the given prices */ taxSettings?: BillingSubscriptionTaxSettings; /** * Fees that are only added to an invoice when a specific condition is met. * For example, a setup fee that only applies to the very first invoice of a * subscription. * * Max: 5 additional fees * @maxSize 5 */ additionalFees?: BillingSubscriptionAdditionalFee[]; /** * General discounts applied to all subscription items. * @maxSize 5 * @readonly */ discounts?: BillingSubscriptionDiscount[]; } interface BillingSubscriptionPauseInfo { /** See BASS documentation */ pausePolicy?: PausePolicyEnumPausePolicyWithLiterals; /** See BASS documentation */ pauseAt?: PauseAtEnumPauseAtWithLiterals; /** See BASS documentation */ startDate?: Date | null; /** See BASS documentation */ startCycle?: number | null; /** See BASS documentation */ resumeAt?: ResumeAtEnumResumeAtWithLiterals; /** See BASS documentation */ resumeDate?: Date | null; /** See BASS documentation */ resumeCycle?: number | null; } interface PlanLineItem { /** * The id of the plan * @format GUID */ planId?: string; /** The billing pricing model for the plan */ pricingModel?: BillingSubscriptionPricingModel; /** * The name of the plan at the time of purchase * @minLength 1 * @maxLength 200 */ name?: string; /** * The description of the plan at the time of purchase * @maxLength 500 */ description?: string | null; /** * The id of the pricing variant selected at the time of purchase * @format GUID */ pricingVariantId?: string | null; /** * Discounts applied to the plan line item. * @maxSize 5 * @readonly */ discounts?: BillingSubscriptionDiscount[]; /** * ID of the corresponding subscription item in BASS. * @format GUID * @readonly */ id?: string | null; } interface BillingSubscriptionBillingStatus { /** * Current cycle of subscription billing schedule. When billing schedule starts cycles start from 1 * and incremented each next billing cycle. * In case billing schedule not started (free trial, pay later start later) then current_cycle will remain 0 */ currentCycle?: number; /** Date when charge will be for next billing cycle */ nextBillingDate?: Date | null; /** Previous Date charged for previous billing cycle */ previousBillingDate?: Date | null; /** last payment details */ latestPaymentData?: BillingSubscriptionPaymentData; } interface BillingSubscriptionPlatformOrigin { /** * The application that created the subscription. * @format GUID */ appId?: string | null; } /** A subset of BASS's `SpecificDateSubscriptionUpdateData`. */ interface BillingSubscriptionSpecificDateSubscriptionUpdateData { /** The pending update data */ updateData?: BillingSubscriptionSubscriptionUpdateData; /** Date at which the pending update will be applied */ executionDate?: Date | null; } /** Form the buyer filled in when purchasing the plan. */ interface FormSubmission { /** * ID of the form the submission belongs to. Empty if the form couldn't be found when the plan subscription was created. * @format GUID */ formId?: string | null; /** * ID of the form submission. * @format GUID */ submissionId?: string; } interface OrderPricingDetails { /** Type of payment schedule and its details. */ pricingModel?: V1PricingModel; } interface V1PricingModel extends V1PricingModelPricingModelOneOf { /** Pricing model for an order with recurring payment cycles. */ subscription?: Recurrence; /** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */ singlePaymentForDuration?: V1Duration; /** Pricing model for an order with a one-time payment and the order is valid until canceled. */ singlePaymentUnlimited?: boolean | null; } /** @oneof */ interface V1PricingModelPricingModelOneOf { /** Pricing model for an order with recurring payment cycles. */ subscription?: Recurrence; /** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */ singlePaymentForDuration?: V1Duration; /** Pricing model for an order with a one-time payment and the order is valid until canceled. */ singlePaymentUnlimited?: boolean | null; } /** An object specifying how often and for how long payments recur (may be forever). */ interface Recurrence { /** * Number of payment cycles the subscription is valid for. * `0` for unlimited plans or for plans that are valid until canceled. */ cycleDuration?: V1Duration; /** * Length of a payment cycle. For example, 1 month to have monthly payments. * Multiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration. * Currently, only a value of `1` is supported. * @max 2000 */ cycleCount?: number | null; } /** A duration expressed in number of time units. */ interface V1Duration { /** * Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`. * @min 1 */ count?: number | null; /** Unit of time for the cycle duration. */ unit?: PeriodUnitWithLiterals; } declare enum PeriodUnit { /** Not defined. */ UNDEFINED = "UNDEFINED", /** Time unit is a day. */ DAY = "DAY", /** Time unit is a week. */ WEEK = "WEEK", /** Time unit is a month. */ MONTH = "MONTH", /** Time unit is a year. */ YEAR = "YEAR" } /** @enumType */ type PeriodUnitWithLiterals = PeriodUnit | 'UNDEFINED' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'; /** Coupon applied to the purchase. */ interface Coupon { /** * Code of the applied coupon. * @minLength 1 * @maxLength 20 * @readonly */ code?: string; /** * Coupon ID. * @format GUID * @readonly */ id?: string; } /** Benefit cycle of a plan subscription. */ interface BenefitDistribution { /** The plan's benefit distribution settings. Updated when the plan's settings change. */ settings?: BenefitDistributionSettings; /** * Current benefit cycle number. The first benefit cycle is `0`, and the number increases by 1 at the start of each cycle. Pausing and resuming the plan subscription doesn't change it. * @readonly */ currentCycle?: number; /** * Date and time the current benefit cycle started. * @readonly */ currentCycleStartDate?: Date | null; /** * Date and time the current benefit cycle ends. * @readonly */ currentCycleEndDate?: Date | null; /** * Date and time the current benefit cycle was suspended, because the plan subscription was paused or a payment is overdue. * Empty while the cycle runs. * @readonly */ currentCyclePauseDate?: Date | null; } interface BenefitDistributionSettings extends BenefitDistributionSettingsDistributionStrategyOneOf { /** Custom schedule */ customScheduleOptions?: CustomScheduleOptions; /** The distribution strategy of the benefits for this subscription, which is used to determine how the benefits are distributed in each cycle. */ distributionStrategyType?: DistributionStrategyTypeWithLiterals; } /** @oneof */ interface BenefitDistributionSettingsDistributionStrategyOneOf { /** Custom schedule */ customScheduleOptions?: CustomScheduleOptions; } declare enum CustomScheduleOptionsDurationDurationUnit { UNKNOWN = "UNKNOWN", DAY = "DAY", WEEK = "WEEK", MONTH = "MONTH", YEAR = "YEAR" } /** @enumType */ type CustomScheduleOptionsDurationDurationUnitWithLiterals = CustomScheduleOptionsDurationDurationUnit | 'UNKNOWN' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'; interface CustomScheduleOptionsDuration { /** Duration unit: DAY, WEEK, MONTH, YEAR */ unit?: CustomScheduleOptionsDurationDurationUnitWithLiterals; /** * Amount of units. For example, 1 MONTH, 1 YEAR, 2 WEEKS, etc. Optional. Default is 1. * @min 1 */ count?: number | null; } declare enum DistributionStrategyType { UNKNOWN_DISTRIBUTION_STRATEGY_TYPE = "UNKNOWN_DISTRIBUTION_STRATEGY_TYPE", PER_BILLING_CYCLE = "PER_BILLING_CYCLE", CUSTOM_SCHEDULE = "CUSTOM_SCHEDULE" } /** @enumType */ type DistributionStrategyTypeWithLiterals = DistributionStrategyType | 'UNKNOWN_DISTRIBUTION_STRATEGY_TYPE' | 'PER_BILLING_CYCLE' | 'CUSTOM_SCHEDULE'; interface CustomScheduleOptions { /** Cycle duration */ cycleDuration?: CustomScheduleOptionsDuration; } declare enum EndReason { /** The plan subscription reached its end date. */ END_DATE_REACHED = "END_DATE_REACHED", /** The plan subscription ended early because the buyer used up all of the plan's benefits. */ BENEFITS_USED_UP = "BENEFITS_USED_UP" } /** @enumType */ type EndReasonWithLiterals = EndReason | 'END_DATE_REACHED' | 'BENEFITS_USED_UP'; /** * Triggers Billing Subscription's metadata update with pricingVariantId. * This update can't be done in migration itself to prevent race condition between order-plan-subscription-migration and membership-api when updating the BASS subscription. * * TODO: PPNP-5144 Cleanup PlanSubscription migration messaging */ interface OrderPlanSubscriptionMigrated { /** * Id of the migrated plan subscription (== order id). * @format GUID */ planSubscriptionId?: string; /** * Plan Id. * @format GUID */ planId?: string; /** * Billing subscription Id. * @format GUID */ billingSubscriptionId?: string; /** * Pricing variant Id. * @format GUID */ pricingVariantId?: string; } /** TODO: review docs */ interface PlanSubscriptionPurchased { /** Plan subscription that was paid for. If a free or an offline order, the order that was created. */ planSubscription?: PlanSubscription; } /** * Triggered at the start of a new payment cycle for an existing order. * * This webhook does not trigger at the initial start of an offline order. */ interface PlanSubscriptionCycleStarted { /** Plan subscription whose new cycle started. */ planSubscription?: PlanSubscription; /** Number of the payment cycle will be 0 when the order is in the free trial period. In other cases, the cycle number starts from 1. */ cycleNumber?: number; } interface PlanSubscriptionPaused { /** Paused plan subscription. */ planSubscription?: PlanSubscription; } interface PlanSubscriptionResumed { /** Resumed plan subscription. */ planSubscription?: PlanSubscription; } interface PlanSubscriptionEnded { /** Plan subscription that ended. */ planSubscription?: PlanSubscription; } interface PlanSubscriptionStarted { /** Plan subscription that reached its `startDate`. */ planSubscription?: PlanSubscription; } interface PlanSubscriptionMarkedAsPaid { /** Plan subscription that was marked as paid. */ planSubscription?: PlanSubscription; } /** Emitted when a recurring plan subscription is canceled for the next payment cycle */ interface PlanSubscriptionAutoRenewCanceled { /** Plan subscription that is canceled, effective at the end of the current payment cycle. */ planSubscription?: PlanSubscription; } /** Emitted when a recurring plan subscription has its auto renewal turned on again from the next payment cycle */ interface PlanSubscriptionAutoRenewTurnedOn { /** Plan subscription that is active */ planSubscription?: PlanSubscription; } /** * Emitted when a plan subscription is canceled immediately or when cycle ends for a plan subscription with canceled auto renewal * * To determine the specific reason of the cancellation check `plan_subscription.billingSubscription.cancellationInfo` field. */ interface PlanSubscriptionCanceled { /** Canceled plan subscription. */ planSubscription?: PlanSubscription; } interface PlanSubscriptionEndDatePostponed { /** Plan subscription whose `endDate` was postponed. */ planSubscription?: PlanSubscription; } interface PlanSubscriptionRevived { /** Plan subscription that was revived. */ planSubscription?: PlanSubscription; } interface PlanSubscriptionStartDateChanged { /** Plan subscription whose `startDate` changed. */ planSubscription?: PlanSubscription; } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entityAsJson?: string; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; } interface RestoreInfo { deletedDate?: Date | null; } interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntityAsJson?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntityAsJson?: string | null; } interface ActionEvent { bodyAsJson?: string; } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } interface GetPlanSubscriptionRequest { /** * Plan subscription ID. * @format GUID */ subscriptionId: string; } interface GetPlanSubscriptionResponse { /** Retrieved plan subscription. */ planSubscription?: PlanSubscription; } interface UpsertPlanSubscriptionRequest { /** The BASS subscription for a plan that we want to get the projection for. */ subscription?: Subscription; /** * The payment provider order id that corresponds to this subscription. * @format GUID */ paymentProviderOrderId?: string | null; /** * The form submission associated with this subscription. This value will be used instead of resolving * the submission id through related entities. */ formSubmission?: FormSubmission; } interface Subscription { /** * Subscription's unique id. Automatically generated and read-only. * @format GUID * @readonly */ id?: string | null; /** * Date when subscription was created * @readonly */ createdDate?: Date | null; /** * Date when subscription was updated * @readonly */ updatedDate?: Date | null; /** * Revision of subscription. Increments upon changes * @readonly */ revision?: string | null; /** * Subscription name: minLength is 1, maxLength is 150 * @maxLength 150 */ name?: string; /** * Subscription description. Optional. * @maxLength 500 */ description?: string | null; /** * 3. No Start Date: * - If the start_date is not provided, this field will default to "now", * meaning the subscription will start immediately. */ startDate?: Date | null; /** * Represents when the subscription will end, relevant for subscriptions with a termed period. * If not provided, will be calculated based on billing schedule. Should be empty for evergreen subscription. * Note: A 13-hour tolerance is applied when validating the end date to handle for time zone differences and minor discrepancies. */ endDate?: Date | null; /** Business origin subscription is coming from. In site-level subscription it will be vertical app_id and entity_id */ origin?: BusinessOrigin; /** Customer information like id and identity type (member or contact) */ customer?: Customer; /** * Status of subscription * @readonly */ status?: SubscriptionStatusWithLiterals; /** Billing details parameters including schedule, currency, etc. */ billingSettings?: BillingSettings; /** * Includes many attributes about billing status of the subscription * @readonly */ billingStatus?: BillingStatus; /** Shipping address associated with subscription. At the moment used only for payments. Optional. */ shippingAddress?: FullAddressDetails; /** Restrictions on possible subscription actions. If not provided, default policies are all restrictions enabled. */ policies?: SubscriptionPolicies; /** * Information related to either paused subscription or scheduled for future pause * @readonly */ pauseInfo?: PauseInfo; /** * Information related to cancellation for already canceled subscription or scheduled for cancel * @readonly */ cancellationInfo?: CancellationInfo; /** * Pending update for the next billing cycle * @readonly */ pendingUpdateData?: SubscriptionUpdateData; /** * Key / Value store to keep up to 10 additional values related to the subscription. * Key max length = 50, Value max length = 200. Value can not be empty. * Should not include any sensitive or PII information. * @maxSize 10 */ metadata?: Record; /** * Pending update for a specific date * @readonly */ specificDatePendingUpdateData?: SpecificDateSubscriptionUpdateData; /** * ChangesCounter of subscription. Increments upon every change to the domain * @readonly */ changesCounter?: string | null; /** * Billing order id. Optional. * @format GUID */ orderId?: string | null; /** Platform origin subscription is coming from. */ platformOrigin?: PlatformOrigin; /** * The Business Location ID represents a business location in an external service, which includes the business address. * @format GUID */ businessLocationId?: string | null; /** * items, minSize is 1, maxSize is 100 * @maxSize 100 */ items?: Item[]; /** * Indicates that a contract change is scheduled to take effect at the next renewal. * Present only when a ChangeSubscription with effective_time AT_NEXT_RENEWAL was accepted. * @readonly */ scheduledContractChange?: ScheduledContractChange; } interface BusinessOrigin { /** @format GUID */ appId?: string | null; /** @format GUID */ entityId?: string | null; } interface Customer extends CustomerIdOneOf { /** * Visitor ID of the customer. Available when the customer is an anonymous * site visitor. * @format GUID */ visitorId?: string; /** * Contact ID of the customer. Available when the customer is a * [contact](https://dev.wix.com/docs/rest/api-reference/people-communications/contacts/contacts/contact-v-4#contact-object). * @format GUID */ contactId?: string; /** * Member ID of the customer. Available when the customer is a * [member](https://dev.wix.com/docs/rest/api-reference/people-communications/members/members#member-object). * @format GUID */ memberId?: string; /** * Wix account ID * @format GUID */ accountId?: string; } /** @oneof */ interface CustomerIdOneOf { /** * Visitor ID of the customer. Available when the customer is an anonymous * site visitor. * @format GUID */ visitorId?: string; /** * Contact ID of the customer. Available when the customer is a * [contact](https://dev.wix.com/docs/rest/api-reference/people-communications/contacts/contacts/contact-v-4#contact-object). * @format GUID */ contactId?: string; /** * Member ID of the customer. Available when the customer is a * [member](https://dev.wix.com/docs/rest/api-reference/people-communications/members/members#member-object). * @format GUID */ memberId?: string; /** * Wix account ID * @format GUID */ accountId?: string; } declare enum SubscriptionStatus { UNKNOWN = "UNKNOWN", /** Subscription created in this status, but hasn't been paid for yet. Filtered out from subscriptions querying. */ DRAFT = "DRAFT", /** Subscription that will be active in future. */ PENDING = "PENDING", /** Subscription is active */ ACTIVE = "ACTIVE", /** Subscription is paused */ PAUSED = "PAUSED", /** Subscription was ended */ ENDED = "ENDED", /** Subscription was canceled or auto-renew off. Ended before its time. */ CANCELED = "CANCELED" } /** @enumType */ type SubscriptionStatusWithLiterals = SubscriptionStatus | 'UNKNOWN' | 'DRAFT' | 'PENDING' | 'ACTIVE' | 'PAUSED' | 'ENDED' | 'CANCELED'; interface BillingSettings { /** * Currency of all subscription items prices. Three letter ISO currency code. https://en.wikipedia.org/wiki/ISO_4217 * @format CURRENCY */ currency?: string; /** customer payment source to make recurring payments with */ paymentMethod?: PaymentMethod; /** Instructs how payments will be collected. */ collectionMethod?: CollectionMethodWithLiterals; /** * Duration of cycle. For example, 1 MONTH, 2 WEEKS, 7 DAYS, 1 YEAR etc. * Shortest supported cycle duration is 7 days. */ cycleDuration?: Duration; /** * Number of billing cycles. If not set subscription auto-renewed until cycle-auto-renew will be disabled. * @min 1 */ totalCycles?: number | null; /** If set to false, subscription will be canceled at the next billing cycle. */ cycleAutoRenew?: boolean; /** Billing Schedule to be defined in order to override default billing schedule */ customBillingSchedule?: CustomBillingSchedule; /** Definition of trial period */ freeTrialDuration?: Duration; /** * Shipping costs collected each cycle * @format DECIMAL_VALUE * @deprecated * @replacedBy shipping_charges * @targetRemovalDate 2024-10-31 */ shippingFee?: string | null; /** Billing address associated with subscription to be used for payments. */ billingAddress?: FullAddressDetails; taxSettings?: TaxSettings; /** * Fees that are only added to an invoice when a specific condition is met. * For example, a setup fee that only applies to the very first invoice of a * subscription. * * Max: 5 additional fees * @maxSize 5 */ additionalFees?: AdditionalFee[]; /** Shipping fee charges */ shippingCharges?: ShippingCharges; /** * General discount that applied to all items in the subscription * @maxSize 5 */ discounts?: Discount[]; /** * Details about the external collection service. * Only set when the collection_method is EXTERNAL. */ externalCollectionDetails?: ExternalCollectionDetails; } interface PaymentMethod { /** * reference to payment source id stored in payments system * @format GUID */ id?: string; } declare enum CollectionMethod { UNKNOWN = "UNKNOWN", /** Subscriber automatically charged */ AUTO_CHARGE = "AUTO_CHARGE", /** Payments manually collected and managed by owner */ OFFLINE = "OFFLINE", /** Payment will be collected somehow. Billing only issues invoice per cycle. */ SEND_INVOICE = "SEND_INVOICE", /** Payment will be collected externally */ EXTERNAL = "EXTERNAL", /** Indicates the product has a zero amount, meaning its free with no payment required. */ FREE = "FREE" } /** @enumType */ type CollectionMethodWithLiterals = CollectionMethod | 'UNKNOWN' | 'AUTO_CHARGE' | 'OFFLINE' | 'SEND_INVOICE' | 'EXTERNAL' | 'FREE'; interface Duration { /** Duration unit: DAY, WEEK, MONTH, YEAR */ unit?: DurationUnitWithLiterals; /** * Amount of units. For example, 1 MONTH, 1 YEAR, 2 WEEKS, etc. Optional. Default is 1. * @min 1 */ count?: number | null; } declare enum DurationUnit { UNKNOWN = "UNKNOWN", DAY = "DAY", WEEK = "WEEK", MONTH = "MONTH", YEAR = "YEAR" } /** @enumType */ type DurationUnitWithLiterals = DurationUnit | 'UNKNOWN' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'; interface CustomBillingSchedule { /** * Amount of cycles to be paid on Subscription creation, currently only cycles_to_pay_on_creation equals to 1 is supported * When used with Subscription.start_date, Subscription cycles will be paid on creation but Subscription will be activated in the future * @min 1 * @max 1 */ cyclesToPayOnCreation?: number | null; } interface FullAddressDetails { /** Details about the person associated with the address. */ contactDetails?: FullAddressContactDetails; /** Information about the address. */ address?: Address; } interface FullAddressContactDetails { /** First name of the contact. */ firstName?: string | null; /** Last name of the contact. */ lastName?: string | null; /** * Phone number of the contact. * @format PHONE */ phone?: string | null; /** Company associated with the contact. */ company?: string | null; /** * Email address of the contact. * @format EMAIL */ email?: string | null; } interface Address extends AddressStreetOneOf { /** Street name and number. */ streetAddress?: StreetAddress; /** Main address line, usually street and number as free text. */ addressLine?: string | null; /** * 2-letter country code in * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) * format. * @format COUNTRY */ country?: string | null; /** * Subdivision. Usually a state, region, prefecture, or province code, * according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */ subdivision?: string | null; /** City name. */ city?: string | null; /** Zip/postal code. */ postalCode?: string | null; } /** @oneof */ interface AddressStreetOneOf { /** Street name and number. */ streetAddress?: StreetAddress; /** Main address line, usually street and number as free text. */ addressLine?: string | null; } interface StreetAddress { /** Street number. */ number?: string; /** Street name. */ name?: string; } interface TaxSettings { /** If true then taxes are included in given prices */ inclusive?: boolean; } interface AdditionalFee { /** * Name of the conditional fee. * * Max: 500 characters * @maxLength 500 */ name?: string; /** * Amount of the conditional fee. * * Min: `0.01` * @decimalValue options { gt:0.00 } */ amount?: string; /** * When the fee is added to the invoice. * * + `UNKNOWN_FEE_TRIGGER`: There is no information about when the fee is added to an invoice. * + `FIRST_PAYMENT`: The fee is only added to the very first invoice of a subscription. * @deprecated When the fee is added to the invoice. * * + `UNKNOWN_FEE_TRIGGER`: There is no information about when the fee is added to an invoice. * + `FIRST_PAYMENT`: The fee is only added to the very first invoice of a subscription. * @replacedBy cycles * @targetRemovalDate 2025-12-31 */ trigger?: AdditionalFeeTriggerWithLiterals; /** Information about the tax of the conditional fee. */ tax?: Tax; /** * Specifies the cycles during which the fee will be applied. If this field is provided, * it determines the exact range of cycles the fee applies to. The logic is as follows: * * - `cycle_from`: The first cycle the fee will be added to. Must be greater than 0. * - `number_of_cycles`: The number of consecutive cycles the fee will be applied to, * starting from `cycle_from`. If not specified, the fee applies to all cycles starting * from `cycle_from`. * * Example: * - `cycle_from = 1, number_of_cycles = 3`: Fee applies to cycles 1, 2, and 3. * - `cycle_from = 2, number_of_cycles = None`: Fee applies to cycles 2 and onward indefinitely. * * If `cycles` is not specified (`None`), the fee will be applied on all cycles. */ cycles?: Cycles; /** Indicates the source of the fee, Contains app_id and entity_id */ origin?: Origin; } declare enum AdditionalFeeTrigger { UNKNOWN = "UNKNOWN", /** Charge upon subscription first payment */ FIRST_PAYMENT = "FIRST_PAYMENT" } /** @enumType */ type AdditionalFeeTriggerWithLiterals = AdditionalFeeTrigger | 'UNKNOWN' | 'FIRST_PAYMENT'; interface Tax extends TaxValueOneOf { /** * Tax amount for the invoice's line item. Available when the tax is an * amount and not a precentage. * * Min: `0.01` * @decimalValue options { gt:0.00 } */ amount?: string; /** * Tax amount for the invoice's line item price and application fee. * Can't be combined with `invoiceItems.priceDetails.discount`. * Available when the tax is a precentage and not an amount. * * Min: `0.01` * Max: `100` * @decimalValue options { gt:0.00, lte:100 } */ percentage?: string; /** Dynamic tax calculation */ dynamic?: DynamicTax; } /** @oneof */ interface TaxValueOneOf { /** * Tax amount for the invoice's line item. Available when the tax is an * amount and not a precentage. * * Min: `0.01` * @decimalValue options { gt:0.00 } */ amount?: string; /** * Tax amount for the invoice's line item price and application fee. * Can't be combined with `invoiceItems.priceDetails.discount`. * Available when the tax is a precentage and not an amount. * * Min: `0.01` * Max: `100` * @decimalValue options { gt:0.00, lte:100 } */ percentage?: string; /** Dynamic tax calculation */ dynamic?: DynamicTax; } interface DynamicTax { /** * Tax group ID used to calculate tax, default will be used if not available * @format GUID */ taxGroupId?: string | null; /** Taxable address used to calculate tax */ taxableAddressType?: TaxableAddressTypeWithLiterals; } declare enum TaxableAddressType { UNKNOWN = "UNKNOWN", /** Tax will be calculated using a single address */ BUSINESS = "BUSINESS", /** Tax will be calculated using multiple address (from BUSINESS to BILLING) */ BILLING = "BILLING", /** Tax will be calculated using multiple address (from BUSINESS to SHIPPING) */ SHIPPING = "SHIPPING" } /** @enumType */ type TaxableAddressTypeWithLiterals = TaxableAddressType | 'UNKNOWN' | 'BUSINESS' | 'BILLING' | 'SHIPPING'; interface Cycles { /** * The cycle will start. Minimum cycle number is 1 * @min 1 */ cycleFrom?: number; /** * Number of cycles to be applied on. In order to apply a on all cycles until the end of the subscription, this field should be empty. * @min 1 */ numberOfCycles?: number | null; } interface Origin { /** @format GUID */ appId?: string; /** @format GUID */ entityId?: string; } interface ShippingCharges { /** * Amount of the shipping fee in `0.00` format. * * Min: `0.01` * @decimalValue options { gte:0.00, maxScale:4 } */ amount?: string; /** Tax of the shipping fee */ tax?: Tax; /** @maxSize 5 */ discounts?: Discount[]; } interface Discount extends DiscountValueOneOf { /** * Discount amount. * Available when the discount is an amount. * * Min: `0.01` * @decimalValue options { gt:0.00 } */ amount?: string; /** * Discount percentage. * Available when the discount is a parcentage value. * * Min: `0.01` * Max: `100` * @decimalValue options { gt:0.00, lte:100 } */ percentage?: string; cycles?: DiscountCycles; /** Discount origin is coming from. Contains app_id and entity_id */ origin?: DiscountOrigin; /** * Discount display name, for example the coupon name. * For display only. Not used for validation, pricing or matching. * * Max: 500 characters * @maxLength 500 */ name?: string | null; } /** @oneof */ interface DiscountValueOneOf { /** * Discount amount. * Available when the discount is an amount. * * Min: `0.01` * @decimalValue options { gt:0.00 } */ amount?: string; /** * Discount percentage. * Available when the discount is a parcentage value. * * Min: `0.01` * Max: `100` * @decimalValue options { gt:0.00, lte:100 } */ percentage?: string; } interface DiscountCycles { /** * The cycle from which the discount will start. Minimum cycle number is 1 * @min 1 */ cycleFrom?: number; /** * Number of cycles to be applied on them discount. In order to apply a discount on all cycles until the end of the subscription, this field should be empty. * @min 1 */ numberOfCycles?: number | null; } interface DiscountOrigin { /** @format GUID */ appId?: string; /** @format GUID */ entityId?: string; } interface ExternalCollectionDetails { /** The name of the external collector. */ collectorName?: string; } interface BillingStatus { /** * Current cycle of subscription billing schedule. When billing schedule starts cycles start from 1 * and incremented each next billing cycle. * In case billing schedule not started (free trial, pay later start later) then current_cycle will remain 0 */ currentCycle?: number; /** how many cycled are remaining, For auto-renew subscriptions is not set. */ remainingCycles?: number | null; /** Date when charge will be for next billing cycle */ nextBillingDate?: Date | null; /** Previous Date charged for previous billing cycle */ previousBillingDate?: Date | null; /** last payment details */ latestPaymentData?: PaymentData; /** Free trial data */ freeTrialData?: FreeTrialData; /** * Grace period information during grace period after payment failure * @readonly */ gracePeriodData?: GracePeriodData; /** * Lifetime cycle number at which the current contract started. Current cycle remains * the lifetime billing cycle number. Absent for subscriptions using legacy cycle semantics. * @readonly * @min 1 */ contractStartCycle?: number | null; /** * Number of new_contract changes activated on this subscription over its lifetime. * Absent until the first contract change completes. * @readonly * @min 1 */ contractChangeCount?: number | null; } interface PaymentData { /** * Latest payment's invoice ID * @format GUID */ invoiceId?: string; /** Latest payment's status: UNPAID/PAID/FAILED */ paymentStatus?: PaymentStatusWithLiterals; /** Latest payment's totals. */ totals?: Totals; initialFailedPaymentDate?: Date | null; /** Tax-related data for the latest payment */ taxData?: PaymentTaxData; /** * Currency used when this payment was made. Three letter ISO currency code. * @format CURRENCY */ currency?: string | null; } declare enum PaymentStatus { /** Payment status unknown */ UNKNOWN = "UNKNOWN", /** Payment has not been paid */ UNPAID = "UNPAID", /** Payment has been paid // TODO: p13n review: we are not sending event when in SEND_INVOICE mode cycle was paid. should we and which event? */ PAID = "PAID", /** Payment failed */ FAILED = "FAILED" } /** @enumType */ type PaymentStatusWithLiterals = PaymentStatus | 'UNKNOWN' | 'UNPAID' | 'PAID' | 'FAILED'; interface Totals { /** * Total price of the subscription that the customer must pay per billing * cycle. Calculated as: `subtotal + tax + shippingFee + applicationFee + extraCharge - discount - credit` * Note: platformFee is NOT included in this calculation as it is absorbed by the merchant and does not affect the customer's total. * @format DECIMAL_VALUE * @readonly */ totalPrice?: string; /** * Subtotal of all line items that belong to the subscription. * Calculated as: `sum_{i=1}^{n} (itemPrice[i] * quantity[i])` * @format DECIMAL_VALUE * @readonly */ subtotal?: string; /** * Total tax. * @format DECIMAL_VALUE * @readonly */ tax?: string | null; /** * Tax-exempt amount. * @format DECIMAL_VALUE * @decimalValue options { gte:0.00, maxScale:4 } * @readonly */ exempt?: string | null; /** * Total discount. * @format DECIMAL_VALUE * @readonly */ discount?: string | null; /** * Total application fee. * @format DECIMAL_VALUE * @readonly */ applicationFee?: string | null; /** * Total shipping fee. * @format DECIMAL_VALUE * @readonly */ shippingFee?: string | null; /** * Total extra charges without tax. * @format DECIMAL_VALUE * @readonly */ extraCharge?: string | null; /** * Total credits without tax. * @format DECIMAL_VALUE * @readonly */ credit?: string | null; /** * The tax amount for the proration, which is also included in the total tax. * @format DECIMAL_VALUE * @readonly */ prorationTax?: string | null; /** * Platform fee calculated based on vertical-specific billing settings configuration. * @format DECIMAL_VALUE * @decimalValue options { gte:0.00, maxScale:4 } * @readonly */ platformFee?: string | null; } interface PaymentTaxData { /** * A detailed breakdown of the tax authorities for all subscription items from the latest payment * @minSize 1 * @maxSize 100 */ taxBreakdowns?: TaxBreakdown[]; /** * Tax amount for all subscription items * @format DECIMAL_VALUE * @decimalValue options { gte:0.00, maxScale:4 } */ taxAmount?: string | null; } interface TaxBreakdown { taxType?: string; /** @decimalValue options { maxScale:6 } */ taxRate?: string; /** @format DECIMAL_VALUE */ taxAmount?: string | null; /** @format DECIMAL_VALUE */ taxableAmount?: string | null; /** @format DECIMAL_VALUE */ nonTaxableAmount?: string | null; /** * Name of the tax that was calculated. For example, "NY State Sales Tax", "Quebec GST", etc. * @maxLength 200 */ taxName?: string | null; /** * Jurisdiction that taxes were calculated for. * @maxLength 200 */ jurisdiction?: string | null; /** Type of jurisdiction that taxes were calculated for. */ jurisdictionType?: string; /** * Provider-specific metadata (e.g., Avalara trans/svc codes for financial reporting) * @maxSize 20 */ metadata?: Record; } interface FreeTrialData { /** * Date when free trial starts * @readonly */ startDate?: Date | null; /** * Date when free trial ends * @readonly */ endDate?: Date | null; } interface UpdateBillingDateData { /** * Date until the subscription is paid for. * Different from `nextBillingDate` only when the next billing date is updated without immediately issuing a new invoice. */ paidUntil?: Date | null; /** Information about how to adjust the item's payment due to the update of the billing date */ proration?: Proration; } interface Proration extends ProrationTypeOneOf { /** * BASS automatically calculates the proration amount based on the number * of days added to or removed from the current billing cycle. BASS uses * this formula to calculate the charge or credit amount: * `(Subscription total for the current billing cycle) * (number of days added to or removed from the current billing cycle) / (total number of days for the current billing cycle before the adjustment)`. * For example, the customer has paid 100 UDS for the current * billing cycle that last 31 days, and you want to extend the cycle by 8 * days. Then, BASS calculates the proration amount like this: * `100 USD * 8 days / 31 days`, which equals `25.81 USD`. */ timeBased?: TimeBasedProration; /** Proration amount that's based on your custom calculation. */ custom?: CustomProration; } /** @oneof */ interface ProrationTypeOneOf { /** * BASS automatically calculates the proration amount based on the number * of days added to or removed from the current billing cycle. BASS uses * this formula to calculate the charge or credit amount: * `(Subscription total for the current billing cycle) * (number of days added to or removed from the current billing cycle) / (total number of days for the current billing cycle before the adjustment)`. * For example, the customer has paid 100 UDS for the current * billing cycle that last 31 days, and you want to extend the cycle by 8 * days. Then, BASS calculates the proration amount like this: * `100 USD * 8 days / 31 days`, which equals `25.81 USD`. */ timeBased?: TimeBasedProration; /** Proration amount that's based on your custom calculation. */ custom?: CustomProration; } interface TimeBasedProration { } interface CustomProration extends CustomProrationAmountOneOf { /** * Proration charge amount that's based on your custom calculation. * Increases the total that the customer must pay with the next invoice. * * Min: `0.01` * @decimalValue options { gt:0.00 } */ charge?: string; /** * Proration credit amount that's based on your custom calculation. * Lowers the total that the customer must pay with the next invoice. * * Min: `0.01` * @decimalValue options { gt:0.00 } */ credit?: string; } /** @oneof */ interface CustomProrationAmountOneOf { /** * Proration charge amount that's based on your custom calculation. * Increases the total that the customer must pay with the next invoice. * * Min: `0.01` * @decimalValue options { gt:0.00 } */ charge?: string; /** * Proration credit amount that's based on your custom calculation. * Lowers the total that the customer must pay with the next invoice. * * Min: `0.01` * @decimalValue options { gt:0.00 } */ credit?: string; } interface GracePeriodData { /** * Grace period start date * @readonly */ startDate?: Date | null; /** * Grace period end date * @readonly */ endDate?: Date | null; /** Automatic retry data during grade period, if have any. Optional. */ automaticRetryData?: AutomaticRetryData; } interface AutomaticRetryData { enabled?: boolean; } interface SubscriptionPolicies { /** Subscription can be canceled by the customer who bought it */ customerCanCancel?: boolean; /** Subscription end date can be updated by business */ businessCanExtend?: boolean; /** Subscription can be canceled not only immediately, but also at end of billing cycle by turning off auto-renew */ allowEndOfCycleCancellation?: boolean; /** * Deprecated. Never in production. BASS does not read or write this field; UoU gates use * `CustomerSettingsResolver` → BBS `customer_settings_by_app_def_id` or Legacy booleans above. * @deprecated */ customerActionSettings?: CustomerActionSettings; /** * Number of self-service actions already used on this subscription. * @readonly */ customerActionCounters?: CustomerActionCounters; } /** * Per-action merchant configuration for customer self-service actions. * All booleans use BoolValue (optional) so verticals can selectively override defaults. */ interface CustomerActionSettings { /** Skip cycle action settings */ skip?: SkipActionSettings; /** Pause/resume action settings */ pauseResume?: PauseResumeActionSettings; /** Cancel action settings */ cancel?: CancelActionSettings; /** Update payment method action settings */ upm?: UpmActionSettings; /** Update billing date action settings */ updateBillingDate?: UpdateBillingDateActionSettings; } /** Controls skip cycle functionality — lets a customer skip one or more billing cycles. */ interface SkipActionSettings { /** Whether the skip action is enabled */ enabled?: boolean | null; /** Skip action configuration */ configuration?: SkipActionConfiguration; } /** Configuration for the skip cycle action. */ interface SkipActionConfiguration { /** Maximum number of billing cycles a customer can skip */ maxSkipCycles?: number | null; /** Minimum days before billing date to allow skip */ daysBeforeSkipAllowed?: number | null; /** Minimum days before billing date to allow resume from skip */ daysBeforeResumeAllowed?: number | null; /** Minimum days before billing date to cancel a scheduled skip */ daysBeforeCancelSkipAllowed?: number | null; /** Maximum number of times a customer can perform skip action */ maxSkipUserActions?: number | null; /** Allow skipping the next billing cycle */ skipNextCycle?: boolean | null; /** Allow skipping future billing cycles */ skipFutureCycles?: boolean | null; /** Allow reversing a pending skip */ unskip?: boolean | null; /** Allow cancelling a scheduled skip-pause */ cancelScheduledPause?: boolean | null; /** Allow immediate resume from skip */ resumeImmediately?: boolean | null; /** Allow resume at the next billing date */ resumeAtNextBillingDate?: boolean | null; /** Allow resume at a specific date */ resumeAtSpecificDate?: boolean | null; /** Allow setting auto-resume after N cycles */ autoResumeCycles?: boolean | null; } /** * Subscription pause/resume settings — full pause of billing, not skip. * Skip action (temporary pause for N cycles) is configured via SkipActionSettings. */ interface PauseResumeActionSettings { /** Whether the pause/resume action is enabled */ enabled?: boolean | null; /** Pause/resume action configuration */ configuration?: PauseResumeActionConfiguration; } /** * Configuration for the subscription pause/resume action. * Skip action (temporary pause for N cycles) is configured via SkipActionConfiguration. */ interface PauseResumeActionConfiguration { /** Minimum days before billing date to allow pause */ daysBeforePauseAllowed?: number | null; /** Maximum cycles for auto-resume after pause */ maxAutoResumeCycles?: number | null; /** Minimum days before billing date to allow resume */ daysBeforeResumeAllowed?: number | null; /** Minimum days before billing to cancel scheduled pause */ daysBeforeCancelScheduledPauseAllowed?: number | null; /** Maximum number of times a customer can perform pause action */ maxPauseUserActions?: number | null; } /** Cancel subscription action settings. */ interface CancelActionSettings { /** Whether the cancel action is enabled */ enabled?: boolean | null; /** Cancel action configuration */ configuration?: CancelActionConfiguration; } /** Configuration for the cancel subscription action. */ interface CancelActionConfiguration { /** Minimum days before period end to allow cancellation */ minDaysBeforePeriodEnd?: number | null; } /** Update Payment Method action settings — toggle only, no additional configuration. */ interface UpmActionSettings { /** Whether the update payment method action is enabled */ enabled?: boolean | null; } /** Update billing date action settings. */ interface UpdateBillingDateActionSettings { /** Whether the update billing date action is enabled */ enabled?: boolean | null; /** Update billing date configuration */ configuration?: UpdateBillingDateActionConfiguration; } /** Configuration for the update billing date action. */ interface UpdateBillingDateActionConfiguration { /** Whether to adjust price when billing date changes */ priceAdjustmentEnabled?: boolean | null; /** Maximum days the billing date can be moved forward */ maxDaysAdvance?: number | null; /** Maximum days the billing date can be postponed */ maxDaysPostpone?: number | null; /** Minimum days from today for the new billing date */ minDaysFromToday?: number | null; /** Whether to allow advancing billing date for weekly subscriptions */ allowAdvanceForWeekly?: boolean | null; } interface CustomerActionCounters { /** * Number of self-service skips already used. Unset means zero. * @readonly */ skipCount?: number | null; /** * Number of self-service pauses already used. Unset means zero. * @readonly */ pauseCount?: number | null; } interface PauseInfo { pausePolicy?: PausePolicyWithLiterals; pauseAt?: PauseAtWithLiterals; startDate?: Date | null; startCycle?: number | null; resumeAt?: ResumeAtWithLiterals; resumeDate?: Date | null; resumeCycle?: number | null; } declare enum PausePolicy { NONE = "NONE", /** Pause the payment and the service. When resuming, the subscription end date is extended by the number of cycles postponed, and if the pause happened in a middle of a cycle, the payment date is postponed by the amount of days that already paid. */ SERVICE_AND_PAYMENTS = "SERVICE_AND_PAYMENTS", /** Pause the service and continue the billing. When resuming, extend the service by the time that was paused */ SERVICE_ONLY = "SERVICE_ONLY" } /** @enumType */ type PausePolicyWithLiterals = PausePolicy | 'NONE' | 'SERVICE_AND_PAYMENTS' | 'SERVICE_ONLY'; declare enum PauseAt { /** Cancel scheduled pause */ NONE = "NONE", /** Pause the subscription now */ IMMEDIATELY = "IMMEDIATELY", /** Pause the subscription at the next billing date */ NEXT_BILLING_DATE = "NEXT_BILLING_DATE", /** A specific date must be defined in Schedule.specific_date */ SPECIFIC_DATE = "SPECIFIC_DATE", /** The number of cycles must be defined in Schedule.number_of_cycles */ NUMBER_OF_CYCLES_FROM_TODAY = "NUMBER_OF_CYCLES_FROM_TODAY", /** Pause subscription after N billing cycles from the next billing date. Used for skip-cycle feature where customers skip future billing cycles. Requires Schedule.number_of_cycles to specify how many cycles to wait before pausing. */ NUMBER_OF_CYCLES_FROM_NEXT_BILLING_DATE = "NUMBER_OF_CYCLES_FROM_NEXT_BILLING_DATE" } /** @enumType */ type PauseAtWithLiterals = PauseAt | 'NONE' | 'IMMEDIATELY' | 'NEXT_BILLING_DATE' | 'SPECIFIC_DATE' | 'NUMBER_OF_CYCLES_FROM_TODAY' | 'NUMBER_OF_CYCLES_FROM_NEXT_BILLING_DATE'; declare enum ResumeAt { /** Cancel scheduled resume */ NONE = "NONE", /** Resume the subscription now */ IMMEDIATELY = "IMMEDIATELY", /** Resume the subscription at the next billing date */ NEXT_BILLING_DATE = "NEXT_BILLING_DATE", /** A specific date must be defined in Schedule.specific_date */ SPECIFIC_DATE = "SPECIFIC_DATE", /** Resume subscription after N billing cycles from when the pause starts. Automatically resumes subscription after skipping the specified number of cycles. Requires Schedule.number_of_cycles to specify how many cycles to skip before resuming. */ NUMBER_OF_CYCLES_FROM_PAUSE_START = "NUMBER_OF_CYCLES_FROM_PAUSE_START" } /** @enumType */ type ResumeAtWithLiterals = ResumeAt | 'NONE' | 'IMMEDIATELY' | 'NEXT_BILLING_DATE' | 'SPECIFIC_DATE' | 'NUMBER_OF_CYCLES_FROM_PAUSE_START'; interface CancellationInfo { /** Subscription cancel date. Can contain a future or past date */ cancellationDate?: Date | null; /** Initiator for cancellation */ initiator?: HistoryActionInitiatorWithLiterals; /** Reason for cancellation. Optional. */ reason?: string | null; } declare enum HistoryActionInitiator { UNDEFINED = "UNDEFINED", BUSINESS = "BUSINESS", CUSTOMER = "CUSTOMER", SYSTEM = "SYSTEM", PAYMENT_FAILURE = "PAYMENT_FAILURE" } /** @enumType */ type HistoryActionInitiatorWithLiterals = HistoryActionInitiator | 'UNDEFINED' | 'BUSINESS' | 'CUSTOMER' | 'SYSTEM' | 'PAYMENT_FAILURE'; interface SubscriptionUpdateData { /** @maxSize 100 */ itemsToUpdate?: ItemChange[]; /** @maxSize 99 */ itemsToAdd?: Item[]; /** * @format GUID * @maxSize 99 */ itemsToDelete?: string[] | null; /** @readonly */ numberOfRequests?: number; } interface ItemChange { /** * Item ID * @format GUID */ id?: string; pricingModel?: PricingModel; /** @min 1 */ quantity?: number | null; tax?: Tax; } interface PricingModel extends PricingModelModelOneOf { /** Fixed item price. */ fixedPrice?: FixedPrice; /** External/metered pricing (see ExternalPrice comment for details). */ externalPrice?: ExternalPrice; } /** @oneof */ interface PricingModelModelOneOf { /** Fixed item price. */ fixedPrice?: FixedPrice; /** External/metered pricing (see ExternalPrice comment for details). */ externalPrice?: ExternalPrice; } interface FixedPrice { /** * Fixed item price with a period as a decimal separator. For example, `3.99`. * Price doesn't include tax, discounts, or application fee. * * Min: `0.01` * @decimalValue options { gte:0.00, maxScale:4 } */ itemPrice?: string; } /** * External/metered pricing where price comes from an external provider at billing time. * * The external pricing provider is determined by the Subscription's PlatformOrigin.app_id. * BASS maintains a hardcoded mapping from app_id to the service client (e.g., CustomChargesService). * To add support for other platforms (e.g., eCom), add the mapping in BASS code. */ interface ExternalPrice { /** * Optional fixed base amount (added to external charges) * @decimalValue options { gte:0.00, maxScale:4 } */ baseAmount?: string | null; } interface Item { /** * Unique identifier of subscription item. Automatically generated and read-only. * @readonly * @format GUID */ id?: string | null; /** * Name of the item. Typically product name. * @minLength 1 * @maxLength 200 */ name?: string; /** * Description of the item. * @maxLength 500 */ description?: string | null; /** References to external product catalog data known to client. */ catalogReference?: CatalogReference; /** Category of item. Whether it is digital or physical one. */ category?: ItemCategoryWithLiterals; /** * Amount of products * @min 1 */ quantity?: number; /** Pricing model of the item. Whether fixed price or dynamic price models. */ pricingModel?: PricingModel; /** Tax, positive value, optional */ tax?: Tax; /** * Discounts applied on item price * @maxSize 5 */ discounts?: Discount[]; /** Application specific fee, positive value, optional (if application_fee == 0, don't include it to request). Only positive values. */ applicationFee?: ApplicationFee; /** * External reference identifier for mapping item in consumer's system. * This allows the consumer to correlate the item in their system with the item in this API. * @format GUID */ externalId?: string | null; /** * Unit base-price overrides for specific lifetime subscription cycles. Each entry replaces * pricing_model.fixed_price for the cycles it covers; unlisted cycles bill the fixed price. * Quantity, discounts, tax and application fee apply on top as usual. Fixed-price items only. * At most 5 entries, ranges must not overlap. Accepted only where the route supports it. * @maxSize 5 */ cyclePriceOverrides?: CyclePriceOverride[]; /** * Key / Value store to keep up to 10 additional values related to the subscription item. * Key max length = 50, Value max length = 200. Value can not be empty. * Should not include any sensitive or PII information. * @maxSize 10 */ metadata?: Record; } interface CatalogReference { /** * Product ID from the external catalog. * @minLength 1 * @maxLength 50 */ catalogItemId?: string; /** * ID of the app that the product catalog belongs to. * When omitted, BASS assumes that the product belongs to the subscription's * `origin.appId`. * * Min: 1 character * Max: 50 characters * @minLength 1 * @maxLength 50 */ appId?: string | null; } declare enum ItemCategory { UNKNOWN = "UNKNOWN", PHYSICAL = "PHYSICAL", DIGITAL = "DIGITAL" } /** @enumType */ type ItemCategoryWithLiterals = ItemCategory | 'UNKNOWN' | 'PHYSICAL' | 'DIGITAL'; interface ApplicationFee extends ApplicationFeeValueOneOf { /** * Amount of the application fee in `0.00` format. * @format DECIMAL_VALUE */ amount?: string; /** * Discounts for the application fee. * * Max: 5 discounts * @maxSize 5 */ discounts?: Discount[]; } /** @oneof */ interface ApplicationFeeValueOneOf { /** * Amount of the application fee in `0.00` format. * @format DECIMAL_VALUE */ amount?: string; } interface CyclePriceOverride { /** * Lifetime subscription cycles the price applies to. Required. * Same shape and meaning as item discount cycles; empty number_of_cycles means until the end. */ cycles?: DiscountCycles; /** * Unit base price for these cycles, with a period as a decimal separator. For example, `35.00`. * Can be higher, lower or equal to the fixed price. `0` is valid; an empty value is rejected. * Price doesn't include tax, discounts, or application fee. * @decimalValue options { gte:0.00, maxScale:4 } */ itemPrice?: string; } interface SpecificDateSubscriptionUpdateData { updateData?: SubscriptionUpdateData; executionDate?: Date | null; } interface PlatformOrigin { /** @format GUID */ appId?: string | null; /** @format GUID */ entityId?: string | null; } /** A contract change that has been accepted and will take effect at the next renewal date. */ interface ScheduledContractChange { /** * The idempotency key from the original ChangeSubscription request. * @format GUID * @readonly */ idempotencyKey?: string; /** * The new billing settings that will apply after the renewal. * @readonly */ newBillingSettings?: BillingSettings; /** * The new items that will apply after the renewal. * @readonly * @maxSize 100 */ newItems?: Item[]; } interface UpsertPlanSubscriptionResponse { /** The Created subscription */ planSubscription?: PlanSubscription; } interface GetBySubscriptionContractIdRequest { /** * ID of the eCommerce subscription contract. * @format GUID */ subscriptionContractId: string; } interface GetBySubscriptionContractIdResponse { /** Retrieved plan subscription. */ planSubscription?: PlanSubscription; } interface GetByBillingSubscriptionIdRequest { /** * Billing subscription id * @format GUID */ billingSubscriptionId?: string; } interface GetByBillingSubscriptionIdResponse { /** The retrieved subscription for the plan */ planSubscription?: PlanSubscription; } interface QueryPlanSubscriptionsRequest { /** Query to filter, sort, and page the plan subscriptions. */ query?: QueryV2; } interface QueryV2 extends QueryV2PagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` * @maxSize 5 */ sort?: Sorting[]; } /** @oneof */ interface QueryV2PagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } interface Sorting { /** * Name of the field to sort by. * @maxLength 512 */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } interface CursorPaging { /** * Maximum number of items to return in the results. * @max 100 */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. * @maxLength 16000 */ cursor?: string | null; } interface QueryPlanSubscriptionsResponse { /** Retrieved plan subscriptions. */ planSubscriptions?: PlanSubscription[]; /** Paging metadata. */ pagingMetadata?: PagingMetadataV2; } interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } interface Cursors { /** * Cursor string pointing to the next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to the previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } interface MatchPriceRequest extends MatchPriceRequestRunModeOptionsOneOf { /** If the match price type is DRY_RUN, this field must contain the dry run options. */ dryRunOptions?: DryRunOptions; /** * ID of the plan to change. * @format GUID */ planId?: string; /** * ID of the pricing variant to change. * @format GUID */ pricingVariantId?: string; /** To prevent conflicting changes, the current plan revision must be passed when updating the price. */ planRevision?: string | null; /** The type of match price action to perform. */ runMode?: RunModeWithLiterals; } /** @oneof */ interface MatchPriceRequestRunModeOptionsOneOf { /** If the match price type is DRY_RUN, this field must contain the dry run options. */ dryRunOptions?: DryRunOptions; } interface PricingStrategy extends PricingStrategyStrategyOneOf { /** Single fixed cost charged regardless of usage. */ flatRate?: FlatRate; } /** @oneof */ interface PricingStrategyStrategyOneOf { /** Single fixed cost charged regardless of usage. */ flatRate?: FlatRate; } interface FlatRate { /** * Fixed monetary amount. * @decimalValue options { gte:0, maxScale:4 } */ amount?: string; } /** At least one of custom_amount or predefined_amounts must be set. They can both be active simultaneously. */ interface CustomerChosenPrice { /** Option for customers to write the price they want themselves. */ customAmount?: CustomAmount; /** Option for customers to choose the price they want from predefined values. */ predefinedAmounts?: PredefinedAmounts; } interface CustomAmount { /** * The min value a customer can enter. * @decimalValue options { gt:0, maxScale:4 } * @minLength 1 */ minAmount?: string; /** * The max value a customer can enter. Setting this value is optional. * @decimalValue options { gt:0, maxScale:4 } */ maxAmount?: string | null; } interface PredefinedAmounts { /** * The predefined monetary amount that is chosen by default. Must be one of the values in amounts. Cannot be empty. * @decimalValue options { gt:0, maxScale:4 } * @minLength 1 */ defaultAmount?: string; /** * The predefined monetary amount values that customers can choose from. Cannot be empty. * @decimalValue options { gt:0, maxScale:4 } * @minSize 1 * @maxSize 10 */ amounts?: string[]; } declare enum RunMode { /** Live run - prices of existing subscriptions will be changed. */ LIVE_RUN = "LIVE_RUN", /** Dry run - preview affected subscription count with updating prices. */ DRY_RUN = "DRY_RUN" } /** @enumType */ type RunModeWithLiterals = RunMode | 'LIVE_RUN' | 'DRY_RUN'; interface DryRunOptions { /** The pricing strategy to use for the dry run. This pricing strategy should later be used for the live run. */ pricingStrategy?: PricingStrategy; } interface MatchPriceResponse extends MatchPriceResponseResponseDetailsOneOf { /** If the match price type is LIVE_RUN, this field will contain the live run response details. */ liveRunDetails?: LiveRunDetails; /** If the match price type is DRY_RUN, this field will contain the dry run response details. */ dryRunDetails?: DryRunDetails; } /** @oneof */ interface MatchPriceResponseResponseDetailsOneOf { /** If the match price type is LIVE_RUN, this field will contain the live run response details. */ liveRunDetails?: LiveRunDetails; /** If the match price type is DRY_RUN, this field will contain the dry run response details. */ dryRunDetails?: DryRunDetails; } interface LiveRunDetails { /** * A reference to the price change job. * @format GUID */ jobId?: string | null; } interface DryRunDetails { /** How many subscriptions would be updated. */ affectedSubscriptionsCount?: number | null; } interface PlanRevisionMismatchErrorDetails { /** The provided plan revision. */ providedPlanRevision?: string | null; /** The expected plan revision. */ expectedPlanRevision?: string | null; } interface PlanVariantIsNotRecurringErrorDetails { /** * The plan ID. * @format GUID */ planId?: string; /** * The pricing variant ID. * @format GUID */ pricingVariantId?: string; } interface PricingVariantNotFoundErrorDetails { /** * The plan ID. * @format GUID */ planId?: string; /** * The pricing variant ID. * @format GUID */ pricingVariantId?: string; } interface CustomerChosenPriceNotSupportedErrorDetails { /** * The plan ID. * @format GUID */ planId?: string; /** * The pricing variant ID. * @format GUID */ pricingVariantId?: string; } interface CountPlanSubscriptionsRequest { /** * Filter object in WQL format. * Supported fields: * `id`, * `member_id`, * `billing_subscription.plan_line_item.plan_id`, * `billing_subscription.plan_line_item.pricing_variant_id`, * `billing_subscription.status`. */ filter?: Record | null; /** * Stop counting at this number. When set, the returned count is at most `max_count`. * @min 1 * @max 10000 */ maxCount?: number | null; } interface CountPlanSubscriptionsResponse { /** Number of plan subscriptions matching the filter. */ count?: number; } interface EndPlanSubscriptionRequest { /** * Plan subscription ID. * @format GUID */ planSubscriptionId?: string; } interface EndPlanSubscriptionResponse { } interface Empty { } type __PublicMethodMetaInfo = { getUrl: (context: any) => string; httpMethod: K; path: string; pathParams: M; __requestType: T; __originalRequestType: S; __responseType: Q; __originalResponseType: R; }; declare function getPlanSubscription(): __PublicMethodMetaInfo<'GET', { subscriptionId: string; }, GetPlanSubscriptionRequest$1, GetPlanSubscriptionRequest, GetPlanSubscriptionResponse$1, GetPlanSubscriptionResponse>; declare function getBySubscriptionContractId(): __PublicMethodMetaInfo<'GET', { subscriptionContractId: string; }, GetBySubscriptionContractIdRequest$1, GetBySubscriptionContractIdRequest, GetBySubscriptionContractIdResponse$1, GetBySubscriptionContractIdResponse>; declare function queryPlanSubscriptions(): __PublicMethodMetaInfo<'POST', {}, QueryPlanSubscriptionsRequest$1, QueryPlanSubscriptionsRequest, QueryPlanSubscriptionsResponse$1, QueryPlanSubscriptionsResponse>; export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, type AdditionalFee as AdditionalFeeOriginal, AdditionalFeeTrigger as AdditionalFeeTriggerOriginal, type AdditionalFeeTriggerWithLiterals as AdditionalFeeTriggerWithLiteralsOriginal, type Address as AddressOriginal, type AddressStreetOneOf as AddressStreetOneOfOriginal, type ApplicationFee as ApplicationFeeOriginal, type ApplicationFeeValueOneOf as ApplicationFeeValueOneOfOriginal, type AutomaticRetryData as AutomaticRetryDataOriginal, type BenefitDistribution as BenefitDistributionOriginal, type BenefitDistributionSettingsDistributionStrategyOneOf as BenefitDistributionSettingsDistributionStrategyOneOfOriginal, type BenefitDistributionSettings as BenefitDistributionSettingsOriginal, type BillingSettings as BillingSettingsOriginal, type BillingStatus as BillingStatusOriginal, type BillingSubscriptionAdditionalFee as BillingSubscriptionAdditionalFeeOriginal, type BillingSubscriptionBillingSettings as BillingSubscriptionBillingSettingsOriginal, type BillingSubscriptionBillingStatus as BillingSubscriptionBillingStatusOriginal, type BillingSubscriptionCancellationInfo as BillingSubscriptionCancellationInfoOriginal, type BillingSubscriptionCycles as BillingSubscriptionCyclesOriginal, type BillingSubscriptionDiscountCycles as BillingSubscriptionDiscountCyclesOriginal, type BillingSubscriptionDiscountOrigin as BillingSubscriptionDiscountOriginOriginal, type BillingSubscriptionDiscount as BillingSubscriptionDiscountOriginal, type BillingSubscriptionDiscountValueOneOf as BillingSubscriptionDiscountValueOneOfOriginal, type BillingSubscriptionDuration as BillingSubscriptionDurationOriginal, type BillingSubscriptionItemChange as BillingSubscriptionItemChangeOriginal, type BillingSubscription as BillingSubscriptionOriginal, type BillingSubscriptionPauseInfo as BillingSubscriptionPauseInfoOriginal, type BillingSubscriptionPaymentData as BillingSubscriptionPaymentDataOriginal, type BillingSubscriptionPlatformOrigin as BillingSubscriptionPlatformOriginOriginal, type BillingSubscriptionPricingModelModelOneOf as BillingSubscriptionPricingModelModelOneOfOriginal, type BillingSubscriptionPricingModel as BillingSubscriptionPricingModelOriginal, type BillingSubscriptionSpecificDateSubscriptionUpdateData as BillingSubscriptionSpecificDateSubscriptionUpdateDataOriginal, type BillingSubscriptionSubscriptionUpdateData as BillingSubscriptionSubscriptionUpdateDataOriginal, type BillingSubscriptionTaxSettings as BillingSubscriptionTaxSettingsOriginal, type BillingSubscriptionTotals as BillingSubscriptionTotalsOriginal, type BusinessOrigin as BusinessOriginOriginal, type CancelActionConfiguration as CancelActionConfigurationOriginal, type CancelActionSettings as CancelActionSettingsOriginal, CancellationInfoHistoryActionInitiator as CancellationInfoHistoryActionInitiatorOriginal, type CancellationInfoHistoryActionInitiatorWithLiterals as CancellationInfoHistoryActionInitiatorWithLiteralsOriginal, type CancellationInfo as CancellationInfoOriginal, type CatalogReference as CatalogReferenceOriginal, CollectionMethodEnumCollectionMethod as CollectionMethodEnumCollectionMethodOriginal, type CollectionMethodEnumCollectionMethodWithLiterals as CollectionMethodEnumCollectionMethodWithLiteralsOriginal, CollectionMethod as CollectionMethodOriginal, type CollectionMethodWithLiterals as CollectionMethodWithLiteralsOriginal, type CountPlanSubscriptionsRequest as CountPlanSubscriptionsRequestOriginal, type CountPlanSubscriptionsResponse as CountPlanSubscriptionsResponseOriginal, type Coupon as CouponOriginal, type CursorPaging as CursorPagingOriginal, type Cursors as CursorsOriginal, type CustomAmount as CustomAmountOriginal, type CustomBillingSchedule as CustomBillingScheduleOriginal, type CustomProrationAmountOneOf as CustomProrationAmountOneOfOriginal, type CustomProration as CustomProrationOriginal, CustomScheduleOptionsDurationDurationUnit as CustomScheduleOptionsDurationDurationUnitOriginal, type CustomScheduleOptionsDurationDurationUnitWithLiterals as CustomScheduleOptionsDurationDurationUnitWithLiteralsOriginal, type CustomScheduleOptionsDuration as CustomScheduleOptionsDurationOriginal, type CustomScheduleOptions as CustomScheduleOptionsOriginal, type CustomerActionCounters as CustomerActionCountersOriginal, type CustomerActionSettings as CustomerActionSettingsOriginal, type CustomerChosenPriceNotSupportedErrorDetails as CustomerChosenPriceNotSupportedErrorDetailsOriginal, type CustomerChosenPrice as CustomerChosenPriceOriginal, type CustomerIdOneOf as CustomerIdOneOfOriginal, type Customer as CustomerOriginal, type CyclePriceOverride as CyclePriceOverrideOriginal, type Cycles as CyclesOriginal, type DiscountCycles as DiscountCyclesOriginal, type DiscountOrigin as DiscountOriginOriginal, type Discount as DiscountOriginal, type DiscountValueOneOf as DiscountValueOneOfOriginal, DistributionStrategyType as DistributionStrategyTypeOriginal, type DistributionStrategyTypeWithLiterals as DistributionStrategyTypeWithLiteralsOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type DryRunDetails as DryRunDetailsOriginal, type DryRunOptions as DryRunOptionsOriginal, DurationDurationUnit as DurationDurationUnitOriginal, type DurationDurationUnitWithLiterals as DurationDurationUnitWithLiteralsOriginal, type Duration as DurationOriginal, DurationUnit as DurationUnitOriginal, type DurationUnitWithLiterals as DurationUnitWithLiteralsOriginal, type DynamicTax as DynamicTaxOriginal, type Empty as EmptyOriginal, type EndPlanSubscriptionRequest as EndPlanSubscriptionRequestOriginal, type EndPlanSubscriptionResponse as EndPlanSubscriptionResponseOriginal, EndReason as EndReasonOriginal, type EndReasonWithLiterals as EndReasonWithLiteralsOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type ExternalCollectionDetails as ExternalCollectionDetailsOriginal, type ExternalPrice as ExternalPriceOriginal, type FixedPrice as FixedPriceOriginal, type FlatRate as FlatRateOriginal, type FormSubmission as FormSubmissionOriginal, type FreeTrialData as FreeTrialDataOriginal, type FullAddressContactDetails as FullAddressContactDetailsOriginal, type FullAddressDetails as FullAddressDetailsOriginal, type GetByBillingSubscriptionIdRequest as GetByBillingSubscriptionIdRequestOriginal, type GetByBillingSubscriptionIdResponse as GetByBillingSubscriptionIdResponseOriginal, type GetBySubscriptionContractIdRequest as GetBySubscriptionContractIdRequestOriginal, type GetBySubscriptionContractIdResponse as GetBySubscriptionContractIdResponseOriginal, type GetPlanSubscriptionRequest as GetPlanSubscriptionRequestOriginal, type GetPlanSubscriptionResponse as GetPlanSubscriptionResponseOriginal, type GracePeriodData as GracePeriodDataOriginal, HistoryActionInitiator as HistoryActionInitiatorOriginal, type HistoryActionInitiatorWithLiterals as HistoryActionInitiatorWithLiteralsOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, ItemCategory as ItemCategoryOriginal, type ItemCategoryWithLiterals as ItemCategoryWithLiteralsOriginal, type ItemChange as ItemChangeOriginal, type Item as ItemOriginal, type LiveRunDetails as LiveRunDetailsOriginal, type MatchPriceRequest as MatchPriceRequestOriginal, type MatchPriceRequestRunModeOptionsOneOf as MatchPriceRequestRunModeOptionsOneOfOriginal, type MatchPriceResponse as MatchPriceResponseOriginal, type MatchPriceResponseResponseDetailsOneOf as MatchPriceResponseResponseDetailsOneOfOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type OrderPlanSubscriptionMigrated as OrderPlanSubscriptionMigratedOriginal, type OrderPricingDetails as OrderPricingDetailsOriginal, type Origin as OriginOriginal, type PagingMetadataV2 as PagingMetadataV2Original, type Paging as PagingOriginal, PauseAtEnumPauseAt as PauseAtEnumPauseAtOriginal, type PauseAtEnumPauseAtWithLiterals as PauseAtEnumPauseAtWithLiteralsOriginal, PauseAt as PauseAtOriginal, type PauseAtWithLiterals as PauseAtWithLiteralsOriginal, type PauseInfo as PauseInfoOriginal, PausePolicyEnumPausePolicy as PausePolicyEnumPausePolicyOriginal, type PausePolicyEnumPausePolicyWithLiterals as PausePolicyEnumPausePolicyWithLiteralsOriginal, PausePolicy as PausePolicyOriginal, type PausePolicyWithLiterals as PausePolicyWithLiteralsOriginal, type PauseResumeActionConfiguration as PauseResumeActionConfigurationOriginal, type PauseResumeActionSettings as PauseResumeActionSettingsOriginal, type PaymentData as PaymentDataOriginal, PaymentDataPaymentStatus as PaymentDataPaymentStatusOriginal, type PaymentDataPaymentStatusWithLiterals as PaymentDataPaymentStatusWithLiteralsOriginal, type PaymentMethod as PaymentMethodOriginal, PaymentStatus as PaymentStatusOriginal, type PaymentStatusWithLiterals as PaymentStatusWithLiteralsOriginal, type PaymentTaxData as PaymentTaxDataOriginal, PeriodUnit as PeriodUnitOriginal, type PeriodUnitWithLiterals as PeriodUnitWithLiteralsOriginal, type PlanLineItem as PlanLineItemOriginal, type PlanRevisionMismatchErrorDetails as PlanRevisionMismatchErrorDetailsOriginal, type PlanSubscriptionAutoRenewCanceled as PlanSubscriptionAutoRenewCanceledOriginal, type PlanSubscriptionAutoRenewTurnedOn as PlanSubscriptionAutoRenewTurnedOnOriginal, type PlanSubscriptionCanceled as PlanSubscriptionCanceledOriginal, type PlanSubscriptionCycleStarted as PlanSubscriptionCycleStartedOriginal, type PlanSubscriptionEndDatePostponed as PlanSubscriptionEndDatePostponedOriginal, type PlanSubscriptionEnded as PlanSubscriptionEndedOriginal, type PlanSubscriptionMarkedAsPaid as PlanSubscriptionMarkedAsPaidOriginal, type PlanSubscription as PlanSubscriptionOriginal, type PlanSubscriptionPaused as PlanSubscriptionPausedOriginal, type PlanSubscriptionPurchased as PlanSubscriptionPurchasedOriginal, type PlanSubscriptionResumed as PlanSubscriptionResumedOriginal, type PlanSubscriptionRevived as PlanSubscriptionRevivedOriginal, type PlanSubscriptionStartDateChanged as PlanSubscriptionStartDateChangedOriginal, type PlanSubscriptionStarted as PlanSubscriptionStartedOriginal, type PlanVariantIsNotRecurringErrorDetails as PlanVariantIsNotRecurringErrorDetailsOriginal, type PlatformOrigin as PlatformOriginOriginal, type PredefinedAmounts as PredefinedAmountsOriginal, type PricingModelFixedPrice as PricingModelFixedPriceOriginal, type PricingModelModelOneOf as PricingModelModelOneOfOriginal, type PricingModel as PricingModelOriginal, type PricingStrategy as PricingStrategyOriginal, type PricingStrategyStrategyOneOf as PricingStrategyStrategyOneOfOriginal, type PricingVariantNotFoundErrorDetails as PricingVariantNotFoundErrorDetailsOriginal, type Proration as ProrationOriginal, type ProrationTypeOneOf as ProrationTypeOneOfOriginal, type QueryPlanSubscriptionsRequest as QueryPlanSubscriptionsRequestOriginal, type QueryPlanSubscriptionsResponse as QueryPlanSubscriptionsResponseOriginal, type QueryV2 as QueryV2Original, type QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOfOriginal, type Recurrence as RecurrenceOriginal, type RestoreInfo as RestoreInfoOriginal, ResumeAtEnumResumeAt as ResumeAtEnumResumeAtOriginal, type ResumeAtEnumResumeAtWithLiterals as ResumeAtEnumResumeAtWithLiteralsOriginal, ResumeAt as ResumeAtOriginal, type ResumeAtWithLiterals as ResumeAtWithLiteralsOriginal, RunMode as RunModeOriginal, type RunModeWithLiterals as RunModeWithLiteralsOriginal, type ScheduledContractChange as ScheduledContractChangeOriginal, type ShippingCharges as ShippingChargesOriginal, type SkipActionConfiguration as SkipActionConfigurationOriginal, type SkipActionSettings as SkipActionSettingsOriginal, SortOrder as SortOrderOriginal, type SortOrderWithLiterals as SortOrderWithLiteralsOriginal, type Sorting as SortingOriginal, type SpecificDateSubscriptionUpdateData as SpecificDateSubscriptionUpdateDataOriginal, type StreetAddress as StreetAddressOriginal, type Subscription as SubscriptionOriginal, type SubscriptionPolicies as SubscriptionPoliciesOriginal, SubscriptionStatusEnumSubscriptionStatus as SubscriptionStatusEnumSubscriptionStatusOriginal, type SubscriptionStatusEnumSubscriptionStatusWithLiterals as SubscriptionStatusEnumSubscriptionStatusWithLiteralsOriginal, SubscriptionStatus as SubscriptionStatusOriginal, type SubscriptionStatusWithLiterals as SubscriptionStatusWithLiteralsOriginal, type SubscriptionUpdateData as SubscriptionUpdateDataOriginal, type TaxBreakdown as TaxBreakdownOriginal, type Tax as TaxOriginal, type TaxSettings as TaxSettingsOriginal, type TaxValueOneOf as TaxValueOneOfOriginal, TaxableAddressType as TaxableAddressTypeOriginal, type TaxableAddressTypeWithLiterals as TaxableAddressTypeWithLiteralsOriginal, type TimeBasedProration as TimeBasedProrationOriginal, type Totals as TotalsOriginal, type UpdateBillingDateActionConfiguration as UpdateBillingDateActionConfigurationOriginal, type UpdateBillingDateActionSettings as UpdateBillingDateActionSettingsOriginal, type UpdateBillingDateData as UpdateBillingDateDataOriginal, type UpmActionSettings as UpmActionSettingsOriginal, type UpsertPlanSubscriptionRequest as UpsertPlanSubscriptionRequestOriginal, type UpsertPlanSubscriptionResponse as UpsertPlanSubscriptionResponseOriginal, type V1Duration as V1DurationOriginal, type V1PricingModel as V1PricingModelOriginal, type V1PricingModelPricingModelOneOf as V1PricingModelPricingModelOneOfOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, getBySubscriptionContractId, getPlanSubscription, queryPlanSubscriptions };