@wix/auto_sdk_subscription_subscriptions 1.0.47 → 1.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +3 -11
  2. package/build/cjs/index.js +402 -142
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +2020 -1771
  5. package/build/cjs/index.typings.js +338 -97
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +1991 -1762
  8. package/build/cjs/meta.js +291 -92
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +3 -11
  11. package/build/es/index.mjs +396 -141
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +2020 -1771
  14. package/build/es/index.typings.mjs +332 -96
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +1991 -1762
  17. package/build/es/meta.mjs +285 -91
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +28 -10
  20. package/build/internal/cjs/index.typings.d.ts +1713 -1383
  21. package/build/internal/cjs/meta.d.ts +2124 -1783
  22. package/build/internal/es/index.d.mts +28 -10
  23. package/build/internal/es/index.typings.d.mts +1713 -1383
  24. package/build/internal/es/meta.d.mts +2124 -1783
  25. package/package.json +4 -4
  26. package/build/internal/cjs/index.js +0 -6659
  27. package/build/internal/cjs/index.js.map +0 -1
  28. package/build/internal/cjs/index.typings.js +0 -5629
  29. package/build/internal/cjs/index.typings.js.map +0 -1
  30. package/build/internal/cjs/meta.js +0 -4712
  31. package/build/internal/cjs/meta.js.map +0 -1
  32. package/build/internal/es/index.mjs +0 -6543
  33. package/build/internal/es/index.mjs.map +0 -1
  34. package/build/internal/es/index.typings.mjs +0 -5526
  35. package/build/internal/es/index.typings.mjs.map +0 -1
  36. package/build/internal/es/meta.mjs +0 -4606
  37. package/build/internal/es/meta.mjs.map +0 -1
@@ -651,6 +651,13 @@ interface Totals {
651
651
  * @readonly
652
652
  */
653
653
  tax?: string | null;
654
+ /**
655
+ * Tax-exempt amount.
656
+ * @format DECIMAL_VALUE
657
+ * @decimalValue options { gte:0.00, maxScale:2 }
658
+ * @readonly
659
+ */
660
+ exempt?: string | null;
654
661
  /**
655
662
  * Total discount.
656
663
  * @format DECIMAL_VALUE
@@ -853,11 +860,16 @@ interface SubscriptionPolicies {
853
860
  /** Subscription can be canceled not only immediately, but also at end of billing cycle by turning off auto-renew */
854
861
  allowEndOfCycleCancellation?: boolean;
855
862
  /**
856
- * Per-subscription customer action settings. Controls which self-service actions
857
- * customers can perform on this specific subscription.
858
- * If not provided on creation, copied from site-level BillingSettings.
863
+ * Deprecated. Never in production. BASS does not read or write this field; UoU gates use
864
+ * `CustomerSettingsResolver` BBS `customer_settings_by_app_def_id` or Legacy booleans above.
865
+ * @deprecated
859
866
  */
860
867
  customerActionSettings?: CustomerActionSettings;
868
+ /**
869
+ * Number of self-service actions already used on this subscription.
870
+ * @readonly
871
+ */
872
+ customerActionCounters?: CustomerActionCounters;
861
873
  }
862
874
  /**
863
875
  * Per-action merchant configuration for customer self-service actions.
@@ -974,6 +986,18 @@ interface UpdateBillingDateActionConfiguration {
974
986
  /** Whether to allow advancing billing date for weekly subscriptions */
975
987
  allowAdvanceForWeekly?: boolean | null;
976
988
  }
989
+ interface CustomerActionCounters {
990
+ /**
991
+ * Number of self-service skips already used. Unset means zero.
992
+ * @readonly
993
+ */
994
+ skipCount?: number | null;
995
+ /**
996
+ * Number of self-service pauses already used. Unset means zero.
997
+ * @readonly
998
+ */
999
+ pauseCount?: number | null;
1000
+ }
977
1001
  interface PauseInfo {
978
1002
  pausePolicy?: PausePolicyWithLiterals;
979
1003
  pauseAt?: PauseAtWithLiterals;
@@ -1344,6 +1368,11 @@ interface Sorting {
1344
1368
  fieldName?: string;
1345
1369
  /** Sort order. */
1346
1370
  order?: SortOrderWithLiterals;
1371
+ /**
1372
+ * Origin point for geo-distance sorting on a GEO field
1373
+ * results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
1374
+ */
1375
+ origin?: AddressLocation;
1347
1376
  }
1348
1377
  declare enum SortOrder {
1349
1378
  ASC = "ASC",
@@ -1351,6 +1380,12 @@ declare enum SortOrder {
1351
1380
  }
1352
1381
  /** @enumType */
1353
1382
  type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
1383
+ interface AddressLocation {
1384
+ /** Address latitude. */
1385
+ latitude?: number | null;
1386
+ /** Address longitude. */
1387
+ longitude?: number | null;
1388
+ }
1354
1389
  interface Paging {
1355
1390
  /** Number of items to load. */
1356
1391
  limit?: number | null;
@@ -1515,10 +1550,11 @@ declare enum ActionType {
1515
1550
  UPDATE_BILLING_DATE = "UPDATE_BILLING_DATE",
1516
1551
  UPDATE_COLLECTION_METHOD = "UPDATE_COLLECTION_METHOD",
1517
1552
  SKIP_CYCLE = "SKIP_CYCLE",
1518
- CUSTOMER_UPDATE_BILLING_DATE = "CUSTOMER_UPDATE_BILLING_DATE"
1553
+ CUSTOMER_UPDATE_BILLING_DATE = "CUSTOMER_UPDATE_BILLING_DATE",
1554
+ CHANGE_SUBSCRIPTION = "CHANGE_SUBSCRIPTION"
1519
1555
  }
1520
1556
  /** @enumType */
1521
- type ActionTypeWithLiterals = ActionType | 'NONE' | 'CREATION' | 'CANCEL' | 'CYCLE_AUTO_RENEW_ON' | 'CYCLE_AUTO_RENEW_OFF' | 'PAUSE' | 'RESUME' | 'MARK_AS_PAID' | 'EXTEND' | 'UPDATE' | 'UPDATE_START_DATE' | 'UPM' | 'UPDATE_BILLING_DATE' | 'UPDATE_COLLECTION_METHOD' | 'SKIP_CYCLE' | 'CUSTOMER_UPDATE_BILLING_DATE';
1557
+ type ActionTypeWithLiterals = ActionType | 'NONE' | 'CREATION' | 'CANCEL' | 'CYCLE_AUTO_RENEW_ON' | 'CYCLE_AUTO_RENEW_OFF' | 'PAUSE' | 'RESUME' | 'MARK_AS_PAID' | 'EXTEND' | 'UPDATE' | 'UPDATE_START_DATE' | 'UPM' | 'UPDATE_BILLING_DATE' | 'UPDATE_COLLECTION_METHOD' | 'SKIP_CYCLE' | 'CUSTOMER_UPDATE_BILLING_DATE' | 'CHANGE_SUBSCRIPTION';
1522
1558
  declare enum ExtendPolicyType {
1523
1559
  PERIOD = "PERIOD",
1524
1560
  BILLING_CYCLE = "BILLING_CYCLE"
@@ -1852,6 +1888,12 @@ interface LineItemTaxSummary {
1852
1888
  * @decimalValue options { maxScale:4 }
1853
1889
  */
1854
1890
  finalTaxAmount?: string | null;
1891
+ /**
1892
+ * Tax amount the merchant is NOT collecting because the customer is responsible for paying the authority directly (reverse charge / exempt). Optional; absence is treated as zero.
1893
+ * @format DECIMAL_VALUE
1894
+ * @decimalValue options { maxScale:4 }
1895
+ */
1896
+ exemptAmount?: string | null;
1855
1897
  }
1856
1898
  interface FixedPriceConfig {
1857
1899
  }
@@ -2060,6 +2102,182 @@ interface CustomerUpdateBillingDateRequest {
2060
2102
  interface CustomerUpdateBillingDateResponse {
2061
2103
  subscription?: Subscription;
2062
2104
  }
2105
+ interface CustomerChangeSubscriptionRequest {
2106
+ /** @format GUID */
2107
+ subscriptionId: string;
2108
+ /** @maxSize 100 */
2109
+ itemChanges?: SubscriptionItemChange[];
2110
+ newCycle?: Duration;
2111
+ effectiveTime?: ChangeEffectiveTimeWithLiterals;
2112
+ }
2113
+ /**
2114
+ * Describes a change to a single subscription item.
2115
+ * The caller (BG/CVS) resolves pricing from their catalog and passes concrete values.
2116
+ */
2117
+ interface SubscriptionItemChange {
2118
+ /**
2119
+ * Which item to change. Must match an existing item ID in the subscription.
2120
+ * @format GUID
2121
+ */
2122
+ itemId?: string;
2123
+ /**
2124
+ * New price per unit. Caller resolves this from their product catalog.
2125
+ * Required when changing product/plan. Optional for quantity-only changes (uses current price).
2126
+ * @decimalValue options { gte:0.00, maxScale:2 }
2127
+ */
2128
+ newPrice?: string | null;
2129
+ /**
2130
+ * New quantity (seats/licenses). Optional — unchanged if not set.
2131
+ * @min 1
2132
+ */
2133
+ newQuantity?: number | null;
2134
+ /**
2135
+ * New catalog reference. Optional — set when changing to a different product.
2136
+ * This is metadata for the caller's tracking; BASS does not use it for pricing.
2137
+ */
2138
+ newCatalogReference?: CatalogReference;
2139
+ /**
2140
+ * New item name. Optional — set when changing to a different product.
2141
+ * @maxLength 200
2142
+ */
2143
+ newName?: string | null;
2144
+ }
2145
+ declare enum ChangeEffectiveTime {
2146
+ UNKNOWN = "UNKNOWN",
2147
+ /** Apply change immediately with proration */
2148
+ IMMEDIATELY = "IMMEDIATELY",
2149
+ /** Schedule change for the next billing cycle */
2150
+ AT_NEXT_RENEWAL = "AT_NEXT_RENEWAL"
2151
+ }
2152
+ /** @enumType */
2153
+ type ChangeEffectiveTimeWithLiterals = ChangeEffectiveTime | 'UNKNOWN' | 'IMMEDIATELY' | 'AT_NEXT_RENEWAL';
2154
+ interface CustomerChangeSubscriptionResponse {
2155
+ subscription?: Subscription;
2156
+ }
2157
+ interface CustomerPreviewChangeSubscriptionRequest {
2158
+ /** @format GUID */
2159
+ subscriptionId: string;
2160
+ /** @maxSize 100 */
2161
+ itemChanges?: SubscriptionItemChange[];
2162
+ newCycle?: Duration;
2163
+ effectiveTime?: ChangeEffectiveTimeWithLiterals;
2164
+ }
2165
+ interface CustomerPreviewChangeSubscriptionResponse {
2166
+ preview?: PreviewChangeSubscriptionResponse;
2167
+ }
2168
+ interface PreviewChangeSubscriptionResponse {
2169
+ /** Summary of the current subscription state */
2170
+ current?: SubscriptionChangeSummary;
2171
+ /** Summary of the proposed subscription state after the change */
2172
+ proposed?: SubscriptionChangeSummary;
2173
+ /** Proration preview details. Present only for immediate changes. */
2174
+ proration?: ProrationPreview;
2175
+ /** Renewal preview. Present only for changes at next renewal. */
2176
+ renewalPreview?: RenewalPreview;
2177
+ }
2178
+ /** Summary of a subscription's state, used in change previews. */
2179
+ interface SubscriptionChangeSummary {
2180
+ /** Product ID */
2181
+ productId?: string;
2182
+ /** Product name */
2183
+ productName?: string;
2184
+ /** Billing cycle duration */
2185
+ cycle?: Duration;
2186
+ /** Number of units */
2187
+ quantity?: number;
2188
+ /**
2189
+ * Price per unit
2190
+ * @format DECIMAL_VALUE
2191
+ */
2192
+ pricePerUnit?: string;
2193
+ /**
2194
+ * Total price (price_per_unit * quantity)
2195
+ * @format DECIMAL_VALUE
2196
+ */
2197
+ totalPrice?: string;
2198
+ /**
2199
+ * Currency code (ISO 4217)
2200
+ * @format CURRENCY
2201
+ */
2202
+ currency?: string;
2203
+ /** Current billing period start */
2204
+ periodStart?: Date | null;
2205
+ /** Current billing period end */
2206
+ periodEnd?: Date | null;
2207
+ }
2208
+ /** Preview of proration amounts for a proposed subscription change. */
2209
+ interface ProrationPreview {
2210
+ /**
2211
+ * Credit amount for unused time on the current plan
2212
+ * @format DECIMAL_VALUE
2213
+ */
2214
+ creditAmount?: string;
2215
+ /**
2216
+ * Charge amount for the new plan's prorated price
2217
+ * @format DECIMAL_VALUE
2218
+ */
2219
+ chargeAmount?: string;
2220
+ /**
2221
+ * Net amount (charge minus credit)
2222
+ * @format DECIMAL_VALUE
2223
+ */
2224
+ netAmount?: string;
2225
+ /**
2226
+ * Tax amount on the net proration
2227
+ * @format DECIMAL_VALUE
2228
+ */
2229
+ taxAmount?: string;
2230
+ /**
2231
+ * Total amount including tax
2232
+ * @format DECIMAL_VALUE
2233
+ */
2234
+ totalAmount?: string;
2235
+ /** Remaining seconds in the current billing period */
2236
+ remainingSeconds?: string;
2237
+ /** Total seconds in the current billing cycle */
2238
+ totalCycleSeconds?: string;
2239
+ /** New period end date. Present when proration_behavior is PRORATE_AND_EXTEND. */
2240
+ newPeriodEnd?: Date | null;
2241
+ /** Number of days added to the billing period. Present when proration_behavior is PRORATE_AND_EXTEND. */
2242
+ daysAdded?: number;
2243
+ /** The proration action that would be taken */
2244
+ action?: ProrationActionWithLiterals;
2245
+ }
2246
+ declare enum ProrationAction {
2247
+ UNKNOWN = "UNKNOWN",
2248
+ /** Net charge to customer */
2249
+ CHARGE = "CHARGE",
2250
+ /** Net refund to customer */
2251
+ REFUND = "REFUND",
2252
+ /** Extend billing period instead of refund */
2253
+ EXTEND_PERIOD = "EXTEND_PERIOD",
2254
+ /** No financial change needed */
2255
+ NO_CHANGE = "NO_CHANGE"
2256
+ }
2257
+ /** @enumType */
2258
+ type ProrationActionWithLiterals = ProrationAction | 'UNKNOWN' | 'CHARGE' | 'REFUND' | 'EXTEND_PERIOD' | 'NO_CHANGE';
2259
+ /** Preview of what the next renewal will look like after a change. */
2260
+ interface RenewalPreview {
2261
+ /**
2262
+ * New price per unit at next renewal
2263
+ * @format DECIMAL_VALUE
2264
+ */
2265
+ newPrice?: string;
2266
+ /**
2267
+ * New total at next renewal (price * quantity)
2268
+ * @format DECIMAL_VALUE
2269
+ */
2270
+ newTotal?: string;
2271
+ /** Date of the next renewal */
2272
+ nextRenewalDate?: Date | null;
2273
+ }
2274
+ interface CustomerCancelPendingChangeRequest {
2275
+ /** @format GUID */
2276
+ subscriptionId: string;
2277
+ }
2278
+ interface CustomerCancelPendingChangeResponse {
2279
+ subscription?: Subscription;
2280
+ }
2063
2281
  interface DomainEvent extends DomainEventBodyOneOf {
2064
2282
  createdEvent?: EntityCreatedEvent;
2065
2283
  updatedEvent?: EntityUpdatedEvent;
@@ -2089,7 +2307,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
2089
2307
  /** If present, indicates the action that triggered the event. */
2090
2308
  originatedFrom?: string | null;
2091
2309
  /**
2092
- * 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.
2310
+ * 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.
2093
2311
  * 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.
2094
2312
  */
2095
2313
  entityEventSequence?: string | null;
@@ -2213,12 +2431,64 @@ interface AccountInfo {
2213
2431
  */
2214
2432
  siteId?: string | null;
2215
2433
  }
2216
- interface CreateSubscriptionInStateRequest extends CreateSubscriptionInStateRequestModeOneOf {
2217
- activeSubscription?: CreateSubscriptionRequest;
2434
+ interface SetIsMigratedEvent {
2435
+ /** @format GUID */
2436
+ subscriptionId?: string;
2437
+ }
2438
+ interface SubscriptionDelayedSyncEvent {
2439
+ /** @format GUID */
2440
+ subscriptionId?: string;
2441
+ }
2442
+ interface InvoiceAction extends InvoiceActionActionTypeOneOf {
2443
+ payRecurring?: PayRecurringInvoice;
2218
2444
  }
2219
2445
  /** @oneof */
2220
- interface CreateSubscriptionInStateRequestModeOneOf {
2221
- activeSubscription?: CreateSubscriptionRequest;
2446
+ interface InvoiceActionActionTypeOneOf {
2447
+ payRecurring?: PayRecurringInvoice;
2448
+ }
2449
+ interface PayRecurringInvoice {
2450
+ /** @format GUID */
2451
+ invoiceId?: string;
2452
+ }
2453
+ /**
2454
+ * Sent each time a subscription status has been set to Active
2455
+ * Active shows that a subscription is live and operational.
2456
+ * For example:
2457
+ * * For subscription with free trial, free trial start date is also the activation date.
2458
+ * * For a subscription with future start date, the start date is also the activation date.
2459
+ * * When a subscription is resumed from a pause status, the resume date is also the activation date.
2460
+ */
2461
+ interface SubscriptionActivated {
2462
+ subscription?: Subscription;
2463
+ }
2464
+ /**
2465
+ * Sent each time a subscription status has been set to Ended
2466
+ * Ended shows that a subscription reached its end date and ended its life cycle as a result of the agreement.
2467
+ * This is different from a Canceled subscription which ends the subscription before a designated end date.
2468
+ * Therefore, Ended and Canceled are mutually exclusive.
2469
+ */
2470
+ interface SubscriptionEnded {
2471
+ subscription?: Subscription;
2472
+ }
2473
+ interface SubscriptionInitialPurchaseCompleted {
2474
+ subscription?: Subscription;
2475
+ actionDetails?: ActionDetails;
2476
+ /** @format GUID */
2477
+ paymentTransactionId?: string | null;
2478
+ }
2479
+ interface SubscriptionCycleReadyToPay {
2480
+ subscription?: Subscription;
2481
+ }
2482
+ interface SubscriptionBillingCycleStarted {
2483
+ subscription?: Subscription;
2484
+ /**
2485
+ * Wix Pay transaction id, optional. Exists if event was triggered by a payment.
2486
+ * @format GUID
2487
+ */
2488
+ paymentTransactionId?: string | null;
2489
+ }
2490
+ interface SubscriptionRevived {
2491
+ subscription?: Subscription;
2222
2492
  }
2223
2493
  interface CreateSubscriptionRequest {
2224
2494
  subscription?: Subscription;
@@ -2238,2148 +2508,2083 @@ interface OriginOverride {
2238
2508
  /** @format GUID */
2239
2509
  instanceId?: string;
2240
2510
  }
2241
- interface CreateSubscriptionInStateResponse {
2242
- /** @format GUID */
2243
- subscriptionId?: string;
2244
- }
2245
- interface PayCycleRequest {
2246
- /** @format GUID */
2247
- subscriptionId: string;
2248
- paymentTestMode?: PaymentTestModeWithLiterals;
2249
- /** @format GUID */
2250
- tenantId: string;
2251
- }
2252
- declare enum PaymentTestMode {
2253
- REGULAR = "REGULAR",
2254
- FAIL_TECHNICAL = "FAIL_TECHNICAL",
2255
- FAIL_DECLINE = "FAIL_DECLINE",
2256
- FAIL_RETRYABLE_DECLINE = "FAIL_RETRYABLE_DECLINE"
2257
- }
2258
- /** @enumType */
2259
- type PaymentTestModeWithLiterals = PaymentTestMode | 'REGULAR' | 'FAIL_TECHNICAL' | 'FAIL_DECLINE' | 'FAIL_RETRYABLE_DECLINE';
2260
- interface PayCycleResponse {
2261
- /** @format GUID */
2262
- invoiceId?: string;
2263
- /** @format GUID */
2264
- paymentOrderId?: string | null;
2511
+ interface CreateSubscriptionResponse {
2265
2512
  subscription?: Subscription;
2513
+ /**
2514
+ * Payments order that should be paid (or authorize card) in order to activate subscription. Empty for free subscriptions.
2515
+ * @format GUID
2516
+ */
2517
+ paymentOrderId?: string | null;
2266
2518
  }
2267
- interface GetFullSubscriptionDataRequest {
2268
- /** @format GUID */
2269
- _id?: string;
2270
- }
2271
- interface GetFullSubscriptionDataResponse {
2519
+ interface UpdateSubscriptionRequest {
2520
+ /** Revision is validated if Subscription.revision is set */
2272
2521
  subscription?: Subscription;
2273
- internalSubscriptionData?: InternalSubscriptionData;
2274
- }
2275
- interface InternalSubscriptionData {
2276
- /** @format GUID */
2277
- originInstanceId?: string;
2278
- source?: string | null;
2279
- billingType?: string;
2280
- isOneTime?: boolean;
2281
- migrationDetails?: MigrationDetails;
2282
- pausePaidDuration?: string | null;
2283
- authorizationPaymentData?: PaymentData;
2284
- currentCyclePausePeriods?: PausePeriod[];
2522
+ /** Supported fields: customer, metadata */
2523
+ fieldMask?: string[];
2285
2524
  }
2286
- interface MigrationDetails {
2287
- /** system (application) where the Subscription has been created */
2288
- originSystem?: string;
2289
- /** date when the Subscription started to be managed in BASS */
2290
- shiftManagementDate?: Date | null;
2525
+ interface UpdateSubscriptionResponse {
2526
+ subscription?: Subscription;
2291
2527
  }
2292
- interface PausePeriod {
2528
+ interface UpdateSubscriptionStartDateRequest {
2529
+ /**
2530
+ * Subscription ID
2531
+ * @format GUID
2532
+ */
2533
+ _id?: string;
2534
+ /**
2535
+ * Can be updated only if Subscription is in Draft state
2536
+ * By setting start_date in the future, end_date will be recalculated for termed Subscriptions
2537
+ * cycles_to_pay_on_creation will be set to 1 if no free trial is set
2538
+ */
2293
2539
  startDate?: Date | null;
2294
- endDate?: Date | null;
2295
- }
2296
- interface GetSubscriptionAndInternalDataRequest {
2297
- /** @format GUID */
2298
- subscriptionId?: string;
2299
- /** @format GUID */
2300
- tenantId?: string;
2301
2540
  }
2302
- interface GetSubscriptionAndInternalDataResponse {
2541
+ interface UpdateSubscriptionStartDateResponse {
2303
2542
  subscription?: Subscription;
2304
- internalSubscriptionData?: InternalSubscriptionData;
2305
2543
  }
2306
- interface SearchSubscriptionRequest {
2307
- /** @format GUID */
2544
+ interface BassToSapiPaypalMigrationRequest {
2545
+ /**
2546
+ * Subscription ID
2547
+ * @format GUID
2548
+ */
2308
2549
  _id?: string;
2309
- /** @format GUID */
2310
- tenantId?: string;
2550
+ collectionMethod?: CollectionMethodEnumCollectionMethodWithLiterals;
2311
2551
  }
2312
- interface SearchSubscriptionResponse {
2552
+ interface BassToSapiPaypalMigrationResponse {
2313
2553
  subscription?: Subscription;
2314
2554
  }
2315
- interface UpdatePausePaidDurationRequest {
2316
- /** @format GUID */
2317
- subscriptionId?: string;
2555
+ interface UpdateSubscriptionPoliciesRequest {
2318
2556
  /**
2319
- * @min 1
2320
- * @max 10000000
2557
+ * Subscription ID
2558
+ * @format GUID
2321
2559
  */
2322
- pausePaidDurationSeconds?: string;
2323
- /** @format GUID */
2324
- tenantId?: string;
2560
+ _id?: string;
2561
+ cancellableByCustomer?: boolean | null;
2325
2562
  }
2326
- interface UpdatePausePaidDurationResponse {
2563
+ interface UpdateSubscriptionPoliciesResponse {
2564
+ /** Updated policies of the subscription */
2565
+ policies?: SubscriptionPolicies;
2327
2566
  }
2328
- interface UpdateStatusRequest {
2329
- /** @format GUID */
2330
- subscriptionId?: string;
2331
- /** @format GUID */
2332
- tenantId?: string;
2333
- status?: SubscriptionStatusEnumSubscriptionStatusWithLiterals;
2567
+ interface UpdateSubscriptionBillingDateRequest {
2568
+ /**
2569
+ * ID of the subscription to update the billing date for.
2570
+ * @format GUID
2571
+ */
2572
+ _id: string;
2573
+ /** New billing date in `YYYY-MM-DDThh:mm:ss:sssZ` format. */
2574
+ billingDate: Date | null;
2575
+ /**
2576
+ * Information about how BASS adjusts the total of the next invoice. Extending
2577
+ * the current billing cycle results in a higher payment, while shortening it
2578
+ * leads to a lower payment. BASS offers automatic calculation of the proration
2579
+ * amount based on the number of days added to or removed from the current billing
2580
+ * cycle. Alternatively, you can use your own custom method to calculate the
2581
+ * proration amount. The custom proration amount can't exceed the total of the
2582
+ * current billing cycle.
2583
+ */
2584
+ proration?: Proration;
2334
2585
  }
2335
- interface UpdateStatusResponse {
2586
+ interface UpdateSubscriptionBillingDateResponse {
2587
+ /** Updated subscription. */
2336
2588
  subscription?: Subscription;
2337
2589
  }
2338
- interface UpdatePaymentStatusRequest {
2339
- /** @format GUID */
2340
- subscriptionId?: string;
2341
- /** @format GUID */
2342
- tenantId?: string;
2343
- paymentStatus?: PaymentStatusWithLiterals;
2344
- }
2345
- interface UpdatePaymentStatusResponse {
2590
+ interface SubscriptionBillingDateUpdated {
2346
2591
  subscription?: Subscription;
2592
+ billingDate?: Date | null;
2593
+ proration?: Proration;
2347
2594
  }
2348
- interface RemoveCancellationInfoRequest {
2349
- /** @format GUID */
2350
- subscriptionId?: string;
2351
- /** @format GUID */
2352
- tenantId?: string;
2595
+ interface UpdateSubscriptionOriginRequest {
2596
+ /**
2597
+ * ID of the subscription to update origin.
2598
+ * @format GUID
2599
+ */
2600
+ _id?: string;
2601
+ /**
2602
+ * Origin entity ID of the subscription to update.
2603
+ * @format GUID
2604
+ */
2605
+ entityId?: string;
2353
2606
  }
2354
- interface RemoveCancellationInfoResponse {
2607
+ interface UpdateSubscriptionOriginResponse {
2608
+ /** Updated subscription. */
2355
2609
  subscription?: Subscription;
2356
2610
  }
2357
- interface RemovePauseInfoRequest {
2358
- /** @format GUID */
2359
- subscriptionId?: string;
2360
- /** @format GUID */
2361
- tenantId?: string;
2611
+ interface ReviseSubscriptionRequest {
2612
+ /**
2613
+ * Subscription ID
2614
+ * @format GUID
2615
+ */
2616
+ _id: string;
2617
+ /**
2618
+ * 0 for no revision, maxSize is 100
2619
+ * @maxSize 100
2620
+ */
2621
+ items?: Item[];
2362
2622
  }
2363
- interface RemovePauseInfoResponse {
2623
+ interface ReviseSubscriptionResponse {
2364
2624
  subscription?: Subscription;
2365
2625
  }
2366
- interface ReviveSubscriptionRequest {
2367
- /** @format GUID */
2368
- tenantId?: string;
2369
- /** @format GUID */
2370
- subscriptionId?: string;
2371
- revivePolicy?: RevivePolicyWithLiterals;
2372
- isTestRun?: boolean;
2626
+ interface UpdateSubscriptionItemsRequest {
2627
+ /**
2628
+ * Subscription ID
2629
+ * @format GUID
2630
+ */
2631
+ _id?: string;
2632
+ /** Update action. For RESET_PENDING_UPDATES, nothing but the subscription ID should be defined in the request. */
2633
+ updateAction?: UpdateActionWithLiterals;
2634
+ /** Updates execution date. Relevant only for UpdateAction.SPECIFIC_DATE. Only specific date is supported. */
2635
+ scheduleAdditionalInfo?: ScheduleAdditionalInfo;
2636
+ /**
2637
+ * Existing items to update
2638
+ * @maxSize 100
2639
+ */
2640
+ itemsToUpdate?: ItemChange[];
2641
+ /**
2642
+ * Items to add
2643
+ * @maxSize 99
2644
+ */
2645
+ itemsToAdd?: Item[];
2646
+ /**
2647
+ * Existing items to delete
2648
+ * @format GUID
2649
+ * @maxSize 99
2650
+ */
2651
+ itemsToDelete?: string[] | null;
2373
2652
  }
2374
- declare enum RevivePolicy {
2375
- SIMPLE = "SIMPLE",
2376
- RESUME = "RESUME"
2653
+ declare enum UpdateAction {
2654
+ NONE = "NONE",
2655
+ /** Update subscription immediately, please note proration for updates changing price are not yet supported */
2656
+ IMMEDIATELY = "IMMEDIATELY",
2657
+ /** Request updates that will take affect only at the start of the next billing cycle. */
2658
+ NEXT_BILLING_CYCLE = "NEXT_BILLING_CYCLE",
2659
+ /** Reset all pending updates */
2660
+ RESET_PENDING_UPDATES = "RESET_PENDING_UPDATES",
2661
+ /** Request updates that will take affect only at a specific date. */
2662
+ SPECIFIC_DATE = "SPECIFIC_DATE"
2377
2663
  }
2378
2664
  /** @enumType */
2379
- type RevivePolicyWithLiterals = RevivePolicy | 'SIMPLE' | 'RESUME';
2380
- interface ReviveSubscriptionResponse {
2381
- subscription?: Subscription;
2382
- }
2383
- interface ConvertSapiRequest {
2384
- /** @format GUID */
2385
- subscriptionId?: string;
2386
- }
2387
- interface ConvertSapiResponse {
2665
+ type UpdateActionWithLiterals = UpdateAction | 'NONE' | 'IMMEDIATELY' | 'NEXT_BILLING_CYCLE' | 'RESET_PENDING_UPDATES' | 'SPECIFIC_DATE';
2666
+ interface UpdateSubscriptionItemsResponse {
2388
2667
  subscription?: Subscription;
2389
2668
  }
2390
- interface GetSubscriptionInvoicesRequest {
2391
- /** @format GUID */
2392
- _id?: string;
2393
- }
2394
- interface GetSubscriptionInvoicesResponse {
2395
- invoices?: SubscriptionInvoice[];
2396
- }
2397
- interface SubscriptionInvoice {
2398
- /** @format GUID */
2399
- _id?: string;
2400
- subscriptionCycle?: number;
2401
- _createdDate?: Date | null;
2402
- }
2403
- interface FinishFreeTrialNowRequest {
2404
- /** @format GUID */
2405
- subscriptionId?: string;
2406
- /** @format GUID */
2407
- tenantId?: string;
2408
- }
2409
- interface FinishFreeTrialNowResponse {
2410
- subscription?: Subscription;
2669
+ interface BulkUpdateSubscriptionItemsByFilterRequest {
2670
+ /**
2671
+ * Filter to identify the subscriptions for which items are updated. For
2672
+ * supported fields see
2673
+ * [Search and Query: Bulk Update Subscription Items By Filter](https://bo.wix.com/wix-docs/rest/drafts/subscriptions-by-billing-by-wix/search-and-query#drafts_subscriptions-by-billing-by-wix_search-and-query_bulk-update-subscription-items-by-filter).
2674
+ * Sending an empty subscription filter results in a validation error.
2675
+ * In case you pass `{"updateAction": "RESET_PENDING_UPDATES"}`, use only the
2676
+ * `subscriptionId` field inside this filter. Passing any other filter results
2677
+ * in a failed validation error.
2678
+ */
2679
+ subscriptionFilter?: Record<string, any> | null;
2680
+ /**
2681
+ * Filter to specify which subscription items are updated. Make sure to use
2682
+ * the catalog item ID and not the item's unique ID. All subscription items
2683
+ * with matching `items.catalogReference.catalogItemId` are updated.
2684
+ *
2685
+ * Max: `100` reference catalog item IDs
2686
+ * @format GUID
2687
+ * @maxSize 100
2688
+ */
2689
+ catalogReferenceIds?: string[] | null;
2690
+ /**
2691
+ * Information about the update timing and update type.
2692
+ *
2693
+ * + `"IMMEDIATELY"`: The updates become effective immediately.
2694
+ * + `"NEXT_BILLING_CYCLE"`: The updates are scheduled for the beginning of the next billing cycle.
2695
+ * + `"SPECIFIC_DATE"`: The updates are scheduled for the date specified in `scheduleAdditionalInfo.specificDate`.
2696
+ * + `"RESET_PENDING_UPDATES"`: All currently scheduled updates for the specified supcriptions are canceled. Use only the `subscriptionId` field inside `subscriptionFilter`, all other filters result in failed validation errors.
2697
+ */
2698
+ updateAction?: UpdateActionWithLiterals;
2699
+ /**
2700
+ * Additional information for updates. Currently, only supported for
2701
+ * `{"updateAction": "SPECIFIC_DATE"}`.
2702
+ */
2703
+ scheduleAdditionalInfo?: ScheduleAdditionalInfo;
2704
+ /**
2705
+ * Update details for the susbcription items that match the filtering.
2706
+ * Currently, you can update only the item price, quantity, and tax. Note
2707
+ * that all item properties are updated to the same values. In case you want set
2708
+ * different values for individual items, you must call
2709
+ * _Bulk Update Subscription Items By Filter_ multiple times, once per unique update.
2710
+ */
2711
+ bulkItemUpdateData?: BulkItemChange;
2712
+ /**
2713
+ * __Not implemented yet__. Items to add to the subscriptions matching the filtering.
2714
+ * @maxSize 99
2715
+ */
2716
+ itemsToAdd?: Item[];
2411
2717
  }
2412
- interface FixSubscriptionTimeCapsuleTasksRequest {
2413
- /** @format GUID */
2414
- subscriptionId?: string;
2415
- /** @format GUID */
2416
- tenantId?: string;
2718
+ interface BulkItemChange {
2719
+ /** Information about the new item price. */
2720
+ pricingModel?: PricingModel;
2721
+ /**
2722
+ * New item quantity.
2723
+ *
2724
+ * Min: `1`
2725
+ * @min 1
2726
+ */
2727
+ quantity?: number | null;
2728
+ /** Information about the new item tax. */
2729
+ tax?: Tax;
2417
2730
  }
2418
- interface FixSubscriptionTimeCapsuleTasksResponse {
2731
+ interface BulkUpdateSubscriptionItemsByFilterResponse {
2732
+ /**
2733
+ * ID of your bulk job. You can use
2734
+ * [this Async Infra call](https://pbo.wix.com/fire-console/?artifact=com.wixpress.asyncinfra.async-job-service&service=wix.infra.asyncjobs.v1.AsyncJobService&method=ListAsyncJobItems&body=eyJqb2JfaWQiOiIifQ%3D%3D)
2735
+ * to retrieve information about the job status.
2736
+ */
2737
+ jobId?: string;
2419
2738
  }
2420
- interface SendTimeCapsuleTaskCanceledBIRequest {
2421
- /** @format GUID */
2422
- tenantId?: string;
2739
+ interface DeleteSubscriptionRequest {
2423
2740
  /** @format GUID */
2424
- subscriptionId?: string;
2425
- /** @minLength 1 */
2426
- taskType?: string;
2741
+ _id?: string;
2742
+ revision?: string;
2427
2743
  }
2428
- interface Empty {
2744
+ interface DeleteSubscriptionResponse {
2429
2745
  }
2430
- interface ScheduleTimeCapsuleTaskRequest {
2431
- /** @format GUID */
2432
- subscriptionId?: string;
2433
- /** @minLength 1 */
2434
- taskType?: string;
2435
- executionTime?: Date | null;
2746
+ interface CancelSubscriptionRequest {
2436
2747
  /** @format GUID */
2437
- tenantId?: string;
2748
+ _id: string;
2749
+ actionContext: ActionContext;
2438
2750
  }
2439
- interface CancelTimeCapsuleTaskRequest {
2440
- /** @format GUID */
2441
- tenantId?: string;
2442
- /** @format GUID */
2443
- subscriptionId?: string;
2444
- /** @minLength 1 */
2445
- taskType?: string;
2751
+ interface ActionContext {
2752
+ initiator?: ActionInitiatorWithLiterals;
2753
+ /** Optional action reason message */
2754
+ reason?: string | null;
2446
2755
  }
2447
- interface UpdateFullSubscriptionRequest {
2756
+ declare enum ActionInitiator {
2757
+ UNDEFINED = "UNDEFINED",
2758
+ BUSINESS = "BUSINESS",
2759
+ CUSTOMER = "CUSTOMER",
2760
+ SYSTEM = "SYSTEM"
2761
+ }
2762
+ /** @enumType */
2763
+ type ActionInitiatorWithLiterals = ActionInitiator | 'UNDEFINED' | 'BUSINESS' | 'CUSTOMER' | 'SYSTEM';
2764
+ interface CancelSubscriptionResponse {
2765
+ subscription?: Subscription;
2766
+ }
2767
+ interface PauseSubscriptionRequest {
2448
2768
  /** @format GUID */
2449
- tenantId?: string;
2769
+ _id: string;
2770
+ pausePolicy?: PausePolicyWithLiterals;
2771
+ pauseAt?: PauseAtWithLiterals;
2772
+ /** contains additional scheduling information for certain pause_at options (for example: SPECIFIC_DATE & NUMBER_OF_CYCLES_FROM_TODAY) */
2773
+ pauseAtSchedule?: ScheduleAdditionalInfo;
2774
+ /** contains additional scheduling information for certain auto_resume_at either specific date */
2775
+ autoResumeAtSchedule?: ScheduleAdditionalInfo;
2776
+ actionContext: ActionContext;
2777
+ }
2778
+ interface PauseSubscriptionResponse {
2450
2779
  subscription?: Subscription;
2451
2780
  }
2452
- interface UpdateFullSubscriptionResponse {
2781
+ interface SubscriptionPaused {
2453
2782
  subscription?: Subscription;
2783
+ pausePolicy?: PausePolicyWithLiterals;
2784
+ actionDetails?: ActionDetails;
2454
2785
  }
2455
- interface PatchSubscriptionRequest {
2456
- /**
2457
- * Tenant ID (instance ID) of the subscription
2458
- * @format GUID
2459
- */
2460
- tenantId?: string;
2461
- /**
2462
- * Subscription ID to patch
2463
- * @format GUID
2464
- */
2465
- subscriptionId?: string;
2466
- /** Partial subscription with updated values */
2786
+ interface PauseSubscriptionRequested {
2467
2787
  subscription?: Subscription;
2468
- /** Fields to update (e.g., "name", "billing_settings.collection_method") */
2469
- fieldMask?: string[];
2788
+ pauseAt?: PauseAtWithLiterals;
2789
+ pausePolicy?: PausePolicyWithLiterals;
2790
+ actionDetails?: ActionDetails;
2470
2791
  }
2471
- interface PatchSubscriptionResponse {
2472
- /** The updated subscription */
2792
+ interface ScheduledPauseCanceled {
2473
2793
  subscription?: Subscription;
2794
+ actionDetails?: ActionDetails;
2474
2795
  }
2475
- interface UpdateSubscriptionInvoiceCycleRequest {
2476
- /** @format GUID */
2477
- subscriptionId?: string;
2478
- /** @format GUID */
2479
- tenantId?: string;
2796
+ interface ResumeSubscriptionRequest {
2480
2797
  /** @format GUID */
2481
- invoiceId?: string;
2482
- subscriptionCycle?: number;
2483
- }
2484
- interface UpdateSubscriptionInvoiceCycleResponse {
2485
- subscriptionInvoice?: SubscriptionInvoice;
2798
+ _id: string;
2799
+ resumeAt?: ResumeAtWithLiterals;
2800
+ /** contains additional scheduling information for certain resume_at options (for example: SPECIFIC_DATE) */
2801
+ resumeAtSchedule?: ScheduleAdditionalInfo;
2802
+ actionContext: ActionContext;
2803
+ /** Strategy for resuming a migrated paused subscription when the previous billing date is missing. */
2804
+ missingPreviousBillingDateResumeStrategy?: MissingPreviousBillingDateResumeStrategyWithLiterals;
2486
2805
  }
2487
- interface AddPausePeriodRequest {
2488
- /** @format GUID */
2489
- tenantId?: string;
2490
- /** @format GUID */
2491
- subscriptionId?: string;
2492
- pauseStartDate?: Date | null;
2493
- pauseEndDate?: Date | null;
2806
+ declare enum MissingPreviousBillingDateResumeStrategy {
2807
+ UNKNOWN = "UNKNOWN",
2808
+ /** Use a fallback that makes the next billing date resolve to now. */
2809
+ START_BILLING_IMMEDIATELY = "START_BILLING_IMMEDIATELY",
2810
+ /** Use a fallback that makes the next billing date resolve to one full cycle from now. */
2811
+ START_BILLING_AFTER_ONE_FULL_CYCLE = "START_BILLING_AFTER_ONE_FULL_CYCLE"
2494
2812
  }
2495
- interface AddPausePeriodResponse {
2813
+ /** @enumType */
2814
+ type MissingPreviousBillingDateResumeStrategyWithLiterals = MissingPreviousBillingDateResumeStrategy | 'UNKNOWN' | 'START_BILLING_IMMEDIATELY' | 'START_BILLING_AFTER_ONE_FULL_CYCLE';
2815
+ interface ResumeSubscriptionResponse {
2496
2816
  subscription?: Subscription;
2497
2817
  }
2498
- interface RunTimeCapsuleTaskNowRequest {
2499
- /** @format GUID */
2500
- tenantId?: string;
2501
- /** @format GUID */
2502
- subscriptionId?: string;
2503
- /** @minLength 1 */
2504
- taskType?: string;
2505
- }
2506
- interface CreateRecurringInvoiceBORequest {
2507
- /** @format GUID */
2508
- subscriptionId?: string;
2509
- /** @format GUID */
2510
- tenantId?: string;
2511
- /** @min 2 */
2512
- cycleNumber?: number;
2513
- }
2514
- interface CreateRecurringInvoiceBOResponse {
2515
- invoiceId?: string;
2818
+ interface SubscriptionResumed {
2819
+ subscription?: Subscription;
2820
+ actionDetails?: ActionDetails;
2821
+ pauseInfo?: PauseInfo;
2516
2822
  }
2517
- interface SetShiftingDataRequest {
2518
- /** @format GUID */
2519
- subscriptionId?: string;
2520
- /** @format GUID */
2521
- tenantId?: string;
2522
- isBassManaged?: boolean;
2523
- shiftManagementDate?: Date | null;
2823
+ interface ResumeSubscriptionRequested {
2824
+ subscription?: Subscription;
2825
+ resumeAt?: ResumeAtWithLiterals;
2826
+ actionDetails?: ActionDetails;
2524
2827
  }
2525
- interface SetShiftingDataResponse {
2828
+ interface ScheduledResumeCanceled {
2526
2829
  subscription?: Subscription;
2830
+ actionDetails?: ActionDetails;
2527
2831
  }
2528
- interface FixSubscriptionInvoicesRequest extends FixSubscriptionInvoicesRequestModeOneOf {
2529
- attachInvoice?: AttachInvoice;
2530
- detachInvoice?: DetachInvoice;
2531
- /** @format GUID */
2532
- tenantId?: string;
2533
- /** @format GUID */
2534
- subscriptionId?: string;
2832
+ interface SearchSubscriptionsRequest extends SearchSubscriptionsRequestPagingMethodOneOf {
2833
+ /** Limit number of results and enable to skip rows. The default limit is 25. */
2834
+ paging?: Paging;
2835
+ /** A Cursor option for efficient paging. Pass this field from the previous search response to continue to the next page. */
2836
+ cursor?: CursorPaging;
2837
+ /** A filter object */
2838
+ filter?: any;
2839
+ /** A Sorting option by field name and order. */
2840
+ sorting?: SortingClauses;
2535
2841
  }
2536
2842
  /** @oneof */
2537
- interface FixSubscriptionInvoicesRequestModeOneOf {
2538
- attachInvoice?: AttachInvoice;
2539
- detachInvoice?: DetachInvoice;
2843
+ interface SearchSubscriptionsRequestPagingMethodOneOf {
2844
+ /** Limit number of results and enable to skip rows. The default limit is 25. */
2845
+ paging?: Paging;
2846
+ /** A Cursor option for efficient paging. Pass this field from the previous search response to continue to the next page. */
2847
+ cursor?: CursorPaging;
2540
2848
  }
2541
- interface AttachInvoice {
2542
- /** @format GUID */
2543
- invoiceId?: string;
2849
+ interface SortingClauses {
2850
+ sorting?: Sorting[];
2544
2851
  }
2545
- interface DetachInvoice {
2546
- /** @format GUID */
2547
- invoiceId?: string;
2852
+ interface SearchSubscriptionsResponse {
2853
+ subscriptions?: Subscription[];
2854
+ cursor?: CursorPaging;
2855
+ pagingMetadata?: CursorPagingMetadata;
2548
2856
  }
2549
- interface FixSubscriptionInvoicesResponse {
2550
- invoices?: SubscriptionInvoice[];
2551
- }
2552
- interface RestoreDraftSubscriptionRequest {
2553
- /** @format GUID */
2554
- tenantId?: string;
2555
- /** @format GUID */
2556
- subscriptionId?: string;
2557
- }
2558
- interface RestoreDraftSubscriptionResponse {
2559
- subscription?: Subscription;
2857
+ interface CursorPagingMetadata {
2858
+ /** Total number of items matching the filter. Available only on the first page of *Search* */
2859
+ total?: number | null;
2560
2860
  }
2561
- interface DeleteDraftSubscriptionRequest {
2562
- /** @format GUID */
2563
- tenantId?: string;
2861
+ interface TurnOnSubscriptionAutoRenewalRequest {
2564
2862
  /** @format GUID */
2565
- subscriptionId?: string;
2863
+ _id: string;
2864
+ actionContext: ActionContext;
2566
2865
  }
2567
- interface DeleteDraftSubscriptionResponse {
2866
+ interface TurnOnSubscriptionAutoRenewalResponse {
2568
2867
  subscription?: Subscription;
2569
2868
  }
2570
- interface DeleteSubscriptionBORequest {
2571
- /** @format GUID */
2572
- tenantId?: string;
2573
- /** @format GUID */
2574
- subscriptionId?: string;
2575
- }
2576
- interface DeleteSubscriptionBOResponse {
2869
+ interface SubscriptionAutoRenewalTurnedOn {
2577
2870
  subscription?: Subscription;
2871
+ actionDetails?: ActionDetails;
2578
2872
  }
2579
- interface CancelSubscriptionBORequest {
2580
- /** @format GUID */
2581
- tenantId?: string;
2873
+ interface TurnOffSubscriptionAutoRenewalRequest {
2582
2874
  /** @format GUID */
2583
- subscriptionId?: string;
2584
- initiator?: ActionInitiatorWithLiterals;
2585
- reason?: string | null;
2586
- }
2587
- declare enum ActionInitiator {
2588
- UNDEFINED = "UNDEFINED",
2589
- BUSINESS = "BUSINESS",
2590
- CUSTOMER = "CUSTOMER",
2591
- SYSTEM = "SYSTEM"
2875
+ _id: string;
2876
+ actionContext: ActionContext;
2592
2877
  }
2593
- /** @enumType */
2594
- type ActionInitiatorWithLiterals = ActionInitiator | 'UNDEFINED' | 'BUSINESS' | 'CUSTOMER' | 'SYSTEM';
2595
- interface CancelSubscriptionBOResponse {
2878
+ interface TurnOffSubscriptionAutoRenewalResponse {
2596
2879
  subscription?: Subscription;
2597
2880
  }
2598
- interface UpdatePaymentMethodBORequest {
2599
- /** @format GUID */
2600
- tenantId?: string;
2601
- /** @format GUID */
2602
- subscriptionId?: string;
2603
- /** @format GUID */
2604
- paymentMethodId?: string;
2605
- }
2606
- interface UpdatePaymentMethodBOResponse {
2881
+ interface SubscriptionAutoRenewalTurnedOff {
2607
2882
  subscription?: Subscription;
2883
+ actionDetails?: ActionDetails;
2608
2884
  }
2609
- interface SendSubscriptionActionEventBORequest extends SendSubscriptionActionEventBORequestEventOneOf {
2610
- billingCycleStarted?: SubscriptionBillingCycleStarted;
2611
- /** @format GUID */
2612
- tenantId?: string;
2613
- /** @format GUID */
2614
- subscriptionId?: string;
2615
- }
2616
- /** @oneof */
2617
- interface SendSubscriptionActionEventBORequestEventOneOf {
2618
- billingCycleStarted?: SubscriptionBillingCycleStarted;
2619
- }
2620
- interface SubscriptionBillingCycleStarted {
2621
- subscription?: Subscription;
2885
+ interface MarkLatestInvoiceAsPaidRequest {
2622
2886
  /**
2623
- * Wix Pay transaction id, optional. Exists if event was triggered by a payment.
2887
+ * The ID of the offline subscription to mark as paid its latest invoice
2624
2888
  * @format GUID
2625
2889
  */
2626
- paymentTransactionId?: string | null;
2627
- }
2628
- interface SendSubscriptionActionEventResponse {
2629
- }
2630
- interface HandleSubscriptionAfterInvoiceMarkedAsPaidRequest {
2631
- /** @format GUID */
2632
- tenantId?: string;
2633
- /** @format GUID */
2634
- subscriptionId?: string;
2635
- transactionId?: string;
2636
- }
2637
- interface PauseSubscriptionBORequest {
2638
- /** @format GUID */
2639
- tenantId?: string;
2640
- /** @format GUID */
2641
- subscriptionId?: string;
2642
- pausePolicy?: PausePolicyWithLiterals;
2643
- pauseAt?: PauseAtWithLiterals;
2644
- initiator?: ActionInitiatorWithLiterals;
2645
- /** @maxLength 500 */
2646
- reason?: string | null;
2890
+ subscriptionId: string;
2647
2891
  }
2648
- interface PauseSubscriptionBOResponse {
2892
+ interface MarkLatestInvoiceAsPaidResponse {
2649
2893
  subscription?: Subscription;
2650
2894
  }
2651
- interface FixSubscriptionInvoicesConsistencyRequest {
2652
- /** @format GUID */
2653
- tenantId?: string;
2654
- /** @format GUID */
2655
- subscriptionId?: string;
2656
- }
2657
- interface FixSubscriptionInvoicesConsistencyResponse {
2895
+ interface LatestInvoiceMarkedAsPaid {
2896
+ subscription?: Subscription;
2658
2897
  }
2659
- interface UpdateSubscriptionCurrencyRequest {
2898
+ interface MultipleSubscriptionsOnOrdersInvoice {
2660
2899
  /**
2661
- * Tenant ID (instance ID) of the subscription
2900
+ * the invoice id of the affected subscription
2662
2901
  * @format GUID
2663
2902
  */
2664
- tenantId?: string;
2903
+ invoiceId?: string;
2665
2904
  /**
2666
- * Subscription ID to update currency for
2905
+ * the order id of the affected subscription
2667
2906
  * @format GUID
2668
2907
  */
2669
- subscriptionId?: string;
2908
+ orderId?: string;
2909
+ }
2910
+ interface MarkBillingCycleAsPaidRequest {
2670
2911
  /**
2671
- * New currency code (e.g., "USD", "EUR") - ISO 4217 format
2672
- * @format CURRENCY
2912
+ * The ID of the subscription to mark as paid its invoice.
2913
+ * @format GUID
2673
2914
  */
2674
- newCurrency?: string;
2915
+ subscriptionId: string;
2675
2916
  /**
2676
- * Exchange rate from current currency to new currency (newAmount = oldAmount * exchangeRate)
2677
- * @decimalValue options { gt:0.00, maxScale:6 }
2917
+ * The subscription cycle for which the invoice is to be marked as paid.
2918
+ * If left empty, the most recent cycle will be selected.
2919
+ * @min 1
2678
2920
  */
2679
- exchangeRate?: string;
2921
+ paidCycle?: number | null;
2680
2922
  }
2681
- interface UpdateSubscriptionCurrencyResponse {
2682
- /** The updated subscription with new currency and converted amounts */
2923
+ interface MarkBillingCycleAsPaidResponse {
2683
2924
  subscription?: Subscription;
2684
2925
  }
2685
- interface UpdateSubscriptionPlatformOriginRequest {
2926
+ interface GetSubscriptionsStatsRequest {
2927
+ }
2928
+ interface GetSubscriptionsStatsResponse {
2929
+ amountByStatuses?: AmountByStatus[];
2930
+ total?: number;
2931
+ }
2932
+ interface AmountByStatus {
2933
+ status?: SubscriptionStatusEnumSubscriptionStatusWithLiterals;
2934
+ amount?: number;
2935
+ }
2936
+ interface ExtendSubscriptionRequest extends ExtendSubscriptionRequestExtendPolicyOneOf {
2937
+ /** User won't be charged for additional period added on top of subscription end date. */
2938
+ extensionPeriod?: Duration;
2686
2939
  /**
2687
- * Subscription ID to update platform origin for
2688
- * @format GUID
2940
+ * user will be charged for billing cycles added
2941
+ * @min 1
2689
2942
  */
2690
- subscriptionId?: string;
2943
+ extensionBillingCycles?: number;
2691
2944
  /**
2692
- * Tenant ID (instance ID) of the subscription
2945
+ * The ID of the subscription to be extended
2693
2946
  * @format GUID
2694
2947
  */
2695
- tenantId?: string;
2696
- /** New platform origin (appId and entityId) */
2697
- platformOrigin?: PlatformOrigin;
2698
- }
2699
- interface UpdateSubscriptionPlatformOriginResponse {
2700
- /** The updated subscription with new platform origin */
2701
- subscription?: Subscription;
2702
- }
2703
- interface SetIsMigratedEvent {
2704
- /** @format GUID */
2705
- subscriptionId?: string;
2706
- }
2707
- interface SubscriptionDelayedSyncEvent {
2708
- /** @format GUID */
2709
- subscriptionId?: string;
2710
- }
2711
- interface InvoiceAction extends InvoiceActionActionTypeOneOf {
2712
- payRecurring?: PayRecurringInvoice;
2948
+ _id: string;
2949
+ actionContext: ActionContext;
2713
2950
  }
2714
2951
  /** @oneof */
2715
- interface InvoiceActionActionTypeOneOf {
2716
- payRecurring?: PayRecurringInvoice;
2717
- }
2718
- interface PayRecurringInvoice {
2719
- /** @format GUID */
2720
- invoiceId?: string;
2721
- }
2722
- /**
2723
- * Sent each time a subscription status has been set to Active
2724
- * Active shows that a subscription is live and operational.
2725
- * For example:
2726
- * * For subscription with free trial, free trial start date is also the activation date.
2727
- * * For a subscription with future start date, the start date is also the activation date.
2728
- * * When a subscription is resumed from a pause status, the resume date is also the activation date.
2729
- */
2730
- interface SubscriptionActivated {
2731
- subscription?: Subscription;
2952
+ interface ExtendSubscriptionRequestExtendPolicyOneOf {
2953
+ /** User won't be charged for additional period added on top of subscription end date. */
2954
+ extensionPeriod?: Duration;
2955
+ /**
2956
+ * user will be charged for billing cycles added
2957
+ * @min 1
2958
+ */
2959
+ extensionBillingCycles?: number;
2732
2960
  }
2733
- /**
2734
- * Sent each time a subscription status has been set to Ended
2735
- * Ended shows that a subscription reached its end date and ended its life cycle as a result of the agreement.
2736
- * This is different from a Canceled subscription which ends the subscription before a designated end date.
2737
- * Therefore, Ended and Canceled are mutually exclusive.
2738
- */
2739
- interface SubscriptionEnded {
2961
+ interface ExtendSubscriptionResponse {
2962
+ /** The now extended subscription */
2740
2963
  subscription?: Subscription;
2741
2964
  }
2742
- interface SubscriptionInitialPurchaseCompleted {
2743
- subscription?: Subscription;
2744
- actionDetails?: ActionDetails;
2965
+ interface AllowedActionsRequest {
2745
2966
  /** @format GUID */
2746
- paymentTransactionId?: string | null;
2747
- }
2748
- interface SubscriptionCycleReadyToPay {
2749
- subscription?: Subscription;
2967
+ _id: string;
2968
+ /**
2969
+ * List of additional fields to be included in the response.
2970
+ * @maxSize 1
2971
+ */
2972
+ fields?: RequestedFieldsWithLiterals[];
2750
2973
  }
2751
- interface SubscriptionRevived {
2752
- subscription?: Subscription;
2974
+ declare enum RequestedFields {
2975
+ /** Include unsupported action list, including the reasons for the lack of support */
2976
+ UNSUPPORTED_ACTION = "UNSUPPORTED_ACTION"
2753
2977
  }
2754
- interface CreateSubscriptionResponse {
2755
- subscription?: Subscription;
2978
+ /** @enumType */
2979
+ type RequestedFieldsWithLiterals = RequestedFields | 'UNSUPPORTED_ACTION';
2980
+ interface AllowedActionsResponse {
2981
+ /** List of actions that are allowed. */
2982
+ actions?: Action[];
2756
2983
  /**
2757
- * Payments order that should be paid (or authorize card) in order to activate subscription. Empty for free subscriptions.
2758
- * @format GUID
2984
+ * List of actions that are not supported, included only if requested. Provides reasons for each unsupported action.
2985
+ * @maxSize 20
2759
2986
  */
2760
- paymentOrderId?: string | null;
2987
+ unsupportedActions?: UnsupportedAction[];
2761
2988
  }
2762
- interface UpdateSubscriptionRequest {
2763
- /** Revision is validated if Subscription.revision is set */
2764
- subscription?: Subscription;
2989
+ interface UnsupportedAction {
2990
+ actionType?: ActionTypeWithLiterals;
2765
2991
  /**
2766
- * Supported field: start_date
2767
- * Can be updated only if Subscription is in Draft state
2992
+ * Provides detailed reasons for the unsupported action. Each `UnsupportedReason` includes a code and a message explaining why the action is not allowed.
2993
+ * @maxSize 20
2768
2994
  */
2769
- fieldMask?: string[];
2995
+ reasons?: UnsupportedReason[];
2770
2996
  }
2771
- interface UpdateSubscriptionResponse {
2772
- subscription?: Subscription;
2997
+ interface UnsupportedReason {
2998
+ code?: string;
2999
+ description?: string | null;
2773
3000
  }
2774
- interface UpdateSubscriptionStartDateRequest {
3001
+ interface ListUpcomingChargesRequest {
2775
3002
  /**
2776
- * Subscription ID
3003
+ * Subscription id charges to be previewed for
2777
3004
  * @format GUID
2778
3005
  */
2779
- _id?: string;
3006
+ subscriptionId: string;
3007
+ /** Period of time to provide charged for. If not provided,then only next charge will be returned. */
3008
+ customDuration?: Duration;
2780
3009
  /**
2781
- * Can be updated only if Subscription is in Draft state
2782
- * By setting start_date in the future, end_date will be recalculated for termed Subscriptions
2783
- * cycles_to_pay_on_creation will be set to 1 if no free trial is set
3010
+ * Date of the next billing cycle so that the upcoming charges will be calculated accordingly.
3011
+ * If not provided, the upcoming charges will be calculated according to the existing next billing date.
2784
3012
  */
2785
- startDate?: Date | null;
3013
+ nextBillingDate?: Date | null;
2786
3014
  }
2787
- interface UpdateSubscriptionStartDateResponse {
2788
- subscription?: Subscription;
3015
+ interface ListUpcomingChargesResponse {
3016
+ upcomingCharges?: SubscriptionCharge[];
2789
3017
  }
2790
- interface BassToSapiPaypalMigrationRequest {
2791
- /**
2792
- * Subscription ID
2793
- * @format GUID
2794
- */
2795
- _id?: string;
2796
- collectionMethod?: CollectionMethodEnumCollectionMethodWithLiterals;
3018
+ interface PreviewSubscriptionChargesRequest extends PreviewSubscriptionChargesRequestSubscriptionOneOf {
3019
+ /** Information about a non-existing subscription. */
3020
+ subscriptionInfo?: SubscriptionInfo;
2797
3021
  }
2798
- interface BassToSapiPaypalMigrationResponse {
2799
- subscription?: Subscription;
3022
+ /** @oneof */
3023
+ interface PreviewSubscriptionChargesRequestSubscriptionOneOf {
3024
+ /** Information about a non-existing subscription. */
3025
+ subscriptionInfo?: SubscriptionInfo;
2800
3026
  }
2801
- interface UpdateSubscriptionPoliciesRequest {
3027
+ /** Subscription information to use for calculating the preview of charges for a subscription. */
3028
+ interface SubscriptionInfo {
3029
+ billingSettings?: BillingSettings;
3030
+ items?: Item[];
3031
+ startDate?: Date | null;
2802
3032
  /**
2803
- * Subscription ID
2804
- * @format GUID
3033
+ * Customer the subscription belongs to. When provided, used for accurate tax calculation.
3034
+ * Optional for backward compatibility; if omitted, a synthetic id is used (legacy behavior)
3035
+ * and customer-specific tax rules (VAT exemptions, tax IDs) will not apply.
2805
3036
  */
2806
- _id?: string;
2807
- cancellableByCustomer?: boolean | null;
3037
+ customer?: Customer;
2808
3038
  }
2809
- interface UpdateSubscriptionPoliciesResponse {
2810
- /** Updated policies of the subscription */
2811
- policies?: SubscriptionPolicies;
3039
+ interface PreviewSubscriptionChargesResponse {
3040
+ /** Charges for subscription. */
3041
+ charges?: Charge[];
2812
3042
  }
2813
- interface UpdateSubscriptionBillingDateRequest {
3043
+ /** Represents a charge applicable to a subscription. */
3044
+ interface Charge {
3045
+ /** The cycle number from which the charge starts. */
3046
+ cycleFrom?: number;
3047
+ /** The number of cycles for which the charge is applicable. */
3048
+ cycleCount?: number | null;
3049
+ /** The breakdown of the charge */
3050
+ totals?: Totals;
3051
+ /** The billing date from which the charge starts */
3052
+ cycleBillingDate?: Date | null;
3053
+ }
3054
+ interface PreviewSubscriptionsChargesRequest {
2814
3055
  /**
2815
- * ID of the subscription to update the billing date for.
2816
- * @format GUID
3056
+ * Information required to calculate the preview charges for the subscriptions, including an identifier.
3057
+ * @minSize 1
3058
+ * @maxSize 10
2817
3059
  */
2818
- _id: string;
2819
- /** New billing date in `YYYY-MM-DDThh:mm:ss:sssZ` format. */
2820
- billingDate: Date | null;
3060
+ subscriptionsBillingDetails?: SubscriptionBillingDetails[];
2821
3061
  /**
2822
- * Information about how BASS adjusts the total of the next invoice. Extending
2823
- * the current billing cycle results in a higher payment, while shortening it
2824
- * leads to a lower payment. BASS offers automatic calculation of the proration
2825
- * amount based on the number of days added to or removed from the current billing
2826
- * cycle. Alternatively, you can use your own custom method to calculate the
2827
- * proration amount. The custom proration amount can't exceed the total of the
2828
- * current billing cycle.
3062
+ * Specifies the number of upcoming billing charges to preview for all subscriptions in the order.
3063
+ * For instance, if a subscription costs $10 for the first 3 cycles, $12 for cycles 4 through 7,
3064
+ * $15 for cycles 8 through 10, and $20 for cycle 11 onwards:
3065
+ * - Sending "1" will calculate and return charges for cycles 4 through 7 since it's the first charge in the future.
3066
+ * - Sending "2" will provide a response with charges for cycles 4 through 7 and cycles 8 through 10.
3067
+ * - Sending "3" or more will include totals for cycles 4 through 7, cycles 8 through 10, and from cycle 11 onwards.
3068
+ * If no value is provided, the response will include charges for all upcoming cycles, including the existing one,
3069
+ * in this case, charges for cycle 1 through 3.
3070
+ * If there is a single charge for a subscription, meaning that subscription price remains consistent across all cycles,
3071
+ * then even if future_charges_count is set, it will be ignored and the only charge this subscription has will be returned.
3072
+ * @min 1
3073
+ * @max 10
2829
3074
  */
2830
- proration?: Proration;
2831
- }
2832
- interface UpdateSubscriptionBillingDateResponse {
2833
- /** Updated subscription. */
2834
- subscription?: Subscription;
2835
- }
2836
- interface SubscriptionBillingDateUpdated {
2837
- subscription?: Subscription;
2838
- billingDate?: Date | null;
2839
- proration?: Proration;
3075
+ numberOfNextRecurringCharges?: number | null;
2840
3076
  }
2841
- interface UpdateSubscriptionOriginRequest {
3077
+ interface SubscriptionBillingDetails {
2842
3078
  /**
2843
- * ID of the subscription to update origin.
3079
+ * External identifier of the subscription
2844
3080
  * @format GUID
2845
3081
  */
2846
- _id?: string;
3082
+ externalId?: string | null;
3083
+ /** Billing details parameters including schedule, currency, etc. */
3084
+ billingSettings?: BillingSettings;
2847
3085
  /**
2848
- * Origin entity ID of the subscription to update.
2849
- * @format GUID
3086
+ * Items, minSize is 1, maxSize is 100
3087
+ * @minSize 1
3088
+ * @maxSize 100
2850
3089
  */
2851
- entityId?: string;
3090
+ items?: Item[];
3091
+ /** Subscription start date, now if not set */
3092
+ startDate?: Date | null;
3093
+ /** Shipping address associated with subscription. At the moment used only for payments. Optional. */
3094
+ shippingAddress?: FullAddressDetails;
3095
+ /**
3096
+ * Customer the subscription belongs to. When provided, used for accurate tax calculation.
3097
+ * Optional for backward compatibility; if omitted, a synthetic id is used (legacy behavior).
3098
+ */
3099
+ customer?: Customer;
2852
3100
  }
2853
- interface UpdateSubscriptionOriginResponse {
2854
- /** Updated subscription. */
2855
- subscription?: Subscription;
3101
+ interface PreviewSubscriptionsChargesResponse {
3102
+ /** Charges for the subscriptions, including an identifier. */
3103
+ subscriptionsCharges?: SubscriptionCharges[];
2856
3104
  }
2857
- interface ReviseSubscriptionRequest {
3105
+ interface SubscriptionCharges {
2858
3106
  /**
2859
- * Subscription ID
3107
+ * External identifier of the subscription
2860
3108
  * @format GUID
2861
3109
  */
2862
- _id: string;
3110
+ externalId?: string | null;
3111
+ /** Charges for subscription. */
3112
+ charges?: Charge[];
3113
+ }
3114
+ interface CreateSubscriptionForOrderRequest {
3115
+ /** Subscription needs to be created */
3116
+ subscription?: Subscription;
2863
3117
  /**
2864
- * 0 for no revision, maxSize is 100
2865
- * @maxSize 100
3118
+ * Optional unique identifier for this request in order to prevent subscription duplications
3119
+ * @format GUID
2866
3120
  */
2867
- items?: Item[];
3121
+ idempotencyKey?: string | null;
2868
3122
  }
2869
- interface ReviseSubscriptionResponse {
3123
+ interface CreateSubscriptionForOrderResponse {
3124
+ /** Created subscription */
2870
3125
  subscription?: Subscription;
3126
+ /** Non-persistent invoice */
3127
+ invoice?: Invoice;
2871
3128
  }
2872
- interface UpdateSubscriptionItemsRequest {
3129
+ /** An invoice includes information about the subscription and the customer. */
3130
+ interface Invoice {
2873
3131
  /**
2874
- * Subscription ID
3132
+ * Invoice ID.
2875
3133
  * @format GUID
3134
+ * @readonly
2876
3135
  */
2877
- _id?: string;
2878
- /** Update action. For RESET_PENDING_UPDATES, nothing but the subscription ID should be defined in the request. */
2879
- updateAction?: UpdateActionWithLiterals;
2880
- /** Updates execution date. Relevant only for UpdateAction.SPECIFIC_DATE. Only specific date is supported. */
2881
- scheduleAdditionalInfo?: ScheduleAdditionalInfo;
2882
- /**
2883
- * Existing items to update
2884
- * @maxSize 100
2885
- */
2886
- itemsToUpdate?: ItemChange[];
2887
- /**
2888
- * Items to add
2889
- * @maxSize 99
2890
- */
2891
- itemsToAdd?: Item[];
3136
+ _id?: string | null;
2892
3137
  /**
2893
- * Existing items to delete
2894
- * @format GUID
2895
- * @maxSize 99
3138
+ * Date and time the invoice was created.
3139
+ * @readonly
2896
3140
  */
2897
- itemsToDelete?: string[] | null;
2898
- }
2899
- declare enum UpdateAction {
2900
- NONE = "NONE",
2901
- /** Update subscription immediately, please note proration for updates changing price are not yet supported */
2902
- IMMEDIATELY = "IMMEDIATELY",
2903
- /** Request updates that will take affect only at the start of the next billing cycle. */
2904
- NEXT_BILLING_CYCLE = "NEXT_BILLING_CYCLE",
2905
- /** Reset all pending updates */
2906
- RESET_PENDING_UPDATES = "RESET_PENDING_UPDATES",
2907
- /** Request updates that will take affect only at a specific date. */
2908
- SPECIFIC_DATE = "SPECIFIC_DATE"
2909
- }
2910
- /** @enumType */
2911
- type UpdateActionWithLiterals = UpdateAction | 'NONE' | 'IMMEDIATELY' | 'NEXT_BILLING_CYCLE' | 'RESET_PENDING_UPDATES' | 'SPECIFIC_DATE';
2912
- interface UpdateSubscriptionItemsResponse {
2913
- subscription?: Subscription;
2914
- }
2915
- interface BulkUpdateSubscriptionItemsByFilterRequest {
3141
+ _createdDate?: Date | null;
2916
3142
  /**
2917
- * Filter to identify the subscriptions for which items are updated. For
2918
- * supported fields see
2919
- * [Search and Query: Bulk Update Subscription Items By Filter](https://bo.wix.com/wix-docs/rest/drafts/subscriptions-by-billing-by-wix/search-and-query#drafts_subscriptions-by-billing-by-wix_search-and-query_bulk-update-subscription-items-by-filter).
2920
- * Sending an empty subscription filter results in a validation error.
2921
- * In case you pass `{"updateAction": "RESET_PENDING_UPDATES"}`, use only the
2922
- * `subscriptionId` field inside this filter. Passing any other filter results
2923
- * in a failed validation error.
3143
+ * Date and time the invoice was last updated.
3144
+ * @readonly
2924
3145
  */
2925
- subscriptionFilter?: Record<string, any> | null;
3146
+ _updatedDate?: Date | null;
2926
3147
  /**
2927
- * Filter to specify which subscription items are updated. Make sure to use
2928
- * the catalog item ID and not the item's unique ID. All subscription items
2929
- * with matching `items.catalogReference.catalogItemId` are updated.
3148
+ * Revision number, which increments by 1 each time the invoice is updated.
3149
+ * To prevent conflicting changes,
3150
+ * the current revision must be passed when updating the invoice.
2930
3151
  *
2931
- * Max: `100` reference catalog item IDs
2932
- * @format GUID
2933
- * @maxSize 100
3152
+ * Ignored when creating a invoice.
3153
+ * @readonly
2934
3154
  */
2935
- catalogReferenceIds?: string[] | null;
3155
+ revision?: string | null;
3156
+ /** Information about the invoice origin. */
3157
+ origin?: BusinessOriginData;
2936
3158
  /**
2937
- * Information about the update timing and update type.
3159
+ * Invoice status.
2938
3160
  *
2939
- * + `"IMMEDIATELY"`: The updates become effective immediately.
2940
- * + `"NEXT_BILLING_CYCLE"`: The updates are scheduled for the beginning of the next billing cycle.
2941
- * + `"SPECIFIC_DATE"`: The updates are scheduled for the date specified in `scheduleAdditionalInfo.specificDate`.
2942
- * + `"RESET_PENDING_UPDATES"`: All currently scheduled updates for the specified supcriptions are canceled. Use only the `subscriptionId` field inside `subscriptionFilter`, all other filters result in failed validation errors.
3161
+ * + `"UNKNOWN"`: There is no information about the invoice status.
3162
+ * + `"OPEN"`: BASS has created the invoice but hasn't initiated the payment process.
3163
+ * + `"PAID"`: The customer has successfully paid for the invoice.
3164
+ * + `"ATTEMPT_FAILED"`: The payment process has started and there has been at least one unsuccessful payment attempt.
3165
+ * + `"FAILED"`: The payment process has failed and there are no more retries.
3166
+ * + `"CANCELED"`: The payment process has been stopped because the related subscription has been canceled.
3167
+ * @readonly
2943
3168
  */
2944
- updateAction?: UpdateActionWithLiterals;
3169
+ status?: InvoiceStatusWithLiterals;
2945
3170
  /**
2946
- * Additional information for updates. Currently, only supported for
2947
- * `{"updateAction": "SPECIFIC_DATE"}`.
3171
+ * 3-letter currency code of the invoice in
3172
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
3173
+ * @format CURRENCY
2948
3174
  */
2949
- scheduleAdditionalInfo?: ScheduleAdditionalInfo;
3175
+ currency?: string;
3176
+ /** Information about the customer. */
3177
+ customer?: Customer;
2950
3178
  /**
2951
- * Update details for the susbcription items that match the filtering.
2952
- * Currently, you can update only the item price, quantity, and tax. Note
2953
- * that all item properties are updated to the same values. In case you want set
2954
- * different values for individual items, you must call
2955
- * _Bulk Update Subscription Items By Filter_ multiple times, once per unique update.
3179
+ * Whether the payment is processed through Wix and whether the customer must provide some input.
3180
+ *
3181
+ * + `"UNKNOWN"`: There is no information about the collection method.
3182
+ * + `"AUTO_CHARGE"`: The customer pays automatically through Wix.
3183
+ * + `"SEND_INVOICE"`: The customer pays through Wix, but some manual input is required.
3184
+ * + `"OFFLINE"`: The customer pays outside of Wix.
2956
3185
  */
2957
- bulkItemUpdateData?: BulkItemChange;
3186
+ collectionMethod?: CollectionMethodWithLiterals;
2958
3187
  /**
2959
- * __Not implemented yet__. Items to add to the subscriptions matching the filtering.
2960
- * @maxSize 99
3188
+ * ID of the
3189
+ * [payment method](https://bo.wix.com/wix-docs/rest/wix-cashier/settings/payment-method-type/payment-method-type-object).
3190
+ * Not available for the first payment of a subscription and all offline
3191
+ * payments.
3192
+ * @format GUID
2961
3193
  */
2962
- itemsToAdd?: Item[];
2963
- }
2964
- interface BulkItemChange {
2965
- /** Information about the new item price. */
2966
- pricingModel?: PricingModel;
3194
+ paymentMethodId?: string | null;
2967
3195
  /**
2968
- * New item quantity.
3196
+ * Cashier [Order ID](https://dev.wix.com/docs/rest/payments/wix-cashier/pay/order#order-object)
3197
+ * for the corresponding payment.
3198
+ * @format GUID
3199
+ * @readonly
3200
+ */
3201
+ paymentOrderId?: string | null;
3202
+ /** Information about a discount. Available only for invoices that include a discount. */
3203
+ discount?: InvoiceDiscount;
3204
+ /** Billing address. */
3205
+ billingAddress?: FullAddressDetails;
3206
+ /** Shipping address. Available only for `"PHYSICAL"` line items. */
3207
+ shippingAddress?: FullAddressDetails;
3208
+ /**
3209
+ * Shipping fee in `0.00` format.
3210
+ * @format DECIMAL_VALUE
3211
+ */
3212
+ shippingFee?: string | null;
3213
+ /**
3214
+ * Information about the invoice's totals.
3215
+ * @readonly
3216
+ */
3217
+ totals?: Totals;
3218
+ /** Line items belonging to the invoice. */
3219
+ invoiceItems?: InvoiceItem[];
3220
+ /**
3221
+ * Whether the invoice is used to validate payment details.
2969
3222
  *
2970
- * Min: `1`
2971
- * @min 1
3223
+ * + `true`: BASS uses the invoice to test payment details. Relevant for free trials. Ensures that Wix can collect the payment of the first billing cycle.
3224
+ * + `false`: Standard invoice.
2972
3225
  */
2973
- quantity?: number | null;
2974
- /** Information about the new item tax. */
2975
- tax?: Tax;
2976
- }
2977
- interface BulkUpdateSubscriptionItemsByFilterResponse {
3226
+ isAuthorization?: boolean | null;
3227
+ /** Whether the invoice's `totals.totalPrice` includes tax. */
3228
+ isTaxInclusive?: boolean | null;
3229
+ /** Details of the latest payment attempt. */
3230
+ latestPaymentAttempt?: LatestPaymentAttempt;
3231
+ /** List of charges and credits that adjust the invoice's `totals.totalPrice`. */
3232
+ adjustments?: PriceAdjustment[];
2978
3233
  /**
2979
- * ID of your bulk job. You can use
2980
- * [this Async Infra call](https://pbo.wix.com/fire-console/?artifact=com.wixpress.asyncinfra.async-job-service&service=wix.infra.asyncjobs.v1.AsyncJobService&method=ListAsyncJobItems&body=eyJqb2JfaWQiOiIifQ%3D%3D)
2981
- * to retrieve information about the job status.
3234
+ * Invoice Number.
3235
+ * @maxLength 10
3236
+ * @readonly
2982
3237
  */
2983
- jobId?: string;
2984
- }
2985
- interface DeleteSubscriptionRequest {
2986
- /** @format GUID */
2987
- _id?: string;
2988
- revision?: string;
2989
- }
2990
- interface DeleteSubscriptionResponse {
2991
- }
2992
- interface CancelSubscriptionRequest {
2993
- /** @format GUID */
2994
- _id: string;
2995
- actionContext: ActionContext;
2996
- }
2997
- interface ActionContext {
2998
- initiator?: ActionInitiatorWithLiterals;
2999
- /** Optional action reason message */
3000
- reason?: string | null;
3001
- }
3002
- interface CancelSubscriptionResponse {
3003
- subscription?: Subscription;
3004
- }
3005
- interface PauseSubscriptionRequest {
3006
- /** @format GUID */
3007
- _id: string;
3008
- pausePolicy?: PausePolicyWithLiterals;
3009
- pauseAt?: PauseAtWithLiterals;
3010
- /** contains additional scheduling information for certain pause_at options (for example: SPECIFIC_DATE & NUMBER_OF_CYCLES_FROM_TODAY) */
3011
- pauseAtSchedule?: ScheduleAdditionalInfo;
3012
- /** contains additional scheduling information for certain auto_resume_at either specific date */
3013
- autoResumeAtSchedule?: ScheduleAdditionalInfo;
3014
- actionContext: ActionContext;
3015
- }
3016
- interface PauseSubscriptionResponse {
3017
- subscription?: Subscription;
3018
- }
3019
- interface SubscriptionPaused {
3020
- subscription?: Subscription;
3021
- pausePolicy?: PausePolicyWithLiterals;
3022
- actionDetails?: ActionDetails;
3023
- }
3024
- interface PauseSubscriptionRequested {
3025
- subscription?: Subscription;
3026
- pauseAt?: PauseAtWithLiterals;
3027
- pausePolicy?: PausePolicyWithLiterals;
3028
- actionDetails?: ActionDetails;
3029
- }
3030
- interface ScheduledPauseCanceled {
3031
- subscription?: Subscription;
3032
- actionDetails?: ActionDetails;
3033
- }
3034
- interface ResumeSubscriptionRequest {
3035
- /** @format GUID */
3036
- _id: string;
3037
- resumeAt?: ResumeAtWithLiterals;
3038
- /** contains additional scheduling information for certain resume_at options (for example: SPECIFIC_DATE) */
3039
- resumeAtSchedule?: ScheduleAdditionalInfo;
3040
- actionContext: ActionContext;
3041
- }
3042
- interface ResumeSubscriptionResponse {
3043
- subscription?: Subscription;
3044
- }
3045
- interface SubscriptionResumed {
3046
- subscription?: Subscription;
3047
- actionDetails?: ActionDetails;
3048
- pauseInfo?: PauseInfo;
3049
- }
3050
- interface ResumeSubscriptionRequested {
3051
- subscription?: Subscription;
3052
- resumeAt?: ResumeAtWithLiterals;
3053
- actionDetails?: ActionDetails;
3054
- }
3055
- interface ScheduledResumeCanceled {
3056
- subscription?: Subscription;
3057
- actionDetails?: ActionDetails;
3058
- }
3059
- interface SearchSubscriptionsRequest extends SearchSubscriptionsRequestPagingMethodOneOf {
3060
- /** Limit number of results and enable to skip rows. The default limit is 25. */
3061
- paging?: Paging;
3062
- /** A Cursor option for efficient paging. Pass this field from the previous search response to continue to the next page. */
3063
- cursor?: CursorPaging;
3064
- /** A filter object */
3065
- filter?: any;
3066
- /** A Sorting option by field name and order. */
3067
- sorting?: SortingClauses;
3068
- }
3069
- /** @oneof */
3070
- interface SearchSubscriptionsRequestPagingMethodOneOf {
3071
- /** Limit number of results and enable to skip rows. The default limit is 25. */
3072
- paging?: Paging;
3073
- /** A Cursor option for efficient paging. Pass this field from the previous search response to continue to the next page. */
3074
- cursor?: CursorPaging;
3075
- }
3076
- interface SortingClauses {
3077
- sorting?: Sorting[];
3078
- }
3079
- interface SearchSubscriptionsResponse {
3080
- subscriptions?: Subscription[];
3081
- cursor?: CursorPaging;
3082
- pagingMetadata?: CursorPagingMetadata;
3083
- }
3084
- interface CursorPagingMetadata {
3085
- /** Total number of items matching the filter. Available only on the first page of *Search* */
3086
- total?: number | null;
3087
- }
3088
- interface TurnOnSubscriptionAutoRenewalRequest {
3089
- /** @format GUID */
3090
- _id: string;
3091
- actionContext: ActionContext;
3092
- }
3093
- interface TurnOnSubscriptionAutoRenewalResponse {
3094
- subscription?: Subscription;
3095
- }
3096
- interface SubscriptionAutoRenewalTurnedOn {
3097
- subscription?: Subscription;
3098
- actionDetails?: ActionDetails;
3099
- }
3100
- interface TurnOffSubscriptionAutoRenewalRequest {
3101
- /** @format GUID */
3102
- _id: string;
3103
- actionContext: ActionContext;
3104
- }
3105
- interface TurnOffSubscriptionAutoRenewalResponse {
3106
- subscription?: Subscription;
3107
- }
3108
- interface SubscriptionAutoRenewalTurnedOff {
3109
- subscription?: Subscription;
3110
- actionDetails?: ActionDetails;
3111
- }
3112
- interface MarkLatestInvoiceAsPaidRequest {
3238
+ invoiceNumber?: string | null;
3113
3239
  /**
3114
- * The ID of the offline subscription to mark as paid its latest invoice
3115
- * @format GUID
3240
+ * Shipping charges for the invoice.
3241
+ * Supports only one discount without cycles.
3242
+ * Discounts with cycles (repeated discounts across different billing cycles) are not supported for shipping
3116
3243
  */
3117
- subscriptionId: string;
3118
- }
3119
- interface MarkLatestInvoiceAsPaidResponse {
3120
- subscription?: Subscription;
3121
- }
3122
- interface LatestInvoiceMarkedAsPaid {
3123
- subscription?: Subscription;
3124
- }
3125
- interface MultipleSubscriptionsOnOrdersInvoice {
3244
+ shippingCharges?: InvoiceShippingCharges;
3245
+ /** Information about the invoice tax */
3246
+ taxData?: TaxData;
3247
+ /** Business address. */
3248
+ businessAddress?: Address;
3126
3249
  /**
3127
- * the invoice id of the affected subscription
3250
+ * ID of the billing order that created this invoice.
3128
3251
  * @format GUID
3129
3252
  */
3130
- invoiceId?: string;
3253
+ orderId?: string | null;
3131
3254
  /**
3132
- * the order id of the affected subscription
3255
+ * Platform origin the invoice is originated from.
3133
3256
  * @format GUID
3134
3257
  */
3135
- orderId?: string;
3258
+ platformOriginAppId?: string | null;
3259
+ /**
3260
+ * Refund information, provided that there are refunds for this invoice.
3261
+ * @readonly
3262
+ */
3263
+ refundInfo?: RefundInfo;
3136
3264
  }
3137
- interface MarkBillingCycleAsPaidRequest {
3265
+ interface BusinessOriginData {
3138
3266
  /**
3139
- * The ID of the subscription to mark as paid its invoice.
3267
+ * ID of the app for which BASS has created the invoice. For example,
3268
+ * `"1380b703-ce81-ff05-f115-39571d94dfcd"` for the Wix eCommerce app.
3140
3269
  * @format GUID
3141
3270
  */
3142
- subscriptionId: string;
3271
+ appId?: string;
3143
3272
  /**
3144
- * The subscription cycle for which the invoice is to be marked as paid.
3145
- * If left empty, the most recent cycle will be selected.
3146
- * @min 1
3273
+ * [Instance ID](https://dev.wix.com/api/rest/app-management/apps/app-instance/get-app-instance)
3274
+ * of the app for which BASS has created the invoice.
3275
+ * @format GUID
3147
3276
  */
3148
- paidCycle?: number | null;
3149
- }
3150
- interface MarkBillingCycleAsPaidResponse {
3151
- subscription?: Subscription;
3152
- }
3153
- interface GetSubscriptionsStatsRequest {
3154
- }
3155
- interface GetSubscriptionsStatsResponse {
3156
- amountByStatuses?: AmountByStatus[];
3157
- total?: number;
3158
- }
3159
- interface AmountByStatus {
3160
- status?: SubscriptionStatusEnumSubscriptionStatusWithLiterals;
3161
- amount?: number;
3162
- }
3163
- interface ExtendSubscriptionRequest extends ExtendSubscriptionRequestExtendPolicyOneOf {
3164
- /** User won't be charged for additional period added on top of subscription end date. */
3165
- extensionPeriod?: Duration;
3166
- /**
3167
- * user will be charged for billing cycles added
3168
- * @min 1
3169
- */
3170
- extensionBillingCycles?: number;
3277
+ instanceId?: string;
3171
3278
  /**
3172
- * The ID of the subscription to be extended
3279
+ * ID of the entity that triggered the invoice creation. For example, the ID of a
3280
+ * [pricing plan](https://dev.wix.com/docs/rest/payments/pricing-plans/pricing-plans/plan#plan-object).
3173
3281
  * @format GUID
3174
3282
  */
3175
- _id: string;
3176
- actionContext: ActionContext;
3177
- }
3178
- /** @oneof */
3179
- interface ExtendSubscriptionRequestExtendPolicyOneOf {
3180
- /** User won't be charged for additional period added on top of subscription end date. */
3181
- extensionPeriod?: Duration;
3182
- /**
3183
- * user will be charged for billing cycles added
3184
- * @min 1
3185
- */
3186
- extensionBillingCycles?: number;
3283
+ entityId?: string;
3187
3284
  }
3188
- interface ExtendSubscriptionResponse {
3189
- /** The now extended subscription */
3190
- subscription?: Subscription;
3285
+ declare enum InvoiceStatus {
3286
+ UNKNOWN = "UNKNOWN",
3287
+ OPEN = "OPEN",
3288
+ PAID = "PAID",
3289
+ FAILED = "FAILED",
3290
+ ATTEMPT_FAILED = "ATTEMPT_FAILED",
3291
+ CANCELED = "CANCELED",
3292
+ REFUNDED = "REFUNDED",
3293
+ CHARGEBACKED = "CHARGEBACKED"
3191
3294
  }
3192
- interface AllowedActionsRequest {
3193
- /** @format GUID */
3194
- _id: string;
3195
- /**
3196
- * List of additional fields to be included in the response.
3197
- * @maxSize 1
3198
- */
3199
- fields?: RequestedFieldsWithLiterals[];
3295
+ /** @enumType */
3296
+ type InvoiceStatusWithLiterals = InvoiceStatus | 'UNKNOWN' | 'OPEN' | 'PAID' | 'FAILED' | 'ATTEMPT_FAILED' | 'CANCELED' | 'REFUNDED' | 'CHARGEBACKED';
3297
+ declare enum CollectionMethod {
3298
+ UNKNOWN = "UNKNOWN",
3299
+ AUTO_CHARGE = "AUTO_CHARGE",
3300
+ OFFLINE = "OFFLINE",
3301
+ SEND_INVOICE = "SEND_INVOICE"
3200
3302
  }
3201
- declare enum RequestedFields {
3202
- /** Include unsupported action list, including the reasons for the lack of support */
3203
- UNSUPPORTED_ACTION = "UNSUPPORTED_ACTION"
3303
+ /** @enumType */
3304
+ type CollectionMethodWithLiterals = CollectionMethod | 'UNKNOWN' | 'AUTO_CHARGE' | 'OFFLINE' | 'SEND_INVOICE';
3305
+ declare enum CreationMode {
3306
+ UNKNOWN = "UNKNOWN",
3307
+ SYSTEM = "SYSTEM",
3308
+ MANUAL = "MANUAL"
3204
3309
  }
3205
3310
  /** @enumType */
3206
- type RequestedFieldsWithLiterals = RequestedFields | 'UNSUPPORTED_ACTION';
3207
- interface AllowedActionsResponse {
3208
- /** List of actions that are allowed. */
3209
- actions?: Action[];
3311
+ type CreationModeWithLiterals = CreationMode | 'UNKNOWN' | 'SYSTEM' | 'MANUAL';
3312
+ interface LatestPaymentAttempt {
3210
3313
  /**
3211
- * List of actions that are not supported, included only if requested. Provides reasons for each unsupported action.
3212
- * @maxSize 20
3314
+ * ID of the latest payment attempt.
3315
+ * @format GUID
3316
+ * @readonly
3213
3317
  */
3214
- unsupportedActions?: UnsupportedAction[];
3215
- }
3216
- interface UnsupportedAction {
3217
- actionType?: ActionTypeWithLiterals;
3318
+ paymentAttemptId?: string;
3218
3319
  /**
3219
- * Provides detailed reasons for the unsupported action. Each `UnsupportedReason` includes a code and a message explaining why the action is not allowed.
3220
- * @maxSize 20
3320
+ * Date and time of the latest payment attempt in `YYYY-MM-DDThh:mm.sssZ` format.
3321
+ * @readonly
3221
3322
  */
3222
- reasons?: UnsupportedReason[];
3223
- }
3224
- interface UnsupportedReason {
3225
- code?: string;
3226
- description?: string | null;
3227
- }
3228
- interface ListUpcomingChargesRequest {
3323
+ dateAttempt?: Date | null;
3324
+ /** Number of the latest payment attempt. */
3325
+ attemptNumber?: number;
3229
3326
  /**
3230
- * Subscription id charges to be previewed for
3231
- * @format GUID
3327
+ * Status of the latest payment attempt.
3328
+ *
3329
+ * + `"UNKNOWN"`: There is no information about the status of the latest payment attempt.
3330
+ * + `"SCHEDULED"`: The latest payment attempt is scheduled but hasn't started yet.
3331
+ * + `"IN_PROGRESS"`: The latest payment attempt is in progress.
3332
+ * + `"PAID"`: The latest payment attempt resulted in a successful payment.
3333
+ * + `"DECLINED"`: The latest payment attempt has been declined.
3334
+ * + `"TECHNICAL_FAILURE"`: The latest payment attempt couldn't be process due to a technical failure.
3335
+ * + `"CANCELED"`: The latest payment attempt has been canceled by BASS.
3336
+ * @readonly
3232
3337
  */
3233
- subscriptionId: string;
3234
- /** Period of time to provide charged for. If not provided,then only next charge will be returned. */
3235
- customDuration?: Duration;
3338
+ status?: PaymentAttemptStatusWithLiterals;
3236
3339
  /**
3237
- * Date of the next billing cycle so that the upcoming charges will be calculated accordingly.
3238
- * If not provided, the upcoming charges will be calculated according to the existing next billing date.
3340
+ * Whether BASS tries to collect the payment another time. Available only when
3341
+ * `latestPaymentAttempt.status` is set to `"DECLINED"`.
3239
3342
  */
3240
- nextBillingDate?: Date | null;
3343
+ retryable?: boolean;
3344
+ /**
3345
+ * Platform fee that was collected on this transaction.
3346
+ * @format DECIMAL_VALUE
3347
+ * @decimalValue options { gte:0.00, maxScale:2 }
3348
+ * @readonly
3349
+ */
3350
+ appliedPlatformFee?: string | null;
3241
3351
  }
3242
- interface ListUpcomingChargesResponse {
3243
- upcomingCharges?: SubscriptionCharge[];
3352
+ declare enum PaymentAttemptStatus {
3353
+ UNKNOWN = "UNKNOWN",
3354
+ SCHEDULED = "SCHEDULED",
3355
+ IN_PROGRESS = "IN_PROGRESS",
3356
+ PAID = "PAID",
3357
+ DECLINED = "DECLINED",
3358
+ TECHNICAL_FAILURE = "TECHNICAL_FAILURE",
3359
+ CANCELED = "CANCELED",
3360
+ PENDING = "PENDING",
3361
+ REFUNDED = "REFUNDED",
3362
+ CHARGEBACKED = "CHARGEBACKED"
3244
3363
  }
3245
- interface PreviewSubscriptionChargesRequest extends PreviewSubscriptionChargesRequestSubscriptionOneOf {
3246
- /** Information about a non-existing subscription. */
3247
- subscriptionInfo?: SubscriptionInfo;
3364
+ /** @enumType */
3365
+ type PaymentAttemptStatusWithLiterals = PaymentAttemptStatus | 'UNKNOWN' | 'SCHEDULED' | 'IN_PROGRESS' | 'PAID' | 'DECLINED' | 'TECHNICAL_FAILURE' | 'CANCELED' | 'PENDING' | 'REFUNDED' | 'CHARGEBACKED';
3366
+ interface PriceAdjustment extends PriceAdjustmentAdjustmentTypeOneOf {
3367
+ /** Adjustment that increases the price. */
3368
+ charge?: PriceAdjustmentValue;
3369
+ /** Adjustment that lowers the price. */
3370
+ credit?: PriceAdjustmentValue;
3371
+ /** Reason for this price adjustment. Used to categorize proration adjustments. */
3372
+ reason?: PriceAdjustmentReasonWithLiterals;
3248
3373
  }
3249
3374
  /** @oneof */
3250
- interface PreviewSubscriptionChargesRequestSubscriptionOneOf {
3251
- /** Information about a non-existing subscription. */
3252
- subscriptionInfo?: SubscriptionInfo;
3253
- }
3254
- /** Subscription information to use for calculating the preview of charges for a subscription. */
3255
- interface SubscriptionInfo {
3256
- billingSettings?: BillingSettings;
3257
- items?: Item[];
3258
- startDate?: Date | null;
3259
- }
3260
- interface PreviewSubscriptionChargesResponse {
3261
- /** Charges for subscription. */
3262
- charges?: Charge[];
3263
- }
3264
- /** Represents a charge applicable to a subscription. */
3265
- interface Charge {
3266
- /** The cycle number from which the charge starts. */
3267
- cycleFrom?: number;
3268
- /** The number of cycles for which the charge is applicable. */
3269
- cycleCount?: number | null;
3270
- /** The breakdown of the charge */
3271
- totals?: Totals;
3272
- /** The billing date from which the charge starts */
3273
- cycleBillingDate?: Date | null;
3375
+ interface PriceAdjustmentAdjustmentTypeOneOf {
3376
+ /** Adjustment that increases the price. */
3377
+ charge?: PriceAdjustmentValue;
3378
+ /** Adjustment that lowers the price. */
3379
+ credit?: PriceAdjustmentValue;
3274
3380
  }
3275
- interface PreviewSubscriptionsChargesRequest {
3381
+ interface PriceAdjustmentValue extends PriceAdjustmentValueAdjustmentValueTypeOneOf {
3276
3382
  /**
3277
- * Information required to calculate the preview charges for the subscriptions, including an identifier.
3278
- * @minSize 1
3279
- * @maxSize 10
3383
+ * Absolute amount that adjusts the price.
3384
+ *
3385
+ * Min: `0.01`
3386
+ * @decimalValue options { gt:0.00 }
3280
3387
  */
3281
- subscriptionsBillingDetails?: SubscriptionBillingDetails[];
3388
+ amount?: string;
3282
3389
  /**
3283
- * Specifies the number of upcoming billing charges to preview for all subscriptions in the order.
3284
- * For instance, if a subscription costs $10 for the first 3 cycles, $12 for cycles 4 through 7,
3285
- * $15 for cycles 8 through 10, and $20 for cycle 11 onwards:
3286
- * - Sending "1" will calculate and return charges for cycles 4 through 7 since it's the first charge in the future.
3287
- * - Sending "2" will provide a response with charges for cycles 4 through 7 and cycles 8 through 10.
3288
- * - Sending "3" or more will include totals for cycles 4 through 7, cycles 8 through 10, and from cycle 11 onwards.
3289
- * If no value is provided, the response will include charges for all upcoming cycles, including the existing one,
3290
- * in this case, charges for cycle 1 through 3.
3291
- * If there is a single charge for a subscription, meaning that subscription price remains consistent across all cycles,
3292
- * then even if future_charges_count is set, it will be ignored and the only charge this subscription has will be returned.
3293
- * @min 1
3294
- * @max 10
3390
+ * Relative factor that adjusts the price. For example, setting
3391
+ * `multiplier` to:
3392
+ * - `0.50` results in a price adjustment of 50% of the original value.
3393
+ * - `0.75` results in a price adjustment of 75% of the original value.
3394
+ * - `1.00` results in a price adjustment of 100% of the original value.
3395
+ *
3396
+ * Min: `0.01`
3397
+ * Max: `1.00`
3398
+ * @decimalValue options { gt:0.00, lte:1 }
3295
3399
  */
3296
- numberOfNextRecurringCharges?: number | null;
3400
+ multiplier?: string;
3297
3401
  }
3298
- interface SubscriptionBillingDetails {
3402
+ /** @oneof */
3403
+ interface PriceAdjustmentValueAdjustmentValueTypeOneOf {
3299
3404
  /**
3300
- * External identifier of the subscription
3301
- * @format GUID
3405
+ * Absolute amount that adjusts the price.
3406
+ *
3407
+ * Min: `0.01`
3408
+ * @decimalValue options { gt:0.00 }
3302
3409
  */
3303
- externalId?: string | null;
3304
- /** Billing details parameters including schedule, currency, etc. */
3305
- billingSettings?: BillingSettings;
3410
+ amount?: string;
3306
3411
  /**
3307
- * Items, minSize is 1, maxSize is 100
3308
- * @minSize 1
3309
- * @maxSize 100
3412
+ * Relative factor that adjusts the price. For example, setting
3413
+ * `multiplier` to:
3414
+ * - `0.50` results in a price adjustment of 50% of the original value.
3415
+ * - `0.75` results in a price adjustment of 75% of the original value.
3416
+ * - `1.00` results in a price adjustment of 100% of the original value.
3417
+ *
3418
+ * Min: `0.01`
3419
+ * Max: `1.00`
3420
+ * @decimalValue options { gt:0.00, lte:1 }
3310
3421
  */
3311
- items?: Item[];
3312
- /** Subscription start date, now if not set */
3313
- startDate?: Date | null;
3314
- /** Shipping address associated with subscription. At the moment used only for payments. Optional. */
3315
- shippingAddress?: FullAddressDetails;
3316
- }
3317
- interface PreviewSubscriptionsChargesResponse {
3318
- /** Charges for the subscriptions, including an identifier. */
3319
- subscriptionsCharges?: SubscriptionCharges[];
3422
+ multiplier?: string;
3320
3423
  }
3321
- interface SubscriptionCharges {
3322
- /**
3323
- * External identifier of the subscription
3324
- * @format GUID
3325
- */
3326
- externalId?: string | null;
3327
- /** Charges for subscription. */
3328
- charges?: Charge[];
3424
+ /** Reason for a price adjustment. Categorizes different types of proration adjustments. */
3425
+ declare enum PriceAdjustmentReason {
3426
+ /** Default value. Used for adjustments without a specific categorization. */
3427
+ PRICE_ADJUSTMENT_REASON_UNSPECIFIED = "PRICE_ADJUSTMENT_REASON_UNSPECIFIED",
3428
+ /** Adjustment due to a billing date change. */
3429
+ BILLING_DATE_CHANGE = "BILLING_DATE_CHANGE",
3430
+ /** Proration adjustment from changing the subscription plan. */
3431
+ PLAN_CHANGE_PRORATION = "PLAN_CHANGE_PRORATION",
3432
+ /** Proration adjustment from changing the billing cycle (e.g., monthly to yearly). */
3433
+ CYCLE_CHANGE_PRORATION = "CYCLE_CHANGE_PRORATION",
3434
+ /** Proration adjustment from changing the subscription quantity. */
3435
+ QUANTITY_CHANGE_PRORATION = "QUANTITY_CHANGE_PRORATION",
3436
+ /** Custom adjustment provided by the caller. */
3437
+ CUSTOM_PRICE_ADJUSTMENT = "CUSTOM_PRICE_ADJUSTMENT"
3329
3438
  }
3330
- interface CreateSubscriptionForOrderRequest {
3331
- /** Subscription needs to be created */
3332
- subscription?: Subscription;
3439
+ /** @enumType */
3440
+ type PriceAdjustmentReasonWithLiterals = PriceAdjustmentReason | 'PRICE_ADJUSTMENT_REASON_UNSPECIFIED' | 'BILLING_DATE_CHANGE' | 'PLAN_CHANGE_PRORATION' | 'CYCLE_CHANGE_PRORATION' | 'QUANTITY_CHANGE_PRORATION' | 'CUSTOM_PRICE_ADJUSTMENT';
3441
+ interface InvoiceShippingCharges {
3333
3442
  /**
3334
- * Optional unique identifier for this request in order to prevent subscription duplications
3335
- * @format GUID
3443
+ * Amount of the shipping fee in `0.00` format.
3444
+ *
3445
+ * Min: `0.01`
3446
+ * @decimalValue options { gte:0.00, maxScale:2 }
3336
3447
  */
3337
- idempotencyKey?: string | null;
3448
+ amount?: string;
3449
+ /** Tax of the shipping fee */
3450
+ tax?: Tax;
3451
+ /** Information about the shipping charges tax data */
3452
+ taxData?: ItemTaxData;
3453
+ discount?: Discount;
3338
3454
  }
3339
- interface CreateSubscriptionForOrderResponse {
3340
- /** Created subscription */
3341
- subscription?: Subscription;
3342
- /** Non-persistent invoice */
3343
- invoice?: Invoice;
3455
+ /** Tax data from all items */
3456
+ interface TaxData {
3457
+ /** Aggregated tax data from all items */
3458
+ taxSummary?: TaxSummary;
3344
3459
  }
3345
- /** An invoice includes information about the subscription and the customer. */
3346
- interface Invoice {
3347
- /**
3348
- * Invoice ID.
3349
- * @format GUID
3350
- * @readonly
3351
- */
3352
- _id?: string | null;
3460
+ interface TaxSummary {
3353
3461
  /**
3354
- * Date and time the invoice was created.
3355
- * @readonly
3462
+ * Aggregated from tax_breakdowns with exemptions excluded from amount
3463
+ * @format DECIMAL_VALUE
3356
3464
  */
3357
- _createdDate?: Date | null;
3465
+ aggregatedTaxAmount?: string;
3358
3466
  /**
3359
- * Date and time the invoice was last updated.
3360
- * @readonly
3467
+ * Array of each tax applied, grouped by `"jurisdiction"`, `"jurisdiction_type"`, `"tax_type"`, `"tax_name"` and `"tax_rate"`.
3468
+ * @maxSize 50
3361
3469
  */
3362
- _updatedDate?: Date | null;
3470
+ aggregatedTaxBreakdowns?: AggregatedTaxBreakdown[];
3363
3471
  /**
3364
- * Revision number, which increments by 1 each time the invoice is updated.
3365
- * To prevent conflicting changes,
3366
- * the current revision must be passed when updating the invoice.
3367
- *
3368
- * Ignored when creating a invoice.
3369
- * @readonly
3472
+ * Tax amount the merchant is NOT collecting because the customer is responsible for paying the authority directly (reverse charge / exempt). Optional; absence is treated as zero.
3473
+ * @format DECIMAL_VALUE
3474
+ * @decimalValue options { maxScale:4 }
3370
3475
  */
3371
- revision?: string | null;
3372
- /** Information about the invoice origin. */
3373
- origin?: BusinessOriginData;
3476
+ exemptAmount?: string | null;
3477
+ }
3478
+ interface AggregatedTaxBreakdown {
3374
3479
  /**
3375
- * Invoice status.
3376
- *
3377
- * + `"UNKNOWN"`: There is no information about the invoice status.
3378
- * + `"OPEN"`: BASS has created the invoice but hasn't initiated the payment process.
3379
- * + `"PAID"`: The customer has successfully paid for the invoice.
3380
- * + `"ATTEMPT_FAILED"`: The payment process has started and there has been at least one unsuccessful payment attempt.
3381
- * + `"FAILED"`: The payment process has failed and there are no more retries.
3382
- * + `"CANCELED"`: The payment process has been stopped because the related subscription has been canceled.
3383
- * @readonly
3480
+ * Name of the tax that was calculated.
3481
+ * @maxLength 200
3384
3482
  */
3385
- status?: InvoiceStatusWithLiterals;
3483
+ taxName?: string;
3386
3484
  /**
3387
- * 3-letter currency code of the invoice in
3388
- * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
3389
- * @format CURRENCY
3485
+ * Type of tax that was calculated.
3486
+ * @maxLength 200
3390
3487
  */
3391
- currency?: string;
3392
- /** Information about the customer. */
3393
- customer?: Customer;
3488
+ taxType?: string;
3394
3489
  /**
3395
- * Whether the payment is processed through Wix and whether the customer must provide some input.
3396
- *
3397
- * + `"UNKNOWN"`: There is no information about the collection method.
3398
- * + `"AUTO_CHARGE"`: The customer pays automatically through Wix.
3399
- * + `"SEND_INVOICE"`: The customer pays through Wix, but some manual input is required.
3400
- * + `"OFFLINE"`: The customer pays outside of Wix.
3490
+ * Jurisdiction that taxes were calculated for.
3491
+ * @maxLength 200
3401
3492
  */
3402
- collectionMethod?: CollectionMethodWithLiterals;
3493
+ jurisdiction?: string;
3494
+ /** Type of jurisdiction that taxes were calculated for. */
3495
+ jurisdictionType?: string;
3403
3496
  /**
3404
- * ID of the
3405
- * [payment method](https://bo.wix.com/wix-docs/rest/wix-cashier/settings/payment-method-type/payment-method-type-object).
3406
- * Not available for the first payment of a subscription and all offline
3407
- * payments.
3408
- * @format GUID
3497
+ * Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`.
3498
+ * @decimalValue options { gte:0, maxScale:6 }
3409
3499
  */
3410
- paymentMethodId?: string | null;
3500
+ rate?: string;
3411
3501
  /**
3412
- * Cashier [Order ID](https://dev.wix.com/docs/rest/payments/wix-cashier/pay/order#order-object)
3413
- * for the corresponding payment.
3414
- * @format GUID
3415
- * @readonly
3502
+ * Total amount of this tax for this jurisdiction.
3503
+ * @format DECIMAL_VALUE
3504
+ * @decimalValue options { maxScale:4 }
3416
3505
  */
3417
- paymentOrderId?: string | null;
3418
- /** Information about a discount. Available only for invoices that include a discount. */
3419
- discount?: InvoiceDiscount;
3420
- /** Billing address. */
3421
- billingAddress?: FullAddressDetails;
3422
- /** Shipping address. Available only for `"PHYSICAL"` line items. */
3423
- shippingAddress?: FullAddressDetails;
3506
+ aggregatedTaxAmount?: string;
3507
+ }
3508
+ interface RefundInfo {
3424
3509
  /**
3425
- * Shipping fee in `0.00` format.
3510
+ * If refunds are present, this will include the total amount refunded.
3426
3511
  * @format DECIMAL_VALUE
3512
+ * @decimalValue options { gte:0.00, maxScale:2 }
3427
3513
  */
3428
- shippingFee?: string | null;
3514
+ totalRefundAmount?: string | null;
3429
3515
  /**
3430
- * Information about the invoice's totals.
3431
- * @readonly
3516
+ * The refunds that have been applied to this invoice
3517
+ * @maxSize 20
3432
3518
  */
3433
- totals?: Totals;
3434
- /** Line items belonging to the invoice. */
3435
- invoiceItems?: InvoiceItem[];
3519
+ refunds?: Refund[];
3520
+ }
3521
+ interface Refund {
3436
3522
  /**
3437
- * Whether the invoice is used to validate payment details.
3438
- *
3439
- * + `true`: BASS uses the invoice to test payment details. Relevant for free trials. Ensures that Wix can collect the payment of the first billing cycle.
3440
- * + `false`: Standard invoice.
3523
+ * refund amount
3524
+ * @format DECIMAL_VALUE
3525
+ * @decimalValue options { gt:0.00, maxScale:2 }
3441
3526
  */
3442
- isAuthorization?: boolean | null;
3443
- /** Whether the invoice's `totals.totalPrice` includes tax. */
3444
- isTaxInclusive?: boolean | null;
3445
- /** Details of the latest payment attempt. */
3446
- latestPaymentAttempt?: LatestPaymentAttempt;
3447
- /** List of charges and credits that adjust the invoice's `totals.totalPrice`. */
3448
- adjustments?: PriceAdjustment[];
3527
+ amount?: string;
3528
+ /** the date of the refund transaction */
3529
+ transactionDate?: Date | null;
3449
3530
  /**
3450
- * Invoice Number.
3451
- * @maxLength 10
3452
- * @readonly
3531
+ * the transaction id associated with this refund
3532
+ * @format GUID
3453
3533
  */
3454
- invoiceNumber?: string | null;
3534
+ transactionId?: string;
3535
+ /** a reason for the refund */
3536
+ reason?: RefundReasonWithLiterals;
3455
3537
  /**
3456
- * Shipping charges for the invoice.
3457
- * Supports only one discount without cycles.
3458
- * Discounts with cycles (repeated discounts across different billing cycles) are not supported for shipping
3538
+ * a description of the refund - this is a free text field for the initiator
3539
+ * @maxLength 255
3459
3540
  */
3460
- shippingCharges?: InvoiceShippingCharges;
3461
- /** Information about the invoice tax */
3462
- taxData?: TaxData;
3463
- /** Business address. */
3464
- businessAddress?: Address;
3541
+ description?: string | null;
3542
+ }
3543
+ declare enum RefundReason {
3544
+ DUPLICATE_CHARGE = "DUPLICATE_CHARGE",
3545
+ FRAUDULENT = "FRAUDULENT",
3546
+ CUSTOMER_REQUEST = "CUSTOMER_REQUEST",
3547
+ PROVISION_FAILED = "PROVISION_FAILED",
3548
+ OTHER = "OTHER"
3549
+ }
3550
+ /** @enumType */
3551
+ type RefundReasonWithLiterals = RefundReason | 'DUPLICATE_CHARGE' | 'FRAUDULENT' | 'CUSTOMER_REQUEST' | 'PROVISION_FAILED' | 'OTHER';
3552
+ interface ChangeSubscriptionRequest {
3465
3553
  /**
3466
- * ID of the billing order that created this invoice.
3554
+ * ID of the subscription to change
3467
3555
  * @format GUID
3468
3556
  */
3469
- orderId?: string | null;
3557
+ subscriptionId?: string;
3470
3558
  /**
3471
- * Platform origin the invoice is originated from.
3472
- * @format GUID
3559
+ * Item-level changes. Each entry targets one existing item by ID.
3560
+ * Caller passes CONCRETE new values (price, quantity, name) — BASS does not resolve pricing.
3561
+ * BASS uses these for proration: old values (from subscription) vs new values (from here).
3473
3562
  */
3474
- platformOriginAppId?: string | null;
3563
+ itemChanges?: SubscriptionItemChange[];
3475
3564
  /**
3476
- * Refund information, provided that there are refunds for this invoice.
3477
- * @readonly
3565
+ * Subscription-level: new billing cycle (e.g., monthly to yearly).
3566
+ * Affects the billing period for ALL items.
3567
+ * When changing cycle, caller MUST also pass new prices in item_changes.
3478
3568
  */
3479
- refundInfo?: RefundInfo;
3569
+ newCycle?: Duration;
3570
+ /** When the change takes effect. */
3571
+ effectiveTime?: ChangeEffectiveTimeWithLiterals;
3572
+ /** How to handle proration for immediate changes. Ignored for AT_NEXT_RENEWAL. */
3573
+ prorationBehavior?: ProrationBehaviorEnumProrationBehaviorWithLiterals;
3574
+ /** Payment context for immediate changes without checkout flow. */
3575
+ paymentContext?: ChangePaymentContext;
3480
3576
  }
3481
- interface BusinessOriginData {
3577
+ declare enum ProrationBehaviorEnumProrationBehavior {
3578
+ UNKNOWN = "UNKNOWN",
3579
+ /** Credit unused time + charge new prorated price (default for upgrades) */
3580
+ PRORATE_AND_CHARGE = "PRORATE_AND_CHARGE",
3581
+ /** Credit unused time + refund to payment method (downgrades) */
3582
+ PRORATE_AND_REFUND = "PRORATE_AND_REFUND",
3583
+ /** Convert unused value to extra days, no financial transaction */
3584
+ PRORATE_AND_EXTEND = "PRORATE_AND_EXTEND",
3585
+ /** Immediate switch with no financial adjustment */
3586
+ NO_PRORATION = "NO_PRORATION"
3587
+ }
3588
+ /** @enumType */
3589
+ type ProrationBehaviorEnumProrationBehaviorWithLiterals = ProrationBehaviorEnumProrationBehavior | 'UNKNOWN' | 'PRORATE_AND_CHARGE' | 'PRORATE_AND_REFUND' | 'PRORATE_AND_EXTEND' | 'NO_PRORATION';
3590
+ /** Payment context for immediate subscription changes without the checkout flow. */
3591
+ interface ChangePaymentContext {
3592
+ /** Payment settings override for this change */
3593
+ paymentSettings?: PaymentSettings;
3594
+ }
3595
+ interface ChangeSubscriptionResponse {
3596
+ /** Updated subscription */
3597
+ subscription?: Subscription;
3598
+ /** Proration calculation result. Present for immediate changes with proration. */
3599
+ prorationResult?: V1ProrationResult;
3482
3600
  /**
3483
- * ID of the app for which BASS has created the invoice. For example,
3484
- * `"1380b703-ce81-ff05-f115-39571d94dfcd"` for the Wix eCommerce app.
3601
+ * ID of the adjustment invoice created for the proration charge or refund.
3485
3602
  * @format GUID
3486
3603
  */
3487
- appId?: string;
3604
+ adjustmentInvoiceId?: string | null;
3605
+ }
3606
+ /** Result of a proration calculation applied during a subscription change. */
3607
+ interface V1ProrationResult {
3488
3608
  /**
3489
- * [Instance ID](https://dev.wix.com/api/rest/app-management/apps/app-instance/get-app-instance)
3490
- * of the app for which BASS has created the invoice.
3491
- * @format GUID
3609
+ * Credit amount for unused time on the current plan
3610
+ * @format DECIMAL_VALUE
3492
3611
  */
3493
- instanceId?: string;
3612
+ creditAmount?: string;
3494
3613
  /**
3495
- * ID of the entity that triggered the invoice creation. For example, the ID of a
3496
- * [pricing plan](https://dev.wix.com/docs/rest/payments/pricing-plans/pricing-plans/plan#plan-object).
3614
+ * Charge amount for the new plan's prorated price
3615
+ * @format DECIMAL_VALUE
3616
+ */
3617
+ chargeAmount?: string;
3618
+ /**
3619
+ * Net amount (charge minus credit). Positive means customer pays, negative means refund.
3620
+ * @format DECIMAL_VALUE
3621
+ */
3622
+ netAmount?: string;
3623
+ /** Date when the proration was calculated */
3624
+ prorationDate?: Date | null;
3625
+ /** Remaining seconds in the current billing period at time of change */
3626
+ remainingSeconds?: string;
3627
+ /** Total seconds in the current billing cycle */
3628
+ totalCycleSeconds?: string;
3629
+ }
3630
+ interface PreviewChangeSubscriptionRequest {
3631
+ /**
3632
+ * ID of the subscription to preview the change for
3497
3633
  * @format GUID
3498
3634
  */
3499
- entityId?: string;
3635
+ subscriptionId?: string;
3636
+ /** Item-level changes to preview. Same structure as ChangeSubscriptionRequest. */
3637
+ itemChanges?: SubscriptionItemChange[];
3638
+ /** Subscription-level: preview a cycle change. */
3639
+ newCycle?: Duration;
3640
+ /** When the change would take effect. */
3641
+ effectiveTime?: ChangeEffectiveTimeWithLiterals;
3642
+ /** How proration would be handled for immediate changes. */
3643
+ prorationBehavior?: ProrationBehaviorEnumProrationBehaviorWithLiterals;
3500
3644
  }
3501
- declare enum InvoiceStatus {
3502
- UNKNOWN = "UNKNOWN",
3503
- OPEN = "OPEN",
3504
- PAID = "PAID",
3505
- FAILED = "FAILED",
3506
- ATTEMPT_FAILED = "ATTEMPT_FAILED",
3507
- CANCELED = "CANCELED",
3508
- REFUNDED = "REFUNDED",
3509
- CHARGEBACKED = "CHARGEBACKED"
3645
+ interface CancelPendingChangeRequest {
3646
+ /**
3647
+ * ID of the subscription to cancel the pending change for
3648
+ * @format GUID
3649
+ */
3650
+ subscriptionId?: string;
3510
3651
  }
3511
- /** @enumType */
3512
- type InvoiceStatusWithLiterals = InvoiceStatus | 'UNKNOWN' | 'OPEN' | 'PAID' | 'FAILED' | 'ATTEMPT_FAILED' | 'CANCELED' | 'REFUNDED' | 'CHARGEBACKED';
3513
- declare enum CollectionMethod {
3514
- UNKNOWN = "UNKNOWN",
3515
- AUTO_CHARGE = "AUTO_CHARGE",
3516
- OFFLINE = "OFFLINE",
3517
- SEND_INVOICE = "SEND_INVOICE"
3652
+ interface CancelPendingChangeResponse {
3653
+ /** Updated subscription with cleared pending data */
3654
+ subscription?: Subscription;
3518
3655
  }
3519
- /** @enumType */
3520
- type CollectionMethodWithLiterals = CollectionMethod | 'UNKNOWN' | 'AUTO_CHARGE' | 'OFFLINE' | 'SEND_INVOICE';
3521
- declare enum CreationMode {
3522
- UNKNOWN = "UNKNOWN",
3523
- SYSTEM = "SYSTEM",
3524
- MANUAL = "MANUAL"
3656
+ interface ChangeSubscriptionForOrderRequest {
3657
+ /** The new subscription definition from the order (items, billing settings). */
3658
+ subscription?: Subscription;
3659
+ /** Context of the change: source subscription, change type, proration behavior. */
3660
+ changeContext?: ChangeContext;
3525
3661
  }
3526
- /** @enumType */
3527
- type CreationModeWithLiterals = CreationMode | 'UNKNOWN' | 'SYSTEM' | 'MANUAL';
3528
- interface LatestPaymentAttempt {
3662
+ /**
3663
+ * Context for subscription changes within the order/checkout flow.
3664
+ * Carries the source subscription reference and change parameters.
3665
+ * Present on an OrderSubscription when it represents a modification of an
3666
+ * existing subscription rather than a new purchase.
3667
+ */
3668
+ interface ChangeContext {
3529
3669
  /**
3530
- * ID of the latest payment attempt.
3670
+ * ID of the existing subscription being changed.
3531
3671
  * @format GUID
3532
- * @readonly
3533
3672
  */
3534
- paymentAttemptId?: string;
3673
+ sourceSubscriptionId?: string;
3674
+ /** Type of change being performed. */
3675
+ changeType?: ChangeTypeWithLiterals;
3676
+ /** How proration should be handled. */
3677
+ prorationBehavior?: ProrationBehaviorWithLiterals;
3535
3678
  /**
3536
- * Date and time of the latest payment attempt in `YYYY-MM-DDThh:mm.sssZ` format.
3537
- * @readonly
3679
+ * System-populated: proration result after calculation.
3680
+ * Populated by billing-subscriptions during order processing.
3538
3681
  */
3539
- dateAttempt?: Date | null;
3540
- /** Number of the latest payment attempt. */
3541
- attemptNumber?: number;
3682
+ prorationResult?: ProrationResult;
3683
+ }
3684
+ declare enum ChangeType {
3685
+ CHANGE_TYPE_UNKNOWN = "CHANGE_TYPE_UNKNOWN",
3686
+ UPGRADE = "UPGRADE",
3687
+ DOWNGRADE = "DOWNGRADE",
3688
+ CYCLE_CHANGE = "CYCLE_CHANGE",
3689
+ QUANTITY_CHANGE = "QUANTITY_CHANGE"
3690
+ }
3691
+ /** @enumType */
3692
+ type ChangeTypeWithLiterals = ChangeType | 'CHANGE_TYPE_UNKNOWN' | 'UPGRADE' | 'DOWNGRADE' | 'CYCLE_CHANGE' | 'QUANTITY_CHANGE';
3693
+ declare enum ProrationBehavior {
3694
+ PRORATION_BEHAVIOR_UNKNOWN = "PRORATION_BEHAVIOR_UNKNOWN",
3695
+ /** Credit unused time + charge new prorated price (default for upgrades) */
3696
+ PRORATE_AND_CHARGE = "PRORATE_AND_CHARGE",
3697
+ /** Credit unused time + refund to payment method (downgrades) */
3698
+ PRORATE_AND_REFUND = "PRORATE_AND_REFUND",
3699
+ /** Convert unused value to extra days, no financial transaction */
3700
+ PRORATE_AND_EXTEND = "PRORATE_AND_EXTEND",
3701
+ /** Immediate switch with no financial adjustment */
3702
+ NO_PRORATION = "NO_PRORATION"
3703
+ }
3704
+ /** @enumType */
3705
+ type ProrationBehaviorWithLiterals = ProrationBehavior | 'PRORATION_BEHAVIOR_UNKNOWN' | 'PRORATE_AND_CHARGE' | 'PRORATE_AND_REFUND' | 'PRORATE_AND_EXTEND' | 'NO_PRORATION';
3706
+ /**
3707
+ * Result of a proration calculation. Contains the credit, charge, and net amounts
3708
+ * computed during a subscription change.
3709
+ */
3710
+ interface ProrationResult {
3542
3711
  /**
3543
- * Status of the latest payment attempt.
3544
- *
3545
- * + `"UNKNOWN"`: There is no information about the status of the latest payment attempt.
3546
- * + `"SCHEDULED"`: The latest payment attempt is scheduled but hasn't started yet.
3547
- * + `"IN_PROGRESS"`: The latest payment attempt is in progress.
3548
- * + `"PAID"`: The latest payment attempt resulted in a successful payment.
3549
- * + `"DECLINED"`: The latest payment attempt has been declined.
3550
- * + `"TECHNICAL_FAILURE"`: The latest payment attempt couldn't be process due to a technical failure.
3551
- * + `"CANCELED"`: The latest payment attempt has been canceled by BASS.
3552
- * @readonly
3712
+ * Credit amount for unused time on the current plan
3713
+ * @format DECIMAL_VALUE
3553
3714
  */
3554
- status?: PaymentAttemptStatusWithLiterals;
3715
+ creditAmount?: string;
3555
3716
  /**
3556
- * Whether BASS tries to collect the payment another time. Available only when
3557
- * `latestPaymentAttempt.status` is set to `"DECLINED"`.
3717
+ * Charge amount for the new plan's prorated price
3718
+ * @format DECIMAL_VALUE
3558
3719
  */
3559
- retryable?: boolean;
3720
+ chargeAmount?: string;
3560
3721
  /**
3561
- * Platform fee that was collected on this transaction.
3722
+ * Net amount (charge minus credit). Positive means customer pays, negative means refund.
3562
3723
  * @format DECIMAL_VALUE
3563
- * @decimalValue options { gte:0.00, maxScale:2 }
3564
- * @readonly
3565
3724
  */
3566
- appliedPlatformFee?: string | null;
3725
+ netAmount?: string;
3726
+ /** Date when the proration was calculated */
3727
+ prorationDate?: Date | null;
3728
+ /** Remaining seconds in the current billing period at time of change */
3729
+ remainingSeconds?: string;
3730
+ /** Total seconds in the current billing cycle */
3731
+ totalCycleSeconds?: string;
3567
3732
  }
3568
- declare enum PaymentAttemptStatus {
3569
- UNKNOWN = "UNKNOWN",
3570
- SCHEDULED = "SCHEDULED",
3571
- IN_PROGRESS = "IN_PROGRESS",
3572
- PAID = "PAID",
3573
- DECLINED = "DECLINED",
3574
- TECHNICAL_FAILURE = "TECHNICAL_FAILURE",
3575
- CANCELED = "CANCELED",
3576
- PENDING = "PENDING",
3577
- REFUNDED = "REFUNDED",
3578
- CHARGEBACKED = "CHARGEBACKED"
3733
+ interface ChangeSubscriptionForOrderResponse {
3734
+ /** The source subscription (unchanged, for reference). */
3735
+ subscription?: Subscription;
3736
+ /** Non-persistent invoice with proration adjustments. */
3737
+ invoice?: Invoice;
3738
+ /** Calculated proration result. */
3739
+ prorationResult?: ProrationResult;
3579
3740
  }
3580
- /** @enumType */
3581
- type PaymentAttemptStatusWithLiterals = PaymentAttemptStatus | 'UNKNOWN' | 'SCHEDULED' | 'IN_PROGRESS' | 'PAID' | 'DECLINED' | 'TECHNICAL_FAILURE' | 'CANCELED' | 'PENDING' | 'REFUNDED' | 'CHARGEBACKED';
3582
- interface PriceAdjustment extends PriceAdjustmentAdjustmentTypeOneOf {
3583
- /** Adjustment that increases the price. */
3584
- charge?: PriceAdjustmentValue;
3585
- /** Adjustment that lowers the price. */
3586
- credit?: PriceAdjustmentValue;
3587
- /** Reason for this price adjustment. Used to categorize proration adjustments. */
3588
- reason?: PriceAdjustmentReasonWithLiterals;
3741
+ interface Task {
3742
+ key?: TaskKey;
3743
+ executeAt?: Date | null;
3744
+ payload?: string | null;
3745
+ }
3746
+ interface TaskKey {
3747
+ appId?: string;
3748
+ instanceId?: string;
3749
+ subjectId?: string | null;
3750
+ }
3751
+ interface TaskAction extends TaskActionActionOneOf {
3752
+ complete?: Complete;
3753
+ cancel?: Cancel;
3754
+ reschedule?: Reschedule;
3589
3755
  }
3590
3756
  /** @oneof */
3591
- interface PriceAdjustmentAdjustmentTypeOneOf {
3592
- /** Adjustment that increases the price. */
3593
- charge?: PriceAdjustmentValue;
3594
- /** Adjustment that lowers the price. */
3595
- credit?: PriceAdjustmentValue;
3757
+ interface TaskActionActionOneOf {
3758
+ complete?: Complete;
3759
+ cancel?: Cancel;
3760
+ reschedule?: Reschedule;
3596
3761
  }
3597
- interface PriceAdjustmentValue extends PriceAdjustmentValueAdjustmentValueTypeOneOf {
3762
+ interface Complete {
3763
+ }
3764
+ interface Cancel {
3765
+ }
3766
+ interface Reschedule {
3767
+ executeAt?: Date | null;
3768
+ payload?: string | null;
3769
+ }
3770
+ interface Empty {
3771
+ }
3772
+ interface V1SubscriptionEvent extends V1SubscriptionEventEventOneOf {
3773
+ /** A subscriptions was created */
3774
+ created?: V1SubscriptionCreated;
3775
+ /** Subscription is considered active and will be visible to site owners and members */
3776
+ activated?: V1SubscriptionActivated;
3598
3777
  /**
3599
- * Absolute amount that adjusts the price.
3600
- *
3601
- * Min: `0.01`
3602
- * @decimalValue options { gt:0.00 }
3778
+ * Subscription was canceled either by cancellation request with requested expiration date NOW or by payment provider.
3779
+ * If cancelled by payment provider subscription will be valid until the date calculated depending on how many cycles it was already paid for.
3603
3780
  */
3604
- amount?: string;
3781
+ canceled?: V1SubscriptionCanceled;
3782
+ /** Subscription was updated. Currently the only possible change is valid_until date */
3783
+ updated?: V1SubscriptionUpdated;
3784
+ /** Subscription cycle has started. Currently the cycle starts when a payment is received. */
3785
+ cycleTriggered?: SubscriptionCycleTriggered;
3786
+ /** Offline subscription was marked as paid */
3787
+ markedAsPaid?: SubscriptionMarkedAsPaid;
3605
3788
  /**
3606
- * Relative factor that adjusts the price. For example, setting
3607
- * `multiplier` to:
3608
- * - `0.50` results in a price adjustment of 50% of the original value.
3609
- * - `0.75` results in a price adjustment of 75% of the original value.
3610
- * - `1.00` results in a price adjustment of 100% of the original value.
3611
- *
3612
- * Min: `0.01`
3613
- * Max: `1.00`
3614
- * @decimalValue options { gt:0.00, lte:1 }
3789
+ * Subscription cancellation for the future date was requested.
3790
+ * Subscription will stay in pending cancellation status until the date calculated depending on free trial and the next payment date.
3615
3791
  */
3616
- multiplier?: string;
3792
+ cancellationRequested?: SubscriptionCancellationRequested;
3793
+ /** Subscription and it's payment schedule (for recurring) was suspended */
3794
+ suspended?: SubscriptionSuspended;
3795
+ /** Previously suspended subscription and it's payment schedule (for recurring) was resumed */
3796
+ resumed?: V1SubscriptionResumed;
3797
+ /** Subscription expired according to valid_until expiration date. */
3798
+ expired?: SubscriptionExpired;
3799
+ /** Subscription initial purchase completed */
3800
+ initialPurchaseCompleted?: V1SubscriptionInitialPurchaseCompleted;
3617
3801
  }
3618
3802
  /** @oneof */
3619
- interface PriceAdjustmentValueAdjustmentValueTypeOneOf {
3803
+ interface V1SubscriptionEventEventOneOf {
3804
+ /** A subscriptions was created */
3805
+ created?: V1SubscriptionCreated;
3806
+ /** Subscription is considered active and will be visible to site owners and members */
3807
+ activated?: V1SubscriptionActivated;
3620
3808
  /**
3621
- * Absolute amount that adjusts the price.
3622
- *
3623
- * Min: `0.01`
3624
- * @decimalValue options { gt:0.00 }
3809
+ * Subscription was canceled either by cancellation request with requested expiration date NOW or by payment provider.
3810
+ * If cancelled by payment provider subscription will be valid until the date calculated depending on how many cycles it was already paid for.
3625
3811
  */
3626
- amount?: string;
3812
+ canceled?: V1SubscriptionCanceled;
3813
+ /** Subscription was updated. Currently the only possible change is valid_until date */
3814
+ updated?: V1SubscriptionUpdated;
3815
+ /** Subscription cycle has started. Currently the cycle starts when a payment is received. */
3816
+ cycleTriggered?: SubscriptionCycleTriggered;
3817
+ /** Offline subscription was marked as paid */
3818
+ markedAsPaid?: SubscriptionMarkedAsPaid;
3627
3819
  /**
3628
- * Relative factor that adjusts the price. For example, setting
3629
- * `multiplier` to:
3630
- * - `0.50` results in a price adjustment of 50% of the original value.
3631
- * - `0.75` results in a price adjustment of 75% of the original value.
3632
- * - `1.00` results in a price adjustment of 100% of the original value.
3633
- *
3634
- * Min: `0.01`
3635
- * Max: `1.00`
3636
- * @decimalValue options { gt:0.00, lte:1 }
3637
- */
3638
- multiplier?: string;
3639
- }
3640
- /** Reason for a price adjustment. Categorizes different types of proration adjustments. */
3641
- declare enum PriceAdjustmentReason {
3642
- /** Default value. Used for adjustments without a specific categorization. */
3643
- PRICE_ADJUSTMENT_REASON_UNSPECIFIED = "PRICE_ADJUSTMENT_REASON_UNSPECIFIED",
3644
- /** Adjustment due to a billing date change. */
3645
- BILLING_DATE_CHANGE = "BILLING_DATE_CHANGE",
3646
- /** Proration adjustment from changing the subscription plan. */
3647
- PLAN_CHANGE_PRORATION = "PLAN_CHANGE_PRORATION",
3648
- /** Proration adjustment from changing the billing cycle (e.g., monthly to yearly). */
3649
- CYCLE_CHANGE_PRORATION = "CYCLE_CHANGE_PRORATION",
3650
- /** Proration adjustment from changing the subscription quantity. */
3651
- QUANTITY_CHANGE_PRORATION = "QUANTITY_CHANGE_PRORATION",
3652
- /** Custom adjustment provided by the caller. */
3653
- CUSTOM_PRICE_ADJUSTMENT = "CUSTOM_PRICE_ADJUSTMENT"
3654
- }
3655
- /** @enumType */
3656
- type PriceAdjustmentReasonWithLiterals = PriceAdjustmentReason | 'PRICE_ADJUSTMENT_REASON_UNSPECIFIED' | 'BILLING_DATE_CHANGE' | 'PLAN_CHANGE_PRORATION' | 'CYCLE_CHANGE_PRORATION' | 'QUANTITY_CHANGE_PRORATION' | 'CUSTOM_PRICE_ADJUSTMENT';
3657
- interface InvoiceShippingCharges {
3658
- /**
3659
- * Amount of the shipping fee in `0.00` format.
3660
- *
3661
- * Min: `0.01`
3662
- * @decimalValue options { gte:0.00, maxScale:2 }
3820
+ * Subscription cancellation for the future date was requested.
3821
+ * Subscription will stay in pending cancellation status until the date calculated depending on free trial and the next payment date.
3663
3822
  */
3664
- amount?: string;
3665
- /** Tax of the shipping fee */
3666
- tax?: Tax;
3667
- /** Information about the shipping charges tax data */
3668
- taxData?: ItemTaxData;
3669
- discount?: Discount;
3823
+ cancellationRequested?: SubscriptionCancellationRequested;
3824
+ /** Subscription and it's payment schedule (for recurring) was suspended */
3825
+ suspended?: SubscriptionSuspended;
3826
+ /** Previously suspended subscription and it's payment schedule (for recurring) was resumed */
3827
+ resumed?: V1SubscriptionResumed;
3828
+ /** Subscription expired according to valid_until expiration date. */
3829
+ expired?: SubscriptionExpired;
3830
+ /** Subscription initial purchase completed */
3831
+ initialPurchaseCompleted?: V1SubscriptionInitialPurchaseCompleted;
3670
3832
  }
3671
- /** Tax data from all items */
3672
- interface TaxData {
3673
- /** Aggregated tax data from all items */
3674
- taxSummary?: TaxSummary;
3833
+ interface V1SubscriptionCreated {
3834
+ subscription?: V1Subscription;
3675
3835
  }
3676
- interface TaxSummary {
3836
+ interface V1Subscription {
3677
3837
  /**
3678
- * Aggregated from tax_breakdowns with exemptions excluded from amount
3679
- * @format DECIMAL_VALUE
3838
+ * ID of the subscription
3839
+ * @format GUID
3840
+ * @readonly
3680
3841
  */
3681
- aggregatedTaxAmount?: string;
3842
+ _id?: string;
3682
3843
  /**
3683
- * Array of each tax applied, grouped by `"jurisdiction"`, `"jurisdiction_type"`, `"tax_type"`, `"tax_name"` and `"tax_rate"`.
3684
- * @maxSize 50
3844
+ * ID of the app which created the subscription
3845
+ * @format GUID
3685
3846
  */
3686
- aggregatedTaxBreakdowns?: AggregatedTaxBreakdown[];
3687
- }
3688
- interface AggregatedTaxBreakdown {
3847
+ wixAppId?: string;
3689
3848
  /**
3690
- * Name of the tax that was calculated.
3691
- * @maxLength 200
3849
+ * Instance ID of the Subscriptions app
3850
+ * @format GUID
3692
3851
  */
3693
- taxName?: string;
3852
+ tenantId?: string;
3694
3853
  /**
3695
- * Type of tax that was calculated.
3696
- * @maxLength 200
3854
+ * ID of entity in app (e.g. a cart in stores/order in paid plans)
3855
+ * @format GUID
3697
3856
  */
3698
- taxType?: string;
3857
+ originEntityId?: string;
3858
+ /** Site member or a contact who bought the subscription */
3859
+ subscriber?: Subscriber;
3699
3860
  /**
3700
- * Jurisdiction that taxes were calculated for.
3701
- * @maxLength 200
3861
+ * Wix Pay order ID, is empty for free subscriptions
3862
+ * @format GUID
3702
3863
  */
3703
- jurisdiction?: string;
3704
- /** Type of jurisdiction that taxes were calculated for. */
3705
- jurisdictionType?: string;
3864
+ wixPayOrderId?: string | null;
3706
3865
  /**
3707
- * Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`.
3708
- * @decimalValue options { gte:0, maxScale:6 }
3866
+ * Subscription name (e.g. a product or subscription package name)
3867
+ * @maxLength 150
3709
3868
  */
3710
- rate?: string;
3869
+ name?: string;
3711
3870
  /**
3712
- * Total amount of this tax for this jurisdiction.
3713
- * @format DECIMAL_VALUE
3714
- * @decimalValue options { maxScale:4 }
3871
+ * Optional additional subscription description
3872
+ * @maxLength 500
3715
3873
  */
3716
- aggregatedTaxAmount?: string;
3874
+ description?: string;
3875
+ /** Amount to be paid for a single scheduled payment */
3876
+ price?: Money;
3877
+ /** True if the subscription is recurring, false for a single payment subscription */
3878
+ recurring?: boolean;
3879
+ /** Online (paid by subscriber using wix pay) or offline (need to manually mark as paid) */
3880
+ subscriptionType?: SubscriptionTypeWithLiterals;
3881
+ /** Active, expired, canceled, etc. */
3882
+ subscriptionStatus?: V1SubscriptionStatusEnumSubscriptionStatusWithLiterals;
3883
+ /** Subscription start date (may differ from creation date) */
3884
+ validFrom?: Date | null;
3885
+ /** Subscription expiration date */
3886
+ validUntil?: Date | null;
3887
+ /** Status of last payment associated with this subscription */
3888
+ lastPaymentStatus?: PaymentStatusEnumPaymentStatusWithLiterals;
3889
+ /** Payment schedule in the wix pay format. Exists for recurring subscriptions only. */
3890
+ billingProfile?: V2Subscription;
3891
+ /** Owner, member, etc. - present if subscription is canceled */
3892
+ cancellationInitiator?: CancellationInitiatorWithLiterals;
3893
+ /** Optional, present if subscription is canceled */
3894
+ cancellationReason?: string | null;
3895
+ /** Can be used for arbitrary app-specific map<string, string> data */
3896
+ externalData?: Record<string, string>;
3897
+ /** Date when subscription was created (not related to payment dates) */
3898
+ dateCreated?: Date | null;
3899
+ /** Restrictions on possible subscription actions. Default policy has all restrictions enabled. */
3900
+ policy?: SubscriptionPolicy;
3901
+ /** List of subscription suspension periods */
3902
+ suspensions?: Suspension[];
3903
+ /** Initial subscription expiration date that was calculated on the subscription purchase plus duration of suspensions */
3904
+ validUntilDateWithSuspensions?: Date | null;
3905
+ /** Duration of single payment subscription (instead of billing_profile) */
3906
+ singlePaymentDuration?: V1Duration;
3907
+ /** @format GUID */
3908
+ originInstanceId?: string | null;
3717
3909
  }
3718
- interface RefundInfo {
3719
- /**
3720
- * If refunds are present, this will include the total amount refunded.
3721
- * @format DECIMAL_VALUE
3722
- * @decimalValue options { gte:0.00, maxScale:2 }
3723
- */
3724
- totalRefundAmount?: string | null;
3910
+ interface Subscriber {
3725
3911
  /**
3726
- * The refunds that have been applied to this invoice
3727
- * @maxSize 20
3912
+ * Member or contact ID
3913
+ * @format GUID
3728
3914
  */
3729
- refunds?: Refund[];
3915
+ _id?: string;
3916
+ /** Member or contact */
3917
+ identityType?: IdentityTypeWithLiterals;
3730
3918
  }
3731
- interface Refund {
3919
+ declare enum IdentityType {
3920
+ /** Identity type undefined */
3921
+ UNDEFINED = "UNDEFINED",
3922
+ /** Subscription is associated with a member ID */
3923
+ MEMBER = "MEMBER",
3924
+ /** Subscriptions is associated with a contact ID */
3925
+ CONTACT = "CONTACT"
3926
+ }
3927
+ /** @enumType */
3928
+ type IdentityTypeWithLiterals = IdentityType | 'UNDEFINED' | 'MEMBER' | 'CONTACT';
3929
+ /** Price of a payment. Includes amount and currency. */
3930
+ interface Money {
3732
3931
  /**
3733
- * refund amount
3932
+ * Monetary amount i.e. 3.99.
3734
3933
  * @format DECIMAL_VALUE
3735
- * @decimalValue options { gt:0.00, maxScale:2 }
3736
3934
  */
3737
3935
  amount?: string;
3738
- /** the date of the refund transaction */
3739
- transactionDate?: Date | null;
3740
- /**
3741
- * the transaction id associated with this refund
3742
- * @format GUID
3743
- */
3744
- transactionId?: string;
3745
- /** a reason for the refund */
3746
- reason?: RefundReasonWithLiterals;
3747
3936
  /**
3748
- * a description of the refund - this is a free text field for the initiator
3749
- * @maxLength 255
3937
+ * Currency in ISO 4217 format i.e. USD.
3938
+ * @minLength 3
3939
+ * @maxLength 3
3750
3940
  */
3751
- description?: string | null;
3941
+ currency?: string;
3752
3942
  }
3753
- declare enum RefundReason {
3754
- DUPLICATE_CHARGE = "DUPLICATE_CHARGE",
3755
- FRAUDULENT = "FRAUDULENT",
3756
- CUSTOMER_REQUEST = "CUSTOMER_REQUEST",
3757
- PROVISION_FAILED = "PROVISION_FAILED",
3758
- OTHER = "OTHER"
3943
+ declare enum SubscriptionType {
3944
+ UNDEFINED = "UNDEFINED",
3945
+ /** Payments made by the subscriber */
3946
+ ONLINE = "ONLINE",
3947
+ /** Payments managed manually by the site owner */
3948
+ OFFLINE = "OFFLINE"
3759
3949
  }
3760
3950
  /** @enumType */
3761
- type RefundReasonWithLiterals = RefundReason | 'DUPLICATE_CHARGE' | 'FRAUDULENT' | 'CUSTOMER_REQUEST' | 'PROVISION_FAILED' | 'OTHER';
3762
- interface ChangeSubscriptionRequest {
3763
- /**
3764
- * ID of the subscription to change
3765
- * @format GUID
3766
- */
3767
- subscriptionId?: string;
3768
- /**
3769
- * Item-level changes. Each entry targets one existing item by ID.
3770
- * Caller passes CONCRETE new values (price, quantity, name) — BASS does not resolve pricing.
3771
- * BASS uses these for proration: old values (from subscription) vs new values (from here).
3772
- */
3773
- itemChanges?: SubscriptionItemChange[];
3774
- /**
3775
- * Subscription-level: new billing cycle (e.g., monthly to yearly).
3776
- * Affects the billing period for ALL items.
3777
- * When changing cycle, caller MUST also pass new prices in item_changes.
3778
- */
3779
- newCycle?: Duration;
3780
- /** When the change takes effect. */
3781
- effectiveTime?: ChangeEffectiveTimeWithLiterals;
3782
- /** How to handle proration for immediate changes. Ignored for AT_NEXT_RENEWAL. */
3783
- prorationBehavior?: ProrationBehaviorWithLiterals;
3784
- /** Payment context for immediate changes without checkout flow. */
3785
- paymentContext?: ChangePaymentContext;
3951
+ type SubscriptionTypeWithLiterals = SubscriptionType | 'UNDEFINED' | 'ONLINE' | 'OFFLINE';
3952
+ declare enum V1SubscriptionStatusEnumSubscriptionStatus {
3953
+ /** Subscription status undefined */
3954
+ UNDEFINED = "UNDEFINED",
3955
+ /** Subscription created, but hasn't been paid for yet. This status if filtered out in ListSubscriptions response by default. */
3956
+ DRAFT = "DRAFT",
3957
+ /** Subscription has been paid for, but the start date is in the future */
3958
+ PENDING = "PENDING",
3959
+ /** Subscription is active */
3960
+ ACTIVE = "ACTIVE",
3961
+ /** Subscription has expired */
3962
+ EXPIRED = "EXPIRED",
3963
+ /** Subscription has been canceled */
3964
+ CANCELED = "CANCELED",
3965
+ /** Subscription has been set to be canceled at a future date */
3966
+ PENDING_CANCELLATION = "PENDING_CANCELLATION",
3967
+ /** Subscription is suspended */
3968
+ SUSPENDED = "SUSPENDED"
3786
3969
  }
3787
- /**
3788
- * Describes a change to a single subscription item.
3789
- * The caller (BG/CVS) resolves pricing from their catalog and passes concrete values.
3790
- */
3791
- interface SubscriptionItemChange {
3792
- /**
3793
- * Which item to change. Must match an existing item ID in the subscription.
3794
- * @format GUID
3795
- */
3796
- itemId?: string;
3797
- /**
3798
- * New price per unit. Caller resolves this from their product catalog.
3799
- * Required when changing product/plan. Optional for quantity-only changes (uses current price).
3800
- * @decimalValue options { gte:0.00, maxScale:2 }
3801
- */
3802
- newPrice?: string | null;
3803
- /**
3804
- * New quantity (seats/licenses). Optional unchanged if not set.
3805
- * @min 1
3806
- */
3807
- newQuantity?: number | null;
3970
+ /** @enumType */
3971
+ type V1SubscriptionStatusEnumSubscriptionStatusWithLiterals = V1SubscriptionStatusEnumSubscriptionStatus | 'UNDEFINED' | 'DRAFT' | 'PENDING' | 'ACTIVE' | 'EXPIRED' | 'CANCELED' | 'PENDING_CANCELLATION' | 'SUSPENDED';
3972
+ declare enum PaymentStatusEnumPaymentStatus {
3973
+ /** Payment status undefined */
3974
+ UNDEFINED = "UNDEFINED",
3975
+ /** Payment has been paid */
3976
+ PAID = "PAID",
3977
+ /** Payment has been refunded */
3978
+ REFUNDED = "REFUNDED",
3979
+ /** Recurring payment has failed */
3980
+ FAILED = "FAILED",
3981
+ /** Payment has not been paid */
3982
+ UNPAID = "UNPAID",
3983
+ /** Billing has been initialized, but actual charge is yet to be made. Can happen for free trial and PayPal */
3984
+ PENDING = "PENDING"
3985
+ }
3986
+ /** @enumType */
3987
+ type PaymentStatusEnumPaymentStatusWithLiterals = PaymentStatusEnumPaymentStatus | 'UNDEFINED' | 'PAID' | 'REFUNDED' | 'FAILED' | 'UNPAID' | 'PENDING';
3988
+ /**
3989
+ * Recurring payment is described by `frequency` (day, week, month) and `interval`.
3990
+ *
3991
+ * For example, to create a recurring payment every 14 days, just set `interval` to 14 and frequency to `DAY`.
3992
+ *
3993
+ * In some cases there should be a trial period for the order, after which payments start to occur.
3994
+ * Trial period is also defined as `frequency` and `interval` pair.
3995
+ *
3996
+ * So one can define a monthly 'subscription' with a 14 days trial period.
3997
+ */
3998
+ interface V2Subscription {
3999
+ /** frequency of recurring payment (required) */
4000
+ frequency?: SubscriptionFrequencyWithLiterals;
4001
+ /** interval of recurring payment (required) */
4002
+ interval?: number;
4003
+ /** trial period for recurring payment (optional) */
4004
+ trial?: SubscriptionTrialPeriod;
3808
4005
  /**
3809
- * New catalog reference. Optional set when changing to a different product.
3810
- * This is metadata for the caller's tracking; BASS does not use it for pricing.
4006
+ * how many billing cycles should be done before subscription finishes
4007
+ * (optional, 0 by default means endless subscription)
3811
4008
  */
3812
- newCatalogReference?: CatalogReference;
4009
+ billingCycles?: number;
3813
4010
  /**
3814
- * New item name. Optional set when changing to a different product.
3815
- * @maxLength 200
4011
+ * date in the future or in the past when the first billing cycle begins
4012
+ * (the first off-session payment is performed when it ends)
3816
4013
  */
3817
- newName?: string | null;
4014
+ firstCycleStartDate?: Date | null;
3818
4015
  }
3819
- declare enum ChangeEffectiveTime {
3820
- UNKNOWN = "UNKNOWN",
3821
- /** Apply change immediately with proration */
3822
- IMMEDIATELY = "IMMEDIATELY",
3823
- /** Schedule change for the next billing cycle */
3824
- AT_NEXT_RENEWAL = "AT_NEXT_RENEWAL"
4016
+ /** Frequency unit of recurring payment */
4017
+ declare enum SubscriptionFrequency {
4018
+ UNDEFINED = "UNDEFINED",
4019
+ DAY = "DAY",
4020
+ WEEK = "WEEK",
4021
+ MONTH = "MONTH",
4022
+ YEAR = "YEAR"
3825
4023
  }
3826
4024
  /** @enumType */
3827
- type ChangeEffectiveTimeWithLiterals = ChangeEffectiveTime | 'UNKNOWN' | 'IMMEDIATELY' | 'AT_NEXT_RENEWAL';
3828
- declare enum ProrationBehavior {
3829
- UNKNOWN = "UNKNOWN",
3830
- /** Credit unused time + charge new prorated price (default for upgrades) */
3831
- PRORATE_AND_CHARGE = "PRORATE_AND_CHARGE",
3832
- /** Credit unused time + refund to payment method (downgrades) */
3833
- PRORATE_AND_REFUND = "PRORATE_AND_REFUND",
3834
- /** Convert unused value to extra days, no financial transaction */
3835
- PRORATE_AND_EXTEND = "PRORATE_AND_EXTEND",
3836
- /** Immediate switch with no financial adjustment */
3837
- NO_PRORATION = "NO_PRORATION"
4025
+ type SubscriptionFrequencyWithLiterals = SubscriptionFrequency | 'UNDEFINED' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
4026
+ /** Trial period of subscription */
4027
+ interface SubscriptionTrialPeriod {
4028
+ /** trial period in units (required) */
4029
+ period?: number;
4030
+ /** units in which trial period is described (optional, default DAY) */
4031
+ unit?: SubscriptionFrequencyWithLiterals;
4032
+ }
4033
+ declare enum CancellationInitiator {
4034
+ /** Cancellation initiator undefined */
4035
+ UNDEFINED = "UNDEFINED",
4036
+ /** Subscription was canceled by site owner (default if canceled by user or service identity) */
4037
+ OWNER = "OWNER",
4038
+ /** Subscription was canceled by member (default if canceled by member identity) */
4039
+ MEMBER = "MEMBER",
4040
+ /** Subscription was canceled because of payment failure */
4041
+ PAYMENT_FAILURE = "PAYMENT_FAILURE",
4042
+ /** Subscription was canceled because of payment setup failure */
4043
+ SETUP_FAILURE = "SETUP_FAILURE"
3838
4044
  }
3839
4045
  /** @enumType */
3840
- type ProrationBehaviorWithLiterals = ProrationBehavior | 'UNKNOWN' | 'PRORATE_AND_CHARGE' | 'PRORATE_AND_REFUND' | 'PRORATE_AND_EXTEND' | 'NO_PRORATION';
3841
- /** Payment context for immediate subscription changes without the checkout flow. */
3842
- interface ChangePaymentContext {
3843
- /** Payment settings override for this change */
3844
- paymentSettings?: PaymentSettings;
4046
+ type CancellationInitiatorWithLiterals = CancellationInitiator | 'UNDEFINED' | 'OWNER' | 'MEMBER' | 'PAYMENT_FAILURE' | 'SETUP_FAILURE';
4047
+ interface SubscriptionPolicy {
4048
+ /** Subscription expiration date can be updated */
4049
+ expiryDateChangeable?: boolean;
4050
+ /** Subscription can be cancelled by the member who bought it (when memberId == subscriberId) */
4051
+ cancellableByMember?: boolean;
4052
+ /** Subscription expiration date on cancellation can be set to next payment date */
4053
+ cancellableAtNextPaymentCycle?: boolean;
3845
4054
  }
3846
- interface ChangeSubscriptionResponse {
3847
- /** Updated subscription */
3848
- subscription?: Subscription;
3849
- /** Proration calculation result. Present for immediate changes with proration. */
3850
- prorationResult?: ProrationResult;
3851
- /**
3852
- * ID of the adjustment invoice created for the proration charge or refund.
3853
- * @format GUID
3854
- */
3855
- adjustmentInvoiceId?: string | null;
4055
+ interface Suspension {
4056
+ status?: StatusWithLiterals;
4057
+ /** Beginning of the suspended period */
4058
+ startsAt?: Date | null;
4059
+ /** End of the suspended period */
4060
+ endsAt?: Date | null;
3856
4061
  }
3857
- /** Result of a proration calculation applied during a subscription change. */
3858
- interface ProrationResult {
3859
- /**
3860
- * Credit amount for unused time on the current plan
3861
- * @format DECIMAL_VALUE
3862
- */
3863
- creditAmount?: string;
3864
- /**
3865
- * Charge amount for the new plan's prorated price
3866
- * @format DECIMAL_VALUE
3867
- */
3868
- chargeAmount?: string;
3869
- /**
3870
- * Net amount (charge minus credit). Positive means customer pays, negative means refund.
3871
- * @format DECIMAL_VALUE
3872
- */
3873
- netAmount?: string;
3874
- /** Date when the proration was calculated */
3875
- prorationDate?: Date | null;
3876
- /** Remaining seconds in the current billing period at time of change */
3877
- remainingSeconds?: string;
3878
- /** Total seconds in the current billing cycle */
3879
- totalCycleSeconds?: string;
4062
+ declare enum Status {
4063
+ UNDEFINED = "UNDEFINED",
4064
+ ACTIVE = "ACTIVE",
4065
+ ENDED = "ENDED"
3880
4066
  }
3881
- interface PreviewChangeSubscriptionRequest {
4067
+ /** @enumType */
4068
+ type StatusWithLiterals = Status | 'UNDEFINED' | 'ACTIVE' | 'ENDED';
4069
+ /** A duration expressed in amount of time units. */
4070
+ interface V1Duration {
4071
+ /** Amount of the unit */
4072
+ amount?: number;
4073
+ /** Day, Week, Month, Year. */
4074
+ unit?: SubscriptionFrequencyWithLiterals;
4075
+ }
4076
+ interface V1SubscriptionActivated {
4077
+ subscription?: V1Subscription;
4078
+ }
4079
+ interface V1SubscriptionCanceled {
4080
+ subscription?: V1Subscription;
4081
+ }
4082
+ interface V1SubscriptionUpdated {
4083
+ subscription?: V1Subscription;
4084
+ }
4085
+ interface SubscriptionCycleTriggered {
4086
+ subscription?: V1Subscription;
4087
+ billingCycle?: number;
3882
4088
  /**
3883
- * ID of the subscription to preview the change for
4089
+ * Wix Pay transaction id, optional. Exists if event was triggered by a payment.
3884
4090
  * @format GUID
3885
4091
  */
3886
- subscriptionId?: string;
3887
- /** Item-level changes to preview. Same structure as ChangeSubscriptionRequest. */
3888
- itemChanges?: SubscriptionItemChange[];
3889
- /** Subscription-level: preview a cycle change. */
3890
- newCycle?: Duration;
3891
- /** When the change would take effect. */
3892
- effectiveTime?: ChangeEffectiveTimeWithLiterals;
3893
- /** How proration would be handled for immediate changes. */
3894
- prorationBehavior?: ProrationBehaviorWithLiterals;
4092
+ transactionId?: string | null;
3895
4093
  }
3896
- interface PreviewChangeSubscriptionResponse {
3897
- /** Summary of the current subscription state */
3898
- current?: SubscriptionChangeSummary;
3899
- /** Summary of the proposed subscription state after the change */
3900
- proposed?: SubscriptionChangeSummary;
3901
- /** Proration preview details. Present only for immediate changes. */
3902
- proration?: ProrationPreview;
3903
- /** Renewal preview. Present only for changes at next renewal. */
3904
- renewalPreview?: RenewalPreview;
4094
+ interface SubscriptionMarkedAsPaid {
4095
+ subscription?: V1Subscription;
4096
+ /** A number indicating which payment (cycle) was marked as paid. For recurring subscriptions only. */
4097
+ billingCycle?: number | null;
3905
4098
  }
3906
- /** Summary of a subscription's state, used in change previews. */
3907
- interface SubscriptionChangeSummary {
3908
- /** Product ID */
3909
- productId?: string;
3910
- /** Product name */
3911
- productName?: string;
3912
- /** Billing cycle duration */
3913
- cycle?: Duration;
3914
- /** Number of units */
3915
- quantity?: number;
3916
- /**
3917
- * Price per unit
3918
- * @format DECIMAL_VALUE
3919
- */
3920
- pricePerUnit?: string;
3921
- /**
3922
- * Total price (price_per_unit * quantity)
3923
- * @format DECIMAL_VALUE
3924
- */
3925
- totalPrice?: string;
3926
- /**
3927
- * Currency code (ISO 4217)
3928
- * @format CURRENCY
3929
- */
3930
- currency?: string;
3931
- /** Current billing period start */
3932
- periodStart?: Date | null;
3933
- /** Current billing period end */
3934
- periodEnd?: Date | null;
4099
+ interface SubscriptionCancellationRequested {
4100
+ subscription?: V1Subscription;
3935
4101
  }
3936
- /** Preview of proration amounts for a proposed subscription change. */
3937
- interface ProrationPreview {
3938
- /**
3939
- * Credit amount for unused time on the current plan
3940
- * @format DECIMAL_VALUE
3941
- */
3942
- creditAmount?: string;
3943
- /**
3944
- * Charge amount for the new plan's prorated price
3945
- * @format DECIMAL_VALUE
3946
- */
3947
- chargeAmount?: string;
3948
- /**
3949
- * Net amount (charge minus credit)
3950
- * @format DECIMAL_VALUE
3951
- */
3952
- netAmount?: string;
3953
- /**
3954
- * Tax amount on the net proration
3955
- * @format DECIMAL_VALUE
3956
- */
3957
- taxAmount?: string;
3958
- /**
3959
- * Total amount including tax
3960
- * @format DECIMAL_VALUE
3961
- */
3962
- totalAmount?: string;
3963
- /** Remaining seconds in the current billing period */
3964
- remainingSeconds?: string;
3965
- /** Total seconds in the current billing cycle */
3966
- totalCycleSeconds?: string;
3967
- /** New period end date. Present when proration_behavior is PRORATE_AND_EXTEND. */
3968
- newPeriodEnd?: Date | null;
3969
- /** Number of days added to the billing period. Present when proration_behavior is PRORATE_AND_EXTEND. */
3970
- daysAdded?: number;
3971
- /** The proration action that would be taken */
3972
- action?: ProrationActionWithLiterals;
4102
+ interface SubscriptionSuspended {
4103
+ subscription?: V1Subscription;
3973
4104
  }
3974
- declare enum ProrationAction {
3975
- UNKNOWN = "UNKNOWN",
3976
- /** Net charge to customer */
3977
- CHARGE = "CHARGE",
3978
- /** Net refund to customer */
3979
- REFUND = "REFUND",
3980
- /** Extend billing period instead of refund */
3981
- EXTEND_PERIOD = "EXTEND_PERIOD",
3982
- /** No financial change needed */
3983
- NO_CHANGE = "NO_CHANGE"
4105
+ interface V1SubscriptionResumed {
4106
+ subscription?: V1Subscription;
3984
4107
  }
3985
- /** @enumType */
3986
- type ProrationActionWithLiterals = ProrationAction | 'UNKNOWN' | 'CHARGE' | 'REFUND' | 'EXTEND_PERIOD' | 'NO_CHANGE';
3987
- /** Preview of what the next renewal will look like after a change. */
3988
- interface RenewalPreview {
3989
- /**
3990
- * New price per unit at next renewal
3991
- * @format DECIMAL_VALUE
3992
- */
3993
- newPrice?: string;
3994
- /**
3995
- * New total at next renewal (price * quantity)
3996
- * @format DECIMAL_VALUE
3997
- */
3998
- newTotal?: string;
3999
- /** Date of the next renewal */
4000
- nextRenewalDate?: Date | null;
4108
+ interface SubscriptionExpired {
4109
+ subscription?: V1Subscription;
4001
4110
  }
4002
- interface CancelPendingChangeRequest {
4003
- /**
4004
- * ID of the subscription to cancel the pending change for
4005
- * @format GUID
4006
- */
4111
+ interface V1SubscriptionInitialPurchaseCompleted {
4112
+ subscription?: V1Subscription;
4113
+ }
4114
+ interface CreateSubscriptionInStateRequest extends CreateSubscriptionInStateRequestModeOneOf {
4115
+ activeSubscription?: CreateSubscriptionRequest;
4116
+ }
4117
+ /** @oneof */
4118
+ interface CreateSubscriptionInStateRequestModeOneOf {
4119
+ activeSubscription?: CreateSubscriptionRequest;
4120
+ }
4121
+ interface CreateSubscriptionInStateResponse {
4122
+ /** @format GUID */
4007
4123
  subscriptionId?: string;
4008
4124
  }
4009
- interface CancelPendingChangeResponse {
4010
- /** Updated subscription with cleared pending data */
4125
+ interface PayCycleRequest {
4126
+ /** @format GUID */
4127
+ subscriptionId?: string;
4128
+ paymentTestMode?: PaymentTestModeWithLiterals;
4129
+ /** @format GUID */
4130
+ tenantId?: string;
4131
+ }
4132
+ declare enum PaymentTestMode {
4133
+ REGULAR = "REGULAR",
4134
+ FAIL_TECHNICAL = "FAIL_TECHNICAL",
4135
+ FAIL_DECLINE = "FAIL_DECLINE",
4136
+ FAIL_RETRYABLE_DECLINE = "FAIL_RETRYABLE_DECLINE"
4137
+ }
4138
+ /** @enumType */
4139
+ type PaymentTestModeWithLiterals = PaymentTestMode | 'REGULAR' | 'FAIL_TECHNICAL' | 'FAIL_DECLINE' | 'FAIL_RETRYABLE_DECLINE';
4140
+ interface PayCycleResponse {
4141
+ /** @format GUID */
4142
+ invoiceId?: string;
4143
+ /** @format GUID */
4144
+ paymentOrderId?: string | null;
4011
4145
  subscription?: Subscription;
4012
4146
  }
4013
- interface Task {
4014
- key?: TaskKey;
4015
- executeAt?: Date | null;
4016
- payload?: string | null;
4147
+ interface GetFullSubscriptionDataRequest {
4148
+ /** @format GUID */
4149
+ _id?: string;
4017
4150
  }
4018
- interface TaskKey {
4019
- appId?: string;
4020
- instanceId?: string;
4021
- subjectId?: string | null;
4151
+ interface GetFullSubscriptionDataResponse {
4152
+ subscription?: Subscription;
4153
+ internalSubscriptionData?: InternalSubscriptionData;
4022
4154
  }
4023
- interface TaskAction extends TaskActionActionOneOf {
4024
- complete?: Complete;
4025
- cancel?: Cancel;
4026
- reschedule?: Reschedule;
4155
+ interface InternalSubscriptionData {
4156
+ /** @format GUID */
4157
+ originInstanceId?: string;
4158
+ source?: string | null;
4159
+ billingType?: string;
4160
+ isOneTime?: boolean;
4161
+ migrationDetails?: MigrationDetails;
4162
+ pausePaidDuration?: string | null;
4163
+ authorizationPaymentData?: PaymentData;
4164
+ currentCyclePausePeriods?: PausePeriod[];
4027
4165
  }
4028
- /** @oneof */
4029
- interface TaskActionActionOneOf {
4030
- complete?: Complete;
4031
- cancel?: Cancel;
4032
- reschedule?: Reschedule;
4166
+ interface MigrationDetails {
4167
+ /** system (application) where the Subscription has been created */
4168
+ originSystem?: string;
4169
+ /** date when the Subscription started to be managed in BASS */
4170
+ shiftManagementDate?: Date | null;
4033
4171
  }
4034
- interface Complete {
4172
+ interface PausePeriod {
4173
+ startDate?: Date | null;
4174
+ endDate?: Date | null;
4035
4175
  }
4036
- interface Cancel {
4176
+ interface GetSubscriptionAndInternalDataRequest {
4177
+ /** @format GUID */
4178
+ subscriptionId?: string;
4179
+ /** @format GUID */
4180
+ tenantId?: string;
4037
4181
  }
4038
- interface Reschedule {
4039
- executeAt?: Date | null;
4040
- payload?: string | null;
4182
+ interface GetSubscriptionAndInternalDataResponse {
4183
+ subscription?: Subscription;
4184
+ internalSubscriptionData?: InternalSubscriptionData;
4041
4185
  }
4042
- interface V1SubscriptionEvent extends V1SubscriptionEventEventOneOf {
4043
- /** A subscriptions was created */
4044
- created?: V1SubscriptionCreated;
4045
- /** Subscription is considered active and will be visible to site owners and members */
4046
- activated?: V1SubscriptionActivated;
4047
- /**
4048
- * Subscription was canceled either by cancellation request with requested expiration date NOW or by payment provider.
4049
- * If cancelled by payment provider subscription will be valid until the date calculated depending on how many cycles it was already paid for.
4050
- */
4051
- canceled?: V1SubscriptionCanceled;
4052
- /** Subscription was updated. Currently the only possible change is valid_until date */
4053
- updated?: V1SubscriptionUpdated;
4054
- /** Subscription cycle has started. Currently the cycle starts when a payment is received. */
4055
- cycleTriggered?: SubscriptionCycleTriggered;
4056
- /** Offline subscription was marked as paid */
4057
- markedAsPaid?: SubscriptionMarkedAsPaid;
4058
- /**
4059
- * Subscription cancellation for the future date was requested.
4060
- * Subscription will stay in pending cancellation status until the date calculated depending on free trial and the next payment date.
4061
- */
4062
- cancellationRequested?: SubscriptionCancellationRequested;
4063
- /** Subscription and it's payment schedule (for recurring) was suspended */
4064
- suspended?: SubscriptionSuspended;
4065
- /** Previously suspended subscription and it's payment schedule (for recurring) was resumed */
4066
- resumed?: V1SubscriptionResumed;
4067
- /** Subscription expired according to valid_until expiration date. */
4068
- expired?: SubscriptionExpired;
4069
- /** Subscription initial purchase completed */
4070
- initialPurchaseCompleted?: V1SubscriptionInitialPurchaseCompleted;
4186
+ interface SearchSubscriptionRequest {
4187
+ /** @format GUID */
4188
+ _id?: string;
4189
+ /** @format GUID */
4190
+ tenantId?: string;
4071
4191
  }
4072
- /** @oneof */
4073
- interface V1SubscriptionEventEventOneOf {
4074
- /** A subscriptions was created */
4075
- created?: V1SubscriptionCreated;
4076
- /** Subscription is considered active and will be visible to site owners and members */
4077
- activated?: V1SubscriptionActivated;
4078
- /**
4079
- * Subscription was canceled either by cancellation request with requested expiration date NOW or by payment provider.
4080
- * If cancelled by payment provider subscription will be valid until the date calculated depending on how many cycles it was already paid for.
4081
- */
4082
- canceled?: V1SubscriptionCanceled;
4083
- /** Subscription was updated. Currently the only possible change is valid_until date */
4084
- updated?: V1SubscriptionUpdated;
4085
- /** Subscription cycle has started. Currently the cycle starts when a payment is received. */
4086
- cycleTriggered?: SubscriptionCycleTriggered;
4087
- /** Offline subscription was marked as paid */
4088
- markedAsPaid?: SubscriptionMarkedAsPaid;
4192
+ interface SearchSubscriptionResponse {
4193
+ subscription?: Subscription;
4194
+ }
4195
+ interface UpdatePausePaidDurationRequest {
4196
+ /** @format GUID */
4197
+ subscriptionId?: string;
4089
4198
  /**
4090
- * Subscription cancellation for the future date was requested.
4091
- * Subscription will stay in pending cancellation status until the date calculated depending on free trial and the next payment date.
4199
+ * @min 1
4200
+ * @max 10000000
4092
4201
  */
4093
- cancellationRequested?: SubscriptionCancellationRequested;
4094
- /** Subscription and it's payment schedule (for recurring) was suspended */
4095
- suspended?: SubscriptionSuspended;
4096
- /** Previously suspended subscription and it's payment schedule (for recurring) was resumed */
4097
- resumed?: V1SubscriptionResumed;
4098
- /** Subscription expired according to valid_until expiration date. */
4099
- expired?: SubscriptionExpired;
4100
- /** Subscription initial purchase completed */
4101
- initialPurchaseCompleted?: V1SubscriptionInitialPurchaseCompleted;
4202
+ pausePaidDurationSeconds?: string;
4203
+ /** @format GUID */
4204
+ tenantId?: string;
4102
4205
  }
4103
- interface V1SubscriptionCreated {
4104
- subscription?: V1Subscription;
4206
+ interface UpdatePausePaidDurationResponse {
4105
4207
  }
4106
- interface V1Subscription {
4107
- /**
4108
- * ID of the subscription
4109
- * @format GUID
4110
- * @readonly
4111
- */
4112
- _id?: string;
4113
- /**
4114
- * ID of the app which created the subscription
4115
- * @format GUID
4116
- */
4117
- wixAppId?: string;
4118
- /**
4119
- * Instance ID of the Subscriptions app
4120
- * @format GUID
4121
- */
4208
+ interface UpdateStatusRequest {
4209
+ /** @format GUID */
4210
+ subscriptionId?: string;
4211
+ /** @format GUID */
4122
4212
  tenantId?: string;
4123
- /**
4124
- * ID of entity in app (e.g. a cart in stores/order in paid plans)
4125
- * @format GUID
4126
- */
4127
- originEntityId?: string;
4128
- /** Site member or a contact who bought the subscription */
4129
- subscriber?: Subscriber;
4130
- /**
4131
- * Wix Pay order ID, is empty for free subscriptions
4132
- * @format GUID
4133
- */
4134
- wixPayOrderId?: string | null;
4135
- /**
4136
- * Subscription name (e.g. a product or subscription package name)
4137
- * @maxLength 150
4138
- */
4139
- name?: string;
4140
- /**
4141
- * Optional additional subscription description
4142
- * @maxLength 500
4143
- */
4144
- description?: string;
4145
- /** Amount to be paid for a single scheduled payment */
4146
- price?: Money;
4147
- /** True if the subscription is recurring, false for a single payment subscription */
4148
- recurring?: boolean;
4149
- /** Online (paid by subscriber using wix pay) or offline (need to manually mark as paid) */
4150
- subscriptionType?: SubscriptionTypeWithLiterals;
4151
- /** Active, expired, canceled, etc. */
4152
- subscriptionStatus?: V1SubscriptionStatusEnumSubscriptionStatusWithLiterals;
4153
- /** Subscription start date (may differ from creation date) */
4154
- validFrom?: Date | null;
4155
- /** Subscription expiration date */
4156
- validUntil?: Date | null;
4157
- /** Status of last payment associated with this subscription */
4158
- lastPaymentStatus?: PaymentStatusEnumPaymentStatusWithLiterals;
4159
- /** Payment schedule in the wix pay format. Exists for recurring subscriptions only. */
4160
- billingProfile?: V2Subscription;
4161
- /** Owner, member, etc. - present if subscription is canceled */
4162
- cancellationInitiator?: CancellationInitiatorWithLiterals;
4163
- /** Optional, present if subscription is canceled */
4164
- cancellationReason?: string | null;
4165
- /** Can be used for arbitrary app-specific map<string, string> data */
4166
- externalData?: Record<string, string>;
4167
- /** Date when subscription was created (not related to payment dates) */
4168
- dateCreated?: Date | null;
4169
- /** Restrictions on possible subscription actions. Default policy has all restrictions enabled. */
4170
- policy?: SubscriptionPolicy;
4171
- /** List of subscription suspension periods */
4172
- suspensions?: Suspension[];
4173
- /** Initial subscription expiration date that was calculated on the subscription purchase plus duration of suspensions */
4174
- validUntilDateWithSuspensions?: Date | null;
4175
- /** Duration of single payment subscription (instead of billing_profile) */
4176
- singlePaymentDuration?: V1Duration;
4213
+ status?: SubscriptionStatusEnumSubscriptionStatusWithLiterals;
4214
+ }
4215
+ interface UpdateStatusResponse {
4216
+ subscription?: Subscription;
4217
+ }
4218
+ interface UpdatePaymentStatusRequest {
4177
4219
  /** @format GUID */
4178
- originInstanceId?: string | null;
4220
+ subscriptionId?: string;
4221
+ /** @format GUID */
4222
+ tenantId?: string;
4223
+ paymentStatus?: PaymentStatusWithLiterals;
4179
4224
  }
4180
- interface Subscriber {
4181
- /**
4182
- * Member or contact ID
4183
- * @format GUID
4184
- */
4185
- _id?: string;
4186
- /** Member or contact */
4187
- identityType?: IdentityTypeWithLiterals;
4225
+ interface UpdatePaymentStatusResponse {
4226
+ subscription?: Subscription;
4188
4227
  }
4189
- declare enum IdentityType {
4190
- /** Identity type undefined */
4191
- UNDEFINED = "UNDEFINED",
4192
- /** Subscription is associated with a member ID */
4193
- MEMBER = "MEMBER",
4194
- /** Subscriptions is associated with a contact ID */
4195
- CONTACT = "CONTACT"
4228
+ interface RemoveCancellationInfoRequest {
4229
+ /** @format GUID */
4230
+ subscriptionId?: string;
4231
+ /** @format GUID */
4232
+ tenantId?: string;
4233
+ }
4234
+ interface RemoveCancellationInfoResponse {
4235
+ subscription?: Subscription;
4236
+ }
4237
+ interface RemovePauseInfoRequest {
4238
+ /** @format GUID */
4239
+ subscriptionId?: string;
4240
+ /** @format GUID */
4241
+ tenantId?: string;
4242
+ }
4243
+ interface RemovePauseInfoResponse {
4244
+ subscription?: Subscription;
4245
+ }
4246
+ interface ReviveSubscriptionRequest {
4247
+ /** @format GUID */
4248
+ tenantId?: string;
4249
+ /** @format GUID */
4250
+ subscriptionId?: string;
4251
+ revivePolicy?: RevivePolicyWithLiterals;
4252
+ isTestRun?: boolean;
4253
+ }
4254
+ declare enum RevivePolicy {
4255
+ SIMPLE = "SIMPLE",
4256
+ RESUME = "RESUME"
4196
4257
  }
4197
4258
  /** @enumType */
4198
- type IdentityTypeWithLiterals = IdentityType | 'UNDEFINED' | 'MEMBER' | 'CONTACT';
4199
- /** Price of a payment. Includes amount and currency. */
4200
- interface Money {
4259
+ type RevivePolicyWithLiterals = RevivePolicy | 'SIMPLE' | 'RESUME';
4260
+ interface ReviveSubscriptionResponse {
4261
+ subscription?: Subscription;
4262
+ }
4263
+ interface ConvertSapiRequest {
4264
+ /** @format GUID */
4265
+ subscriptionId?: string;
4266
+ }
4267
+ interface ConvertSapiResponse {
4268
+ subscription?: Subscription;
4269
+ }
4270
+ interface GetSubscriptionInvoicesRequest {
4271
+ /** @format GUID */
4272
+ _id?: string;
4273
+ }
4274
+ interface GetSubscriptionInvoicesResponse {
4275
+ invoices?: SubscriptionInvoice[];
4276
+ }
4277
+ interface SubscriptionInvoice {
4278
+ /** @format GUID */
4279
+ _id?: string;
4280
+ subscriptionCycle?: number;
4281
+ _createdDate?: Date | null;
4282
+ }
4283
+ interface FinishFreeTrialNowRequest {
4284
+ /** @format GUID */
4285
+ subscriptionId?: string;
4286
+ /** @format GUID */
4287
+ tenantId?: string;
4288
+ }
4289
+ interface FinishFreeTrialNowResponse {
4290
+ subscription?: Subscription;
4291
+ }
4292
+ interface FixSubscriptionTimeCapsuleTasksRequest {
4293
+ /** @format GUID */
4294
+ subscriptionId?: string;
4295
+ /** @format GUID */
4296
+ tenantId?: string;
4297
+ }
4298
+ interface FixSubscriptionTimeCapsuleTasksResponse {
4299
+ }
4300
+ interface SendTimeCapsuleTaskCanceledBIRequest {
4301
+ /** @format GUID */
4302
+ tenantId?: string;
4303
+ /** @format GUID */
4304
+ subscriptionId?: string;
4305
+ /** @minLength 1 */
4306
+ taskType?: string;
4307
+ }
4308
+ interface ScheduleTimeCapsuleTaskRequest {
4309
+ /** @format GUID */
4310
+ subscriptionId?: string;
4311
+ /** @minLength 1 */
4312
+ taskType?: string;
4313
+ executionTime?: Date | null;
4314
+ /** @format GUID */
4315
+ tenantId?: string;
4316
+ }
4317
+ interface CancelTimeCapsuleTaskRequest {
4318
+ /** @format GUID */
4319
+ tenantId?: string;
4320
+ /** @format GUID */
4321
+ subscriptionId?: string;
4322
+ /** @minLength 1 */
4323
+ taskType?: string;
4324
+ }
4325
+ interface UpdateFullSubscriptionRequest {
4326
+ /** @format GUID */
4327
+ tenantId?: string;
4328
+ subscription?: Subscription;
4329
+ }
4330
+ interface UpdateFullSubscriptionResponse {
4331
+ subscription?: Subscription;
4332
+ }
4333
+ interface PatchSubscriptionRequest {
4201
4334
  /**
4202
- * Monetary amount i.e. 3.99.
4203
- * @format DECIMAL_VALUE
4335
+ * Tenant ID (instance ID) of the subscription
4336
+ * @format GUID
4204
4337
  */
4205
- amount?: string;
4338
+ tenantId?: string;
4206
4339
  /**
4207
- * Currency in ISO 4217 format i.e. USD.
4208
- * @minLength 3
4209
- * @maxLength 3
4340
+ * Subscription ID to patch
4341
+ * @format GUID
4210
4342
  */
4211
- currency?: string;
4343
+ subscriptionId?: string;
4344
+ /** Partial subscription with updated values */
4345
+ subscription?: Subscription;
4346
+ /** Fields to update (e.g., "name", "billing_settings.collection_method") */
4347
+ fieldMask?: string[];
4212
4348
  }
4213
- declare enum SubscriptionType {
4214
- UNDEFINED = "UNDEFINED",
4215
- /** Payments made by the subscriber */
4216
- ONLINE = "ONLINE",
4217
- /** Payments managed manually by the site owner */
4218
- OFFLINE = "OFFLINE"
4349
+ interface PatchSubscriptionResponse {
4350
+ /** The updated subscription */
4351
+ subscription?: Subscription;
4219
4352
  }
4220
- /** @enumType */
4221
- type SubscriptionTypeWithLiterals = SubscriptionType | 'UNDEFINED' | 'ONLINE' | 'OFFLINE';
4222
- declare enum V1SubscriptionStatusEnumSubscriptionStatus {
4223
- /** Subscription status undefined */
4224
- UNDEFINED = "UNDEFINED",
4225
- /** Subscription created, but hasn't been paid for yet. This status if filtered out in ListSubscriptions response by default. */
4226
- DRAFT = "DRAFT",
4227
- /** Subscription has been paid for, but the start date is in the future */
4228
- PENDING = "PENDING",
4229
- /** Subscription is active */
4230
- ACTIVE = "ACTIVE",
4231
- /** Subscription has expired */
4232
- EXPIRED = "EXPIRED",
4233
- /** Subscription has been canceled */
4234
- CANCELED = "CANCELED",
4235
- /** Subscription has been set to be canceled at a future date */
4236
- PENDING_CANCELLATION = "PENDING_CANCELLATION",
4237
- /** Subscription is suspended */
4238
- SUSPENDED = "SUSPENDED"
4353
+ interface UpdateSubscriptionInvoiceCycleRequest {
4354
+ /** @format GUID */
4355
+ subscriptionId?: string;
4356
+ /** @format GUID */
4357
+ tenantId?: string;
4358
+ /** @format GUID */
4359
+ invoiceId?: string;
4360
+ subscriptionCycle?: number;
4361
+ }
4362
+ interface UpdateSubscriptionInvoiceCycleResponse {
4363
+ subscriptionInvoice?: SubscriptionInvoice;
4364
+ }
4365
+ interface AddPausePeriodRequest {
4366
+ /** @format GUID */
4367
+ tenantId?: string;
4368
+ /** @format GUID */
4369
+ subscriptionId?: string;
4370
+ pauseStartDate?: Date | null;
4371
+ pauseEndDate?: Date | null;
4372
+ }
4373
+ interface AddPausePeriodResponse {
4374
+ subscription?: Subscription;
4375
+ }
4376
+ interface RunTimeCapsuleTaskNowRequest {
4377
+ /** @format GUID */
4378
+ tenantId?: string;
4379
+ /** @format GUID */
4380
+ subscriptionId?: string;
4381
+ /** @minLength 1 */
4382
+ taskType?: string;
4383
+ }
4384
+ interface CreateRecurringInvoiceBORequest {
4385
+ /** @format GUID */
4386
+ subscriptionId?: string;
4387
+ /** @format GUID */
4388
+ tenantId?: string;
4389
+ /** @min 2 */
4390
+ cycleNumber?: number;
4391
+ }
4392
+ interface CreateRecurringInvoiceBOResponse {
4393
+ invoiceId?: string;
4394
+ }
4395
+ interface SetShiftingDataRequest {
4396
+ /** @format GUID */
4397
+ subscriptionId?: string;
4398
+ /** @format GUID */
4399
+ tenantId?: string;
4400
+ isBassManaged?: boolean;
4401
+ shiftManagementDate?: Date | null;
4402
+ }
4403
+ interface SetShiftingDataResponse {
4404
+ subscription?: Subscription;
4405
+ }
4406
+ interface FixSubscriptionInvoicesRequest extends FixSubscriptionInvoicesRequestModeOneOf {
4407
+ attachInvoice?: AttachInvoice;
4408
+ detachInvoice?: DetachInvoice;
4409
+ /** @format GUID */
4410
+ tenantId?: string;
4411
+ /** @format GUID */
4412
+ subscriptionId?: string;
4413
+ }
4414
+ /** @oneof */
4415
+ interface FixSubscriptionInvoicesRequestModeOneOf {
4416
+ attachInvoice?: AttachInvoice;
4417
+ detachInvoice?: DetachInvoice;
4418
+ }
4419
+ interface AttachInvoice {
4420
+ /** @format GUID */
4421
+ invoiceId?: string;
4422
+ }
4423
+ interface DetachInvoice {
4424
+ /** @format GUID */
4425
+ invoiceId?: string;
4426
+ }
4427
+ interface FixSubscriptionInvoicesResponse {
4428
+ invoices?: SubscriptionInvoice[];
4429
+ }
4430
+ interface RestoreDraftSubscriptionRequest {
4431
+ /** @format GUID */
4432
+ tenantId?: string;
4433
+ /** @format GUID */
4434
+ subscriptionId?: string;
4435
+ }
4436
+ interface RestoreDraftSubscriptionResponse {
4437
+ subscription?: Subscription;
4438
+ }
4439
+ interface DeleteDraftSubscriptionRequest {
4440
+ /** @format GUID */
4441
+ tenantId?: string;
4442
+ /** @format GUID */
4443
+ subscriptionId?: string;
4444
+ }
4445
+ interface DeleteDraftSubscriptionResponse {
4446
+ subscription?: Subscription;
4447
+ }
4448
+ interface DeleteSubscriptionBORequest {
4449
+ /** @format GUID */
4450
+ tenantId?: string;
4451
+ /** @format GUID */
4452
+ subscriptionId?: string;
4453
+ }
4454
+ interface DeleteSubscriptionBOResponse {
4455
+ subscription?: Subscription;
4239
4456
  }
4240
- /** @enumType */
4241
- type V1SubscriptionStatusEnumSubscriptionStatusWithLiterals = V1SubscriptionStatusEnumSubscriptionStatus | 'UNDEFINED' | 'DRAFT' | 'PENDING' | 'ACTIVE' | 'EXPIRED' | 'CANCELED' | 'PENDING_CANCELLATION' | 'SUSPENDED';
4242
- declare enum PaymentStatusEnumPaymentStatus {
4243
- /** Payment status undefined */
4244
- UNDEFINED = "UNDEFINED",
4245
- /** Payment has been paid */
4246
- PAID = "PAID",
4247
- /** Payment has been refunded */
4248
- REFUNDED = "REFUNDED",
4249
- /** Recurring payment has failed */
4250
- FAILED = "FAILED",
4251
- /** Payment has not been paid */
4252
- UNPAID = "UNPAID",
4253
- /** Billing has been initialized, but actual charge is yet to be made. Can happen for free trial and PayPal */
4254
- PENDING = "PENDING"
4457
+ interface CancelSubscriptionBORequest {
4458
+ /** @format GUID */
4459
+ tenantId?: string;
4460
+ /** @format GUID */
4461
+ subscriptionId?: string;
4462
+ initiator?: ActionInitiatorWithLiterals;
4463
+ reason?: string | null;
4255
4464
  }
4256
- /** @enumType */
4257
- type PaymentStatusEnumPaymentStatusWithLiterals = PaymentStatusEnumPaymentStatus | 'UNDEFINED' | 'PAID' | 'REFUNDED' | 'FAILED' | 'UNPAID' | 'PENDING';
4258
- /**
4259
- * Recurring payment is described by `frequency` (day, week, month) and `interval`.
4260
- *
4261
- * For example, to create a recurring payment every 14 days, just set `interval` to 14 and frequency to `DAY`.
4262
- *
4263
- * In some cases there should be a trial period for the order, after which payments start to occur.
4264
- * Trial period is also defined as `frequency` and `interval` pair.
4265
- *
4266
- * So one can define a monthly 'subscription' with a 14 days trial period.
4267
- */
4268
- interface V2Subscription {
4269
- /** frequency of recurring payment (required) */
4270
- frequency?: SubscriptionFrequencyWithLiterals;
4271
- /** interval of recurring payment (required) */
4272
- interval?: number;
4273
- /** trial period for recurring payment (optional) */
4274
- trial?: SubscriptionTrialPeriod;
4275
- /**
4276
- * how many billing cycles should be done before subscription finishes
4277
- * (optional, 0 by default means endless subscription)
4278
- */
4279
- billingCycles?: number;
4280
- /**
4281
- * date in the future or in the past when the first billing cycle begins
4282
- * (the first off-session payment is performed when it ends)
4283
- */
4284
- firstCycleStartDate?: Date | null;
4465
+ interface CancelSubscriptionBOResponse {
4466
+ subscription?: Subscription;
4285
4467
  }
4286
- /** Frequency unit of recurring payment */
4287
- declare enum SubscriptionFrequency {
4288
- UNDEFINED = "UNDEFINED",
4289
- DAY = "DAY",
4290
- WEEK = "WEEK",
4291
- MONTH = "MONTH",
4292
- YEAR = "YEAR"
4468
+ interface UpdatePaymentMethodBORequest {
4469
+ /** @format GUID */
4470
+ tenantId?: string;
4471
+ /** @format GUID */
4472
+ subscriptionId?: string;
4473
+ /** @format GUID */
4474
+ paymentMethodId?: string;
4293
4475
  }
4294
- /** @enumType */
4295
- type SubscriptionFrequencyWithLiterals = SubscriptionFrequency | 'UNDEFINED' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
4296
- /** Trial period of subscription */
4297
- interface SubscriptionTrialPeriod {
4298
- /** trial period in units (required) */
4299
- period?: number;
4300
- /** units in which trial period is described (optional, default DAY) */
4301
- unit?: SubscriptionFrequencyWithLiterals;
4476
+ interface UpdatePaymentMethodBOResponse {
4477
+ subscription?: Subscription;
4302
4478
  }
4303
- declare enum CancellationInitiator {
4304
- /** Cancellation initiator undefined */
4305
- UNDEFINED = "UNDEFINED",
4306
- /** Subscription was canceled by site owner (default if canceled by user or service identity) */
4307
- OWNER = "OWNER",
4308
- /** Subscription was canceled by member (default if canceled by member identity) */
4309
- MEMBER = "MEMBER",
4310
- /** Subscription was canceled because of payment failure */
4311
- PAYMENT_FAILURE = "PAYMENT_FAILURE",
4312
- /** Subscription was canceled because of payment setup failure */
4313
- SETUP_FAILURE = "SETUP_FAILURE"
4479
+ interface SendSubscriptionActionEventBORequest extends SendSubscriptionActionEventBORequestEventOneOf {
4480
+ billingCycleStarted?: SubscriptionBillingCycleStarted;
4481
+ /** @format GUID */
4482
+ tenantId?: string;
4483
+ /** @format GUID */
4484
+ subscriptionId?: string;
4314
4485
  }
4315
- /** @enumType */
4316
- type CancellationInitiatorWithLiterals = CancellationInitiator | 'UNDEFINED' | 'OWNER' | 'MEMBER' | 'PAYMENT_FAILURE' | 'SETUP_FAILURE';
4317
- interface SubscriptionPolicy {
4318
- /** Subscription expiration date can be updated */
4319
- expiryDateChangeable?: boolean;
4320
- /** Subscription can be cancelled by the member who bought it (when memberId == subscriberId) */
4321
- cancellableByMember?: boolean;
4322
- /** Subscription expiration date on cancellation can be set to next payment date */
4323
- cancellableAtNextPaymentCycle?: boolean;
4486
+ /** @oneof */
4487
+ interface SendSubscriptionActionEventBORequestEventOneOf {
4488
+ billingCycleStarted?: SubscriptionBillingCycleStarted;
4324
4489
  }
4325
- interface Suspension {
4326
- status?: StatusWithLiterals;
4327
- /** Beginning of the suspended period */
4328
- startsAt?: Date | null;
4329
- /** End of the suspended period */
4330
- endsAt?: Date | null;
4490
+ interface SendSubscriptionActionEventResponse {
4331
4491
  }
4332
- declare enum Status {
4333
- UNDEFINED = "UNDEFINED",
4334
- ACTIVE = "ACTIVE",
4335
- ENDED = "ENDED"
4492
+ interface HandleSubscriptionAfterInvoiceMarkedAsPaidRequest {
4493
+ /** @format GUID */
4494
+ tenantId?: string;
4495
+ /** @format GUID */
4496
+ subscriptionId?: string;
4497
+ transactionId?: string;
4336
4498
  }
4337
- /** @enumType */
4338
- type StatusWithLiterals = Status | 'UNDEFINED' | 'ACTIVE' | 'ENDED';
4339
- /** A duration expressed in amount of time units. */
4340
- interface V1Duration {
4341
- /** Amount of the unit */
4342
- amount?: number;
4343
- /** Day, Week, Month, Year. */
4344
- unit?: SubscriptionFrequencyWithLiterals;
4499
+ interface PauseSubscriptionBORequest {
4500
+ /** @format GUID */
4501
+ tenantId?: string;
4502
+ /** @format GUID */
4503
+ subscriptionId?: string;
4504
+ pausePolicy?: PausePolicyWithLiterals;
4505
+ pauseAt?: PauseAtWithLiterals;
4506
+ initiator?: ActionInitiatorWithLiterals;
4507
+ /** @maxLength 500 */
4508
+ reason?: string | null;
4345
4509
  }
4346
- interface V1SubscriptionActivated {
4347
- subscription?: V1Subscription;
4510
+ interface PauseSubscriptionBOResponse {
4511
+ subscription?: Subscription;
4348
4512
  }
4349
- interface V1SubscriptionCanceled {
4350
- subscription?: V1Subscription;
4513
+ interface FixSubscriptionInvoicesConsistencyRequest {
4514
+ /** @format GUID */
4515
+ tenantId?: string;
4516
+ /** @format GUID */
4517
+ subscriptionId?: string;
4351
4518
  }
4352
- interface V1SubscriptionUpdated {
4353
- subscription?: V1Subscription;
4519
+ interface FixSubscriptionInvoicesConsistencyResponse {
4354
4520
  }
4355
- interface SubscriptionCycleTriggered {
4356
- subscription?: V1Subscription;
4357
- billingCycle?: number;
4521
+ interface FixSubscriptionPaymentStatusRequest {
4522
+ /** @format GUID */
4523
+ tenantId?: string;
4524
+ /** @format GUID */
4525
+ subscriptionId?: string;
4526
+ /** When true, verify and report the would-be fix without mutating anything. */
4527
+ dryRun?: boolean;
4528
+ }
4529
+ interface FixSubscriptionPaymentStatusResponse {
4530
+ /** The invoice is PAID but the (DRAFT) subscription never processed the paid event. */
4531
+ mismatchDetected?: boolean;
4532
+ /** A real mismatch was found and the invoice-paid activation was re-driven (always false in dry-run). */
4533
+ fixed?: boolean;
4358
4534
  /**
4359
- * Wix Pay transaction id, optional. Exists if event was triggered by a payment.
4360
- * @format GUID
4535
+ * Subscription status after the re-drive (ACTIVE / PENDING); in dry-run, the predicted status; "" when no fix ran.
4536
+ * @maxLength 50
4361
4537
  */
4362
- transactionId?: string | null;
4363
- }
4364
- interface SubscriptionMarkedAsPaid {
4365
- subscription?: V1Subscription;
4366
- /** A number indicating which payment (cycle) was marked as paid. For recurring subscriptions only. */
4367
- billingCycle?: number | null;
4368
- }
4369
- interface SubscriptionCancellationRequested {
4370
- subscription?: V1Subscription;
4538
+ resultingStatus?: string;
4539
+ /**
4540
+ * Human-readable summary of the decision and action.
4541
+ * @maxLength 500
4542
+ */
4543
+ detail?: string;
4371
4544
  }
4372
- interface SubscriptionSuspended {
4373
- subscription?: V1Subscription;
4545
+ interface UpdateSubscriptionCurrencyRequest {
4546
+ /**
4547
+ * Tenant ID (instance ID) of the subscription
4548
+ * @format GUID
4549
+ */
4550
+ tenantId?: string;
4551
+ /**
4552
+ * Subscription ID to update currency for
4553
+ * @format GUID
4554
+ */
4555
+ subscriptionId?: string;
4556
+ /**
4557
+ * New currency code (e.g., "USD", "EUR") - ISO 4217 format
4558
+ * @format CURRENCY
4559
+ */
4560
+ newCurrency?: string;
4561
+ /**
4562
+ * Exchange rate from current currency to new currency (newAmount = oldAmount * exchangeRate)
4563
+ * @decimalValue options { gt:0.00, maxScale:6 }
4564
+ */
4565
+ exchangeRate?: string;
4374
4566
  }
4375
- interface V1SubscriptionResumed {
4376
- subscription?: V1Subscription;
4567
+ interface UpdateSubscriptionCurrencyResponse {
4568
+ /** The updated subscription with new currency and converted amounts */
4569
+ subscription?: Subscription;
4377
4570
  }
4378
- interface SubscriptionExpired {
4379
- subscription?: V1Subscription;
4571
+ interface UpdateSubscriptionPlatformOriginRequest {
4572
+ /**
4573
+ * Subscription ID to update platform origin for
4574
+ * @format GUID
4575
+ */
4576
+ subscriptionId?: string;
4577
+ /**
4578
+ * Tenant ID (instance ID) of the subscription
4579
+ * @format GUID
4580
+ */
4581
+ tenantId?: string;
4582
+ /** New platform origin (appId and entityId) */
4583
+ platformOrigin?: PlatformOrigin;
4380
4584
  }
4381
- interface V1SubscriptionInitialPurchaseCompleted {
4382
- subscription?: V1Subscription;
4585
+ interface UpdateSubscriptionPlatformOriginResponse {
4586
+ /** The updated subscription with new platform origin */
4587
+ subscription?: Subscription;
4383
4588
  }
4384
4589
  interface ListSubscriptionHistoryRequest {
4385
4590
  /** @format GUID */
@@ -4446,6 +4651,8 @@ interface SubscriptionEvent extends SubscriptionEventPayloadOneOf {
4446
4651
  billingCyclePaid?: SubscriptionBillingCyclePaid;
4447
4652
  initiatePaymentMethodSetup?: InitiatedPaymentMethodSetup;
4448
4653
  futurePriceUpdatesRequested?: FuturePriceUpdatesRequested;
4654
+ /** Fired once when an offline subscription purchase is completed (BILL-534). */
4655
+ offlinePurchaseCompleted?: SubscriptionOfflinePurchaseCompleted;
4449
4656
  subscriptionBoAction?: SubscriptionBackOfficeAction;
4450
4657
  unknown?: UnknownSubscriptionEvent;
4451
4658
  }
@@ -4484,6 +4691,8 @@ interface SubscriptionEventPayloadOneOf {
4484
4691
  billingCyclePaid?: SubscriptionBillingCyclePaid;
4485
4692
  initiatePaymentMethodSetup?: InitiatedPaymentMethodSetup;
4486
4693
  futurePriceUpdatesRequested?: FuturePriceUpdatesRequested;
4694
+ /** Fired once when an offline subscription purchase is completed (BILL-534). */
4695
+ offlinePurchaseCompleted?: SubscriptionOfflinePurchaseCompleted;
4487
4696
  subscriptionBoAction?: SubscriptionBackOfficeAction;
4488
4697
  unknown?: UnknownSubscriptionEvent;
4489
4698
  }
@@ -4557,6 +4766,10 @@ interface FuturePriceUpdatesRequested {
4557
4766
  subscription?: Subscription;
4558
4767
  requestedUpdateData?: SubscriptionUpdateData;
4559
4768
  }
4769
+ interface SubscriptionOfflinePurchaseCompleted {
4770
+ subscription?: Subscription;
4771
+ actionDetails?: ActionDetails;
4772
+ }
4560
4773
  interface SubscriptionBackOfficeAction {
4561
4774
  subscription?: Subscription;
4562
4775
  /** The backoffice method name */
@@ -4677,6 +4890,16 @@ type CustomerUpdateBillingDateApplicationErrors = {
4677
4890
  data?: Record<string, any>;
4678
4891
  };
4679
4892
  /** @docsIgnore */
4893
+ type CustomerChangeSubscriptionApplicationErrors = {
4894
+ code?: 'CUSTOMER_ACTION_NOT_ENABLED';
4895
+ description?: string;
4896
+ data?: Record<string, any>;
4897
+ } | {
4898
+ code?: 'CUSTOMER_TIMING_RESTRICTION';
4899
+ description?: string;
4900
+ data?: Record<string, any>;
4901
+ };
4902
+ /** @docsIgnore */
4680
4903
  type UpdateSubscriptionBillingDateApplicationErrors = {
4681
4904
  code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
4682
4905
  description?: string;
@@ -4787,7 +5010,7 @@ interface EventMetadata extends BaseEventMetadata {
4787
5010
  /** If present, indicates the action that triggered the event. */
4788
5011
  originatedFrom?: string | null;
4789
5012
  /**
4790
- * 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.
5013
+ * 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.
4791
5014
  * 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.
4792
5015
  */
4793
5016
  entityEventSequence?: string | null;
@@ -4807,6 +5030,8 @@ interface SubscriptionCanceledEnvelope {
4807
5030
  }
4808
5031
  /**
4809
5032
  * Triggered when a subscription is canceled.
5033
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5034
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
4810
5035
  * @permissionScope Manage Stores
4811
5036
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4812
5037
  * @permissionScope Manage Events
@@ -4825,6 +5050,8 @@ interface SubscriptionExtendedEnvelope {
4825
5050
  }
4826
5051
  /**
4827
5052
  * Triggered when subscription has been extended
5053
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5054
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
4828
5055
  * @permissionScope Manage Stores
4829
5056
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4830
5057
  * @permissionScope Manage Events
@@ -4843,6 +5070,8 @@ interface SubscriptionUpdatedEnvelope {
4843
5070
  }
4844
5071
  /**
4845
5072
  * Triggered when a subscription is updated.
5073
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5074
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
4846
5075
  * @permissionScope Manage Stores
4847
5076
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4848
5077
  * @permissionScope Manage Events
@@ -4861,6 +5090,8 @@ interface SubscriptionAutoRenewalTurnedOffEnvelope {
4861
5090
  }
4862
5091
  /**
4863
5092
  * Triggered when a subscription cycleAutoRenew was turned off.
5093
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5094
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
4864
5095
  * @permissionScope Manage Stores
4865
5096
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4866
5097
  * @permissionScope Manage Events
@@ -4879,6 +5110,8 @@ interface SubscriptionAutoRenewalTurnedOnEnvelope {
4879
5110
  }
4880
5111
  /**
4881
5112
  * Triggered when a subscription cycleAutoRenew was turned on.
5113
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5114
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
4882
5115
  * @permissionScope Manage Stores
4883
5116
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4884
5117
  * @permissionScope Manage Events
@@ -4897,6 +5130,8 @@ interface SubscriptionBillingDateUpdatedEnvelope {
4897
5130
  }
4898
5131
  /**
4899
5132
  * Triggered when subscription has been extended
5133
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5134
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
4900
5135
  * @permissionScope Manage Stores
4901
5136
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4902
5137
  * @permissionScope Manage Events
@@ -4913,7 +5148,9 @@ interface SubscriptionLatestInvoiceMarkedAsPaidEnvelope {
4913
5148
  data: LatestInvoiceMarkedAsPaid;
4914
5149
  metadata: EventMetadata;
4915
5150
  }
4916
- /** @permissionScope Manage Stores
5151
+ /** @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5152
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
5153
+ * @permissionScope Manage Stores
4917
5154
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4918
5155
  * @permissionScope Manage Events
4919
5156
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
@@ -4931,6 +5168,8 @@ interface SubscriptionPauseScheduleCanceledEnvelope {
4931
5168
  }
4932
5169
  /**
4933
5170
  * Triggered when scheduled pause canceled
5171
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5172
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
4934
5173
  * @permissionScope Manage Stores
4935
5174
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4936
5175
  * @permissionScope Manage Events
@@ -4949,6 +5188,8 @@ interface SubscriptionPauseScheduledEnvelope {
4949
5188
  }
4950
5189
  /**
4951
5190
  * Triggered when pause subscription requested
5191
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5192
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
4952
5193
  * @permissionScope Manage Stores
4953
5194
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4954
5195
  * @permissionScope Manage Events
@@ -4967,6 +5208,8 @@ interface SubscriptionPausedEnvelope {
4967
5208
  }
4968
5209
  /**
4969
5210
  * Triggered when a subscription is paused.
5211
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5212
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
4970
5213
  * @permissionScope Manage Stores
4971
5214
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4972
5215
  * @permissionScope Manage Events
@@ -4985,6 +5228,8 @@ interface SubscriptionResumeScheduleCanceledEnvelope {
4985
5228
  }
4986
5229
  /**
4987
5230
  * Triggered when scheduled pause canceled
5231
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5232
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
4988
5233
  * @permissionScope Manage Stores
4989
5234
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4990
5235
  * @permissionScope Manage Events
@@ -5003,6 +5248,8 @@ interface SubscriptionResumeScheduledEnvelope {
5003
5248
  }
5004
5249
  /**
5005
5250
  * Triggered when resume subscription requested
5251
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5252
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
5006
5253
  * @permissionScope Manage Stores
5007
5254
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
5008
5255
  * @permissionScope Manage Events
@@ -5021,6 +5268,8 @@ interface SubscriptionResumedEnvelope {
5021
5268
  }
5022
5269
  /**
5023
5270
  * Triggered when a subscription is resumed.
5271
+ * @permissionScope Manage_Wix_Rentals_App_Forms_submissions
5272
+ * @permissionScopeId SCOPE.RENTALS.MANAGE
5024
5273
  * @permissionScope Manage Stores
5025
5274
  * @permissionScopeId SCOPE.STORES.MANAGE-STORES
5026
5275
  * @permissionScope Manage Events
@@ -5192,19 +5441,17 @@ interface CustomerUpdateBillingDateOptions {
5192
5441
  /** Optional reason for the update. */
5193
5442
  reason?: string | null;
5194
5443
  }
5195
- /**
5196
- * This used only for automation and permitted tenants (QA & testing)
5197
- * @public
5198
- * @documentationMaturity preview
5199
- * @requiredField options.tenantId
5200
- * @requiredField subscriptionId
5201
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsBackOfficeService.PayCycle
5202
- */
5203
- declare function payCycle(subscriptionId: string, options?: NonNullablePaths<PayCycleOptions, `tenantId`, 2>): Promise<NonNullablePaths<PayCycleResponse, `invoiceId` | `subscription.name` | `subscription.customer.visitorId` | `subscription.customer.contactId` | `subscription.customer.memberId` | `subscription.customer.accountId` | `subscription.status` | `subscription.billingSettings.currency` | `subscription.billingSettings.paymentMethod._id` | `subscription.billingSettings.collectionMethod` | `subscription.billingSettings.cycleDuration.unit` | `subscription.billingSettings.cycleAutoRenew` | `subscription.billingSettings.billingAddress.address.streetAddress.number` | `subscription.billingSettings.billingAddress.address.streetAddress.name` | `subscription.billingSettings.taxSettings.inclusive` | `subscription.billingSettings.additionalFees` | `subscription.billingSettings.additionalFees.${number}.name` | `subscription.billingSettings.additionalFees.${number}.amount` | `subscription.billingSettings.additionalFees.${number}.trigger` | `subscription.billingSettings.additionalFees.${number}.tax.amount` | `subscription.billingSettings.additionalFees.${number}.tax.percentage` | `subscription.billingSettings.additionalFees.${number}.tax.dynamic.taxableAddressType` | `subscription.billingSettings.additionalFees.${number}.cycles.cycleFrom` | `subscription.billingSettings.additionalFees.${number}.origin.appId` | `subscription.billingSettings.additionalFees.${number}.origin.entityId` | `subscription.billingSettings.shippingCharges.amount` | `subscription.billingSettings.shippingCharges.discounts` | `subscription.billingSettings.shippingCharges.discounts.${number}.amount` | `subscription.billingSettings.shippingCharges.discounts.${number}.percentage` | `subscription.billingSettings.shippingCharges.discounts.${number}.cycles.cycleFrom` | `subscription.billingSettings.shippingCharges.discounts.${number}.origin.appId` | `subscription.billingSettings.shippingCharges.discounts.${number}.origin.entityId` | `subscription.billingSettings.discounts` | `subscription.billingSettings.externalCollectionDetails.collectorName` | `subscription.billingStatus.currentCycle` | `subscription.billingStatus.latestPaymentData.invoiceId` | `subscription.billingStatus.latestPaymentData.paymentStatus` | `subscription.billingStatus.latestPaymentData.totals.totalPrice` | `subscription.billingStatus.latestPaymentData.totals.subtotal` | `subscription.billingStatus.latestPaymentData.taxData.taxBreakdowns` | `subscription.billingStatus.latestPaymentData.taxData.taxBreakdowns.${number}.taxType` | `subscription.billingStatus.latestPaymentData.taxData.taxBreakdowns.${number}.taxRate` | `subscription.billingStatus.latestPaymentData.taxData.taxBreakdowns.${number}.jurisdictionType` | `subscription.billingStatus.gracePeriodData.automaticRetryData.enabled` | `subscription.policies.customerCanCancel` | `subscription.policies.businessCanExtend` | `subscription.policies.allowEndOfCycleCancellation` | `subscription.pauseInfo.pausePolicy` | `subscription.pauseInfo.pauseAt` | `subscription.pauseInfo.resumeAt` | `subscription.cancellationInfo.initiator` | `subscription.pendingUpdateData.itemsToUpdate` | `subscription.pendingUpdateData.itemsToUpdate.${number}._id` | `subscription.pendingUpdateData.itemsToUpdate.${number}.pricingModel.fixedPrice.itemPrice` | `subscription.pendingUpdateData.itemsToAdd` | `subscription.pendingUpdateData.itemsToAdd.${number}.name` | `subscription.pendingUpdateData.itemsToAdd.${number}.catalogReference.catalogItemId` | `subscription.pendingUpdateData.itemsToAdd.${number}.category` | `subscription.pendingUpdateData.itemsToAdd.${number}.quantity` | `subscription.pendingUpdateData.itemsToAdd.${number}.applicationFee.amount` | `subscription.pendingUpdateData.itemsToDelete` | `subscription.pendingUpdateData.numberOfRequests` | `subscription.items`, 8>>;
5204
- interface PayCycleOptions {
5205
- paymentTestMode?: PaymentTestModeWithLiterals;
5206
- /** @format GUID */
5207
- tenantId: string;
5444
+ interface CustomerChangeSubscriptionOptions {
5445
+ /** @maxSize 100 */
5446
+ itemChanges?: SubscriptionItemChange[];
5447
+ newCycle?: Duration;
5448
+ effectiveTime?: ChangeEffectiveTimeWithLiterals;
5449
+ }
5450
+ interface CustomerPreviewChangeSubscriptionOptions {
5451
+ /** @maxSize 100 */
5452
+ itemChanges?: SubscriptionItemChange[];
5453
+ newCycle?: Duration;
5454
+ effectiveTime?: ChangeEffectiveTimeWithLiterals;
5208
5455
  }
5209
5456
  /**
5210
5457
  * Returns a single subscription by its id
@@ -5327,6 +5574,8 @@ interface ResumeSubscriptionOptions {
5327
5574
  /** contains additional scheduling information for certain resume_at options (for example: SPECIFIC_DATE) */
5328
5575
  resumeAtSchedule?: ScheduleAdditionalInfo;
5329
5576
  actionContext: ActionContext;
5577
+ /** Strategy for resuming a migrated paused subscription when the previous billing date is missing. */
5578
+ missingPreviousBillingDateResumeStrategy?: MissingPreviousBillingDateResumeStrategyWithLiterals;
5330
5579
  }
5331
5580
  /**
5332
5581
  * Lists subscriptions based on specified filters.
@@ -5618,4 +5867,4 @@ interface ListSubscriptionHistoryOptions {
5618
5867
  cursor?: CursorPaging;
5619
5868
  }
5620
5869
 
5621
- export { type AbsorbFeeConfig, type AbsorbFeeConfigValueOneOf, type AccountInfo, type AccountInfoMetadata, type Action, type ActionContext, type ActionDetails, type ActionEvent, ActionInitiator, type ActionInitiatorWithLiterals, ActionType, type ActionTypeWithLiterals, type AddPausePeriodRequest, type AddPausePeriodResponse, type AdditionalFee, AdditionalFeeTrigger, type AdditionalFeeTriggerWithLiterals, type Address, type AddressStreetOneOf, type AggregatedTaxBreakdown, type AllowedActionsOptions, type AllowedActionsRequest, type AllowedActionsResponse, type AmountByStatus, type ApplicationFee, type ApplicationFeeValueOneOf, type AttachInvoice, type AutomaticRetryData, type BaseEventMetadata, type BassToSapiPaypalMigrationRequest, type BassToSapiPaypalMigrationResponse, type BillingSettings, type BillingStatus, type BulkItemChange, type BulkUpdateSubscriptionItemsByFilterRequest, type BulkUpdateSubscriptionItemsByFilterResponse, type BusinessOrigin, type BusinessOriginData, type Cancel, type CancelActionConfiguration, type CancelActionSettings, type CancelPendingChangeRequest, type CancelPendingChangeResponse, type CancelSubscriptionApplicationErrors, type CancelSubscriptionBORequest, type CancelSubscriptionBOResponse, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CancelTimeCapsuleTaskRequest, type CancellationInfo, CancellationInitiator, type CancellationInitiatorWithLiterals, type CatalogReference, ChangeEffectiveTime, type ChangeEffectiveTimeWithLiterals, type ChangePaymentContext, type ChangeSubscriptionRequest, type ChangeSubscriptionResponse, type Charge, CollectionMethod, CollectionMethodEnumCollectionMethod, type CollectionMethodEnumCollectionMethodWithLiterals, type CollectionMethodWithLiterals, type Complete, type ConvertSapiRequest, type ConvertSapiResponse, type CountByStatus, type CountSubscriptionFilter, type CountSubscriptionFilterStatusOneOf, type CountSubscriptionsOptions, type CountSubscriptionsRequest, type CountSubscriptionsResponse, type CreateRecurringInvoiceBORequest, type CreateRecurringInvoiceBOResponse, type CreateSubscriptionForOrderRequest, type CreateSubscriptionForOrderResponse, type CreateSubscriptionInStateRequest, type CreateSubscriptionInStateRequestModeOneOf, type CreateSubscriptionInStateResponse, type CreateSubscriptionRequest, type CreateSubscriptionResponse, CreationMode, type CreationModeWithLiterals, type CursorPaging, type CursorPagingMetadata, type Cursors, type CustomBillingSchedule, type CustomProration, type CustomProrationAmountOneOf, type Customer, type CustomerAction, type CustomerActionConfigurationOneOf, type CustomerActionSettings, type CustomerAllowedActionsRequest, type CustomerAllowedActionsResponse, type CustomerCancelConfiguration, type CustomerCancelScheduledPauseApplicationErrors, type CustomerCancelScheduledPauseOptions, type CustomerCancelScheduledPauseRequest, type CustomerCancelScheduledPauseResponse, type CustomerCancelScheduledSkipApplicationErrors, type CustomerCancelScheduledSkipOptions, type CustomerCancelScheduledSkipRequest, type CustomerCancelScheduledSkipResponse, type CustomerCancelSubscriptionApplicationErrors, type CustomerCancelSubscriptionOptions, type CustomerCancelSubscriptionRequest, type CustomerCancelSubscriptionResponse, type CustomerExtendSubscriptionApplicationErrors, type CustomerExtendSubscriptionOptions, type CustomerExtendSubscriptionRequest, type CustomerExtendSubscriptionResponse, type CustomerIdOneOf, type CustomerInitiatePaymentMethodSetupOptions, type CustomerListUpcomingChargesRequest, type CustomerListUpcomingChargesResponse, type CustomerPauseResumeConfiguration, type CustomerPauseSubscriptionApplicationErrors, type CustomerPauseSubscriptionOptions, type CustomerPauseSubscriptionRequest, type CustomerPauseSubscriptionResponse, type CustomerQuerySubscriptionsOptions, type CustomerResumeSubscriptionApplicationErrors, type CustomerResumeSubscriptionOptions, type CustomerResumeSubscriptionRequest, type CustomerResumeSubscriptionResponse, type CustomerSkipConfiguration, type CustomerSkipCycleApplicationErrors, type CustomerSkipCycleOptions, type CustomerSkipCycleRequest, type CustomerSkipCycleResponse, type CustomerTurnOffAutoRenewalRequest, type CustomerTurnOffAutoRenewalResponse, type CustomerTurnOffSubscriptionAutoRenewalApplicationErrors, type CustomerTurnOffSubscriptionAutoRenewalOptions, type CustomerTurnOnAutoRenewalRequest, type CustomerTurnOnAutoRenewalResponse, type CustomerTurnOnSubscriptionAutoRenewalApplicationErrors, type CustomerTurnOnSubscriptionAutoRenewalOptions, type CustomerUpdateBillingDateApplicationErrors, type CustomerUpdateBillingDateConfiguration, type CustomerUpdateBillingDateOptions, type CustomerUpdateBillingDateRequest, type CustomerUpdateBillingDateResponse, type Cycles, type DeleteDraftSubscriptionRequest, type DeleteDraftSubscriptionResponse, type DeleteSubscriptionBORequest, type DeleteSubscriptionBOResponse, type DeleteSubscriptionRequest, type DeleteSubscriptionResponse, type DetachInvoice, type Discount, type DiscountCycles, type DiscountOrigin, type DiscountValueOneOf, type DomainEvent, type DomainEventBodyOneOf, type Duration, DurationUnit, type DurationUnitWithLiterals, type DynamicTax, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, ExtendPolicyType, type ExtendPolicyTypeWithLiterals, type ExtendSubscriptionApplicationErrors, type ExtendSubscriptionOptions, type ExtendSubscriptionOptionsExtendPolicyOneOf, type ExtendSubscriptionRequest, type ExtendSubscriptionRequestExtendPolicyOneOf, type ExtendSubscriptionResponse, type ExternalCollectionDetails, type ExternalPrice, type ExternalPriceConfig, type FinishFreeTrialNowRequest, type FinishFreeTrialNowResponse, type FixSubscriptionInvoicesConsistencyRequest, type FixSubscriptionInvoicesConsistencyResponse, type FixSubscriptionInvoicesRequest, type FixSubscriptionInvoicesRequestModeOneOf, type FixSubscriptionInvoicesResponse, type FixSubscriptionTimeCapsuleTasksRequest, type FixSubscriptionTimeCapsuleTasksResponse, type FixedAmountFee, type FixedPrice, type FixedPriceConfig, type FreeTrailEnded, type FreeTrailStarted, type FreeTrialData, type FullAddressContactDetails, type FullAddressDetails, type FuturePriceUpdatesRequested, type FutureUpdatesRequested, type GetFullSubscriptionDataRequest, type GetFullSubscriptionDataResponse, type GetSubscriptionAndInternalDataRequest, type GetSubscriptionAndInternalDataResponse, type GetSubscriptionInvoicesRequest, type GetSubscriptionInvoicesResponse, type GetSubscriptionRequest, type GetSubscriptionResponse, type GetSubscriptionsStatsRequest, type GetSubscriptionsStatsResponse, type GracePeriodData, type GracePeriodEnded, type GracePeriodStarted, type HandleSubscriptionAfterInvoiceMarkedAsPaidRequest, HistoryActionInitiator, type HistoryActionInitiatorWithLiterals, HistoryViewMode, type HistoryViewModeWithLiterals, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, type InitiatePaymentMethodSetupOptions, type InitiatePaymentMethodSetupRequest, type InitiatePaymentMethodSetupResponse, type InitiatedPaymentMethodSetup, type InternalSubscriptionData, type Invoice, type InvoiceAction, type InvoiceActionActionTypeOneOf, type InvoiceApplicationFee, type InvoiceApplicationFeeValueOneOf, type InvoiceDiscount, type InvoiceDiscountValueOneOf, type InvoiceItem, type InvoiceItemPaymentTypeOneOf, type InvoiceItemPricingModelOneOf, type InvoicePlatformFee, type InvoicePlatformFeeFeeModelOneOf, type InvoiceShippingCharges, InvoiceStatus, type InvoiceStatusWithLiterals, type Item, ItemCategory, type ItemCategoryWithLiterals, type ItemChange, type ItemTaxData, type LatestInvoiceMarkedAsPaid, type LatestPaymentAttempt, type LineItemTaxSummary, type ListSubscriptionHistoryOptions, type ListSubscriptionHistoryRequest, type ListSubscriptionHistoryResponse, type ListUpcomingChargesOptions, type ListUpcomingChargesRequest, type ListUpcomingChargesResponse, type MarkBillingCycleAsPaidApplicationErrors, type MarkBillingCycleAsPaidOptions, type MarkBillingCycleAsPaidRequest, type MarkBillingCycleAsPaidResponse, type MarkLatestInvoiceAsPaidApplicationErrors, type MarkLatestInvoiceAsPaidRequest, type MarkLatestInvoiceAsPaidResponse, type MessageEnvelope, type MigrationDetails, type Money, type MultipleSubscriptionsOnOrdersInvoice, type OneTime, OrderMethod, type OrderMethodWithLiterals, type Origin, type OriginOverride, type Paging, type PagingMetadataV2, type PassOnFeeConfig, type PassOnFeeConfigValueOneOf, type PatchSubscriptionRequest, type PatchSubscriptionResponse, PauseAt, type PauseAtWithLiterals, type PauseInfo, type PausePeriod, PausePolicy, type PausePolicyWithLiterals, type PauseResumeActionConfiguration, type PauseResumeActionSettings, type PauseSubscriptionApplicationErrors, type PauseSubscriptionBORequest, type PauseSubscriptionBOResponse, type PauseSubscriptionOptions, type PauseSubscriptionRequest, type PauseSubscriptionRequested, type PauseSubscriptionResponse, type PayCycleOptions, type PayCycleRequest, type PayCycleResponse, type PayRecurringInvoice, PaymentAttemptStatus, type PaymentAttemptStatusWithLiterals, type PaymentData, type PaymentMethod, type PaymentMethodUpdated, PaymentMode, type PaymentModeWithLiterals, type PaymentOrigin, type PaymentSettings, PaymentSettlementMethod, type PaymentSettlementMethodWithLiterals, PaymentStatus, PaymentStatusEnumPaymentStatus, type PaymentStatusEnumPaymentStatusWithLiterals, type PaymentStatusWithLiterals, type PaymentTaxData, PaymentTestMode, type PaymentTestModeWithLiterals, type PercentageFee, type PlatformOrigin, type PreviewChangeSubscriptionRequest, type PreviewChangeSubscriptionResponse, type PreviewSubscriptionChargesOptions, type PreviewSubscriptionChargesOptionsSubscriptionOneOf, type PreviewSubscriptionChargesRequest, type PreviewSubscriptionChargesRequestSubscriptionOneOf, type PreviewSubscriptionChargesResponse, type PreviewSubscriptionsChargesOptions, type PreviewSubscriptionsChargesRequest, type PreviewSubscriptionsChargesResponse, type PriceAdjustment, type PriceAdjustmentAdjustmentTypeOneOf, PriceAdjustmentReason, type PriceAdjustmentReasonWithLiterals, type PriceAdjustmentValue, type PriceAdjustmentValueAdjustmentValueTypeOneOf, type PriceDetails, type PricingModel, type PricingModelModelOneOf, type Proration, ProrationAction, type ProrationActionWithLiterals, ProrationBehavior, type ProrationBehaviorWithLiterals, type ProrationPreview, type ProrationResult, type ProrationTypeOneOf, type QuerySubscriptionsRequest, type QuerySubscriptionsResponse, type QueryV2, type QueryV2PagingMethodOneOf, type Recurring, type RedirectUrls, type Refund, type RefundInfo, RefundReason, type RefundReasonWithLiterals, type RemoveCancellationInfoRequest, type RemoveCancellationInfoResponse, type RemovePauseInfoRequest, type RemovePauseInfoResponse, type RenewalPreview, RequestedFields, type RequestedFieldsWithLiterals, type Reschedule, type ResetPendingUpdates, type RestoreDraftSubscriptionRequest, type RestoreDraftSubscriptionResponse, type RestoreInfo, ResumeAt, type ResumeAtWithLiterals, type ResumeSubscriptionApplicationErrors, type ResumeSubscriptionOptions, type ResumeSubscriptionRequest, type ResumeSubscriptionRequested, type ResumeSubscriptionResponse, type ReviseSubscriptionOptions, type ReviseSubscriptionRequest, type ReviseSubscriptionResponse, RevivePolicy, type RevivePolicyWithLiterals, type ReviveSubscriptionRequest, type ReviveSubscriptionResponse, type RunTimeCapsuleTaskNowRequest, type ScheduleAdditionalInfo, type ScheduleAdditionalInfoParamOneOf, type ScheduleTimeCapsuleTaskRequest, type ScheduledPauseCanceled, type ScheduledResumeCanceled, type SearchSubscriptionRequest, type SearchSubscriptionResponse, type SearchSubscriptionsOptions, type SearchSubscriptionsOptionsPagingMethodOneOf, type SearchSubscriptionsRequest, type SearchSubscriptionsRequestPagingMethodOneOf, type SearchSubscriptionsResponse, type SendSubscriptionActionEventBORequest, type SendSubscriptionActionEventBORequestEventOneOf, type SendSubscriptionActionEventResponse, type SendTimeCapsuleTaskCanceledBIRequest, type SetIsMigratedEvent, type SetShiftingDataRequest, type SetShiftingDataResponse, type ShippingCharges, type SkipActionConfiguration, type SkipActionSettings, SortOrder, type SortOrderWithLiterals, type Sorting, type SortingClauses, type SpecificDateSubscriptionUpdateData, Status, type StatusWithLiterals, type StreetAddress, type Subscriber, type Subscription, type SubscriptionActivated, type SubscriptionAutoRenewalTurnedOff, type SubscriptionAutoRenewalTurnedOffEnvelope, type SubscriptionAutoRenewalTurnedOn, type SubscriptionAutoRenewalTurnedOnEnvelope, type SubscriptionBackOfficeAction, type SubscriptionBillingCyclePaid, type SubscriptionBillingCycleStarted, type SubscriptionBillingDateUpdated, type SubscriptionBillingDateUpdatedEnvelope, type SubscriptionBillingDetails, type SubscriptionCanceled, type SubscriptionCanceledEnvelope, type SubscriptionCancellationRequested, type SubscriptionChangeSummary, type SubscriptionCharge, type SubscriptionCharges, type SubscriptionCollectionMethodUpdated, type SubscriptionCreated, type SubscriptionCycleReadyToPay, type SubscriptionCycleTriggered, type SubscriptionDelayedSyncEvent, type SubscriptionDeleted, type SubscriptionDiff, type SubscriptionEnded, type SubscriptionEvent, type SubscriptionEventPayloadOneOf, type SubscriptionExpired, type SubscriptionExtended, type SubscriptionExtendedEnvelope, type SubscriptionExtendedExtendPolicyOneOf, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionHistoryEntry, type SubscriptionInfo, type SubscriptionInitialPurchaseCompleted, type SubscriptionInvoice, type SubscriptionItemChange, type SubscriptionLatestInvoiceMarkedAsPaidEnvelope, type SubscriptionMarkedAsPaid, type SubscriptionPauseScheduleCanceledEnvelope, type SubscriptionPauseScheduledEnvelope, type SubscriptionPaused, type SubscriptionPausedEnvelope, type SubscriptionPolicies, type SubscriptionPolicy, type SubscriptionResumeScheduleCanceledEnvelope, type SubscriptionResumeScheduledEnvelope, type SubscriptionResumed, type SubscriptionResumedEnvelope, type SubscriptionRevived, type SubscriptionStatus, SubscriptionStatusEnumSubscriptionStatus, type SubscriptionStatusEnumSubscriptionStatusWithLiterals, SubscriptionStatusGroup, type SubscriptionStatusGroupWithLiterals, type SubscriptionSuspended, type SubscriptionTrialPeriod, SubscriptionType, type SubscriptionTypeWithLiterals, type SubscriptionUpdateData, type SubscriptionUpdated, type SubscriptionUpdatedEnvelope, type Suspension, type Task, type TaskAction, type TaskActionActionOneOf, type TaskKey, type Tax, type TaxBreakdown, type TaxData, type TaxSettings, type TaxSummary, type TaxValueOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type TimeBasedProration, type Totals, type TurnOffSubscriptionAutoRenewalApplicationErrors, type TurnOffSubscriptionAutoRenewalRequest, type TurnOffSubscriptionAutoRenewalResponse, type TurnOnSubscriptionAutoRenewalApplicationErrors, type TurnOnSubscriptionAutoRenewalRequest, type TurnOnSubscriptionAutoRenewalResponse, type UnknownSubscriptionEvent, type UnsupportedAction, type UnsupportedReason, UpdateAction, type UpdateActionWithLiterals, type UpdateBillingDateActionConfiguration, type UpdateBillingDateActionSettings, type UpdateBillingDateData, type UpdateFullSubscriptionRequest, type UpdateFullSubscriptionResponse, type UpdatePausePaidDurationRequest, type UpdatePausePaidDurationResponse, type UpdatePaymentMethodBORequest, type UpdatePaymentMethodBOResponse, type UpdatePaymentStatusRequest, type UpdatePaymentStatusResponse, type UpdateStatusRequest, type UpdateStatusResponse, type UpdateSubscriptionBillingDateApplicationErrors, type UpdateSubscriptionBillingDateOptions, type UpdateSubscriptionBillingDateRequest, type UpdateSubscriptionBillingDateResponse, type UpdateSubscriptionCurrencyRequest, type UpdateSubscriptionCurrencyResponse, type UpdateSubscriptionInvoiceCycleRequest, type UpdateSubscriptionInvoiceCycleResponse, type UpdateSubscriptionItemsRequest, type UpdateSubscriptionItemsResponse, type UpdateSubscriptionOriginRequest, type UpdateSubscriptionOriginResponse, type UpdateSubscriptionPaymentMethodRequest, type UpdateSubscriptionPaymentMethodResponse, type UpdateSubscriptionPlatformOriginRequest, type UpdateSubscriptionPlatformOriginResponse, type UpdateSubscriptionPoliciesRequest, type UpdateSubscriptionPoliciesResponse, type UpdateSubscriptionRequest, type UpdateSubscriptionResponse, type UpdateSubscriptionStartDateRequest, type UpdateSubscriptionStartDateResponse, type UpdatesApplied, type UpmActionSettings, type V1Duration, type V1Subscription, type V1SubscriptionActivated, type V1SubscriptionCanceled, type V1SubscriptionCreated, type V1SubscriptionEvent, type V1SubscriptionEventEventOneOf, type V1SubscriptionInitialPurchaseCompleted, type V1SubscriptionResumed, V1SubscriptionStatusEnumSubscriptionStatus, type V1SubscriptionStatusEnumSubscriptionStatusWithLiterals, type V1SubscriptionUpdated, type V2Subscription, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, allowedActions, cancelSubscription, countSubscriptions, customerAllowedActions, customerCancelSubscription, customerExtendSubscription, customerGetSubscription, customerInitiatePaymentMethodSetup, customerListUpcomingCharges, customerQuerySubscriptions, customerTurnOffSubscriptionAutoRenewal, customerTurnOnSubscriptionAutoRenewal, customerUpdateSubscriptionPaymentMethod, extendSubscription, getSubscription, getSubscriptionsStats, initiatePaymentMethodSetup, listSubscriptionHistory, listUpcomingCharges, markLatestInvoiceAsPaid, onSubscriptionAutoRenewalTurnedOff, onSubscriptionAutoRenewalTurnedOn, onSubscriptionBillingDateUpdated, onSubscriptionCanceled, onSubscriptionExtended, onSubscriptionLatestInvoiceMarkedAsPaid, onSubscriptionPauseScheduleCanceled, onSubscriptionPauseScheduled, onSubscriptionPaused, onSubscriptionResumeScheduleCanceled, onSubscriptionResumeScheduled, onSubscriptionResumed, onSubscriptionUpdated, pauseSubscription, payCycle, previewSubscriptionCharges, previewSubscriptionsCharges, querySubscriptions, resumeSubscription, searchSubscriptions, turnOffSubscriptionAutoRenewal, turnOnSubscriptionAutoRenewal, updateSubscriptionBillingDate, updateSubscriptionPaymentMethod };
5870
+ export { type AbsorbFeeConfig, type AbsorbFeeConfigValueOneOf, type AccountInfo, type AccountInfoMetadata, type Action, type ActionContext, type ActionDetails, type ActionEvent, ActionInitiator, type ActionInitiatorWithLiterals, ActionType, type ActionTypeWithLiterals, type AddPausePeriodRequest, type AddPausePeriodResponse, type AdditionalFee, AdditionalFeeTrigger, type AdditionalFeeTriggerWithLiterals, type Address, type AddressLocation, type AddressStreetOneOf, type AggregatedTaxBreakdown, type AllowedActionsOptions, type AllowedActionsRequest, type AllowedActionsResponse, type AmountByStatus, type ApplicationFee, type ApplicationFeeValueOneOf, type AttachInvoice, type AutomaticRetryData, type BaseEventMetadata, type BassToSapiPaypalMigrationRequest, type BassToSapiPaypalMigrationResponse, type BillingSettings, type BillingStatus, type BulkItemChange, type BulkUpdateSubscriptionItemsByFilterRequest, type BulkUpdateSubscriptionItemsByFilterResponse, type BusinessOrigin, type BusinessOriginData, type Cancel, type CancelActionConfiguration, type CancelActionSettings, type CancelPendingChangeRequest, type CancelPendingChangeResponse, type CancelSubscriptionApplicationErrors, type CancelSubscriptionBORequest, type CancelSubscriptionBOResponse, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CancelTimeCapsuleTaskRequest, type CancellationInfo, CancellationInitiator, type CancellationInitiatorWithLiterals, type CatalogReference, type ChangeContext, ChangeEffectiveTime, type ChangeEffectiveTimeWithLiterals, type ChangePaymentContext, type ChangeSubscriptionForOrderRequest, type ChangeSubscriptionForOrderResponse, type ChangeSubscriptionRequest, type ChangeSubscriptionResponse, ChangeType, type ChangeTypeWithLiterals, type Charge, CollectionMethod, CollectionMethodEnumCollectionMethod, type CollectionMethodEnumCollectionMethodWithLiterals, type CollectionMethodWithLiterals, type Complete, type ConvertSapiRequest, type ConvertSapiResponse, type CountByStatus, type CountSubscriptionFilter, type CountSubscriptionFilterStatusOneOf, type CountSubscriptionsOptions, type CountSubscriptionsRequest, type CountSubscriptionsResponse, type CreateRecurringInvoiceBORequest, type CreateRecurringInvoiceBOResponse, type CreateSubscriptionForOrderRequest, type CreateSubscriptionForOrderResponse, type CreateSubscriptionInStateRequest, type CreateSubscriptionInStateRequestModeOneOf, type CreateSubscriptionInStateResponse, type CreateSubscriptionRequest, type CreateSubscriptionResponse, CreationMode, type CreationModeWithLiterals, type CursorPaging, type CursorPagingMetadata, type Cursors, type CustomBillingSchedule, type CustomProration, type CustomProrationAmountOneOf, type Customer, type CustomerAction, type CustomerActionConfigurationOneOf, type CustomerActionCounters, type CustomerActionSettings, type CustomerAllowedActionsRequest, type CustomerAllowedActionsResponse, type CustomerCancelConfiguration, type CustomerCancelPendingChangeRequest, type CustomerCancelPendingChangeResponse, type CustomerCancelScheduledPauseApplicationErrors, type CustomerCancelScheduledPauseOptions, type CustomerCancelScheduledPauseRequest, type CustomerCancelScheduledPauseResponse, type CustomerCancelScheduledSkipApplicationErrors, type CustomerCancelScheduledSkipOptions, type CustomerCancelScheduledSkipRequest, type CustomerCancelScheduledSkipResponse, type CustomerCancelSubscriptionApplicationErrors, type CustomerCancelSubscriptionOptions, type CustomerCancelSubscriptionRequest, type CustomerCancelSubscriptionResponse, type CustomerChangeSubscriptionApplicationErrors, type CustomerChangeSubscriptionOptions, type CustomerChangeSubscriptionRequest, type CustomerChangeSubscriptionResponse, type CustomerExtendSubscriptionApplicationErrors, type CustomerExtendSubscriptionOptions, type CustomerExtendSubscriptionRequest, type CustomerExtendSubscriptionResponse, type CustomerIdOneOf, type CustomerInitiatePaymentMethodSetupOptions, type CustomerListUpcomingChargesRequest, type CustomerListUpcomingChargesResponse, type CustomerPauseResumeConfiguration, type CustomerPauseSubscriptionApplicationErrors, type CustomerPauseSubscriptionOptions, type CustomerPauseSubscriptionRequest, type CustomerPauseSubscriptionResponse, type CustomerPreviewChangeSubscriptionOptions, type CustomerPreviewChangeSubscriptionRequest, type CustomerPreviewChangeSubscriptionResponse, type CustomerQuerySubscriptionsOptions, type CustomerResumeSubscriptionApplicationErrors, type CustomerResumeSubscriptionOptions, type CustomerResumeSubscriptionRequest, type CustomerResumeSubscriptionResponse, type CustomerSkipConfiguration, type CustomerSkipCycleApplicationErrors, type CustomerSkipCycleOptions, type CustomerSkipCycleRequest, type CustomerSkipCycleResponse, type CustomerTurnOffAutoRenewalRequest, type CustomerTurnOffAutoRenewalResponse, type CustomerTurnOffSubscriptionAutoRenewalApplicationErrors, type CustomerTurnOffSubscriptionAutoRenewalOptions, type CustomerTurnOnAutoRenewalRequest, type CustomerTurnOnAutoRenewalResponse, type CustomerTurnOnSubscriptionAutoRenewalApplicationErrors, type CustomerTurnOnSubscriptionAutoRenewalOptions, type CustomerUpdateBillingDateApplicationErrors, type CustomerUpdateBillingDateConfiguration, type CustomerUpdateBillingDateOptions, type CustomerUpdateBillingDateRequest, type CustomerUpdateBillingDateResponse, type Cycles, type DeleteDraftSubscriptionRequest, type DeleteDraftSubscriptionResponse, type DeleteSubscriptionBORequest, type DeleteSubscriptionBOResponse, type DeleteSubscriptionRequest, type DeleteSubscriptionResponse, type DetachInvoice, type Discount, type DiscountCycles, type DiscountOrigin, type DiscountValueOneOf, type DomainEvent, type DomainEventBodyOneOf, type Duration, DurationUnit, type DurationUnitWithLiterals, type DynamicTax, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, ExtendPolicyType, type ExtendPolicyTypeWithLiterals, type ExtendSubscriptionApplicationErrors, type ExtendSubscriptionOptions, type ExtendSubscriptionOptionsExtendPolicyOneOf, type ExtendSubscriptionRequest, type ExtendSubscriptionRequestExtendPolicyOneOf, type ExtendSubscriptionResponse, type ExternalCollectionDetails, type ExternalPrice, type ExternalPriceConfig, type FinishFreeTrialNowRequest, type FinishFreeTrialNowResponse, type FixSubscriptionInvoicesConsistencyRequest, type FixSubscriptionInvoicesConsistencyResponse, type FixSubscriptionInvoicesRequest, type FixSubscriptionInvoicesRequestModeOneOf, type FixSubscriptionInvoicesResponse, type FixSubscriptionPaymentStatusRequest, type FixSubscriptionPaymentStatusResponse, type FixSubscriptionTimeCapsuleTasksRequest, type FixSubscriptionTimeCapsuleTasksResponse, type FixedAmountFee, type FixedPrice, type FixedPriceConfig, type FreeTrailEnded, type FreeTrailStarted, type FreeTrialData, type FullAddressContactDetails, type FullAddressDetails, type FuturePriceUpdatesRequested, type FutureUpdatesRequested, type GetFullSubscriptionDataRequest, type GetFullSubscriptionDataResponse, type GetSubscriptionAndInternalDataRequest, type GetSubscriptionAndInternalDataResponse, type GetSubscriptionInvoicesRequest, type GetSubscriptionInvoicesResponse, type GetSubscriptionRequest, type GetSubscriptionResponse, type GetSubscriptionsStatsRequest, type GetSubscriptionsStatsResponse, type GracePeriodData, type GracePeriodEnded, type GracePeriodStarted, type HandleSubscriptionAfterInvoiceMarkedAsPaidRequest, HistoryActionInitiator, type HistoryActionInitiatorWithLiterals, HistoryViewMode, type HistoryViewModeWithLiterals, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, type InitiatePaymentMethodSetupOptions, type InitiatePaymentMethodSetupRequest, type InitiatePaymentMethodSetupResponse, type InitiatedPaymentMethodSetup, type InternalSubscriptionData, type Invoice, type InvoiceAction, type InvoiceActionActionTypeOneOf, type InvoiceApplicationFee, type InvoiceApplicationFeeValueOneOf, type InvoiceDiscount, type InvoiceDiscountValueOneOf, type InvoiceItem, type InvoiceItemPaymentTypeOneOf, type InvoiceItemPricingModelOneOf, type InvoicePlatformFee, type InvoicePlatformFeeFeeModelOneOf, type InvoiceShippingCharges, InvoiceStatus, type InvoiceStatusWithLiterals, type Item, ItemCategory, type ItemCategoryWithLiterals, type ItemChange, type ItemTaxData, type LatestInvoiceMarkedAsPaid, type LatestPaymentAttempt, type LineItemTaxSummary, type ListSubscriptionHistoryOptions, type ListSubscriptionHistoryRequest, type ListSubscriptionHistoryResponse, type ListUpcomingChargesOptions, type ListUpcomingChargesRequest, type ListUpcomingChargesResponse, type MarkBillingCycleAsPaidApplicationErrors, type MarkBillingCycleAsPaidOptions, type MarkBillingCycleAsPaidRequest, type MarkBillingCycleAsPaidResponse, type MarkLatestInvoiceAsPaidApplicationErrors, type MarkLatestInvoiceAsPaidRequest, type MarkLatestInvoiceAsPaidResponse, type MessageEnvelope, type MigrationDetails, MissingPreviousBillingDateResumeStrategy, type MissingPreviousBillingDateResumeStrategyWithLiterals, type Money, type MultipleSubscriptionsOnOrdersInvoice, type OneTime, OrderMethod, type OrderMethodWithLiterals, type Origin, type OriginOverride, type Paging, type PagingMetadataV2, type PassOnFeeConfig, type PassOnFeeConfigValueOneOf, type PatchSubscriptionRequest, type PatchSubscriptionResponse, PauseAt, type PauseAtWithLiterals, type PauseInfo, type PausePeriod, PausePolicy, type PausePolicyWithLiterals, type PauseResumeActionConfiguration, type PauseResumeActionSettings, type PauseSubscriptionApplicationErrors, type PauseSubscriptionBORequest, type PauseSubscriptionBOResponse, type PauseSubscriptionOptions, type PauseSubscriptionRequest, type PauseSubscriptionRequested, type PauseSubscriptionResponse, type PayCycleRequest, type PayCycleResponse, type PayRecurringInvoice, PaymentAttemptStatus, type PaymentAttemptStatusWithLiterals, type PaymentData, type PaymentMethod, type PaymentMethodUpdated, PaymentMode, type PaymentModeWithLiterals, type PaymentOrigin, type PaymentSettings, PaymentSettlementMethod, type PaymentSettlementMethodWithLiterals, PaymentStatus, PaymentStatusEnumPaymentStatus, type PaymentStatusEnumPaymentStatusWithLiterals, type PaymentStatusWithLiterals, type PaymentTaxData, PaymentTestMode, type PaymentTestModeWithLiterals, type PercentageFee, type PlatformOrigin, type PreviewChangeSubscriptionRequest, type PreviewChangeSubscriptionResponse, type PreviewSubscriptionChargesOptions, type PreviewSubscriptionChargesOptionsSubscriptionOneOf, type PreviewSubscriptionChargesRequest, type PreviewSubscriptionChargesRequestSubscriptionOneOf, type PreviewSubscriptionChargesResponse, type PreviewSubscriptionsChargesOptions, type PreviewSubscriptionsChargesRequest, type PreviewSubscriptionsChargesResponse, type PriceAdjustment, type PriceAdjustmentAdjustmentTypeOneOf, PriceAdjustmentReason, type PriceAdjustmentReasonWithLiterals, type PriceAdjustmentValue, type PriceAdjustmentValueAdjustmentValueTypeOneOf, type PriceDetails, type PricingModel, type PricingModelModelOneOf, type Proration, ProrationAction, type ProrationActionWithLiterals, ProrationBehavior, ProrationBehaviorEnumProrationBehavior, type ProrationBehaviorEnumProrationBehaviorWithLiterals, type ProrationBehaviorWithLiterals, type ProrationPreview, type ProrationResult, type ProrationTypeOneOf, type QuerySubscriptionsRequest, type QuerySubscriptionsResponse, type QueryV2, type QueryV2PagingMethodOneOf, type Recurring, type RedirectUrls, type Refund, type RefundInfo, RefundReason, type RefundReasonWithLiterals, type RemoveCancellationInfoRequest, type RemoveCancellationInfoResponse, type RemovePauseInfoRequest, type RemovePauseInfoResponse, type RenewalPreview, RequestedFields, type RequestedFieldsWithLiterals, type Reschedule, type ResetPendingUpdates, type RestoreDraftSubscriptionRequest, type RestoreDraftSubscriptionResponse, type RestoreInfo, ResumeAt, type ResumeAtWithLiterals, type ResumeSubscriptionApplicationErrors, type ResumeSubscriptionOptions, type ResumeSubscriptionRequest, type ResumeSubscriptionRequested, type ResumeSubscriptionResponse, type ReviseSubscriptionOptions, type ReviseSubscriptionRequest, type ReviseSubscriptionResponse, RevivePolicy, type RevivePolicyWithLiterals, type ReviveSubscriptionRequest, type ReviveSubscriptionResponse, type RunTimeCapsuleTaskNowRequest, type ScheduleAdditionalInfo, type ScheduleAdditionalInfoParamOneOf, type ScheduleTimeCapsuleTaskRequest, type ScheduledPauseCanceled, type ScheduledResumeCanceled, type SearchSubscriptionRequest, type SearchSubscriptionResponse, type SearchSubscriptionsOptions, type SearchSubscriptionsOptionsPagingMethodOneOf, type SearchSubscriptionsRequest, type SearchSubscriptionsRequestPagingMethodOneOf, type SearchSubscriptionsResponse, type SendSubscriptionActionEventBORequest, type SendSubscriptionActionEventBORequestEventOneOf, type SendSubscriptionActionEventResponse, type SendTimeCapsuleTaskCanceledBIRequest, type SetIsMigratedEvent, type SetShiftingDataRequest, type SetShiftingDataResponse, type ShippingCharges, type SkipActionConfiguration, type SkipActionSettings, SortOrder, type SortOrderWithLiterals, type Sorting, type SortingClauses, type SpecificDateSubscriptionUpdateData, Status, type StatusWithLiterals, type StreetAddress, type Subscriber, type Subscription, type SubscriptionActivated, type SubscriptionAutoRenewalTurnedOff, type SubscriptionAutoRenewalTurnedOffEnvelope, type SubscriptionAutoRenewalTurnedOn, type SubscriptionAutoRenewalTurnedOnEnvelope, type SubscriptionBackOfficeAction, type SubscriptionBillingCyclePaid, type SubscriptionBillingCycleStarted, type SubscriptionBillingDateUpdated, type SubscriptionBillingDateUpdatedEnvelope, type SubscriptionBillingDetails, type SubscriptionCanceled, type SubscriptionCanceledEnvelope, type SubscriptionCancellationRequested, type SubscriptionChangeSummary, type SubscriptionCharge, type SubscriptionCharges, type SubscriptionCollectionMethodUpdated, type SubscriptionCreated, type SubscriptionCycleReadyToPay, type SubscriptionCycleTriggered, type SubscriptionDelayedSyncEvent, type SubscriptionDeleted, type SubscriptionDiff, type SubscriptionEnded, type SubscriptionEvent, type SubscriptionEventPayloadOneOf, type SubscriptionExpired, type SubscriptionExtended, type SubscriptionExtendedEnvelope, type SubscriptionExtendedExtendPolicyOneOf, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionHistoryEntry, type SubscriptionInfo, type SubscriptionInitialPurchaseCompleted, type SubscriptionInvoice, type SubscriptionItemChange, type SubscriptionLatestInvoiceMarkedAsPaidEnvelope, type SubscriptionMarkedAsPaid, type SubscriptionOfflinePurchaseCompleted, type SubscriptionPauseScheduleCanceledEnvelope, type SubscriptionPauseScheduledEnvelope, type SubscriptionPaused, type SubscriptionPausedEnvelope, type SubscriptionPolicies, type SubscriptionPolicy, type SubscriptionResumeScheduleCanceledEnvelope, type SubscriptionResumeScheduledEnvelope, type SubscriptionResumed, type SubscriptionResumedEnvelope, type SubscriptionRevived, type SubscriptionStatus, SubscriptionStatusEnumSubscriptionStatus, type SubscriptionStatusEnumSubscriptionStatusWithLiterals, SubscriptionStatusGroup, type SubscriptionStatusGroupWithLiterals, type SubscriptionSuspended, type SubscriptionTrialPeriod, SubscriptionType, type SubscriptionTypeWithLiterals, type SubscriptionUpdateData, type SubscriptionUpdated, type SubscriptionUpdatedEnvelope, type Suspension, type Task, type TaskAction, type TaskActionActionOneOf, type TaskKey, type Tax, type TaxBreakdown, type TaxData, type TaxSettings, type TaxSummary, type TaxValueOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type TimeBasedProration, type Totals, type TurnOffSubscriptionAutoRenewalApplicationErrors, type TurnOffSubscriptionAutoRenewalRequest, type TurnOffSubscriptionAutoRenewalResponse, type TurnOnSubscriptionAutoRenewalApplicationErrors, type TurnOnSubscriptionAutoRenewalRequest, type TurnOnSubscriptionAutoRenewalResponse, type UnknownSubscriptionEvent, type UnsupportedAction, type UnsupportedReason, UpdateAction, type UpdateActionWithLiterals, type UpdateBillingDateActionConfiguration, type UpdateBillingDateActionSettings, type UpdateBillingDateData, type UpdateFullSubscriptionRequest, type UpdateFullSubscriptionResponse, type UpdatePausePaidDurationRequest, type UpdatePausePaidDurationResponse, type UpdatePaymentMethodBORequest, type UpdatePaymentMethodBOResponse, type UpdatePaymentStatusRequest, type UpdatePaymentStatusResponse, type UpdateStatusRequest, type UpdateStatusResponse, type UpdateSubscriptionBillingDateApplicationErrors, type UpdateSubscriptionBillingDateOptions, type UpdateSubscriptionBillingDateRequest, type UpdateSubscriptionBillingDateResponse, type UpdateSubscriptionCurrencyRequest, type UpdateSubscriptionCurrencyResponse, type UpdateSubscriptionInvoiceCycleRequest, type UpdateSubscriptionInvoiceCycleResponse, type UpdateSubscriptionItemsRequest, type UpdateSubscriptionItemsResponse, type UpdateSubscriptionOriginRequest, type UpdateSubscriptionOriginResponse, type UpdateSubscriptionPaymentMethodRequest, type UpdateSubscriptionPaymentMethodResponse, type UpdateSubscriptionPlatformOriginRequest, type UpdateSubscriptionPlatformOriginResponse, type UpdateSubscriptionPoliciesRequest, type UpdateSubscriptionPoliciesResponse, type UpdateSubscriptionRequest, type UpdateSubscriptionResponse, type UpdateSubscriptionStartDateRequest, type UpdateSubscriptionStartDateResponse, type UpdatesApplied, type UpmActionSettings, type V1Duration, type V1ProrationResult, type V1Subscription, type V1SubscriptionActivated, type V1SubscriptionCanceled, type V1SubscriptionCreated, type V1SubscriptionEvent, type V1SubscriptionEventEventOneOf, type V1SubscriptionInitialPurchaseCompleted, type V1SubscriptionResumed, V1SubscriptionStatusEnumSubscriptionStatus, type V1SubscriptionStatusEnumSubscriptionStatusWithLiterals, type V1SubscriptionUpdated, type V2Subscription, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, allowedActions, cancelSubscription, countSubscriptions, customerAllowedActions, customerCancelSubscription, customerExtendSubscription, customerGetSubscription, customerInitiatePaymentMethodSetup, customerListUpcomingCharges, customerQuerySubscriptions, customerTurnOffSubscriptionAutoRenewal, customerTurnOnSubscriptionAutoRenewal, customerUpdateSubscriptionPaymentMethod, extendSubscription, getSubscription, getSubscriptionsStats, initiatePaymentMethodSetup, listSubscriptionHistory, listUpcomingCharges, markLatestInvoiceAsPaid, onSubscriptionAutoRenewalTurnedOff, onSubscriptionAutoRenewalTurnedOn, onSubscriptionBillingDateUpdated, onSubscriptionCanceled, onSubscriptionExtended, onSubscriptionLatestInvoiceMarkedAsPaid, onSubscriptionPauseScheduleCanceled, onSubscriptionPauseScheduled, onSubscriptionPaused, onSubscriptionResumeScheduleCanceled, onSubscriptionResumeScheduled, onSubscriptionResumed, onSubscriptionUpdated, pauseSubscription, previewSubscriptionCharges, previewSubscriptionsCharges, querySubscriptions, resumeSubscription, searchSubscriptions, turnOffSubscriptionAutoRenewal, turnOnSubscriptionAutoRenewal, updateSubscriptionBillingDate, updateSubscriptionPaymentMethod };