@wix/auto_sdk_subscription_subscriptions 1.0.7 → 1.0.9

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 (125) hide show
  1. package/build/cjs/index.d.ts +379 -1
  2. package/build/cjs/index.js +5705 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +4684 -1
  5. package/build/cjs/index.typings.js +4768 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +2379 -1
  8. package/build/cjs/meta.js +3660 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +379 -0
  11. package/build/es/index.mjs +5603 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/{internal/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts → es/index.typings.d.mts} +796 -1149
  14. package/build/es/index.typings.mjs +4679 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +2379 -0
  17. package/build/es/meta.mjs +3605 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +403 -1
  20. package/build/internal/cjs/index.js +5705 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +4708 -1
  23. package/build/internal/cjs/index.typings.js +4768 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +2379 -1
  26. package/build/internal/cjs/meta.js +3660 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +403 -0
  29. package/build/internal/es/index.mjs +5603 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/internal/es/{src/billing-v1-subscription-subscriptions.universal.d.ts → index.typings.d.mts} +799 -1128
  32. package/build/internal/es/index.typings.mjs +4679 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/internal/es/meta.d.mts +2379 -0
  35. package/build/internal/es/meta.mjs +3605 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +12 -10
  38. package/build/cjs/src/billing-v1-subscription-subscriptions.context.d.ts +0 -99
  39. package/build/cjs/src/billing-v1-subscription-subscriptions.context.js +0 -142
  40. package/build/cjs/src/billing-v1-subscription-subscriptions.context.js.map +0 -1
  41. package/build/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +0 -134
  42. package/build/cjs/src/billing-v1-subscription-subscriptions.http.js +0 -3048
  43. package/build/cjs/src/billing-v1-subscription-subscriptions.http.js.map +0 -1
  44. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +0 -94
  45. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js +0 -636
  46. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +0 -1
  47. package/build/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +0 -273
  48. package/build/cjs/src/billing-v1-subscription-subscriptions.public.js +0 -769
  49. package/build/cjs/src/billing-v1-subscription-subscriptions.public.js.map +0 -1
  50. package/build/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +0 -4203
  51. package/build/cjs/src/billing-v1-subscription-subscriptions.types.js +0 -347
  52. package/build/cjs/src/billing-v1-subscription-subscriptions.types.js.map +0 -1
  53. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts +0 -5013
  54. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js +0 -1997
  55. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/src/billing-v1-subscription-subscriptions.context.d.ts +0 -99
  66. package/build/es/src/billing-v1-subscription-subscriptions.context.js +0 -101
  67. package/build/es/src/billing-v1-subscription-subscriptions.context.js.map +0 -1
  68. package/build/es/src/billing-v1-subscription-subscriptions.http.d.ts +0 -134
  69. package/build/es/src/billing-v1-subscription-subscriptions.http.js +0 -3013
  70. package/build/es/src/billing-v1-subscription-subscriptions.http.js.map +0 -1
  71. package/build/es/src/billing-v1-subscription-subscriptions.meta.d.ts +0 -94
  72. package/build/es/src/billing-v1-subscription-subscriptions.meta.js +0 -578
  73. package/build/es/src/billing-v1-subscription-subscriptions.meta.js.map +0 -1
  74. package/build/es/src/billing-v1-subscription-subscriptions.public.d.ts +0 -273
  75. package/build/es/src/billing-v1-subscription-subscriptions.public.js +0 -696
  76. package/build/es/src/billing-v1-subscription-subscriptions.public.js.map +0 -1
  77. package/build/es/src/billing-v1-subscription-subscriptions.types.d.ts +0 -4203
  78. package/build/es/src/billing-v1-subscription-subscriptions.types.js +0 -344
  79. package/build/es/src/billing-v1-subscription-subscriptions.types.js.map +0 -1
  80. package/build/es/src/billing-v1-subscription-subscriptions.universal.d.ts +0 -5013
  81. package/build/es/src/billing-v1-subscription-subscriptions.universal.js +0 -1938
  82. package/build/es/src/billing-v1-subscription-subscriptions.universal.js.map +0 -1
  83. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.d.ts +0 -101
  84. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js +0 -142
  85. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js.map +0 -1
  86. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +0 -134
  87. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js +0 -3048
  88. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js.map +0 -1
  89. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +0 -94
  90. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js +0 -636
  91. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +0 -1
  92. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +0 -293
  93. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js +0 -769
  94. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js.map +0 -1
  95. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +0 -4203
  96. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js +0 -347
  97. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js.map +0 -1
  98. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js +0 -1997
  99. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +0 -1
  100. package/build/internal/es/index.d.ts +0 -1
  101. package/build/internal/es/index.js +0 -2
  102. package/build/internal/es/index.js.map +0 -1
  103. package/build/internal/es/index.typings.d.ts +0 -1
  104. package/build/internal/es/index.typings.js +0 -2
  105. package/build/internal/es/index.typings.js.map +0 -1
  106. package/build/internal/es/meta.d.ts +0 -1
  107. package/build/internal/es/meta.js +0 -2
  108. package/build/internal/es/meta.js.map +0 -1
  109. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.d.ts +0 -101
  110. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js +0 -101
  111. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js.map +0 -1
  112. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.d.ts +0 -134
  113. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js +0 -3013
  114. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js.map +0 -1
  115. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.d.ts +0 -94
  116. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js +0 -578
  117. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js.map +0 -1
  118. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.d.ts +0 -293
  119. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js +0 -696
  120. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js.map +0 -1
  121. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.d.ts +0 -4203
  122. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js +0 -344
  123. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js.map +0 -1
  124. package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js +0 -1938
  125. package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js.map +0 -1
@@ -1 +1,4708 @@
1
- export * from './src/billing-v1-subscription-subscriptions.universal.js';
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ interface Subscription {
4
+ /**
5
+ * Subscription's unique id. Automatically generated and read-only.
6
+ * @format GUID
7
+ * @readonly
8
+ */
9
+ _id?: string | null;
10
+ /**
11
+ * Date when subscription was created
12
+ * @readonly
13
+ */
14
+ _createdDate?: Date | null;
15
+ /**
16
+ * Date when subscription was updated
17
+ * @readonly
18
+ */
19
+ _updatedDate?: Date | null;
20
+ /**
21
+ * Revision of subscription. Increments upon changes
22
+ * @readonly
23
+ */
24
+ revision?: string | null;
25
+ /**
26
+ * Subscription name: minLength is 1, maxLength is 150
27
+ * @maxLength 150
28
+ */
29
+ name?: string;
30
+ /**
31
+ * Subscription description. Optional.
32
+ * @maxLength 500
33
+ */
34
+ description?: string | null;
35
+ /**
36
+ * 3. No Start Date:
37
+ * - If the start_date is not provided, this field will default to "now",
38
+ * meaning the subscription will start immediately.
39
+ */
40
+ startDate?: Date | null;
41
+ /**
42
+ * Represents when the subscription will end, relevant for subscriptions with a termed period.
43
+ * If not provided, will be calculated based on billing schedule. Should be empty for evergreen subscription.
44
+ * Note: A 13-hour tolerance is applied when validating the end date to handle for time zone differences and minor discrepancies.
45
+ */
46
+ endDate?: Date | null;
47
+ /** Business origin subscription is coming from. In site-level subscription it will be vertical app_id and entity_id */
48
+ origin?: BusinessOrigin;
49
+ /** Customer information like id and identity type (member or contact) */
50
+ customer?: Customer;
51
+ /**
52
+ * Status of subscription
53
+ * @readonly
54
+ */
55
+ status?: SubscriptionStatusEnumSubscriptionStatusWithLiterals;
56
+ /** Billing details parameters including schedule, currency, etc. */
57
+ billingSettings?: BillingSettings;
58
+ /**
59
+ * Includes many attributes about billing status of the subscription
60
+ * @readonly
61
+ */
62
+ billingStatus?: BillingStatus;
63
+ /** Shipping address associated with subscription. At the moment used only for payments. Optional. */
64
+ shippingAddress?: FullAddressDetails;
65
+ /** Restrictions on possible subscription actions. If not provided, default policies are all restrictions enabled. */
66
+ policies?: SubscriptionPolicies;
67
+ /**
68
+ * Information related to either paused subscription or scheduled for future pause
69
+ * @readonly
70
+ */
71
+ pauseInfo?: PauseInfo;
72
+ /**
73
+ * Information related to cancellation for already canceled subscription or scheduled for cancel
74
+ * @readonly
75
+ */
76
+ cancellationInfo?: CancellationInfo;
77
+ /**
78
+ * Pending update for the next billing cycle
79
+ * @readonly
80
+ */
81
+ pendingUpdateData?: SubscriptionUpdateData;
82
+ /**
83
+ * Key / Value store to keep up to 10 additional values related to the subscription.
84
+ * Key max length = 50, Value max length = 200. Value can not be empty.
85
+ * Should not include any sensitive or PII information.
86
+ * @maxSize 10
87
+ */
88
+ metadata?: Record<string, string>;
89
+ /**
90
+ * Pending update for a specific date
91
+ * @readonly
92
+ */
93
+ specificDatePendingUpdateData?: SpecificDateSubscriptionUpdateData;
94
+ /**
95
+ * ChangesCounter of subscription. Increments upon every change to the domain
96
+ * @readonly
97
+ */
98
+ changesCounter?: string | null;
99
+ /**
100
+ * Billing order id. Optional.
101
+ * @format GUID
102
+ */
103
+ orderId?: string | null;
104
+ /** Platform origin subscription is coming from. */
105
+ platformOrigin?: PlatformOrigin;
106
+ /**
107
+ * The Business Location ID represents a business location in an external service, which includes the business address.
108
+ * @format GUID
109
+ */
110
+ businessLocationId?: string | null;
111
+ /**
112
+ * items, minSize is 1, maxSize is 100
113
+ * @maxSize 100
114
+ */
115
+ items?: Item[];
116
+ }
117
+ interface BusinessOrigin {
118
+ /** @format GUID */
119
+ appId?: string | null;
120
+ /** @format GUID */
121
+ entityId?: string | null;
122
+ }
123
+ interface Customer extends CustomerIdOneOf {
124
+ /**
125
+ * Visitor ID of the customer. Available when the customer is an anonymous
126
+ * site visitor.
127
+ * @format GUID
128
+ */
129
+ visitorId?: string;
130
+ /**
131
+ * Contact ID of the customer. Available when the customer is a
132
+ * [contact](https://dev.wix.com/docs/rest/api-reference/people-communications/contacts/contacts/contact-v-4#contact-object).
133
+ * @format GUID
134
+ */
135
+ contactId?: string;
136
+ /**
137
+ * Member ID of the customer. Available when the customer is a
138
+ * [member](https://dev.wix.com/docs/rest/api-reference/people-communications/members/members#member-object).
139
+ * @format GUID
140
+ */
141
+ memberId?: string;
142
+ /**
143
+ * Wix account ID
144
+ * @format GUID
145
+ */
146
+ accountId?: string;
147
+ }
148
+ /** @oneof */
149
+ interface CustomerIdOneOf {
150
+ /**
151
+ * Visitor ID of the customer. Available when the customer is an anonymous
152
+ * site visitor.
153
+ * @format GUID
154
+ */
155
+ visitorId?: string;
156
+ /**
157
+ * Contact ID of the customer. Available when the customer is a
158
+ * [contact](https://dev.wix.com/docs/rest/api-reference/people-communications/contacts/contacts/contact-v-4#contact-object).
159
+ * @format GUID
160
+ */
161
+ contactId?: string;
162
+ /**
163
+ * Member ID of the customer. Available when the customer is a
164
+ * [member](https://dev.wix.com/docs/rest/api-reference/people-communications/members/members#member-object).
165
+ * @format GUID
166
+ */
167
+ memberId?: string;
168
+ /**
169
+ * Wix account ID
170
+ * @format GUID
171
+ */
172
+ accountId?: string;
173
+ }
174
+ declare enum SubscriptionStatusEnumSubscriptionStatus {
175
+ UNKNOWN = "UNKNOWN",
176
+ /** Subscription created in this status, but hasn't been paid for yet. Filtered out from subscriptions querying. */
177
+ DRAFT = "DRAFT",
178
+ /** Subscription that will be active in future. */
179
+ PENDING = "PENDING",
180
+ /** Subscription is active */
181
+ ACTIVE = "ACTIVE",
182
+ /** Subscription is paused */
183
+ PAUSED = "PAUSED",
184
+ /** Subscription was ended */
185
+ ENDED = "ENDED",
186
+ /** Subscription was canceled or auto-renew off. Ended before its time. */
187
+ CANCELED = "CANCELED"
188
+ }
189
+ /** @enumType */
190
+ type SubscriptionStatusEnumSubscriptionStatusWithLiterals = SubscriptionStatusEnumSubscriptionStatus | 'UNKNOWN' | 'DRAFT' | 'PENDING' | 'ACTIVE' | 'PAUSED' | 'ENDED' | 'CANCELED';
191
+ interface BillingSettings {
192
+ /**
193
+ * Currency of all subscription items prices. Three letter ISO currency code. https://en.wikipedia.org/wiki/ISO_4217
194
+ * @format CURRENCY
195
+ */
196
+ currency?: string;
197
+ /** customer payment source to make recurring payments with */
198
+ paymentMethod?: PaymentMethod;
199
+ /** Instructs how payments will be collected. */
200
+ collectionMethod?: CollectionMethodEnumCollectionMethodWithLiterals;
201
+ /**
202
+ * Duration of cycle. For example, 1 MONTH, 2 WEEKS, 7 DAYS, 1 YEAR etc.
203
+ * Shortest supported cycle duration is 7 days.
204
+ */
205
+ cycleDuration?: Duration;
206
+ /**
207
+ * Number of billing cycles. If not set subscription auto-renewed until cycle-auto-renew will be disabled.
208
+ * @min 1
209
+ */
210
+ totalCycles?: number | null;
211
+ /** If set to false, subscription will be canceled at the next billing cycle. */
212
+ cycleAutoRenew?: boolean;
213
+ /** Billing Schedule to be defined in order to override default billing schedule */
214
+ customBillingSchedule?: CustomBillingSchedule;
215
+ /** Definition of trial period */
216
+ freeTrialDuration?: Duration;
217
+ /**
218
+ * Shipping costs collected each cycle
219
+ * @format DECIMAL_VALUE
220
+ * @deprecated
221
+ * @replacedBy shipping_charges
222
+ * @targetRemovalDate 2024-10-31
223
+ */
224
+ shippingFee?: string | null;
225
+ /** Billing address associated with subscription to be used for payments. */
226
+ billingAddress?: FullAddressDetails;
227
+ taxSettings?: TaxSettings;
228
+ /**
229
+ * Fees that are only added to an invoice when a specific condition is met.
230
+ * For example, a setup fee that only applies to the very first invoice of a
231
+ * subscription.
232
+ *
233
+ * Max: 5 additional fees
234
+ * @maxSize 5
235
+ */
236
+ additionalFees?: AdditionalFee[];
237
+ /** Shipping fee charges */
238
+ shippingCharges?: ShippingCharges;
239
+ /**
240
+ * General discount that applied to all items in the subscription
241
+ * @maxSize 5
242
+ */
243
+ discounts?: Discount[];
244
+ /**
245
+ * Details about the external collection service.
246
+ * Only set when the collection_method is EXTERNAL.
247
+ */
248
+ externalCollectionDetails?: ExternalCollectionDetails;
249
+ }
250
+ interface PaymentMethod {
251
+ /**
252
+ * reference to payment source id stored in payments system
253
+ * @format GUID
254
+ */
255
+ _id?: string;
256
+ }
257
+ declare enum CollectionMethodEnumCollectionMethod {
258
+ UNKNOWN = "UNKNOWN",
259
+ /** Subscriber automatically charged */
260
+ AUTO_CHARGE = "AUTO_CHARGE",
261
+ /** Payments manually collected and managed by owner */
262
+ OFFLINE = "OFFLINE",
263
+ /** Payment will be collected somehow. Billing only issues invoice per cycle. */
264
+ SEND_INVOICE = "SEND_INVOICE",
265
+ /** Payment will be collected externally */
266
+ EXTERNAL = "EXTERNAL",
267
+ /** Indicates the product has a zero amount, meaning its free with no payment required. */
268
+ FREE = "FREE"
269
+ }
270
+ /** @enumType */
271
+ type CollectionMethodEnumCollectionMethodWithLiterals = CollectionMethodEnumCollectionMethod | 'UNKNOWN' | 'AUTO_CHARGE' | 'OFFLINE' | 'SEND_INVOICE' | 'EXTERNAL' | 'FREE';
272
+ interface Duration {
273
+ /** Duration unit: DAY, WEEK, MONTH, YEAR */
274
+ unit?: DurationUnitWithLiterals;
275
+ /**
276
+ * Amount of units. For example, 1 MONTH, 1 YEAR, 2 WEEKS, etc. Optional. Default is 1.
277
+ * @min 1
278
+ */
279
+ count?: number | null;
280
+ }
281
+ declare enum DurationUnit {
282
+ UNKNOWN = "UNKNOWN",
283
+ DAY = "DAY",
284
+ WEEK = "WEEK",
285
+ MONTH = "MONTH",
286
+ YEAR = "YEAR"
287
+ }
288
+ /** @enumType */
289
+ type DurationUnitWithLiterals = DurationUnit | 'UNKNOWN' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
290
+ interface CustomBillingSchedule {
291
+ /**
292
+ * Amount of cycles to be paid on Subscription creation, currently only cycles_to_pay_on_creation equals to 1 is supported
293
+ * When used with Subscription.start_date, Subscription cycles will be paid on creation but Subscription will be activated in the future
294
+ * @min 1
295
+ * @max 1
296
+ */
297
+ cyclesToPayOnCreation?: number | null;
298
+ }
299
+ interface FullAddressDetails {
300
+ /** Details about the person associated with the address. */
301
+ contactDetails?: FullAddressContactDetails;
302
+ /** Information about the address. */
303
+ address?: Address;
304
+ }
305
+ interface FullAddressContactDetails {
306
+ /** First name of the contact. */
307
+ firstName?: string | null;
308
+ /** Last name of the contact. */
309
+ lastName?: string | null;
310
+ /**
311
+ * Phone number of the contact.
312
+ * @format PHONE
313
+ */
314
+ phone?: string | null;
315
+ /** Company associated with the contact. */
316
+ company?: string | null;
317
+ /**
318
+ * Email address of the contact.
319
+ * @format EMAIL
320
+ */
321
+ email?: string | null;
322
+ }
323
+ interface Address extends AddressStreetOneOf {
324
+ /** Street name and number. */
325
+ streetAddress?: StreetAddress;
326
+ /** Main address line, usually street and number as free text. */
327
+ addressLine1?: string | null;
328
+ /**
329
+ * 2-letter country code in
330
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
331
+ * format.
332
+ * @format COUNTRY
333
+ */
334
+ country?: string | null;
335
+ /**
336
+ * Subdivision. Usually a state, region, prefecture, or province code,
337
+ * according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2).
338
+ */
339
+ subdivision?: string | null;
340
+ /** City name. */
341
+ city?: string | null;
342
+ /** Zip/postal code. */
343
+ postalCode?: string | null;
344
+ }
345
+ /** @oneof */
346
+ interface AddressStreetOneOf {
347
+ /** Street name and number. */
348
+ streetAddress?: StreetAddress;
349
+ /** Main address line, usually street and number as free text. */
350
+ addressLine?: string | null;
351
+ }
352
+ interface StreetAddress {
353
+ /** Street number. */
354
+ number?: string;
355
+ /** Street name. */
356
+ name?: string;
357
+ }
358
+ interface TaxSettings {
359
+ /** If true then taxes are included in given prices */
360
+ inclusive?: boolean;
361
+ }
362
+ interface AdditionalFee {
363
+ /**
364
+ * Name of the conditional fee.
365
+ *
366
+ * Max: 500 characters
367
+ * @maxLength 500
368
+ */
369
+ name?: string;
370
+ /**
371
+ * Amount of the conditional fee.
372
+ *
373
+ * Min: `0.01`
374
+ * @decimalValue options { gt:0.00 }
375
+ */
376
+ amount?: string;
377
+ /**
378
+ * When the fee is added to the invoice.
379
+ *
380
+ * + `UNKNOWN_FEE_TRIGGER`: There is no information about when the fee is added to an invoice.
381
+ * + `FIRST_PAYMENT`: The fee is only added to the very first invoice of a subscription.
382
+ * @deprecated When the fee is added to the invoice.
383
+ *
384
+ * + `UNKNOWN_FEE_TRIGGER`: There is no information about when the fee is added to an invoice.
385
+ * + `FIRST_PAYMENT`: The fee is only added to the very first invoice of a subscription.
386
+ * @replacedBy cycles
387
+ * @targetRemovalDate 2025-12-31
388
+ */
389
+ trigger?: AdditionalFeeTriggerWithLiterals;
390
+ /** Information about the tax of the conditional fee. */
391
+ tax?: Tax;
392
+ /**
393
+ * Specifies the cycles during which the fee will be applied. If this field is provided,
394
+ * it determines the exact range of cycles the fee applies to. The logic is as follows:
395
+ *
396
+ * - `cycle_from`: The first cycle the fee will be added to. Must be greater than 0.
397
+ * - `number_of_cycles`: The number of consecutive cycles the fee will be applied to,
398
+ * starting from `cycle_from`. If not specified, the fee applies to all cycles starting
399
+ * from `cycle_from`.
400
+ *
401
+ * Example:
402
+ * - `cycle_from = 1, number_of_cycles = 3`: Fee applies to cycles 1, 2, and 3.
403
+ * - `cycle_from = 2, number_of_cycles = None`: Fee applies to cycles 2 and onward indefinitely.
404
+ *
405
+ * If `cycles` is not specified (`None`), the fee will be applied on all cycles.
406
+ */
407
+ cycles?: Cycles;
408
+ /** Indicates the source of the fee, Contains app_id and entity_id */
409
+ origin?: Origin;
410
+ }
411
+ declare enum AdditionalFeeTrigger {
412
+ UNKNOWN = "UNKNOWN",
413
+ /** Charge upon subscription first payment */
414
+ FIRST_PAYMENT = "FIRST_PAYMENT"
415
+ }
416
+ /** @enumType */
417
+ type AdditionalFeeTriggerWithLiterals = AdditionalFeeTrigger | 'UNKNOWN' | 'FIRST_PAYMENT';
418
+ interface Tax extends TaxValueOneOf {
419
+ /**
420
+ * Tax amount for the invoice's line item. Available when the tax is an
421
+ * amount and not a precentage.
422
+ *
423
+ * Min: `0.01`
424
+ * @decimalValue options { gt:0.00 }
425
+ */
426
+ amount?: string;
427
+ /**
428
+ * Tax amount for the invoice's line item price and application fee.
429
+ * Can't be combined with `invoiceItems.priceDetails.discount`.
430
+ * Available when the tax is a precentage and not an amount.
431
+ *
432
+ * Min: `0.01`
433
+ * Max: `100`
434
+ * @decimalValue options { gt:0.00, lte:100 }
435
+ */
436
+ percentage?: string;
437
+ /** Dynamic tax calculation */
438
+ dynamic?: DynamicTax;
439
+ }
440
+ /** @oneof */
441
+ interface TaxValueOneOf {
442
+ /**
443
+ * Tax amount for the invoice's line item. Available when the tax is an
444
+ * amount and not a precentage.
445
+ *
446
+ * Min: `0.01`
447
+ * @decimalValue options { gt:0.00 }
448
+ */
449
+ amount?: string;
450
+ /**
451
+ * Tax amount for the invoice's line item price and application fee.
452
+ * Can't be combined with `invoiceItems.priceDetails.discount`.
453
+ * Available when the tax is a precentage and not an amount.
454
+ *
455
+ * Min: `0.01`
456
+ * Max: `100`
457
+ * @decimalValue options { gt:0.00, lte:100 }
458
+ */
459
+ percentage?: string;
460
+ /** Dynamic tax calculation */
461
+ dynamic?: DynamicTax;
462
+ }
463
+ interface DynamicTax {
464
+ /**
465
+ * Tax group ID used to calculate tax, default will be used if not available
466
+ * @format GUID
467
+ */
468
+ taxGroupId?: string | null;
469
+ /** Taxable address used to calculate tax */
470
+ taxableAddressType?: TaxableAddressTypeWithLiterals;
471
+ }
472
+ declare enum TaxableAddressType {
473
+ UNKNOWN = "UNKNOWN",
474
+ /** Tax will be calculated using a single address */
475
+ BUSINESS = "BUSINESS",
476
+ /** Tax will be calculated using multiple address (from BUSINESS to BILLING) */
477
+ BILLING = "BILLING",
478
+ /** Tax will be calculated using multiple address (from BUSINESS to SHIPPING) */
479
+ SHIPPING = "SHIPPING"
480
+ }
481
+ /** @enumType */
482
+ type TaxableAddressTypeWithLiterals = TaxableAddressType | 'UNKNOWN' | 'BUSINESS' | 'BILLING' | 'SHIPPING';
483
+ interface Cycles {
484
+ /**
485
+ * The cycle will start. Minimum cycle number is 1
486
+ * @min 1
487
+ */
488
+ cycleFrom?: number;
489
+ /**
490
+ * Number of cycles to be applied on. In order to apply a on all cycles until the end of the subscription, this field should be empty.
491
+ * @min 1
492
+ */
493
+ numberOfCycles?: number | null;
494
+ }
495
+ interface Origin {
496
+ /** @format GUID */
497
+ appId?: string;
498
+ /** @format GUID */
499
+ entityId?: string;
500
+ }
501
+ interface ShippingCharges {
502
+ /**
503
+ * Amount of the shipping fee in `0.00` format.
504
+ *
505
+ * Min: `0.01`
506
+ * @decimalValue options { gte:0.00, maxScale:2 }
507
+ */
508
+ amount?: string;
509
+ /** Tax of the shipping fee */
510
+ tax?: Tax;
511
+ /** @maxSize 5 */
512
+ discounts?: Discount[];
513
+ }
514
+ interface Discount extends DiscountValueOneOf {
515
+ /**
516
+ * Discount amount.
517
+ * Available when the discount is an amount.
518
+ *
519
+ * Min: `0.01`
520
+ * @decimalValue options { gt:0.00 }
521
+ */
522
+ amount?: string;
523
+ /**
524
+ * Discount percentage.
525
+ * Available when the discount is a parcentage value.
526
+ *
527
+ * Min: `0.01`
528
+ * Max: `100`
529
+ * @decimalValue options { gt:0.00, lte:100 }
530
+ */
531
+ percentage?: string;
532
+ cycles?: DiscountCycles;
533
+ /** Discount origin is coming from. Contains app_id and entity_id */
534
+ origin?: DiscountOrigin;
535
+ }
536
+ /** @oneof */
537
+ interface DiscountValueOneOf {
538
+ /**
539
+ * Discount amount.
540
+ * Available when the discount is an amount.
541
+ *
542
+ * Min: `0.01`
543
+ * @decimalValue options { gt:0.00 }
544
+ */
545
+ amount?: string;
546
+ /**
547
+ * Discount percentage.
548
+ * Available when the discount is a parcentage value.
549
+ *
550
+ * Min: `0.01`
551
+ * Max: `100`
552
+ * @decimalValue options { gt:0.00, lte:100 }
553
+ */
554
+ percentage?: string;
555
+ }
556
+ interface DiscountCycles {
557
+ /**
558
+ * The cycle from which the discount will start. Minimum cycle number is 1
559
+ * @min 1
560
+ */
561
+ cycleFrom?: number;
562
+ /**
563
+ * Number of cycles to be applied on them discount. In order to apply a discount on all cycles until the end of the subscription, this field should be empty.
564
+ * @min 1
565
+ */
566
+ numberOfCycles?: number | null;
567
+ }
568
+ interface DiscountOrigin {
569
+ /** @format GUID */
570
+ appId?: string;
571
+ /** @format GUID */
572
+ entityId?: string;
573
+ }
574
+ interface ExternalCollectionDetails {
575
+ /** The name of the external collector. */
576
+ collectorName?: string;
577
+ }
578
+ interface BillingStatus {
579
+ /**
580
+ * Current cycle of subscription billing schedule. When billing schedule starts cycles start from 1
581
+ * and incremented each next billing cycle.
582
+ * In case billing schedule not started (free trial, pay later start later) then current_cycle will remain 0
583
+ */
584
+ currentCycle?: number;
585
+ /** how many cycled are remaining, For auto-renew subscriptions is not set. */
586
+ remainingCycles?: number | null;
587
+ /** Date when charge will be for next billing cycle */
588
+ nextBillingDate?: Date | null;
589
+ /** Previous Date charged for previous billing cycle */
590
+ previousBillingDate?: Date | null;
591
+ /** last payment details */
592
+ latestPaymentData?: PaymentData;
593
+ /** Free trial data */
594
+ freeTrialData?: FreeTrialData;
595
+ /**
596
+ * Grace period information during grace period after payment failure
597
+ * @readonly
598
+ */
599
+ gracePeriodData?: GracePeriodData;
600
+ }
601
+ /** TODO: fill docs */
602
+ interface PaymentData {
603
+ /** @format GUID */
604
+ invoiceId?: string;
605
+ paymentStatus?: PaymentStatusWithLiterals;
606
+ totals?: Totals;
607
+ initialFailedPaymentDate?: Date | null;
608
+ }
609
+ declare enum PaymentStatus {
610
+ /** Payment status unknown */
611
+ UNKNOWN = "UNKNOWN",
612
+ /** Payment has not been paid */
613
+ UNPAID = "UNPAID",
614
+ /** Payment has been paid // TODO: p13n review: we are not sending event when in SEND_INVOICE mode cycle was paid. should we and which event? */
615
+ PAID = "PAID",
616
+ /** Payment failed */
617
+ FAILED = "FAILED"
618
+ }
619
+ /** @enumType */
620
+ type PaymentStatusWithLiterals = PaymentStatus | 'UNKNOWN' | 'UNPAID' | 'PAID' | 'FAILED';
621
+ interface Totals {
622
+ /**
623
+ * Total price of the subscription that the customer must pay per billing
624
+ * cycle. Calculated as: `subtotal + tax + shippingFee + applicationFee + extraCharge - discount - credit`
625
+ * @format DECIMAL_VALUE
626
+ * @readonly
627
+ */
628
+ totalPrice?: string;
629
+ /**
630
+ * Subtotal of all line items that belong to the subscription.
631
+ * Calculated as: `sum_{i=1}^{n} (itemPrice[i] * quantity[i])`
632
+ * @format DECIMAL_VALUE
633
+ * @readonly
634
+ */
635
+ subtotal?: string;
636
+ /**
637
+ * Total tax.
638
+ * @format DECIMAL_VALUE
639
+ * @readonly
640
+ */
641
+ tax?: string | null;
642
+ /**
643
+ * Total discount.
644
+ * @format DECIMAL_VALUE
645
+ * @readonly
646
+ */
647
+ discount?: string | null;
648
+ /**
649
+ * Total application fee.
650
+ * @format DECIMAL_VALUE
651
+ * @readonly
652
+ */
653
+ applicationFee?: string | null;
654
+ /**
655
+ * Total shipping fee.
656
+ * @format DECIMAL_VALUE
657
+ * @readonly
658
+ */
659
+ shippingFee?: string | null;
660
+ /**
661
+ * Total extra charges without tax.
662
+ * @format DECIMAL_VALUE
663
+ * @readonly
664
+ */
665
+ extraCharge?: string | null;
666
+ /**
667
+ * Total credits without tax.
668
+ * @format DECIMAL_VALUE
669
+ * @readonly
670
+ */
671
+ credit?: string | null;
672
+ /**
673
+ * The tax amount for the proration, which is also included in the total tax.
674
+ * @format DECIMAL_VALUE
675
+ * @readonly
676
+ */
677
+ prorationTax?: string | null;
678
+ }
679
+ interface FreeTrialData {
680
+ /**
681
+ * Date when free trial starts
682
+ * @readonly
683
+ */
684
+ startDate?: Date | null;
685
+ /**
686
+ * Date when free trial ends
687
+ * @readonly
688
+ */
689
+ endDate?: Date | null;
690
+ }
691
+ interface UpdateBillingDateData {
692
+ /**
693
+ * Date until the subscription is paid for.
694
+ * Different from `nextBillingDate` only when the next billing date is updated without immediately issuing a new invoice.
695
+ */
696
+ paidUntil?: Date | null;
697
+ /** Information about how to adjust the item's payment due to the update of the billing date */
698
+ proration?: Proration;
699
+ }
700
+ interface Proration extends ProrationTypeOneOf {
701
+ /**
702
+ * BASS automatically calculates the proration amount based on the number
703
+ * of days added to or removed from the current billing cycle. BASS uses
704
+ * this formula to calculate the charge or credit amount:
705
+ * `(Subscription total for the current billing cycle) * (number of days added to or removed from the current billing cycle) / (total number of days for the current billing cycle before the adjustment)`.
706
+ * For example, the customer has paid 100 UDS for the current
707
+ * billing cycle that last 31 days, and you want to extend the cycle by 8
708
+ * days. Then, BASS calculates the proration amount like this:
709
+ * `100 USD * 8 days / 31 days`, which equals `25.81 USD`.
710
+ */
711
+ timeBased?: TimeBasedProration;
712
+ /** Proration amount that's based on your custom calculation. */
713
+ custom?: CustomProration;
714
+ }
715
+ /** @oneof */
716
+ interface ProrationTypeOneOf {
717
+ /**
718
+ * BASS automatically calculates the proration amount based on the number
719
+ * of days added to or removed from the current billing cycle. BASS uses
720
+ * this formula to calculate the charge or credit amount:
721
+ * `(Subscription total for the current billing cycle) * (number of days added to or removed from the current billing cycle) / (total number of days for the current billing cycle before the adjustment)`.
722
+ * For example, the customer has paid 100 UDS for the current
723
+ * billing cycle that last 31 days, and you want to extend the cycle by 8
724
+ * days. Then, BASS calculates the proration amount like this:
725
+ * `100 USD * 8 days / 31 days`, which equals `25.81 USD`.
726
+ */
727
+ timeBased?: TimeBasedProration;
728
+ /** Proration amount that's based on your custom calculation. */
729
+ custom?: CustomProration;
730
+ }
731
+ interface TimeBasedProration {
732
+ }
733
+ interface CustomProration extends CustomProrationAmountOneOf {
734
+ /**
735
+ * Proration charge amount that's based on your custom calculation.
736
+ * Increases the total that the customer must pay with the next invoice.
737
+ *
738
+ * Min: `0.01`
739
+ * @decimalValue options { gt:0.00 }
740
+ */
741
+ charge?: string;
742
+ /**
743
+ * Proration credit amount that's based on your custom calculation.
744
+ * Lowers the total that the customer must pay with the next invoice.
745
+ *
746
+ * Min: `0.01`
747
+ * @decimalValue options { gt:0.00 }
748
+ */
749
+ credit?: string;
750
+ }
751
+ /** @oneof */
752
+ interface CustomProrationAmountOneOf {
753
+ /**
754
+ * Proration charge amount that's based on your custom calculation.
755
+ * Increases the total that the customer must pay with the next invoice.
756
+ *
757
+ * Min: `0.01`
758
+ * @decimalValue options { gt:0.00 }
759
+ */
760
+ charge?: string;
761
+ /**
762
+ * Proration credit amount that's based on your custom calculation.
763
+ * Lowers the total that the customer must pay with the next invoice.
764
+ *
765
+ * Min: `0.01`
766
+ * @decimalValue options { gt:0.00 }
767
+ */
768
+ credit?: string;
769
+ }
770
+ interface GracePeriodData {
771
+ /**
772
+ * Grace period start date
773
+ * @readonly
774
+ */
775
+ startDate?: Date | null;
776
+ /**
777
+ * Grace period end date
778
+ * @readonly
779
+ */
780
+ endDate?: Date | null;
781
+ /** Automatic retry data during grade period, if have any. Optional. */
782
+ automaticRetryData?: AutomaticRetryData;
783
+ }
784
+ interface AutomaticRetryData {
785
+ enabled?: boolean;
786
+ }
787
+ interface SubscriptionPolicies {
788
+ /** Subscription can be canceled by the customer who bought it */
789
+ customerCanCancel?: boolean;
790
+ /** Subscription end date can be updated by business */
791
+ businessCanExtend?: boolean;
792
+ /** Subscription can be canceled not only immediately, but also at end of billing cycle by turning off auto-renew */
793
+ allowEndOfCycleCancellation?: boolean;
794
+ }
795
+ interface PauseInfo {
796
+ pausePolicy?: PausePolicyWithLiterals;
797
+ pauseAt?: PauseAtWithLiterals;
798
+ startDate?: Date | null;
799
+ startCycle?: number | null;
800
+ resumeAt?: ResumeAtWithLiterals;
801
+ resumeDate?: Date | null;
802
+ resumeCycle?: number | null;
803
+ }
804
+ declare enum PausePolicy {
805
+ NONE = "NONE",
806
+ /** Pause the payment and the service. When resuming, the subscription end date is extended by the number of cycles postponed, and if the pause happened in a middle of a cycle, the payment date is postponed by the amount of days that already paid. */
807
+ SERVICE_AND_PAYMENTS = "SERVICE_AND_PAYMENTS",
808
+ /** Pause the service and continue the billing. When resuming, extend the service by the time that was paused */
809
+ SERVICE_ONLY = "SERVICE_ONLY"
810
+ }
811
+ /** @enumType */
812
+ type PausePolicyWithLiterals = PausePolicy | 'NONE' | 'SERVICE_AND_PAYMENTS' | 'SERVICE_ONLY';
813
+ declare enum PauseAt {
814
+ /** Cancel scheduled pause */
815
+ NONE = "NONE",
816
+ /** Pause the subscription now */
817
+ IMMEDIATELY = "IMMEDIATELY",
818
+ /** Pause the subscription at the next billing date */
819
+ NEXT_BILLING_DATE = "NEXT_BILLING_DATE",
820
+ /** A specific date must be defined in Schedule.specific_date */
821
+ SPECIFIC_DATE = "SPECIFIC_DATE",
822
+ /** The number of cycles must be defined in Schedule.number_of_cycles */
823
+ NUMBER_OF_CYCLES_FROM_TODAY = "NUMBER_OF_CYCLES_FROM_TODAY"
824
+ }
825
+ /** @enumType */
826
+ type PauseAtWithLiterals = PauseAt | 'NONE' | 'IMMEDIATELY' | 'NEXT_BILLING_DATE' | 'SPECIFIC_DATE' | 'NUMBER_OF_CYCLES_FROM_TODAY';
827
+ declare enum ResumeAt {
828
+ /** Cancel scheduled resume */
829
+ NONE = "NONE",
830
+ /** Resume the subscription now */
831
+ IMMEDIATELY = "IMMEDIATELY",
832
+ /** Resume the subscription at the next billing date */
833
+ NEXT_BILLING_DATE = "NEXT_BILLING_DATE",
834
+ /** A specific date must be defined in Schedule.specific_date */
835
+ SPECIFIC_DATE = "SPECIFIC_DATE"
836
+ }
837
+ /** @enumType */
838
+ type ResumeAtWithLiterals = ResumeAt | 'NONE' | 'IMMEDIATELY' | 'NEXT_BILLING_DATE' | 'SPECIFIC_DATE';
839
+ interface CancellationInfo {
840
+ /** Subscription cancel date. Can contain a future or past date */
841
+ cancellationDate?: Date | null;
842
+ /** Initiator for cancellation */
843
+ initiator?: HistoryActionInitiatorWithLiterals;
844
+ /** Reason for cancellation. Optional. */
845
+ reason?: string | null;
846
+ }
847
+ declare enum HistoryActionInitiator {
848
+ UNDEFINED = "UNDEFINED",
849
+ BUSINESS = "BUSINESS",
850
+ CUSTOMER = "CUSTOMER",
851
+ SYSTEM = "SYSTEM",
852
+ PAYMENT_FAILURE = "PAYMENT_FAILURE"
853
+ }
854
+ /** @enumType */
855
+ type HistoryActionInitiatorWithLiterals = HistoryActionInitiator | 'UNDEFINED' | 'BUSINESS' | 'CUSTOMER' | 'SYSTEM' | 'PAYMENT_FAILURE';
856
+ interface SubscriptionUpdateData {
857
+ /** @maxSize 100 */
858
+ itemsToUpdate?: ItemChange[];
859
+ /** @maxSize 99 */
860
+ itemsToAdd?: Item[];
861
+ /**
862
+ * @format GUID
863
+ * @maxSize 99
864
+ */
865
+ itemsToDelete?: string[] | null;
866
+ /** @readonly */
867
+ numberOfRequests?: number;
868
+ }
869
+ interface ItemChange {
870
+ /**
871
+ * Item ID
872
+ * @format GUID
873
+ */
874
+ _id?: string;
875
+ pricingModel?: PricingModel;
876
+ /** @min 1 */
877
+ quantity?: number | null;
878
+ tax?: Tax;
879
+ }
880
+ interface PricingModel extends PricingModelModelOneOf {
881
+ /** Details about the fixed item price. */
882
+ fixedPrice?: FixedPrice;
883
+ }
884
+ /** @oneof */
885
+ interface PricingModelModelOneOf {
886
+ /** Details about the fixed item price. */
887
+ fixedPrice?: FixedPrice;
888
+ }
889
+ interface FixedPrice {
890
+ /**
891
+ * Fixed item price with a period as a decimal separator. For example, `3.99`.
892
+ * Price doesn't include tax, discounts, or application fee.
893
+ *
894
+ * Min: `0.01`
895
+ * @decimalValue options { gte:0.00 }
896
+ */
897
+ itemPrice?: string;
898
+ }
899
+ interface Item {
900
+ /**
901
+ * Unique identifier of subscription item. Automatically generated and read-only.
902
+ * @readonly
903
+ * @format GUID
904
+ */
905
+ _id?: string | null;
906
+ /**
907
+ * Name of the item. Typically product name.
908
+ * @minLength 1
909
+ * @maxLength 200
910
+ */
911
+ name?: string;
912
+ /**
913
+ * Description of the item.
914
+ * @maxLength 500
915
+ */
916
+ description?: string | null;
917
+ /** References to external product catalog data known to client. */
918
+ catalogReference?: CatalogReference;
919
+ /** Category of item. Whether it is digital or physical one. */
920
+ category?: ItemCategoryWithLiterals;
921
+ /**
922
+ * Amount of products
923
+ * @min 1
924
+ */
925
+ quantity?: number;
926
+ /** Pricing model of the item. Whether fixed price or dynamic price models. */
927
+ pricingModel?: PricingModel;
928
+ /** Tax, positive value, optional */
929
+ tax?: Tax;
930
+ /**
931
+ * Discounts applied on item price
932
+ * @maxSize 5
933
+ */
934
+ discounts?: Discount[];
935
+ /** Application specific fee, positive value, optional (if application_fee == 0, don't include it to request). Only positive values. */
936
+ applicationFee?: ApplicationFee;
937
+ /**
938
+ * External reference identifier for mapping item in consumer's system.
939
+ * This allows the consumer to correlate the item in their system with the item in this API.
940
+ * @format GUID
941
+ */
942
+ externalId?: string | null;
943
+ /**
944
+ * Key / Value store to keep up to 10 additional values related to the subscription item.
945
+ * Key max length = 50, Value max length = 200. Value can not be empty.
946
+ * Should not include any sensitive or PII information.
947
+ * @maxSize 10
948
+ */
949
+ metadata?: Record<string, string>;
950
+ }
951
+ interface CatalogReference {
952
+ /**
953
+ * Product ID from the external catalog.
954
+ * @minLength 1
955
+ * @maxLength 50
956
+ */
957
+ catalogItemId?: string;
958
+ /**
959
+ * ID of the app that the product catalog belongs to.
960
+ * When omitted, BASS assumes that the product belongs to the subscription's
961
+ * `origin.appId`.
962
+ *
963
+ * Min: 1 character
964
+ * Max: 50 characters
965
+ * @minLength 1
966
+ * @maxLength 50
967
+ */
968
+ appId?: string | null;
969
+ }
970
+ declare enum ItemCategory {
971
+ UNKNOWN = "UNKNOWN",
972
+ PHYSICAL = "PHYSICAL",
973
+ DIGITAL = "DIGITAL"
974
+ }
975
+ /** @enumType */
976
+ type ItemCategoryWithLiterals = ItemCategory | 'UNKNOWN' | 'PHYSICAL' | 'DIGITAL';
977
+ interface ApplicationFee extends ApplicationFeeValueOneOf {
978
+ /**
979
+ * Amount of the application fee in `0.00` format.
980
+ * @format DECIMAL_VALUE
981
+ */
982
+ amount?: string;
983
+ /**
984
+ * Discounts for the application fee.
985
+ *
986
+ * Max: 5 discounts
987
+ * @maxSize 5
988
+ */
989
+ discounts?: Discount[];
990
+ }
991
+ /** @oneof */
992
+ interface ApplicationFeeValueOneOf {
993
+ /**
994
+ * Amount of the application fee in `0.00` format.
995
+ * @format DECIMAL_VALUE
996
+ */
997
+ amount?: string;
998
+ }
999
+ interface SpecificDateSubscriptionUpdateData {
1000
+ updateData?: SubscriptionUpdateData;
1001
+ executionDate?: Date | null;
1002
+ }
1003
+ interface PlatformOrigin {
1004
+ /** @format GUID */
1005
+ appId?: string | null;
1006
+ /** @format GUID */
1007
+ entityId?: string | null;
1008
+ }
1009
+ interface SubscriptionBillingCyclePaid {
1010
+ /** The subscription for which one of the invoices has been marked as paid */
1011
+ subscription?: Subscription;
1012
+ /** The cycle that has been marked as paid */
1013
+ paidCycle?: number;
1014
+ /**
1015
+ * The invoice ID that has been marked as paid
1016
+ * @format GUID
1017
+ */
1018
+ invoiceId?: string;
1019
+ /**
1020
+ * The transaction ID of the payment order that has been marked as paid
1021
+ * @format GUID
1022
+ */
1023
+ paymentTransactionId?: string | null;
1024
+ }
1025
+ interface GetSubscriptionRequest {
1026
+ /** @format GUID */
1027
+ _id: string;
1028
+ }
1029
+ interface GetSubscriptionResponse {
1030
+ subscription?: Subscription;
1031
+ }
1032
+ interface CustomerCancelSubscriptionRequest {
1033
+ /** @format GUID */
1034
+ _id: string;
1035
+ /** Optional action reason message */
1036
+ reason?: string | null;
1037
+ }
1038
+ interface CustomerCancelSubscriptionResponse {
1039
+ subscription?: Subscription;
1040
+ }
1041
+ /**
1042
+ * Sent each time a subscription status has been set to Canceled
1043
+ * Canceled shows that a subscription was canceled and ended its life cycle as a result of some intervention
1044
+ * For example:
1045
+ * * A user decided to cancel a subscription before the original end date
1046
+ * * A subscription is canceled due to bad payment
1047
+ */
1048
+ interface SubscriptionCanceled {
1049
+ subscription?: Subscription;
1050
+ actionDetails?: ActionDetails;
1051
+ }
1052
+ interface ActionDetails {
1053
+ initiator?: HistoryActionInitiatorWithLiterals;
1054
+ reason?: string | null;
1055
+ }
1056
+ interface CustomerTurnOnAutoRenewalRequest {
1057
+ /** @format GUID */
1058
+ _id: string;
1059
+ /** Optional action reason message */
1060
+ reason?: string | null;
1061
+ }
1062
+ interface CustomerTurnOnAutoRenewalResponse {
1063
+ subscription?: Subscription;
1064
+ }
1065
+ interface CustomerTurnOffAutoRenewalRequest {
1066
+ /** @format GUID */
1067
+ _id: string;
1068
+ /** Optional action reason message */
1069
+ reason?: string | null;
1070
+ }
1071
+ interface CustomerTurnOffAutoRenewalResponse {
1072
+ subscription?: Subscription;
1073
+ }
1074
+ interface CustomerExtendSubscriptionRequest {
1075
+ /**
1076
+ * The ID of the subscription to be extended
1077
+ * @format GUID
1078
+ */
1079
+ _id: string;
1080
+ /** Optional action reason message */
1081
+ reason?: string | null;
1082
+ /**
1083
+ * For termed - Subscription end date will be updated with the extension period and number of cycles will be added
1084
+ * @min 1
1085
+ */
1086
+ billingCyclesToAdd: number | null;
1087
+ }
1088
+ interface CustomerExtendSubscriptionResponse {
1089
+ /** The now extended subscription */
1090
+ subscription?: Subscription;
1091
+ }
1092
+ interface SubscriptionExtended extends SubscriptionExtendedExtendPolicyOneOf {
1093
+ extensionPeriod?: Duration;
1094
+ extensionBillingCycles?: number;
1095
+ subscription?: Subscription;
1096
+ actionDetails?: ActionDetails;
1097
+ }
1098
+ /** @oneof */
1099
+ interface SubscriptionExtendedExtendPolicyOneOf {
1100
+ extensionPeriod?: Duration;
1101
+ extensionBillingCycles?: number;
1102
+ }
1103
+ interface QuerySubscriptionsRequest {
1104
+ query?: QueryV2;
1105
+ }
1106
+ interface QueryV2 extends QueryV2PagingMethodOneOf {
1107
+ /** Paging options to limit and offset the number of items. */
1108
+ paging?: Paging;
1109
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
1110
+ cursorPaging?: CursorPaging;
1111
+ /**
1112
+ * Filter object.
1113
+ *
1114
+ * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
1115
+ */
1116
+ filter?: Record<string, any> | null;
1117
+ /**
1118
+ * Sort object.
1119
+ *
1120
+ * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
1121
+ */
1122
+ sort?: Sorting[];
1123
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
1124
+ fields?: string[];
1125
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
1126
+ fieldsets?: string[];
1127
+ }
1128
+ /** @oneof */
1129
+ interface QueryV2PagingMethodOneOf {
1130
+ /** Paging options to limit and offset the number of items. */
1131
+ paging?: Paging;
1132
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
1133
+ cursorPaging?: CursorPaging;
1134
+ }
1135
+ interface Sorting {
1136
+ /**
1137
+ * Name of the field to sort by.
1138
+ * @maxLength 512
1139
+ */
1140
+ fieldName?: string;
1141
+ /** Sort order. */
1142
+ order?: SortOrderWithLiterals;
1143
+ }
1144
+ declare enum SortOrder {
1145
+ ASC = "ASC",
1146
+ DESC = "DESC"
1147
+ }
1148
+ /** @enumType */
1149
+ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
1150
+ interface Paging {
1151
+ /** Number of items to load. */
1152
+ limit?: number | null;
1153
+ /** Number of items to skip in the current sort order. */
1154
+ offset?: number | null;
1155
+ }
1156
+ interface CursorPaging {
1157
+ /**
1158
+ * Maximum number of items to return in the results.
1159
+ * @max 100
1160
+ */
1161
+ limit?: number | null;
1162
+ /**
1163
+ * Pointer to the next or previous page in the list of results.
1164
+ *
1165
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
1166
+ * Not relevant for the first request.
1167
+ * @maxLength 16000
1168
+ */
1169
+ cursor?: string | null;
1170
+ }
1171
+ interface QuerySubscriptionsResponse {
1172
+ subscriptions?: Subscription[];
1173
+ metadata?: PagingMetadataV2;
1174
+ }
1175
+ interface PagingMetadataV2 {
1176
+ /** Number of items returned in the response. */
1177
+ count?: number | null;
1178
+ /** Offset that was requested. */
1179
+ offset?: number | null;
1180
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
1181
+ total?: number | null;
1182
+ /** Flag that indicates the server failed to calculate the `total` field. */
1183
+ tooManyToCount?: boolean | null;
1184
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
1185
+ cursors?: Cursors;
1186
+ }
1187
+ interface Cursors {
1188
+ /**
1189
+ * Cursor string pointing to the next page in the list of results.
1190
+ * @maxLength 16000
1191
+ */
1192
+ next?: string | null;
1193
+ /**
1194
+ * Cursor pointing to the previous page in the list of results.
1195
+ * @maxLength 16000
1196
+ */
1197
+ prev?: string | null;
1198
+ }
1199
+ interface CountSubscriptionsRequest {
1200
+ /** Filters to specify which subscriptions are counted. */
1201
+ filter?: CountSubscriptionFilter;
1202
+ }
1203
+ interface CountSubscriptionFilter extends CountSubscriptionFilterStatusOneOf {
1204
+ /** List of statuses to filter the counted subscriptions by. */
1205
+ statuses?: SubscriptionStatus;
1206
+ /**
1207
+ * Predefined status combination to filter the counted subscriptions by.
1208
+ * + `ALL`: Includes these subscription statuses: `"DRAFT"`, `"PENDING"`, `"ACTIVE"`, `"PAUSED"`, `"ENDED"`, and `"CANCELED"`.
1209
+ * + `LIVE`: Includes these subscription statuses: `"PENDING"`, `"ACTIVE"`, and `"PAUSED"`.
1210
+ */
1211
+ statusGroup?: SubscriptionStatusGroupWithLiterals;
1212
+ /**
1213
+ * Customer ID to filter the counted subscriptions by. You can pass a
1214
+ * [member ID](https://bo.wix.com/wix-docs/rest/members/members/member-object),
1215
+ * [contact ID](https://bo.wix.com/wix-docs/rest/crm/contacts/contacts-v4/contact-object),
1216
+ * or the ID of an anonymous site visitor as `customerId`. When providing a
1217
+ * `customerId` you must also specify a `paymentMethodId`.
1218
+ * @format GUID
1219
+ */
1220
+ customerId?: string | null;
1221
+ /**
1222
+ * ID of the payment method to filter the counted subscriptions by.
1223
+ * You must provide a `paymentMethodId` when passing a `customerId`.
1224
+ * @format GUID
1225
+ */
1226
+ paymentMethodId?: string | null;
1227
+ }
1228
+ /** @oneof */
1229
+ interface CountSubscriptionFilterStatusOneOf {
1230
+ /** List of statuses to filter the counted subscriptions by. */
1231
+ statuses?: SubscriptionStatus;
1232
+ /**
1233
+ * Predefined status combination to filter the counted subscriptions by.
1234
+ * + `ALL`: Includes these subscription statuses: `"DRAFT"`, `"PENDING"`, `"ACTIVE"`, `"PAUSED"`, `"ENDED"`, and `"CANCELED"`.
1235
+ * + `LIVE`: Includes these subscription statuses: `"PENDING"`, `"ACTIVE"`, and `"PAUSED"`.
1236
+ */
1237
+ statusGroup?: SubscriptionStatusGroupWithLiterals;
1238
+ }
1239
+ interface SubscriptionStatus {
1240
+ /**
1241
+ * Statuses to filter the counted subscriptions by.
1242
+ *
1243
+ * Max: 6 statuses
1244
+ * @maxSize 6
1245
+ */
1246
+ statuses?: SubscriptionStatusEnumSubscriptionStatusWithLiterals[];
1247
+ }
1248
+ declare enum SubscriptionStatusGroup {
1249
+ ALL = "ALL",
1250
+ /** Union of ACTIVE, PAUSED and PENDING */
1251
+ LIVE = "LIVE"
1252
+ }
1253
+ /** @enumType */
1254
+ type SubscriptionStatusGroupWithLiterals = SubscriptionStatusGroup | 'ALL' | 'LIVE';
1255
+ interface CountSubscriptionsResponse {
1256
+ /**
1257
+ * List of statuses and the corresponding number of subscriptions that match
1258
+ * the filters.
1259
+ */
1260
+ countByStatus?: CountByStatus[];
1261
+ /** Total number of subscriptions that match the filters. */
1262
+ total?: number;
1263
+ }
1264
+ interface CountByStatus {
1265
+ /** Subscription status. */
1266
+ status?: SubscriptionStatusEnumSubscriptionStatusWithLiterals;
1267
+ /** Number of subscriptions with the status that match the filters. */
1268
+ count?: number;
1269
+ }
1270
+ interface UpdateSubscriptionPaymentMethodRequest {
1271
+ /**
1272
+ * Subscription ID
1273
+ * @format GUID
1274
+ */
1275
+ _id: string;
1276
+ /** @format GUID */
1277
+ paymentMethodId: string;
1278
+ }
1279
+ interface UpdateSubscriptionPaymentMethodResponse {
1280
+ subscription?: Subscription;
1281
+ }
1282
+ interface CustomerAllowedActionsRequest {
1283
+ /** @format GUID */
1284
+ _id: string;
1285
+ }
1286
+ interface CustomerAllowedActionsResponse {
1287
+ actions?: Action[];
1288
+ }
1289
+ interface Action {
1290
+ actionType?: ActionTypeWithLiterals;
1291
+ pausePolicies?: PausePolicyWithLiterals[];
1292
+ pauseAt?: PauseAtWithLiterals[];
1293
+ resumeAt?: ResumeAtWithLiterals[];
1294
+ extendPolicies?: ExtendPolicyTypeWithLiterals[];
1295
+ }
1296
+ declare enum ActionType {
1297
+ NONE = "NONE",
1298
+ CREATION = "CREATION",
1299
+ CANCEL = "CANCEL",
1300
+ CYCLE_AUTO_RENEW_ON = "CYCLE_AUTO_RENEW_ON",
1301
+ CYCLE_AUTO_RENEW_OFF = "CYCLE_AUTO_RENEW_OFF",
1302
+ PAUSE = "PAUSE",
1303
+ RESUME = "RESUME",
1304
+ MARK_AS_PAID = "MARK_AS_PAID",
1305
+ EXTEND = "EXTEND",
1306
+ UPDATE = "UPDATE",
1307
+ UPDATE_START_DATE = "UPDATE_START_DATE",
1308
+ UPM = "UPM",
1309
+ UPDATE_BILLING_DATE = "UPDATE_BILLING_DATE",
1310
+ UPDATE_COLLECTION_METHOD = "UPDATE_COLLECTION_METHOD"
1311
+ }
1312
+ /** @enumType */
1313
+ 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';
1314
+ declare enum ExtendPolicyType {
1315
+ PERIOD = "PERIOD",
1316
+ BILLING_CYCLE = "BILLING_CYCLE"
1317
+ }
1318
+ /** @enumType */
1319
+ type ExtendPolicyTypeWithLiterals = ExtendPolicyType | 'PERIOD' | 'BILLING_CYCLE';
1320
+ interface CustomerListUpcomingChargesRequest {
1321
+ /**
1322
+ * Subscription id upcoming charge to be previewed for
1323
+ * @format GUID
1324
+ */
1325
+ _id: string;
1326
+ }
1327
+ interface CustomerListUpcomingChargesResponse {
1328
+ /** Subscription upcoming charge. Will be empty if no more billing scheduled. */
1329
+ upcomingCharge?: SubscriptionCharge;
1330
+ }
1331
+ interface SubscriptionCharge {
1332
+ /** cycle of future charge */
1333
+ cycle?: number;
1334
+ /** date of the charge */
1335
+ billingDate?: Date | null;
1336
+ /** breakdown of charge */
1337
+ totals?: Totals;
1338
+ /** List of items in the invoice */
1339
+ invoiceItems?: InvoiceItem[];
1340
+ /** Discount details for the invoice */
1341
+ discount?: InvoiceDiscount;
1342
+ }
1343
+ interface InvoiceItem extends InvoiceItemPaymentTypeOneOf {
1344
+ /** Information about a line item that's purchased on a recurring basis. */
1345
+ recurring?: Recurring;
1346
+ /**
1347
+ * Empty object that's available when the line item is purchased a single
1348
+ * time, not on a recurring basis.
1349
+ */
1350
+ oneTime?: OneTime;
1351
+ /**
1352
+ * ID of the invoice line item.
1353
+ * @format GUID
1354
+ */
1355
+ _id?: string;
1356
+ /**
1357
+ * ID of the [subscription](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/subscription-object)
1358
+ * that belongs to the invoice line item.
1359
+ * @format GUID
1360
+ */
1361
+ subscriptionId?: string | null;
1362
+ /**
1363
+ * Name of the invoice line item.
1364
+ * Typically the product name.
1365
+ *
1366
+ * Max: 200 characters
1367
+ * @minLength 1
1368
+ * @maxLength 200
1369
+ */
1370
+ name?: string;
1371
+ /**
1372
+ * Description of the invoice line item.
1373
+ *
1374
+ * Max: 500 characters
1375
+ * @maxLength 500
1376
+ */
1377
+ description?: string | null;
1378
+ /** Information about the product from the external product catalog. */
1379
+ catalogReference?: CatalogReference;
1380
+ /**
1381
+ * Product category.
1382
+ *
1383
+ * + `"UNKNOWN"`: There is no information about the product category.
1384
+ * + `"PHYSICAL"`: A physical product that's shipped to the shipping address.
1385
+ * + `"DIGITAL"`: A digital product that doesn't require shipping.
1386
+ */
1387
+ category?: ItemCategoryWithLiterals;
1388
+ /** Quantity of the invoice line item. */
1389
+ quantity?: number;
1390
+ /** Information about the invoice line item's price. */
1391
+ priceDetails?: PriceDetails;
1392
+ /** Information about the invoice line item's totals */
1393
+ totals?: Totals;
1394
+ /**
1395
+ * Information about the invoice line item's tax data
1396
+ * @readonly
1397
+ */
1398
+ taxData?: ItemTaxData;
1399
+ /**
1400
+ * ID of the [one time] that belongs to the invoice line item.
1401
+ * @format GUID
1402
+ */
1403
+ oneTimeItemId?: string | null;
1404
+ /**
1405
+ * Key / Value store to keep up to 10 additional values related to the invoice item.
1406
+ * Key max length = 50, Value max length = 200. Value can not be empty.
1407
+ * Should not include any sensitive or PII information.
1408
+ * @maxSize 10
1409
+ */
1410
+ metadata?: Record<string, string>;
1411
+ }
1412
+ /** @oneof */
1413
+ interface InvoiceItemPaymentTypeOneOf {
1414
+ /** Information about a line item that's purchased on a recurring basis. */
1415
+ recurring?: Recurring;
1416
+ /**
1417
+ * Empty object that's available when the line item is purchased a single
1418
+ * time, not on a recurring basis.
1419
+ */
1420
+ oneTime?: OneTime;
1421
+ }
1422
+ interface Recurring {
1423
+ /**
1424
+ * Number of cycles. Describes how many times a customer purchases the line item
1425
+ * on a recurring basis.
1426
+ */
1427
+ cycleNumber?: number;
1428
+ }
1429
+ interface OneTime {
1430
+ }
1431
+ interface PriceDetails {
1432
+ /**
1433
+ * Price of the invoice line item in `0.00` format.
1434
+ * A minus sign (-) indicates that the amount is negative.
1435
+ * @format DECIMAL_VALUE
1436
+ */
1437
+ price?: string;
1438
+ /** Information about the invoice line item's tax. */
1439
+ tax?: Tax;
1440
+ /** Discount that's applied to a specicific invoice line item. */
1441
+ discount?: InvoiceDiscount;
1442
+ /**
1443
+ * Application fee. Set by the origin app, and not by BASS. Wix receives the
1444
+ * full `applicationFee`, while the merchant doesn't receive any portion of it.
1445
+ */
1446
+ applicationFeeDetails?: InvoiceApplicationFee;
1447
+ }
1448
+ interface InvoiceDiscount extends InvoiceDiscountValueOneOf {
1449
+ /**
1450
+ * Discount amount.
1451
+ * Available when the discount is an amount.
1452
+ *
1453
+ * Min: `0.01`
1454
+ * @decimalValue options { gt:0.00 }
1455
+ */
1456
+ amount?: string;
1457
+ /**
1458
+ * Discount percentage.
1459
+ * Available when the discount is a percentage value.
1460
+ *
1461
+ * Min: `0.01`
1462
+ * Max: `100`
1463
+ * @decimalValue options { gt:0.00, lte:100 }
1464
+ */
1465
+ percentage?: string;
1466
+ /** Indicates the source of the discount. . Contains app_id and entity_id */
1467
+ origin?: DiscountOrigin;
1468
+ }
1469
+ /** @oneof */
1470
+ interface InvoiceDiscountValueOneOf {
1471
+ /**
1472
+ * Discount amount.
1473
+ * Available when the discount is an amount.
1474
+ *
1475
+ * Min: `0.01`
1476
+ * @decimalValue options { gt:0.00 }
1477
+ */
1478
+ amount?: string;
1479
+ /**
1480
+ * Discount percentage.
1481
+ * Available when the discount is a percentage value.
1482
+ *
1483
+ * Min: `0.01`
1484
+ * Max: `100`
1485
+ * @decimalValue options { gt:0.00, lte:100 }
1486
+ */
1487
+ percentage?: string;
1488
+ }
1489
+ interface InvoiceApplicationFee extends InvoiceApplicationFeeValueOneOf {
1490
+ /**
1491
+ * Application fee amount. Set by the origin app, and not by BASS. Wix
1492
+ * receives the full `applicationFee`, while the merchant doesn't receive
1493
+ * any portion of it.
1494
+ * @format DECIMAL_VALUE
1495
+ */
1496
+ amount?: string;
1497
+ /** Information about the discount for the invoice line item's application fee. */
1498
+ discount?: InvoiceDiscount;
1499
+ }
1500
+ /** @oneof */
1501
+ interface InvoiceApplicationFeeValueOneOf {
1502
+ /**
1503
+ * Application fee amount. Set by the origin app, and not by BASS. Wix
1504
+ * receives the full `applicationFee`, while the merchant doesn't receive
1505
+ * any portion of it.
1506
+ * @format DECIMAL_VALUE
1507
+ */
1508
+ amount?: string;
1509
+ }
1510
+ interface ItemTaxData {
1511
+ /** Aggregated tax from tax_breakdowns */
1512
+ lineItemTaxSummary?: LineItemTaxSummary;
1513
+ /**
1514
+ * A detailed description of all the tax authorities applied on this item.
1515
+ * @minSize 1
1516
+ * @maxSize 100
1517
+ */
1518
+ taxBreakdowns?: TaxBreakdown[];
1519
+ }
1520
+ interface LineItemTaxSummary {
1521
+ /**
1522
+ * Calculated from external tax summary
1523
+ * @format DECIMAL_VALUE
1524
+ */
1525
+ aggregatedTaxAmount?: string;
1526
+ /**
1527
+ * Aggregated from tax_breakdowns
1528
+ * @decimalValue options { gte:0, maxScale:6 }
1529
+ */
1530
+ aggregatedTaxRate?: string;
1531
+ /**
1532
+ * Total taxable amount for this line item.
1533
+ * @format DECIMAL_VALUE
1534
+ * @decimalValue options { maxScale:4 }
1535
+ */
1536
+ taxableAmount?: string;
1537
+ /**
1538
+ * Aggregated from tax_breakdowns after applying exemptions
1539
+ * @format DECIMAL_VALUE
1540
+ * @decimalValue options { maxScale:4 }
1541
+ */
1542
+ finalTaxAmount?: string | null;
1543
+ }
1544
+ interface TaxBreakdown {
1545
+ taxType?: string;
1546
+ /** @decimalValue options { maxScale:4 } */
1547
+ taxRate?: string;
1548
+ /** @format DECIMAL_VALUE */
1549
+ taxAmount?: string | null;
1550
+ /** @format DECIMAL_VALUE */
1551
+ taxableAmount?: string | null;
1552
+ /** @format DECIMAL_VALUE */
1553
+ nonTaxableAmount?: string | null;
1554
+ /**
1555
+ * Name of the tax that was calculated. For example, "NY State Sales Tax", "Quebec GST", etc.
1556
+ * @maxLength 200
1557
+ */
1558
+ taxName?: string | null;
1559
+ /**
1560
+ * Jurisdiction that taxes were calculated for.
1561
+ * @maxLength 200
1562
+ */
1563
+ jurisdiction?: string | null;
1564
+ /** Type of jurisdiction that taxes were calculated for. */
1565
+ jurisdictionType?: string;
1566
+ }
1567
+ interface InitiatePaymentMethodSetupRequest {
1568
+ _id: string;
1569
+ paymentMode?: PaymentModeWithLiterals;
1570
+ paymentSettings?: PaymentSettings;
1571
+ }
1572
+ declare enum PaymentMode {
1573
+ NONE = "NONE",
1574
+ /** The latest invoice of the subscription will be charged. */
1575
+ CHARGE = "CHARGE",
1576
+ /** An authorization invoice with zero amount will be created. */
1577
+ AUTHORIZATION = "AUTHORIZATION"
1578
+ }
1579
+ /** @enumType */
1580
+ type PaymentModeWithLiterals = PaymentMode | 'NONE' | 'CHARGE' | 'AUTHORIZATION';
1581
+ interface PaymentSettings {
1582
+ /** Allowed payment providers for Subscriptions, for example to limit subscriptions to be created only with "Wix Payments" provider. */
1583
+ allowedProviderIds?: string[];
1584
+ /** payment order method, define how the order was applied */
1585
+ orderMethod?: OrderMethodWithLiterals;
1586
+ /** Wix Pay callback url(s) to return buyer to a third party system */
1587
+ redirectUrls?: RedirectUrls;
1588
+ /** @format GUID */
1589
+ paymentMethodId?: string | null;
1590
+ /**
1591
+ * Specifies an alternative origin for processing the payment.
1592
+ * When set, the payment order will be created with the specified origin
1593
+ * instead of the default origin.
1594
+ */
1595
+ paymentOrigin?: PaymentOrigin;
1596
+ }
1597
+ declare enum OrderMethod {
1598
+ UNKNOWN = "UNKNOWN",
1599
+ MOTO = "MOTO",
1600
+ NOT_MOTO = "NOT_MOTO"
1601
+ }
1602
+ /** @enumType */
1603
+ type OrderMethodWithLiterals = OrderMethod | 'UNKNOWN' | 'MOTO' | 'NOT_MOTO';
1604
+ interface RedirectUrls {
1605
+ /** URL to redirect buyer in case of approved (successful) transaction (required) */
1606
+ successUrl?: string;
1607
+ /** URL to redirect buyer in case of failed/rejected transaction (required) */
1608
+ errorUrl?: string;
1609
+ /** URL to redirect buyer in case of buyer canceled the transaction (optional, default: `{error_url}`) */
1610
+ cancelUrl?: string;
1611
+ /**
1612
+ * URL to redirect buyer in case of pending transaction (that might take some time to process) (optional, default:
1613
+ * `{success_url}`)
1614
+ */
1615
+ pendingUrl?: string;
1616
+ }
1617
+ interface PaymentOrigin {
1618
+ /**
1619
+ * ID of the app for which the Payment will create the order on. For example, Paypal.
1620
+ * @format GUID
1621
+ */
1622
+ appId?: string;
1623
+ /**
1624
+ * Id of the entity that order will be created on
1625
+ * @format GUID
1626
+ */
1627
+ instanceId?: string;
1628
+ }
1629
+ interface InitiatePaymentMethodSetupResponse {
1630
+ /** @format GUID */
1631
+ paymentOrderId?: string;
1632
+ }
1633
+ interface DomainEvent extends DomainEventBodyOneOf {
1634
+ createdEvent?: EntityCreatedEvent;
1635
+ updatedEvent?: EntityUpdatedEvent;
1636
+ deletedEvent?: EntityDeletedEvent;
1637
+ actionEvent?: ActionEvent;
1638
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
1639
+ _id?: string;
1640
+ /**
1641
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
1642
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
1643
+ */
1644
+ entityFqdn?: string;
1645
+ /**
1646
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
1647
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
1648
+ */
1649
+ slug?: string;
1650
+ /** ID of the entity associated with the event. */
1651
+ entityId?: string;
1652
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
1653
+ eventTime?: Date | null;
1654
+ /**
1655
+ * Whether the event was triggered as a result of a privacy regulation application
1656
+ * (for example, GDPR).
1657
+ */
1658
+ triggeredByAnonymizeRequest?: boolean | null;
1659
+ /** If present, indicates the action that triggered the event. */
1660
+ originatedFrom?: string | null;
1661
+ /**
1662
+ * 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.
1663
+ * 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.
1664
+ */
1665
+ entityEventSequence?: string | null;
1666
+ }
1667
+ /** @oneof */
1668
+ interface DomainEventBodyOneOf {
1669
+ createdEvent?: EntityCreatedEvent;
1670
+ updatedEvent?: EntityUpdatedEvent;
1671
+ deletedEvent?: EntityDeletedEvent;
1672
+ actionEvent?: ActionEvent;
1673
+ }
1674
+ interface EntityCreatedEvent {
1675
+ entity?: string;
1676
+ }
1677
+ interface RestoreInfo {
1678
+ deletedDate?: Date | null;
1679
+ }
1680
+ interface EntityUpdatedEvent {
1681
+ /**
1682
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
1683
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
1684
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
1685
+ */
1686
+ currentEntity?: string;
1687
+ }
1688
+ interface EntityDeletedEvent {
1689
+ /** Entity that was deleted. */
1690
+ deletedEntity?: string | null;
1691
+ }
1692
+ interface ActionEvent {
1693
+ body?: string;
1694
+ }
1695
+ interface MessageEnvelope {
1696
+ /**
1697
+ * App instance ID.
1698
+ * @format GUID
1699
+ */
1700
+ instanceId?: string | null;
1701
+ /**
1702
+ * Event type.
1703
+ * @maxLength 150
1704
+ */
1705
+ eventType?: string;
1706
+ /** The identification type and identity data. */
1707
+ identity?: IdentificationData;
1708
+ /** Stringify payload. */
1709
+ data?: string;
1710
+ }
1711
+ interface IdentificationData extends IdentificationDataIdOneOf {
1712
+ /**
1713
+ * ID of a site visitor that has not logged in to the site.
1714
+ * @format GUID
1715
+ */
1716
+ anonymousVisitorId?: string;
1717
+ /**
1718
+ * ID of a site visitor that has logged in to the site.
1719
+ * @format GUID
1720
+ */
1721
+ memberId?: string;
1722
+ /**
1723
+ * ID of a Wix user (site owner, contributor, etc.).
1724
+ * @format GUID
1725
+ */
1726
+ wixUserId?: string;
1727
+ /**
1728
+ * ID of an app.
1729
+ * @format GUID
1730
+ */
1731
+ appId?: string;
1732
+ /** @readonly */
1733
+ identityType?: WebhookIdentityTypeWithLiterals;
1734
+ }
1735
+ /** @oneof */
1736
+ interface IdentificationDataIdOneOf {
1737
+ /**
1738
+ * ID of a site visitor that has not logged in to the site.
1739
+ * @format GUID
1740
+ */
1741
+ anonymousVisitorId?: string;
1742
+ /**
1743
+ * ID of a site visitor that has logged in to the site.
1744
+ * @format GUID
1745
+ */
1746
+ memberId?: string;
1747
+ /**
1748
+ * ID of a Wix user (site owner, contributor, etc.).
1749
+ * @format GUID
1750
+ */
1751
+ wixUserId?: string;
1752
+ /**
1753
+ * ID of an app.
1754
+ * @format GUID
1755
+ */
1756
+ appId?: string;
1757
+ }
1758
+ declare enum WebhookIdentityType {
1759
+ UNKNOWN = "UNKNOWN",
1760
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1761
+ MEMBER = "MEMBER",
1762
+ WIX_USER = "WIX_USER",
1763
+ APP = "APP"
1764
+ }
1765
+ /** @enumType */
1766
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
1767
+ interface CreateSubscriptionInStateRequest extends CreateSubscriptionInStateRequestModeOneOf {
1768
+ activeSubscription?: CreateSubscriptionRequest;
1769
+ }
1770
+ /** @oneof */
1771
+ interface CreateSubscriptionInStateRequestModeOneOf {
1772
+ activeSubscription?: CreateSubscriptionRequest;
1773
+ }
1774
+ interface CreateSubscriptionRequest {
1775
+ subscription?: Subscription;
1776
+ /** Optional settings for the payments. Should be empty for free subscriptions. */
1777
+ paymentSettings?: PaymentSettings;
1778
+ /**
1779
+ * Optional unique identifier for this request in order to prevent subscription duplications
1780
+ * @format GUID
1781
+ */
1782
+ idempotencyKey?: string | null;
1783
+ /** Optional origin override for setting identity of subscription creator instead of extracting from context */
1784
+ originOverride?: OriginOverride;
1785
+ }
1786
+ interface OriginOverride {
1787
+ /** @format GUID */
1788
+ appId?: string;
1789
+ /** @format GUID */
1790
+ instanceId?: string;
1791
+ }
1792
+ interface CreateSubscriptionInStateResponse {
1793
+ /** @format GUID */
1794
+ subscriptionId?: string;
1795
+ }
1796
+ interface PayCycleRequest {
1797
+ /** @format GUID */
1798
+ subscriptionId: string;
1799
+ paymentTestMode?: PaymentTestModeWithLiterals;
1800
+ /** @format GUID */
1801
+ tenantId: string;
1802
+ }
1803
+ declare enum PaymentTestMode {
1804
+ REGULAR = "REGULAR",
1805
+ FAIL_TECHNICAL = "FAIL_TECHNICAL",
1806
+ FAIL_DECLINE = "FAIL_DECLINE",
1807
+ FAIL_RETRYABLE_DECLINE = "FAIL_RETRYABLE_DECLINE"
1808
+ }
1809
+ /** @enumType */
1810
+ type PaymentTestModeWithLiterals = PaymentTestMode | 'REGULAR' | 'FAIL_TECHNICAL' | 'FAIL_DECLINE' | 'FAIL_RETRYABLE_DECLINE';
1811
+ interface PayCycleResponse {
1812
+ /** @format GUID */
1813
+ invoiceId?: string;
1814
+ /** @format GUID */
1815
+ paymentOrderId?: string | null;
1816
+ subscription?: Subscription;
1817
+ }
1818
+ interface GetFullSubscriptionDataRequest {
1819
+ /** @format GUID */
1820
+ _id?: string;
1821
+ }
1822
+ interface GetFullSubscriptionDataResponse {
1823
+ subscription?: Subscription;
1824
+ internalSubscriptionData?: InternalSubscriptionData;
1825
+ }
1826
+ interface InternalSubscriptionData {
1827
+ /** @format GUID */
1828
+ originInstanceId?: string;
1829
+ source?: string | null;
1830
+ billingType?: string;
1831
+ isOneTime?: boolean;
1832
+ migrationDetails?: MigrationDetails;
1833
+ pausePaidDuration?: string | null;
1834
+ authorizationPaymentData?: PaymentData;
1835
+ currentCyclePausePeriods?: PausePeriod[];
1836
+ }
1837
+ interface MigrationDetails {
1838
+ /** system (application) where the Subscription has been created */
1839
+ originSystem?: string;
1840
+ /** date when the Subscription started to be managed in BASS */
1841
+ shiftManagementDate?: Date | null;
1842
+ }
1843
+ interface PausePeriod {
1844
+ startDate?: Date | null;
1845
+ endDate?: Date | null;
1846
+ }
1847
+ interface GetSubscriptionAndInternalDataRequest {
1848
+ /** @format GUID */
1849
+ subscriptionId?: string;
1850
+ /** @format GUID */
1851
+ tenantId?: string;
1852
+ }
1853
+ interface GetSubscriptionAndInternalDataResponse {
1854
+ subscription?: Subscription;
1855
+ internalSubscriptionData?: InternalSubscriptionData;
1856
+ }
1857
+ interface SearchSubscriptionRequest {
1858
+ /** @format GUID */
1859
+ _id?: string;
1860
+ /** @format GUID */
1861
+ tenantId?: string;
1862
+ }
1863
+ interface SearchSubscriptionResponse {
1864
+ subscription?: Subscription;
1865
+ }
1866
+ interface UpdatePausePaidDurationRequest {
1867
+ /** @format GUID */
1868
+ subscriptionId?: string;
1869
+ /**
1870
+ * @min 1
1871
+ * @max 10000000
1872
+ */
1873
+ pausePaidDurationSeconds?: string;
1874
+ /** @format GUID */
1875
+ tenantId?: string;
1876
+ }
1877
+ interface UpdatePausePaidDurationResponse {
1878
+ }
1879
+ interface UpdateStatusRequest {
1880
+ /** @format GUID */
1881
+ subscriptionId?: string;
1882
+ /** @format GUID */
1883
+ tenantId?: string;
1884
+ status?: SubscriptionStatusEnumSubscriptionStatusWithLiterals;
1885
+ }
1886
+ interface UpdateStatusResponse {
1887
+ subscription?: Subscription;
1888
+ }
1889
+ interface UpdatePaymentStatusRequest {
1890
+ /** @format GUID */
1891
+ subscriptionId?: string;
1892
+ /** @format GUID */
1893
+ tenantId?: string;
1894
+ paymentStatus?: PaymentStatusWithLiterals;
1895
+ }
1896
+ interface UpdatePaymentStatusResponse {
1897
+ subscription?: Subscription;
1898
+ }
1899
+ interface ReviveSubscriptionRequest {
1900
+ /** @format GUID */
1901
+ tenantId?: string;
1902
+ /** @format GUID */
1903
+ subscriptionId?: string;
1904
+ revivePolicy?: RevivePolicyWithLiterals;
1905
+ isTestRun?: boolean;
1906
+ }
1907
+ declare enum RevivePolicy {
1908
+ SIMPLE = "SIMPLE",
1909
+ RESUME = "RESUME"
1910
+ }
1911
+ /** @enumType */
1912
+ type RevivePolicyWithLiterals = RevivePolicy | 'SIMPLE' | 'RESUME';
1913
+ interface ReviveSubscriptionResponse {
1914
+ subscription?: Subscription;
1915
+ }
1916
+ interface ConvertSapiRequest {
1917
+ /** @format GUID */
1918
+ subscriptionId?: string;
1919
+ }
1920
+ interface ConvertSapiResponse {
1921
+ subscription?: Subscription;
1922
+ }
1923
+ interface GetSubscriptionInvoicesRequest {
1924
+ /** @format GUID */
1925
+ _id?: string;
1926
+ }
1927
+ interface GetSubscriptionInvoicesResponse {
1928
+ invoices?: SubscriptionInvoice[];
1929
+ }
1930
+ interface SubscriptionInvoice {
1931
+ /** @format GUID */
1932
+ _id?: string;
1933
+ subscriptionCycle?: number;
1934
+ _createdDate?: Date | null;
1935
+ }
1936
+ interface FinishFreeTrialNowRequest {
1937
+ /** @format GUID */
1938
+ subscriptionId?: string;
1939
+ /** @format GUID */
1940
+ tenantId?: string;
1941
+ }
1942
+ interface FinishFreeTrialNowResponse {
1943
+ subscription?: Subscription;
1944
+ }
1945
+ interface FixSubscriptionTimeCapsuleTasksRequest {
1946
+ /** @format GUID */
1947
+ subscriptionId?: string;
1948
+ /** @format GUID */
1949
+ tenantId?: string;
1950
+ }
1951
+ interface FixSubscriptionTimeCapsuleTasksResponse {
1952
+ }
1953
+ interface SendTimeCapsuleTaskCanceledBIRequest {
1954
+ /** @format GUID */
1955
+ tenantId?: string;
1956
+ /** @format GUID */
1957
+ subscriptionId?: string;
1958
+ /** @minLength 1 */
1959
+ taskType?: string;
1960
+ }
1961
+ interface Empty {
1962
+ }
1963
+ interface ScheduleTimeCapsuleTaskRequest {
1964
+ /** @format GUID */
1965
+ subscriptionId?: string;
1966
+ /** @minLength 1 */
1967
+ taskType?: string;
1968
+ executionTime?: Date | null;
1969
+ /** @format GUID */
1970
+ tenantId?: string;
1971
+ }
1972
+ interface CancelTimeCapsuleTaskRequest {
1973
+ /** @format GUID */
1974
+ tenantId?: string;
1975
+ /** @format GUID */
1976
+ subscriptionId?: string;
1977
+ /** @minLength 1 */
1978
+ taskType?: string;
1979
+ }
1980
+ interface UpdateFullSubscriptionRequest {
1981
+ /** @format GUID */
1982
+ tenantId?: string;
1983
+ subscription?: Subscription;
1984
+ }
1985
+ interface UpdateFullSubscriptionResponse {
1986
+ subscription?: Subscription;
1987
+ }
1988
+ interface UpdateSubscriptionInvoiceCycleRequest {
1989
+ /** @format GUID */
1990
+ subscriptionId?: string;
1991
+ /** @format GUID */
1992
+ tenantId?: string;
1993
+ /** @format GUID */
1994
+ invoiceId?: string;
1995
+ subscriptionCycle?: number;
1996
+ }
1997
+ interface UpdateSubscriptionInvoiceCycleResponse {
1998
+ subscriptionInvoice?: SubscriptionInvoice;
1999
+ }
2000
+ interface AddPausePeriodRequest {
2001
+ /** @format GUID */
2002
+ tenantId?: string;
2003
+ /** @format GUID */
2004
+ subscriptionId?: string;
2005
+ pauseStartDate?: Date | null;
2006
+ pauseEndDate?: Date | null;
2007
+ }
2008
+ interface AddPausePeriodResponse {
2009
+ subscription?: Subscription;
2010
+ }
2011
+ interface RunTimeCapsuleTaskNowRequest {
2012
+ /** @format GUID */
2013
+ tenantId?: string;
2014
+ /** @format GUID */
2015
+ subscriptionId?: string;
2016
+ /** @minLength 1 */
2017
+ taskType?: string;
2018
+ }
2019
+ interface CreateRecurringInvoiceBORequest {
2020
+ /** @format GUID */
2021
+ subscriptionId?: string;
2022
+ /** @format GUID */
2023
+ tenantId?: string;
2024
+ /** @min 2 */
2025
+ cycleNumber?: number;
2026
+ }
2027
+ interface CreateRecurringInvoiceBOResponse {
2028
+ invoiceId?: string;
2029
+ }
2030
+ interface SetShiftingDataRequest {
2031
+ /** @format GUID */
2032
+ subscriptionId?: string;
2033
+ /** @format GUID */
2034
+ tenantId?: string;
2035
+ isBassManaged?: boolean;
2036
+ shiftManagementDate?: Date | null;
2037
+ }
2038
+ interface SetShiftingDataResponse {
2039
+ subscription?: Subscription;
2040
+ }
2041
+ interface FixSubscriptionInvoicesRequest extends FixSubscriptionInvoicesRequestModeOneOf {
2042
+ attachInvoice?: AttachInvoice;
2043
+ detachInvoice?: DetachInvoice;
2044
+ /** @format GUID */
2045
+ tenantId?: string;
2046
+ /** @format GUID */
2047
+ subscriptionId?: string;
2048
+ }
2049
+ /** @oneof */
2050
+ interface FixSubscriptionInvoicesRequestModeOneOf {
2051
+ attachInvoice?: AttachInvoice;
2052
+ detachInvoice?: DetachInvoice;
2053
+ }
2054
+ interface AttachInvoice {
2055
+ /** @format GUID */
2056
+ invoiceId?: string;
2057
+ }
2058
+ interface DetachInvoice {
2059
+ /** @format GUID */
2060
+ invoiceId?: string;
2061
+ }
2062
+ interface FixSubscriptionInvoicesResponse {
2063
+ invoices?: SubscriptionInvoice[];
2064
+ }
2065
+ interface RestoreDraftSubscriptionRequest {
2066
+ /** @format GUID */
2067
+ tenantId?: string;
2068
+ /** @format GUID */
2069
+ subscriptionId?: string;
2070
+ }
2071
+ interface RestoreDraftSubscriptionResponse {
2072
+ subscription?: Subscription;
2073
+ }
2074
+ interface DeleteDraftSubscriptionRequest {
2075
+ /** @format GUID */
2076
+ tenantId?: string;
2077
+ /** @format GUID */
2078
+ subscriptionId?: string;
2079
+ }
2080
+ interface DeleteDraftSubscriptionResponse {
2081
+ subscription?: Subscription;
2082
+ }
2083
+ interface DeleteSubscriptionBORequest {
2084
+ /** @format GUID */
2085
+ tenantId?: string;
2086
+ /** @format GUID */
2087
+ subscriptionId?: string;
2088
+ }
2089
+ interface DeleteSubscriptionBOResponse {
2090
+ subscription?: Subscription;
2091
+ }
2092
+ interface CancelSubscriptionBORequest {
2093
+ /** @format GUID */
2094
+ tenantId?: string;
2095
+ /** @format GUID */
2096
+ subscriptionId?: string;
2097
+ initiator?: ActionInitiatorWithLiterals;
2098
+ reason?: string | null;
2099
+ }
2100
+ declare enum ActionInitiator {
2101
+ UNDEFINED = "UNDEFINED",
2102
+ BUSINESS = "BUSINESS",
2103
+ CUSTOMER = "CUSTOMER",
2104
+ SYSTEM = "SYSTEM"
2105
+ }
2106
+ /** @enumType */
2107
+ type ActionInitiatorWithLiterals = ActionInitiator | 'UNDEFINED' | 'BUSINESS' | 'CUSTOMER' | 'SYSTEM';
2108
+ interface CancelSubscriptionBOResponse {
2109
+ subscription?: Subscription;
2110
+ }
2111
+ interface UpdatePaymentMethodBORequest {
2112
+ /** @format GUID */
2113
+ tenantId?: string;
2114
+ /** @format GUID */
2115
+ subscriptionId?: string;
2116
+ /** @format GUID */
2117
+ paymentMethodId?: string;
2118
+ }
2119
+ interface UpdatePaymentMethodBOResponse {
2120
+ subscription?: Subscription;
2121
+ }
2122
+ interface SendSubscriptionActionEventBORequest extends SendSubscriptionActionEventBORequestEventOneOf {
2123
+ billingCycleStarted?: SubscriptionBillingCycleStarted;
2124
+ /** @format GUID */
2125
+ tenantId?: string;
2126
+ /** @format GUID */
2127
+ subscriptionId?: string;
2128
+ }
2129
+ /** @oneof */
2130
+ interface SendSubscriptionActionEventBORequestEventOneOf {
2131
+ billingCycleStarted?: SubscriptionBillingCycleStarted;
2132
+ }
2133
+ interface SubscriptionBillingCycleStarted {
2134
+ subscription?: Subscription;
2135
+ /**
2136
+ * Wix Pay transaction id, optional. Exists if event was triggered by a payment.
2137
+ * @format GUID
2138
+ */
2139
+ paymentTransactionId?: string | null;
2140
+ }
2141
+ interface SendSubscriptionActionEventResponse {
2142
+ }
2143
+ interface HandleSubscriptionAfterInvoiceMarkedAsPaidRequest {
2144
+ /** @format GUID */
2145
+ tenantId?: string;
2146
+ /** @format GUID */
2147
+ subscriptionId?: string;
2148
+ transactionId?: string;
2149
+ }
2150
+ interface PauseSubscriptionBORequest {
2151
+ /** @format GUID */
2152
+ tenantId?: string;
2153
+ /** @format GUID */
2154
+ subscriptionId?: string;
2155
+ pausePolicy?: PausePolicyWithLiterals;
2156
+ pauseAt?: PauseAtWithLiterals;
2157
+ initiator?: ActionInitiatorWithLiterals;
2158
+ /** @maxLength 500 */
2159
+ reason?: string | null;
2160
+ }
2161
+ interface PauseSubscriptionBOResponse {
2162
+ subscription?: Subscription;
2163
+ }
2164
+ interface SetIsMigratedEvent {
2165
+ /** @format GUID */
2166
+ subscriptionId?: string;
2167
+ }
2168
+ interface SubscriptionDelayedSyncEvent {
2169
+ /** @format GUID */
2170
+ subscriptionId?: string;
2171
+ }
2172
+ interface InvoiceAction extends InvoiceActionActionTypeOneOf {
2173
+ payRecurring?: PayRecurringInvoice;
2174
+ }
2175
+ /** @oneof */
2176
+ interface InvoiceActionActionTypeOneOf {
2177
+ payRecurring?: PayRecurringInvoice;
2178
+ }
2179
+ interface PayRecurringInvoice {
2180
+ /** @format GUID */
2181
+ invoiceId?: string;
2182
+ }
2183
+ /**
2184
+ * Sent each time a subscription status has been set to Active
2185
+ * Active shows that a subscription is live and operational.
2186
+ * For example:
2187
+ * * For subscription with free trial, free trial start date is also the activation date.
2188
+ * * For a subscription with future start date, the start date is also the activation date.
2189
+ * * When a subscription is resumed from a pause status, the resume date is also the activation date.
2190
+ */
2191
+ interface SubscriptionActivated {
2192
+ subscription?: Subscription;
2193
+ }
2194
+ /**
2195
+ * Sent each time a subscription status has been set to Ended
2196
+ * Ended shows that a subscription reached its end date and ended its life cycle as a result of the agreement.
2197
+ * This is different from a Canceled subscription which ends the subscription before a designated end date.
2198
+ * Therefore, Ended and Canceled are mutually exclusive.
2199
+ */
2200
+ interface SubscriptionEnded {
2201
+ subscription?: Subscription;
2202
+ }
2203
+ interface SubscriptionInitialPurchaseCompleted {
2204
+ subscription?: Subscription;
2205
+ actionDetails?: ActionDetails;
2206
+ /** @format GUID */
2207
+ paymentTransactionId?: string | null;
2208
+ }
2209
+ interface SubscriptionCycleReadyToPay {
2210
+ subscription?: Subscription;
2211
+ }
2212
+ interface SubscriptionRevived {
2213
+ subscription?: Subscription;
2214
+ }
2215
+ interface CreateSubscriptionResponse {
2216
+ subscription?: Subscription;
2217
+ /**
2218
+ * Payments order that should be paid (or authorize card) in order to activate subscription. Empty for free subscriptions.
2219
+ * @format GUID
2220
+ */
2221
+ paymentOrderId?: string | null;
2222
+ }
2223
+ interface UpdateSubscriptionRequest {
2224
+ /** Revision is validated if Subscription.revision is set */
2225
+ subscription?: Subscription;
2226
+ /**
2227
+ * Supported field: start_date
2228
+ * Can be updated only if Subscription is in Draft state
2229
+ */
2230
+ fieldMask?: string[];
2231
+ }
2232
+ interface UpdateSubscriptionResponse {
2233
+ subscription?: Subscription;
2234
+ }
2235
+ interface UpdateSubscriptionStartDateRequest {
2236
+ /**
2237
+ * Subscription ID
2238
+ * @format GUID
2239
+ */
2240
+ _id?: string;
2241
+ /**
2242
+ * Can be updated only if Subscription is in Draft state
2243
+ * By setting start_date in the future, end_date will be recalculated for termed Subscriptions
2244
+ * cycles_to_pay_on_creation will be set to 1 if no free trial is set
2245
+ */
2246
+ startDate?: Date | null;
2247
+ }
2248
+ interface UpdateSubscriptionStartDateResponse {
2249
+ subscription?: Subscription;
2250
+ }
2251
+ interface UpdateSubscriptionPoliciesRequest {
2252
+ /**
2253
+ * Subscription ID
2254
+ * @format GUID
2255
+ */
2256
+ _id?: string;
2257
+ cancellableByCustomer?: boolean | null;
2258
+ }
2259
+ interface UpdateSubscriptionPoliciesResponse {
2260
+ /** Updated policies of the subscription */
2261
+ policies?: SubscriptionPolicies;
2262
+ }
2263
+ interface UpdateSubscriptionBillingDateRequest {
2264
+ /**
2265
+ * ID of the subscription to update the billing date for.
2266
+ * @format GUID
2267
+ */
2268
+ _id: string;
2269
+ /** New billing date in `YYYY-MM-DDThh:mm:ss:sssZ` format. */
2270
+ billingDate: Date | null;
2271
+ /**
2272
+ * Information about how BASS adjusts the total of the next invoice. Extending
2273
+ * the current billing cycle results in a higher payment, while shortening it
2274
+ * leads to a lower payment. BASS offers automatic calculation of the proration
2275
+ * amount based on the number of days added to or removed from the current billing
2276
+ * cycle. Alternatively, you can use your own custom method to calculate the
2277
+ * proration amount. The custom proration amount can't exceed the total of the
2278
+ * current billing cycle.
2279
+ */
2280
+ proration?: Proration;
2281
+ }
2282
+ interface UpdateSubscriptionBillingDateResponse {
2283
+ /** Updated subscription. */
2284
+ subscription?: Subscription;
2285
+ }
2286
+ interface SubscriptionBillingDateUpdated {
2287
+ subscription?: Subscription;
2288
+ billingDate?: Date | null;
2289
+ proration?: Proration;
2290
+ }
2291
+ interface UpdateSubscriptionOriginRequest {
2292
+ /**
2293
+ * ID of the subscription to update origin.
2294
+ * @format GUID
2295
+ */
2296
+ _id?: string;
2297
+ /**
2298
+ * Origin entity ID of the subscription to update.
2299
+ * @format GUID
2300
+ */
2301
+ entityId?: string;
2302
+ }
2303
+ interface UpdateSubscriptionOriginResponse {
2304
+ /** Updated subscription. */
2305
+ subscription?: Subscription;
2306
+ }
2307
+ interface ReviseSubscriptionRequest {
2308
+ /**
2309
+ * Subscription ID
2310
+ * @format GUID
2311
+ */
2312
+ _id?: string;
2313
+ /**
2314
+ * 0 for no revision, maxSize is 100
2315
+ * @maxSize 100
2316
+ */
2317
+ items?: Item[];
2318
+ }
2319
+ interface ReviseSubscriptionResponse {
2320
+ subscription?: Subscription;
2321
+ }
2322
+ interface UpdateSubscriptionItemsRequest {
2323
+ /**
2324
+ * Subscription ID
2325
+ * @format GUID
2326
+ */
2327
+ _id?: string;
2328
+ /** Update action. For RESET_PENDING_UPDATES, nothing but the subscription ID should be defined in the request. */
2329
+ updateAction?: UpdateActionWithLiterals;
2330
+ /** Updates execution date. Relevant only for UpdateAction.SPECIFIC_DATE. Only specific date is supported. */
2331
+ scheduleAdditionalInfo?: ScheduleAdditionalInfo;
2332
+ /**
2333
+ * Existing items to update
2334
+ * @maxSize 100
2335
+ */
2336
+ itemsToUpdate?: ItemChange[];
2337
+ /**
2338
+ * Items to add
2339
+ * @maxSize 99
2340
+ */
2341
+ itemsToAdd?: Item[];
2342
+ /**
2343
+ * Existing items to delete
2344
+ * @format GUID
2345
+ * @maxSize 99
2346
+ */
2347
+ itemsToDelete?: string[] | null;
2348
+ }
2349
+ declare enum UpdateAction {
2350
+ NONE = "NONE",
2351
+ /** Update subscription immediately, please note proration for updates changing price are not yet supported */
2352
+ IMMEDIATELY = "IMMEDIATELY",
2353
+ /** Request updates that will take affect only at the start of the next billing cycle. */
2354
+ NEXT_BILLING_CYCLE = "NEXT_BILLING_CYCLE",
2355
+ /** Reset all pending updates */
2356
+ RESET_PENDING_UPDATES = "RESET_PENDING_UPDATES",
2357
+ /** Request updates that will take affect only at a specific date. */
2358
+ SPECIFIC_DATE = "SPECIFIC_DATE"
2359
+ }
2360
+ /** @enumType */
2361
+ type UpdateActionWithLiterals = UpdateAction | 'NONE' | 'IMMEDIATELY' | 'NEXT_BILLING_CYCLE' | 'RESET_PENDING_UPDATES' | 'SPECIFIC_DATE';
2362
+ interface ScheduleAdditionalInfo extends ScheduleAdditionalInfoParamOneOf {
2363
+ /**
2364
+ * Future date when the update becomes effective in `YYYY-MM-DDThh:mm:ss.sssZ`
2365
+ * format. The use of this field may be restricted in various BASS endpoints.
2366
+ * For example, in _Bulk Update Subscription Items_ it's only available in
2367
+ * combination with `{"updateAction": "SPECIFIC_DATE"}`, in _Resume Subscription_
2368
+ * only in combination with `{"resumeAt": "SPECIFIC_DATE"}`, and in
2369
+ * _Pause Subscription_ only in combination with `{"pauseAt": "SPECIFIC_DATE"}`.
2370
+ */
2371
+ specificDate?: Date | null;
2372
+ /**
2373
+ * When the update becomes effective, as number of billing cycles from now.
2374
+ * The use of this field may be restricted in various BASS endpoints.
2375
+ * For example, in _Pause Subscription_ it's only available in
2376
+ * combination with `{"pauseAt": "NUMBER_OF_CYCLES_FROM_TODAY"}`.
2377
+ * __Note__: Currently not supported in _Bulk Update Subscription Items by Filter_.
2378
+ * @min 1
2379
+ */
2380
+ numberOfCycles?: number;
2381
+ }
2382
+ /** @oneof */
2383
+ interface ScheduleAdditionalInfoParamOneOf {
2384
+ /**
2385
+ * Future date when the update becomes effective in `YYYY-MM-DDThh:mm:ss.sssZ`
2386
+ * format. The use of this field may be restricted in various BASS endpoints.
2387
+ * For example, in _Bulk Update Subscription Items_ it's only available in
2388
+ * combination with `{"updateAction": "SPECIFIC_DATE"}`, in _Resume Subscription_
2389
+ * only in combination with `{"resumeAt": "SPECIFIC_DATE"}`, and in
2390
+ * _Pause Subscription_ only in combination with `{"pauseAt": "SPECIFIC_DATE"}`.
2391
+ */
2392
+ specificDate?: Date | null;
2393
+ /**
2394
+ * When the update becomes effective, as number of billing cycles from now.
2395
+ * The use of this field may be restricted in various BASS endpoints.
2396
+ * For example, in _Pause Subscription_ it's only available in
2397
+ * combination with `{"pauseAt": "NUMBER_OF_CYCLES_FROM_TODAY"}`.
2398
+ * __Note__: Currently not supported in _Bulk Update Subscription Items by Filter_.
2399
+ * @min 1
2400
+ */
2401
+ numberOfCycles?: number;
2402
+ }
2403
+ interface UpdateSubscriptionItemsResponse {
2404
+ subscription?: Subscription;
2405
+ }
2406
+ interface BulkUpdateSubscriptionItemsByFilterRequest {
2407
+ /**
2408
+ * Filter to identify the subscriptions for which items are updated. For
2409
+ * supported fields see
2410
+ * [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).
2411
+ * Sending an empty subscription filter results in a validation error.
2412
+ * In case you pass `{"updateAction": "RESET_PENDING_UPDATES"}`, use only the
2413
+ * `subscriptionId` field inside this filter. Passing any other filter results
2414
+ * in a failed validation error.
2415
+ */
2416
+ subscriptionFilter?: Record<string, any> | null;
2417
+ /**
2418
+ * Filter to specify which subscription items are updated. Make sure to use
2419
+ * the catalog item ID and not the item's unique ID. All subscription items
2420
+ * with matching `items.catalogReference.catalogItemId` are updated.
2421
+ *
2422
+ * Max: `100` reference catalog item IDs
2423
+ * @format GUID
2424
+ * @maxSize 100
2425
+ */
2426
+ catalogReferenceIds?: string[] | null;
2427
+ /**
2428
+ * Information about the update timing and update type.
2429
+ *
2430
+ * + `"IMMEDIATELY"`: The updates become effective immediately.
2431
+ * + `"NEXT_BILLING_CYCLE"`: The updates are scheduled for the beginning of the next billing cycle.
2432
+ * + `"SPECIFIC_DATE"`: The updates are scheduled for the date specified in `scheduleAdditionalInfo.specificDate`.
2433
+ * + `"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.
2434
+ */
2435
+ updateAction?: UpdateActionWithLiterals;
2436
+ /**
2437
+ * Additional information for updates. Currently, only supported for
2438
+ * `{"updateAction": "SPECIFIC_DATE"}`.
2439
+ */
2440
+ scheduleAdditionalInfo?: ScheduleAdditionalInfo;
2441
+ /**
2442
+ * Update details for the susbcription items that match the filtering.
2443
+ * Currently, you can update only the item price, quantity, and tax. Note
2444
+ * that all item properties are updated to the same values. In case you want set
2445
+ * different values for individual items, you must call
2446
+ * _Bulk Update Subscription Items By Filter_ multiple times, once per unique update.
2447
+ */
2448
+ bulkItemUpdateData?: BulkItemChange;
2449
+ /**
2450
+ * __Not implemented yet__. Items to add to the subscriptions matching the filtering.
2451
+ * @maxSize 99
2452
+ */
2453
+ itemsToAdd?: Item[];
2454
+ }
2455
+ interface BulkItemChange {
2456
+ /** Information about the new item price. */
2457
+ pricingModel?: PricingModel;
2458
+ /**
2459
+ * New item quantity.
2460
+ *
2461
+ * Min: `1`
2462
+ * @min 1
2463
+ */
2464
+ quantity?: number | null;
2465
+ /** Information about the new item tax. */
2466
+ tax?: Tax;
2467
+ }
2468
+ interface BulkUpdateSubscriptionItemsByFilterResponse {
2469
+ /**
2470
+ * ID of your bulk job. You can use
2471
+ * [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)
2472
+ * to retrieve information about the job status.
2473
+ */
2474
+ jobId?: string;
2475
+ }
2476
+ interface DeleteSubscriptionRequest {
2477
+ /** @format GUID */
2478
+ _id?: string;
2479
+ revision?: string;
2480
+ }
2481
+ interface DeleteSubscriptionResponse {
2482
+ }
2483
+ interface CancelSubscriptionRequest {
2484
+ /** @format GUID */
2485
+ _id: string;
2486
+ actionContext: ActionContext;
2487
+ }
2488
+ interface ActionContext {
2489
+ initiator?: ActionInitiatorWithLiterals;
2490
+ /** Optional action reason message */
2491
+ reason?: string | null;
2492
+ }
2493
+ interface CancelSubscriptionResponse {
2494
+ subscription?: Subscription;
2495
+ }
2496
+ interface PauseSubscriptionRequest {
2497
+ /** @format GUID */
2498
+ _id: string;
2499
+ pausePolicy?: PausePolicyWithLiterals;
2500
+ pauseAt?: PauseAtWithLiterals;
2501
+ /** contains additional scheduling information for certain pause_at options (for example: SPECIFIC_DATE & NUMBER_OF_CYCLES_FROM_TODAY) */
2502
+ pauseAtSchedule?: ScheduleAdditionalInfo;
2503
+ /** contains additional scheduling information for certain auto_resume_at either specific date */
2504
+ autoResumeAtSchedule?: ScheduleAdditionalInfo;
2505
+ actionContext: ActionContext;
2506
+ }
2507
+ interface PauseSubscriptionResponse {
2508
+ subscription?: Subscription;
2509
+ }
2510
+ interface SubscriptionPaused {
2511
+ subscription?: Subscription;
2512
+ pausePolicy?: PausePolicyWithLiterals;
2513
+ actionDetails?: ActionDetails;
2514
+ }
2515
+ interface PauseSubscriptionRequested {
2516
+ subscription?: Subscription;
2517
+ pauseAt?: PauseAtWithLiterals;
2518
+ pausePolicy?: PausePolicyWithLiterals;
2519
+ actionDetails?: ActionDetails;
2520
+ }
2521
+ interface ScheduledPauseCanceled {
2522
+ subscription?: Subscription;
2523
+ actionDetails?: ActionDetails;
2524
+ }
2525
+ interface ResumeSubscriptionRequest {
2526
+ /** @format GUID */
2527
+ _id: string;
2528
+ resumeAt?: ResumeAtWithLiterals;
2529
+ /** contains additional scheduling information for certain resume_at options (for example: SPECIFIC_DATE) */
2530
+ resumeAtSchedule?: ScheduleAdditionalInfo;
2531
+ actionContext: ActionContext;
2532
+ }
2533
+ interface ResumeSubscriptionResponse {
2534
+ subscription?: Subscription;
2535
+ }
2536
+ interface SubscriptionResumed {
2537
+ subscription?: Subscription;
2538
+ actionDetails?: ActionDetails;
2539
+ }
2540
+ interface ResumeSubscriptionRequested {
2541
+ subscription?: Subscription;
2542
+ resumeAt?: ResumeAtWithLiterals;
2543
+ actionDetails?: ActionDetails;
2544
+ }
2545
+ interface ScheduledResumeCanceled {
2546
+ subscription?: Subscription;
2547
+ actionDetails?: ActionDetails;
2548
+ }
2549
+ interface SearchSubscriptionsRequest extends SearchSubscriptionsRequestPagingMethodOneOf {
2550
+ /** Limit number of results and enable to skip rows. The default limit is 25. */
2551
+ paging?: Paging;
2552
+ /** A Cursor option for efficient paging. Pass this field from the previous search response to continue to the next page. */
2553
+ cursor?: CursorPaging;
2554
+ /** A filter object */
2555
+ filter?: any;
2556
+ /** A Sorting option by field name and order. */
2557
+ sorting?: SortingClauses;
2558
+ }
2559
+ /** @oneof */
2560
+ interface SearchSubscriptionsRequestPagingMethodOneOf {
2561
+ /** Limit number of results and enable to skip rows. The default limit is 25. */
2562
+ paging?: Paging;
2563
+ /** A Cursor option for efficient paging. Pass this field from the previous search response to continue to the next page. */
2564
+ cursor?: CursorPaging;
2565
+ }
2566
+ interface SortingClauses {
2567
+ sorting?: Sorting[];
2568
+ }
2569
+ interface SearchSubscriptionsResponse {
2570
+ subscriptions?: Subscription[];
2571
+ cursor?: CursorPaging;
2572
+ }
2573
+ interface TurnOnSubscriptionAutoRenewalRequest {
2574
+ /** @format GUID */
2575
+ _id: string;
2576
+ actionContext: ActionContext;
2577
+ }
2578
+ interface TurnOnSubscriptionAutoRenewalResponse {
2579
+ subscription?: Subscription;
2580
+ }
2581
+ interface SubscriptionAutoRenewalTurnedOn {
2582
+ subscription?: Subscription;
2583
+ actionDetails?: ActionDetails;
2584
+ }
2585
+ interface TurnOffSubscriptionAutoRenewalRequest {
2586
+ /** @format GUID */
2587
+ _id: string;
2588
+ actionContext: ActionContext;
2589
+ }
2590
+ interface TurnOffSubscriptionAutoRenewalResponse {
2591
+ subscription?: Subscription;
2592
+ }
2593
+ interface SubscriptionAutoRenewalTurnedOff {
2594
+ subscription?: Subscription;
2595
+ actionDetails?: ActionDetails;
2596
+ }
2597
+ interface MarkLatestInvoiceAsPaidRequest {
2598
+ /**
2599
+ * The ID of the offline subscription to mark as paid its latest invoice
2600
+ * @format GUID
2601
+ */
2602
+ subscriptionId: string;
2603
+ }
2604
+ interface MarkLatestInvoiceAsPaidResponse {
2605
+ subscription?: Subscription;
2606
+ }
2607
+ interface LatestInvoiceMarkedAsPaid {
2608
+ subscription?: Subscription;
2609
+ }
2610
+ interface MultipleSubscriptionsOnOrdersInvoice {
2611
+ /**
2612
+ * the invoice id of the affected subscription
2613
+ * @format GUID
2614
+ */
2615
+ invoiceId?: string;
2616
+ /**
2617
+ * the order id of the affected subscription
2618
+ * @format GUID
2619
+ */
2620
+ orderId?: string;
2621
+ }
2622
+ interface MarkBillingCycleAsPaidRequest {
2623
+ /**
2624
+ * The ID of the subscription to mark as paid its invoice.
2625
+ * @format GUID
2626
+ */
2627
+ subscriptionId: string;
2628
+ /**
2629
+ * The subscription cycle for which the invoice is to be marked as paid.
2630
+ * If left empty, the most recent cycle will be selected.
2631
+ * @min 1
2632
+ */
2633
+ paidCycle?: number | null;
2634
+ }
2635
+ interface MarkBillingCycleAsPaidResponse {
2636
+ subscription?: Subscription;
2637
+ }
2638
+ interface GetSubscriptionsStatsRequest {
2639
+ }
2640
+ interface GetSubscriptionsStatsResponse {
2641
+ amountByStatuses?: AmountByStatus[];
2642
+ total?: number;
2643
+ }
2644
+ interface AmountByStatus {
2645
+ status?: SubscriptionStatusEnumSubscriptionStatusWithLiterals;
2646
+ amount?: number;
2647
+ }
2648
+ interface ExtendSubscriptionRequest extends ExtendSubscriptionRequestExtendPolicyOneOf {
2649
+ /** User won't be charged for additional period added on top of subscription end date. */
2650
+ extensionPeriod?: Duration;
2651
+ /**
2652
+ * user will be charged for billing cycles added
2653
+ * @min 1
2654
+ */
2655
+ extensionBillingCycles?: number;
2656
+ /**
2657
+ * The ID of the subscription to be extended
2658
+ * @format GUID
2659
+ */
2660
+ _id: string;
2661
+ actionContext: ActionContext;
2662
+ }
2663
+ /** @oneof */
2664
+ interface ExtendSubscriptionRequestExtendPolicyOneOf {
2665
+ /** User won't be charged for additional period added on top of subscription end date. */
2666
+ extensionPeriod?: Duration;
2667
+ /**
2668
+ * user will be charged for billing cycles added
2669
+ * @min 1
2670
+ */
2671
+ extensionBillingCycles?: number;
2672
+ }
2673
+ interface ExtendSubscriptionResponse {
2674
+ /** The now extended subscription */
2675
+ subscription?: Subscription;
2676
+ }
2677
+ interface AllowedActionsRequest {
2678
+ /** @format GUID */
2679
+ _id: string;
2680
+ /**
2681
+ * List of additional fields to be included in the response.
2682
+ * @maxSize 1
2683
+ */
2684
+ fields?: RequestedFieldsWithLiterals[];
2685
+ }
2686
+ declare enum RequestedFields {
2687
+ UNKNOWN_REQUESTED_FIELD = "UNKNOWN_REQUESTED_FIELD",
2688
+ /** Include unsupported action list, including the reasons for the lack of support */
2689
+ UNSUPPORTED_ACTION = "UNSUPPORTED_ACTION"
2690
+ }
2691
+ /** @enumType */
2692
+ type RequestedFieldsWithLiterals = RequestedFields | 'UNKNOWN_REQUESTED_FIELD' | 'UNSUPPORTED_ACTION';
2693
+ interface AllowedActionsResponse {
2694
+ /** List of actions that are allowed. */
2695
+ actions?: Action[];
2696
+ /**
2697
+ * List of actions that are not supported, included only if requested. Provides reasons for each unsupported action.
2698
+ * @maxSize 20
2699
+ */
2700
+ unsupportedActions?: UnsupportedAction[];
2701
+ }
2702
+ interface UnsupportedAction {
2703
+ actionType?: ActionTypeWithLiterals;
2704
+ /**
2705
+ * Provides detailed reasons for the unsupported action. Each `UnsupportedReason` includes a code and a message explaining why the action is not allowed.
2706
+ * @maxSize 20
2707
+ */
2708
+ reasons?: UnsupportedReason[];
2709
+ }
2710
+ interface UnsupportedReason {
2711
+ code?: string;
2712
+ description?: string | null;
2713
+ }
2714
+ interface ListUpcomingChargesRequest {
2715
+ /**
2716
+ * Subscription id charges to be previewed for
2717
+ * @format GUID
2718
+ */
2719
+ subscriptionId: string;
2720
+ /** Period of time to provide charged for. If not provided,then only next charge will be returned. */
2721
+ customDuration?: Duration;
2722
+ /**
2723
+ * Date of the next billing cycle so that the upcoming charges will be calculated accordingly.
2724
+ * If not provided, the upcoming charges will be calculated according to the existing next billing date.
2725
+ */
2726
+ nextBillingDate?: Date | null;
2727
+ }
2728
+ interface ListUpcomingChargesResponse {
2729
+ upcomingCharges?: SubscriptionCharge[];
2730
+ }
2731
+ interface PreviewSubscriptionChargesRequest extends PreviewSubscriptionChargesRequestSubscriptionOneOf {
2732
+ /** Information about a non-existing subscription. */
2733
+ subscriptionInfo?: SubscriptionInfo;
2734
+ }
2735
+ /** @oneof */
2736
+ interface PreviewSubscriptionChargesRequestSubscriptionOneOf {
2737
+ /** Information about a non-existing subscription. */
2738
+ subscriptionInfo?: SubscriptionInfo;
2739
+ }
2740
+ /** Subscription information to use for calculating the preview of charges for a subscription. */
2741
+ interface SubscriptionInfo {
2742
+ billingSettings?: BillingSettings;
2743
+ items?: Item[];
2744
+ startDate?: Date | null;
2745
+ }
2746
+ interface PreviewSubscriptionChargesResponse {
2747
+ /** Charges for subscription. */
2748
+ charges?: Charge[];
2749
+ }
2750
+ /** Represents a charge applicable to a subscription. */
2751
+ interface Charge {
2752
+ /** The cycle number from which the charge starts. */
2753
+ cycleFrom?: number;
2754
+ /** The number of cycles for which the charge is applicable. */
2755
+ cycleCount?: number | null;
2756
+ /** The breakdown of the charge */
2757
+ totals?: Totals;
2758
+ /** The billing date from which the charge starts */
2759
+ cycleBillingDate?: Date | null;
2760
+ }
2761
+ interface PreviewSubscriptionsChargesRequest {
2762
+ /**
2763
+ * Information required to calculate the preview charges for the subscriptions, including an identifier.
2764
+ * @minSize 1
2765
+ * @maxSize 10
2766
+ */
2767
+ subscriptionsBillingDetails?: SubscriptionBillingDetails[];
2768
+ /**
2769
+ * Specifies the number of upcoming billing charges to preview for all subscriptions in the order.
2770
+ * For instance, if a subscription costs $10 for the first 3 cycles, $12 for cycles 4 through 7,
2771
+ * $15 for cycles 8 through 10, and $20 for cycle 11 onwards:
2772
+ * - Sending "1" will calculate and return charges for cycles 4 through 7 since it's the first charge in the future.
2773
+ * - Sending "2" will provide a response with charges for cycles 4 through 7 and cycles 8 through 10.
2774
+ * - Sending "3" or more will include totals for cycles 4 through 7, cycles 8 through 10, and from cycle 11 onwards.
2775
+ * If no value is provided, the response will include charges for all upcoming cycles, including the existing one,
2776
+ * in this case, charges for cycle 1 through 3.
2777
+ * If there is a single charge for a subscription, meaning that subscription price remains consistent across all cycles,
2778
+ * then even if future_charges_count is set, it will be ignored and the only charge this subscription has will be returned.
2779
+ * @min 1
2780
+ * @max 10
2781
+ */
2782
+ numberOfNextRecurringCharges?: number | null;
2783
+ }
2784
+ interface SubscriptionBillingDetails {
2785
+ /**
2786
+ * External identifier of the subscription
2787
+ * @format GUID
2788
+ */
2789
+ externalId?: string | null;
2790
+ /** Billing details parameters including schedule, currency, etc. */
2791
+ billingSettings?: BillingSettings;
2792
+ /**
2793
+ * Items, minSize is 1, maxSize is 100
2794
+ * @minSize 1
2795
+ * @maxSize 100
2796
+ */
2797
+ items?: Item[];
2798
+ /** Subscription start date, now if not set */
2799
+ startDate?: Date | null;
2800
+ /** Shipping address associated with subscription. At the moment used only for payments. Optional. */
2801
+ shippingAddress?: FullAddressDetails;
2802
+ }
2803
+ interface PreviewSubscriptionsChargesResponse {
2804
+ /** Charges for the subscriptions, including an identifier. */
2805
+ subscriptionsCharges?: SubscriptionCharges[];
2806
+ }
2807
+ interface SubscriptionCharges {
2808
+ /**
2809
+ * External identifier of the subscription
2810
+ * @format GUID
2811
+ */
2812
+ externalId?: string | null;
2813
+ /** Charges for subscription. */
2814
+ charges?: Charge[];
2815
+ }
2816
+ interface CreateSubscriptionForOrderRequest {
2817
+ /** Subscription needs to be created */
2818
+ subscription?: Subscription;
2819
+ /**
2820
+ * Optional unique identifier for this request in order to prevent subscription duplications
2821
+ * @format GUID
2822
+ */
2823
+ idempotencyKey?: string | null;
2824
+ }
2825
+ interface CreateSubscriptionForOrderResponse {
2826
+ /** Created subscription */
2827
+ subscription?: Subscription;
2828
+ /** Non-persistent invoice */
2829
+ invoice?: Invoice;
2830
+ }
2831
+ /** An invoice includes information about the subscription and the customer. */
2832
+ interface Invoice {
2833
+ /**
2834
+ * Invoice ID.
2835
+ * @format GUID
2836
+ * @readonly
2837
+ */
2838
+ _id?: string | null;
2839
+ /**
2840
+ * Date and time the invoice was created.
2841
+ * @readonly
2842
+ */
2843
+ _createdDate?: Date | null;
2844
+ /**
2845
+ * Date and time the invoice was last updated.
2846
+ * @readonly
2847
+ */
2848
+ _updatedDate?: Date | null;
2849
+ /**
2850
+ * Revision number, which increments by 1 each time the invoice is updated.
2851
+ * To prevent conflicting changes,
2852
+ * the current revision must be passed when updating the invoice.
2853
+ *
2854
+ * Ignored when creating a invoice.
2855
+ * @readonly
2856
+ */
2857
+ revision?: string | null;
2858
+ /** Information about the invoice origin. */
2859
+ origin?: BusinessOriginData;
2860
+ /**
2861
+ * Invoice status.
2862
+ *
2863
+ * + `"UNKNOWN"`: There is no information about the invoice status.
2864
+ * + `"OPEN"`: BASS has created the invoice but hasn't initiated the payment process.
2865
+ * + `"PAID"`: The customer has successfully paid for the invoice.
2866
+ * + `"ATTEMPT_FAILED"`: The payment process has started and there has been at least one unsuccessful payment attempt.
2867
+ * + `"FAILED"`: The payment process has failed and there are no more retries.
2868
+ * + `"CANCELED"`: The payment process has been stopped because the related subscription has been canceled.
2869
+ * @readonly
2870
+ */
2871
+ status?: InvoiceStatusWithLiterals;
2872
+ /**
2873
+ * 3-letter currency code of the invoice in
2874
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
2875
+ * @format CURRENCY
2876
+ */
2877
+ currency?: string;
2878
+ /** Information about the customer. */
2879
+ customer?: Customer;
2880
+ /**
2881
+ * Whether the payment is processed through Wix and whether the customer must provide some input.
2882
+ *
2883
+ * + `"UNKNOWN"`: There is no information about the collection method.
2884
+ * + `"AUTO_CHARGE"`: The customer pays automatically through Wix.
2885
+ * + `"SEND_INVOICE"`: The customer pays through Wix, but some manual input is required.
2886
+ * + `"OFFLINE"`: The customer pays outside of Wix.
2887
+ */
2888
+ collectionMethod?: CollectionMethodWithLiterals;
2889
+ /**
2890
+ * ID of the
2891
+ * [payment method](https://bo.wix.com/wix-docs/rest/wix-cashier/settings/payment-method-type/payment-method-type-object).
2892
+ * Not available for the first payment of a subscription and all offline
2893
+ * payments.
2894
+ * @format GUID
2895
+ */
2896
+ paymentMethodId?: string | null;
2897
+ /**
2898
+ * Cashier [Order ID](https://dev.wix.com/docs/rest/payments/wix-cashier/pay/order#order-object)
2899
+ * for the corresponding payment.
2900
+ * @format GUID
2901
+ * @readonly
2902
+ */
2903
+ paymentOrderId?: string | null;
2904
+ /** Information about a discount. Available only for invoices that include a discount. */
2905
+ discount?: InvoiceDiscount;
2906
+ /** Billing address. */
2907
+ billingAddress?: FullAddressDetails;
2908
+ /** Shipping address. Available only for `"PHYSICAL"` line items. */
2909
+ shippingAddress?: FullAddressDetails;
2910
+ /**
2911
+ * Shipping fee in `0.00` format.
2912
+ * @format DECIMAL_VALUE
2913
+ */
2914
+ shippingFee?: string | null;
2915
+ /**
2916
+ * Information about the invoice's totals.
2917
+ * @readonly
2918
+ */
2919
+ totals?: Totals;
2920
+ /** Line items belonging to the invoice. */
2921
+ invoiceItems?: InvoiceItem[];
2922
+ /**
2923
+ * Whether the invoice is used to validate payment details.
2924
+ *
2925
+ * + `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.
2926
+ * + `false`: Standard invoice.
2927
+ */
2928
+ isAuthorization?: boolean | null;
2929
+ /** Whether the invoice's `totals.totalPrice` includes tax. */
2930
+ isTaxInclusive?: boolean | null;
2931
+ /** Details of the latest payment attempt. */
2932
+ latestPaymentAttempt?: LatestPaymentAttempt;
2933
+ /** List of charges and credits that adjust the invoice's `totals.totalPrice`. */
2934
+ adjustments?: PriceAdjustment[];
2935
+ /**
2936
+ * Invoice Number.
2937
+ * @maxLength 10
2938
+ * @readonly
2939
+ */
2940
+ invoiceNumber?: string | null;
2941
+ /**
2942
+ * Shipping charges for the invoice.
2943
+ * Supports only one discount without cycles.
2944
+ * Discounts with cycles (repeated discounts across different billing cycles) are not supported for shipping
2945
+ */
2946
+ shippingCharges?: InvoiceShippingCharges;
2947
+ /** Information about the invoice tax */
2948
+ taxData?: TaxData;
2949
+ /** Business address. */
2950
+ businessAddress?: Address;
2951
+ /**
2952
+ * ID of the billing order that created this invoice.
2953
+ * @format GUID
2954
+ */
2955
+ orderId?: string | null;
2956
+ /**
2957
+ * Platform origin the invoice is originated from.
2958
+ * @format GUID
2959
+ */
2960
+ platformOriginAppId?: string | null;
2961
+ /**
2962
+ * Refund information, provided that there are refunds for this invoice.
2963
+ * @readonly
2964
+ */
2965
+ refundInfo?: RefundInfo;
2966
+ }
2967
+ interface BusinessOriginData {
2968
+ /**
2969
+ * ID of the app for which BASS has created the invoice. For example,
2970
+ * `"1380b703-ce81-ff05-f115-39571d94dfcd"` for the Wix eCommerce app.
2971
+ * @format GUID
2972
+ */
2973
+ appId?: string;
2974
+ /**
2975
+ * [Instance ID](https://dev.wix.com/api/rest/app-management/apps/app-instance/get-app-instance)
2976
+ * of the app for which BASS has created the invoice.
2977
+ * @format GUID
2978
+ */
2979
+ instanceId?: string;
2980
+ /**
2981
+ * ID of the entity that triggered the invoice creation. For example, the ID of a
2982
+ * [pricing plan](https://dev.wix.com/docs/rest/payments/pricing-plans/pricing-plans/plan#plan-object).
2983
+ * @format GUID
2984
+ */
2985
+ entityId?: string;
2986
+ }
2987
+ declare enum InvoiceStatus {
2988
+ UNKNOWN = "UNKNOWN",
2989
+ OPEN = "OPEN",
2990
+ PAID = "PAID",
2991
+ FAILED = "FAILED",
2992
+ ATTEMPT_FAILED = "ATTEMPT_FAILED",
2993
+ CANCELED = "CANCELED",
2994
+ REFUNDED = "REFUNDED"
2995
+ }
2996
+ /** @enumType */
2997
+ type InvoiceStatusWithLiterals = InvoiceStatus | 'UNKNOWN' | 'OPEN' | 'PAID' | 'FAILED' | 'ATTEMPT_FAILED' | 'CANCELED' | 'REFUNDED';
2998
+ declare enum CollectionMethod {
2999
+ UNKNOWN = "UNKNOWN",
3000
+ AUTO_CHARGE = "AUTO_CHARGE",
3001
+ OFFLINE = "OFFLINE",
3002
+ SEND_INVOICE = "SEND_INVOICE"
3003
+ }
3004
+ /** @enumType */
3005
+ type CollectionMethodWithLiterals = CollectionMethod | 'UNKNOWN' | 'AUTO_CHARGE' | 'OFFLINE' | 'SEND_INVOICE';
3006
+ declare enum CreationMode {
3007
+ UNKNOWN = "UNKNOWN",
3008
+ SYSTEM = "SYSTEM",
3009
+ MANUAL = "MANUAL"
3010
+ }
3011
+ /** @enumType */
3012
+ type CreationModeWithLiterals = CreationMode | 'UNKNOWN' | 'SYSTEM' | 'MANUAL';
3013
+ interface LatestPaymentAttempt {
3014
+ /**
3015
+ * ID of the latest payment attempt.
3016
+ * @format GUID
3017
+ * @readonly
3018
+ */
3019
+ paymentAttemptId?: string;
3020
+ /**
3021
+ * Date and time of the latest payment attempt in `YYYY-MM-DDThh:mm.sssZ` format.
3022
+ * @readonly
3023
+ */
3024
+ dateAttempt?: Date | null;
3025
+ /** Number of the latest payment attempt. */
3026
+ attemptNumber?: number;
3027
+ /**
3028
+ * Status of the latest payment attempt.
3029
+ *
3030
+ * + `"UNKNOWN"`: There is no information about the status of the latest payment attempt.
3031
+ * + `"SCHEDULED"`: The latest payment attempt is scheduled but hasn't started yet.
3032
+ * + `"IN_PROGRESS"`: The latest payment attempt is in progress.
3033
+ * + `"PAID"`: The latest payment attempt resulted in a successful payment.
3034
+ * + `"DECLINED"`: The latest payment attempt has been declined.
3035
+ * + `"TECHNICAL_FAILURE"`: The latest payment attempt couldn't be process due to a technical failure.
3036
+ * + `"CANCELED"`: The latest payment attempt has been canceled by BASS.
3037
+ * @readonly
3038
+ */
3039
+ status?: PaymentAttemptStatusWithLiterals;
3040
+ /**
3041
+ * Whether BASS tries to collect the payment another time. Available only when
3042
+ * `latestPaymentAttempt.status` is set to `"DECLINED"`.
3043
+ */
3044
+ retryable?: boolean;
3045
+ }
3046
+ declare enum PaymentAttemptStatus {
3047
+ UNKNOWN = "UNKNOWN",
3048
+ SCHEDULED = "SCHEDULED",
3049
+ IN_PROGRESS = "IN_PROGRESS",
3050
+ PAID = "PAID",
3051
+ DECLINED = "DECLINED",
3052
+ TECHNICAL_FAILURE = "TECHNICAL_FAILURE",
3053
+ CANCELED = "CANCELED",
3054
+ PENDING = "PENDING"
3055
+ }
3056
+ /** @enumType */
3057
+ type PaymentAttemptStatusWithLiterals = PaymentAttemptStatus | 'UNKNOWN' | 'SCHEDULED' | 'IN_PROGRESS' | 'PAID' | 'DECLINED' | 'TECHNICAL_FAILURE' | 'CANCELED' | 'PENDING';
3058
+ interface PriceAdjustment extends PriceAdjustmentAdjustmentTypeOneOf {
3059
+ /** Adjustment that increases the price. */
3060
+ charge?: PriceAdjustmentValue;
3061
+ /** Adjustment that lowers the price. */
3062
+ credit?: PriceAdjustmentValue;
3063
+ }
3064
+ /** @oneof */
3065
+ interface PriceAdjustmentAdjustmentTypeOneOf {
3066
+ /** Adjustment that increases the price. */
3067
+ charge?: PriceAdjustmentValue;
3068
+ /** Adjustment that lowers the price. */
3069
+ credit?: PriceAdjustmentValue;
3070
+ }
3071
+ interface PriceAdjustmentValue extends PriceAdjustmentValueAdjustmentValueTypeOneOf {
3072
+ /**
3073
+ * Absolute amount that adjusts the price.
3074
+ *
3075
+ * Min: `0.01`
3076
+ * @decimalValue options { gt:0.00 }
3077
+ */
3078
+ amount?: string;
3079
+ /**
3080
+ * Relative factor that adjusts the price. For example, setting
3081
+ * `multiplier` to:
3082
+ * - `0.50` results in a price adjustment of 50% of the original value.
3083
+ * - `0.75` results in a price adjustment of 75% of the original value.
3084
+ * - `1.00` results in a price adjustment of 100% of the original value.
3085
+ *
3086
+ * Min: `0.01`
3087
+ * Max: `1.00`
3088
+ * @decimalValue options { gt:0.00, lte:1 }
3089
+ */
3090
+ multiplier?: string;
3091
+ }
3092
+ /** @oneof */
3093
+ interface PriceAdjustmentValueAdjustmentValueTypeOneOf {
3094
+ /**
3095
+ * Absolute amount that adjusts the price.
3096
+ *
3097
+ * Min: `0.01`
3098
+ * @decimalValue options { gt:0.00 }
3099
+ */
3100
+ amount?: string;
3101
+ /**
3102
+ * Relative factor that adjusts the price. For example, setting
3103
+ * `multiplier` to:
3104
+ * - `0.50` results in a price adjustment of 50% of the original value.
3105
+ * - `0.75` results in a price adjustment of 75% of the original value.
3106
+ * - `1.00` results in a price adjustment of 100% of the original value.
3107
+ *
3108
+ * Min: `0.01`
3109
+ * Max: `1.00`
3110
+ * @decimalValue options { gt:0.00, lte:1 }
3111
+ */
3112
+ multiplier?: string;
3113
+ }
3114
+ interface InvoiceShippingCharges {
3115
+ /**
3116
+ * Amount of the shipping fee in `0.00` format.
3117
+ *
3118
+ * Min: `0.01`
3119
+ * @decimalValue options { gte:0.00, maxScale:2 }
3120
+ */
3121
+ amount?: string;
3122
+ /** Tax of the shipping fee */
3123
+ tax?: Tax;
3124
+ /** Information about the shipping charges tax data */
3125
+ taxData?: ItemTaxData;
3126
+ discount?: Discount;
3127
+ }
3128
+ /** Tax data from all items */
3129
+ interface TaxData {
3130
+ /** Aggregated tax data from all items */
3131
+ taxSummary?: TaxSummary;
3132
+ }
3133
+ interface TaxSummary {
3134
+ /**
3135
+ * Aggregated from tax_breakdowns with exemptions excluded from amount
3136
+ * @format DECIMAL_VALUE
3137
+ */
3138
+ aggregatedTaxAmount?: string;
3139
+ /**
3140
+ * Array of each tax applied, grouped by `"jurisdiction"`, `"jurisdiction_type"`, `"tax_type"`, `"tax_name"` and `"tax_rate"`.
3141
+ * @maxSize 50
3142
+ */
3143
+ aggregatedTaxBreakdowns?: AggregatedTaxBreakdown[];
3144
+ }
3145
+ interface AggregatedTaxBreakdown {
3146
+ /**
3147
+ * Name of the tax that was calculated.
3148
+ * @maxLength 200
3149
+ */
3150
+ taxName?: string;
3151
+ /**
3152
+ * Type of tax that was calculated.
3153
+ * @maxLength 200
3154
+ */
3155
+ taxType?: string;
3156
+ /**
3157
+ * Jurisdiction that taxes were calculated for.
3158
+ * @maxLength 200
3159
+ */
3160
+ jurisdiction?: string;
3161
+ /** Type of jurisdiction that taxes were calculated for. */
3162
+ jurisdictionType?: string;
3163
+ /**
3164
+ * Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`.
3165
+ * @decimalValue options { gte:0, maxScale:6 }
3166
+ */
3167
+ rate?: string;
3168
+ /**
3169
+ * Total amount of this tax for this jurisdiction.
3170
+ * @format DECIMAL_VALUE
3171
+ * @decimalValue options { maxScale:4 }
3172
+ */
3173
+ aggregatedTaxAmount?: string;
3174
+ }
3175
+ interface RefundInfo {
3176
+ /**
3177
+ * If refunds are present, this will include the total amount refunded.
3178
+ * @format DECIMAL_VALUE
3179
+ * @decimalValue options { gte:0.00, maxScale:2 }
3180
+ */
3181
+ totalRefundAmount?: string | null;
3182
+ /**
3183
+ * The refunds that have been applied to this invoice
3184
+ * @maxSize 20
3185
+ */
3186
+ refunds?: Refund[];
3187
+ }
3188
+ interface Refund {
3189
+ /**
3190
+ * refund amount
3191
+ * @format DECIMAL_VALUE
3192
+ * @decimalValue options { gt:0.00, maxScale:2 }
3193
+ */
3194
+ amount?: string;
3195
+ /** the date of the refund transaction */
3196
+ transactionDate?: Date | null;
3197
+ /**
3198
+ * the transaction id associated with this refund
3199
+ * @format GUID
3200
+ */
3201
+ transactionId?: string;
3202
+ /** a reason for the refund */
3203
+ reason?: RefundReasonWithLiterals;
3204
+ /**
3205
+ * a description of the refund - this is a free text field for the initiator
3206
+ * @maxLength 255
3207
+ */
3208
+ description?: string | null;
3209
+ }
3210
+ declare enum RefundReason {
3211
+ UNKNOWN_REFUND_REASON = "UNKNOWN_REFUND_REASON",
3212
+ DUPLICATE_CHARGE = "DUPLICATE_CHARGE",
3213
+ FRAUDULENT = "FRAUDULENT",
3214
+ CUSTOMER_REQUEST = "CUSTOMER_REQUEST",
3215
+ PROVISION_FAILED = "PROVISION_FAILED",
3216
+ OTHER = "OTHER"
3217
+ }
3218
+ /** @enumType */
3219
+ type RefundReasonWithLiterals = RefundReason | 'UNKNOWN_REFUND_REASON' | 'DUPLICATE_CHARGE' | 'FRAUDULENT' | 'CUSTOMER_REQUEST' | 'PROVISION_FAILED' | 'OTHER';
3220
+ interface Task {
3221
+ key?: TaskKey;
3222
+ executeAt?: Date | null;
3223
+ payload?: string | null;
3224
+ }
3225
+ interface TaskKey {
3226
+ appId?: string;
3227
+ instanceId?: string;
3228
+ subjectId?: string | null;
3229
+ }
3230
+ interface TaskAction extends TaskActionActionOneOf {
3231
+ complete?: Complete;
3232
+ cancel?: Cancel;
3233
+ reschedule?: Reschedule;
3234
+ }
3235
+ /** @oneof */
3236
+ interface TaskActionActionOneOf {
3237
+ complete?: Complete;
3238
+ cancel?: Cancel;
3239
+ reschedule?: Reschedule;
3240
+ }
3241
+ interface Complete {
3242
+ }
3243
+ interface Cancel {
3244
+ }
3245
+ interface Reschedule {
3246
+ executeAt?: Date | null;
3247
+ payload?: string | null;
3248
+ }
3249
+ interface V1SubscriptionEvent extends V1SubscriptionEventEventOneOf {
3250
+ /** A subscriptions was created */
3251
+ created?: V1SubscriptionCreated;
3252
+ /** Subscription is considered active and will be visible to site owners and members */
3253
+ activated?: V1SubscriptionActivated;
3254
+ /**
3255
+ * Subscription was canceled either by cancellation request with requested expiration date NOW or by payment provider.
3256
+ * If cancelled by payment provider subscription will be valid until the date calculated depending on how many cycles it was already paid for.
3257
+ */
3258
+ canceled?: V1SubscriptionCanceled;
3259
+ /** Subscription was updated. Currently the only possible change is valid_until date */
3260
+ updated?: V1SubscriptionUpdated;
3261
+ /** Subscription cycle has started. Currently the cycle starts when a payment is received. */
3262
+ cycleTriggered?: SubscriptionCycleTriggered;
3263
+ /** Offline subscription was marked as paid */
3264
+ markedAsPaid?: SubscriptionMarkedAsPaid;
3265
+ /**
3266
+ * Subscription cancellation for the future date was requested.
3267
+ * Subscription will stay in pending cancellation status until the date calculated depending on free trial and the next payment date.
3268
+ */
3269
+ cancellationRequested?: SubscriptionCancellationRequested;
3270
+ /** Subscription and it's payment schedule (for recurring) was suspended */
3271
+ suspended?: SubscriptionSuspended;
3272
+ /** Previously suspended subscription and it's payment schedule (for recurring) was resumed */
3273
+ resumed?: V1SubscriptionResumed;
3274
+ /** Subscription expired according to valid_until expiration date. */
3275
+ expired?: SubscriptionExpired;
3276
+ /** Subscription initial purchase completed */
3277
+ initialPurchaseCompleted?: V1SubscriptionInitialPurchaseCompleted;
3278
+ }
3279
+ /** @oneof */
3280
+ interface V1SubscriptionEventEventOneOf {
3281
+ /** A subscriptions was created */
3282
+ created?: V1SubscriptionCreated;
3283
+ /** Subscription is considered active and will be visible to site owners and members */
3284
+ activated?: V1SubscriptionActivated;
3285
+ /**
3286
+ * Subscription was canceled either by cancellation request with requested expiration date NOW or by payment provider.
3287
+ * If cancelled by payment provider subscription will be valid until the date calculated depending on how many cycles it was already paid for.
3288
+ */
3289
+ canceled?: V1SubscriptionCanceled;
3290
+ /** Subscription was updated. Currently the only possible change is valid_until date */
3291
+ updated?: V1SubscriptionUpdated;
3292
+ /** Subscription cycle has started. Currently the cycle starts when a payment is received. */
3293
+ cycleTriggered?: SubscriptionCycleTriggered;
3294
+ /** Offline subscription was marked as paid */
3295
+ markedAsPaid?: SubscriptionMarkedAsPaid;
3296
+ /**
3297
+ * Subscription cancellation for the future date was requested.
3298
+ * Subscription will stay in pending cancellation status until the date calculated depending on free trial and the next payment date.
3299
+ */
3300
+ cancellationRequested?: SubscriptionCancellationRequested;
3301
+ /** Subscription and it's payment schedule (for recurring) was suspended */
3302
+ suspended?: SubscriptionSuspended;
3303
+ /** Previously suspended subscription and it's payment schedule (for recurring) was resumed */
3304
+ resumed?: V1SubscriptionResumed;
3305
+ /** Subscription expired according to valid_until expiration date. */
3306
+ expired?: SubscriptionExpired;
3307
+ /** Subscription initial purchase completed */
3308
+ initialPurchaseCompleted?: V1SubscriptionInitialPurchaseCompleted;
3309
+ }
3310
+ interface V1SubscriptionCreated {
3311
+ subscription?: V1Subscription;
3312
+ }
3313
+ interface V1Subscription {
3314
+ /**
3315
+ * ID of the subscription
3316
+ * @format GUID
3317
+ * @readonly
3318
+ */
3319
+ _id?: string;
3320
+ /**
3321
+ * ID of the app which created the subscription
3322
+ * @format GUID
3323
+ */
3324
+ wixAppId?: string;
3325
+ /**
3326
+ * Instance ID of the Subscriptions app
3327
+ * @format GUID
3328
+ */
3329
+ tenantId?: string;
3330
+ /**
3331
+ * ID of entity in app (e.g. a cart in stores/order in paid plans)
3332
+ * @format GUID
3333
+ */
3334
+ originEntityId?: string;
3335
+ /** Site member or a contact who bought the subscription */
3336
+ subscriber?: Subscriber;
3337
+ /**
3338
+ * Wix Pay order ID, is empty for free subscriptions
3339
+ * @format GUID
3340
+ */
3341
+ wixPayOrderId?: string | null;
3342
+ /**
3343
+ * Subscription name (e.g. a product or subscription package name)
3344
+ * @maxLength 150
3345
+ */
3346
+ name?: string;
3347
+ /**
3348
+ * Optional additional subscription description
3349
+ * @maxLength 500
3350
+ */
3351
+ description?: string;
3352
+ /** Amount to be paid for a single scheduled payment */
3353
+ price?: Money;
3354
+ /** True if the subscription is recurring, false for a single payment subscription */
3355
+ recurring?: boolean;
3356
+ /** Online (paid by subscriber using wix pay) or offline (need to manually mark as paid) */
3357
+ subscriptionType?: SubscriptionTypeWithLiterals;
3358
+ /** Active, expired, canceled, etc. */
3359
+ subscriptionStatus?: V1SubscriptionStatusEnumSubscriptionStatusWithLiterals;
3360
+ /** Subscription start date (may differ from creation date) */
3361
+ validFrom?: Date | null;
3362
+ /** Subscription expiration date */
3363
+ validUntil?: Date | null;
3364
+ /** Status of last payment associated with this subscription */
3365
+ lastPaymentStatus?: PaymentStatusEnumPaymentStatusWithLiterals;
3366
+ /** Payment schedule in the wix pay format. Exists for recurring subscriptions only. */
3367
+ billingProfile?: V2Subscription;
3368
+ /** Owner, member, etc. - present if subscription is canceled */
3369
+ cancellationInitiator?: CancellationInitiatorWithLiterals;
3370
+ /** Optional, present if subscription is canceled */
3371
+ cancellationReason?: string | null;
3372
+ /** Can be used for arbitrary app-specific map<string, string> data */
3373
+ externalData?: Record<string, string>;
3374
+ /** Date when subscription was created (not related to payment dates) */
3375
+ dateCreated?: Date | null;
3376
+ /** Restrictions on possible subscription actions. Default policy has all restrictions enabled. */
3377
+ policy?: SubscriptionPolicy;
3378
+ /** List of subscription suspension periods */
3379
+ suspensions?: Suspension[];
3380
+ /** Initial subscription expiration date that was calculated on the subscription purchase plus duration of suspensions */
3381
+ validUntilDateWithSuspensions?: Date | null;
3382
+ /** Duration of single payment subscription (instead of billing_profile) */
3383
+ singlePaymentDuration?: V1Duration;
3384
+ /** @format GUID */
3385
+ originInstanceId?: string | null;
3386
+ }
3387
+ interface Subscriber {
3388
+ /**
3389
+ * Member or contact ID
3390
+ * @format GUID
3391
+ */
3392
+ _id?: string;
3393
+ /** Member or contact */
3394
+ identityType?: IdentityTypeWithLiterals;
3395
+ }
3396
+ declare enum IdentityType {
3397
+ /** Identity type undefined */
3398
+ UNDEFINED = "UNDEFINED",
3399
+ /** Subscription is associated with a member ID */
3400
+ MEMBER = "MEMBER",
3401
+ /** Subscriptions is associated with a contact ID */
3402
+ CONTACT = "CONTACT"
3403
+ }
3404
+ /** @enumType */
3405
+ type IdentityTypeWithLiterals = IdentityType | 'UNDEFINED' | 'MEMBER' | 'CONTACT';
3406
+ /** Price of a payment. Includes amount and currency. */
3407
+ interface Money {
3408
+ /**
3409
+ * Monetary amount i.e. 3.99.
3410
+ * @format DECIMAL_VALUE
3411
+ */
3412
+ amount?: string;
3413
+ /**
3414
+ * Currency in ISO 4217 format i.e. USD.
3415
+ * @minLength 3
3416
+ * @maxLength 3
3417
+ */
3418
+ currency?: string;
3419
+ }
3420
+ declare enum SubscriptionType {
3421
+ UNDEFINED = "UNDEFINED",
3422
+ /** Payments made by the subscriber */
3423
+ ONLINE = "ONLINE",
3424
+ /** Payments managed manually by the site owner */
3425
+ OFFLINE = "OFFLINE"
3426
+ }
3427
+ /** @enumType */
3428
+ type SubscriptionTypeWithLiterals = SubscriptionType | 'UNDEFINED' | 'ONLINE' | 'OFFLINE';
3429
+ declare enum V1SubscriptionStatusEnumSubscriptionStatus {
3430
+ /** Subscription status undefined */
3431
+ UNDEFINED = "UNDEFINED",
3432
+ /** Subscription created, but hasn't been paid for yet. This status if filtered out in ListSubscriptions response by default. */
3433
+ DRAFT = "DRAFT",
3434
+ /** Subscription has been paid for, but the start date is in the future */
3435
+ PENDING = "PENDING",
3436
+ /** Subscription is active */
3437
+ ACTIVE = "ACTIVE",
3438
+ /** Subscription has expired */
3439
+ EXPIRED = "EXPIRED",
3440
+ /** Subscription has been canceled */
3441
+ CANCELED = "CANCELED",
3442
+ /** Subscription has been set to be canceled at a future date */
3443
+ PENDING_CANCELLATION = "PENDING_CANCELLATION",
3444
+ /** Subscription is suspended */
3445
+ SUSPENDED = "SUSPENDED"
3446
+ }
3447
+ /** @enumType */
3448
+ type V1SubscriptionStatusEnumSubscriptionStatusWithLiterals = V1SubscriptionStatusEnumSubscriptionStatus | 'UNDEFINED' | 'DRAFT' | 'PENDING' | 'ACTIVE' | 'EXPIRED' | 'CANCELED' | 'PENDING_CANCELLATION' | 'SUSPENDED';
3449
+ declare enum PaymentStatusEnumPaymentStatus {
3450
+ /** Payment status undefined */
3451
+ UNDEFINED = "UNDEFINED",
3452
+ /** Payment has been paid */
3453
+ PAID = "PAID",
3454
+ /** Payment has been refunded */
3455
+ REFUNDED = "REFUNDED",
3456
+ /** Recurring payment has failed */
3457
+ FAILED = "FAILED",
3458
+ /** Payment has not been paid */
3459
+ UNPAID = "UNPAID",
3460
+ /** Billing has been initialized, but actual charge is yet to be made. Can happen for free trial and PayPal */
3461
+ PENDING = "PENDING"
3462
+ }
3463
+ /** @enumType */
3464
+ type PaymentStatusEnumPaymentStatusWithLiterals = PaymentStatusEnumPaymentStatus | 'UNDEFINED' | 'PAID' | 'REFUNDED' | 'FAILED' | 'UNPAID' | 'PENDING';
3465
+ /**
3466
+ * Recurring payment is described by `frequency` (day, week, month) and `interval`.
3467
+ *
3468
+ * For example, to create a recurring payment every 14 days, just set `interval` to 14 and frequency to `DAY`.
3469
+ *
3470
+ * In some cases there should be a trial period for the order, after which payments start to occur.
3471
+ * Trial period is also defined as `frequency` and `interval` pair.
3472
+ *
3473
+ * So one can define a monthly 'subscription' with a 14 days trial period.
3474
+ */
3475
+ interface V2Subscription {
3476
+ /** frequency of recurring payment (required) */
3477
+ frequency?: SubscriptionFrequencyWithLiterals;
3478
+ /** interval of recurring payment (required) */
3479
+ interval?: number;
3480
+ /** trial period for recurring payment (optional) */
3481
+ trial?: SubscriptionTrialPeriod;
3482
+ /**
3483
+ * how many billing cycles should be done before subscription finishes
3484
+ * (optional, 0 by default means endless subscription)
3485
+ */
3486
+ billingCycles?: number;
3487
+ /**
3488
+ * date in the future or in the past when the first billing cycle begins
3489
+ * (the first off-session payment is performed when it ends)
3490
+ */
3491
+ firstCycleStartDate?: Date | null;
3492
+ }
3493
+ /** Frequency unit of recurring payment */
3494
+ declare enum SubscriptionFrequency {
3495
+ UNDEFINED = "UNDEFINED",
3496
+ DAY = "DAY",
3497
+ WEEK = "WEEK",
3498
+ MONTH = "MONTH",
3499
+ YEAR = "YEAR"
3500
+ }
3501
+ /** @enumType */
3502
+ type SubscriptionFrequencyWithLiterals = SubscriptionFrequency | 'UNDEFINED' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
3503
+ /** Trial period of subscription */
3504
+ interface SubscriptionTrialPeriod {
3505
+ /** trial period in units (required) */
3506
+ period?: number;
3507
+ /** units in which trial period is described (optional, default DAY) */
3508
+ unit?: SubscriptionFrequencyWithLiterals;
3509
+ }
3510
+ declare enum CancellationInitiator {
3511
+ /** Cancellation initiator undefined */
3512
+ UNDEFINED = "UNDEFINED",
3513
+ /** Subscription was canceled by site owner (default if canceled by user or service identity) */
3514
+ OWNER = "OWNER",
3515
+ /** Subscription was canceled by member (default if canceled by member identity) */
3516
+ MEMBER = "MEMBER",
3517
+ /** Subscription was canceled because of payment failure */
3518
+ PAYMENT_FAILURE = "PAYMENT_FAILURE",
3519
+ /** Subscription was canceled because of payment setup failure */
3520
+ SETUP_FAILURE = "SETUP_FAILURE"
3521
+ }
3522
+ /** @enumType */
3523
+ type CancellationInitiatorWithLiterals = CancellationInitiator | 'UNDEFINED' | 'OWNER' | 'MEMBER' | 'PAYMENT_FAILURE' | 'SETUP_FAILURE';
3524
+ interface SubscriptionPolicy {
3525
+ /** Subscription expiration date can be updated */
3526
+ expiryDateChangeable?: boolean;
3527
+ /** Subscription can be cancelled by the member who bought it (when memberId == subscriberId) */
3528
+ cancellableByMember?: boolean;
3529
+ /** Subscription expiration date on cancellation can be set to next payment date */
3530
+ cancellableAtNextPaymentCycle?: boolean;
3531
+ }
3532
+ interface Suspension {
3533
+ status?: StatusWithLiterals;
3534
+ /** Beginning of the suspended period */
3535
+ startsAt?: Date | null;
3536
+ /** End of the suspended period */
3537
+ endsAt?: Date | null;
3538
+ }
3539
+ declare enum Status {
3540
+ UNDEFINED = "UNDEFINED",
3541
+ ACTIVE = "ACTIVE",
3542
+ ENDED = "ENDED"
3543
+ }
3544
+ /** @enumType */
3545
+ type StatusWithLiterals = Status | 'UNDEFINED' | 'ACTIVE' | 'ENDED';
3546
+ /** A duration expressed in amount of time units. */
3547
+ interface V1Duration {
3548
+ /** Amount of the unit */
3549
+ amount?: number;
3550
+ /** Day, Week, Month, Year. */
3551
+ unit?: SubscriptionFrequencyWithLiterals;
3552
+ }
3553
+ interface V1SubscriptionActivated {
3554
+ subscription?: V1Subscription;
3555
+ }
3556
+ interface V1SubscriptionCanceled {
3557
+ subscription?: V1Subscription;
3558
+ }
3559
+ interface V1SubscriptionUpdated {
3560
+ subscription?: V1Subscription;
3561
+ }
3562
+ interface SubscriptionCycleTriggered {
3563
+ subscription?: V1Subscription;
3564
+ billingCycle?: number;
3565
+ /**
3566
+ * Wix Pay transaction id, optional. Exists if event was triggered by a payment.
3567
+ * @format GUID
3568
+ */
3569
+ transactionId?: string | null;
3570
+ }
3571
+ interface SubscriptionMarkedAsPaid {
3572
+ subscription?: V1Subscription;
3573
+ /** A number indicating which payment (cycle) was marked as paid. For recurring subscriptions only. */
3574
+ billingCycle?: number | null;
3575
+ }
3576
+ interface SubscriptionCancellationRequested {
3577
+ subscription?: V1Subscription;
3578
+ }
3579
+ interface SubscriptionSuspended {
3580
+ subscription?: V1Subscription;
3581
+ }
3582
+ interface V1SubscriptionResumed {
3583
+ subscription?: V1Subscription;
3584
+ }
3585
+ interface SubscriptionExpired {
3586
+ subscription?: V1Subscription;
3587
+ }
3588
+ interface V1SubscriptionInitialPurchaseCompleted {
3589
+ subscription?: V1Subscription;
3590
+ }
3591
+ interface ListSubscriptionHistoryRequest {
3592
+ /** @format GUID */
3593
+ subscriptionId: string;
3594
+ /** Determines the type of view for the history: either a comprehensive backoffice view or a user-centric view. */
3595
+ mode?: HistoryViewModeWithLiterals;
3596
+ /** Cursor for efficient paging. If paging through results, pass this field from the previous search response to continue to the next page. */
3597
+ cursor?: CursorPaging;
3598
+ }
3599
+ declare enum HistoryViewMode {
3600
+ UNKNOWN = "UNKNOWN",
3601
+ /** Comprehensive view including all history events. */
3602
+ BACKOFFICE = "BACKOFFICE",
3603
+ /** User-centric view of the history. */
3604
+ USER = "USER"
3605
+ }
3606
+ /** @enumType */
3607
+ type HistoryViewModeWithLiterals = HistoryViewMode | 'UNKNOWN' | 'BACKOFFICE' | 'USER';
3608
+ interface ListSubscriptionHistoryResponse {
3609
+ /** List of history entries for the subscription. */
3610
+ historyEntries?: SubscriptionHistoryEntry[];
3611
+ /** Paging metadata. A `next` cursor is returned if there are more results. */
3612
+ pagingMetadata?: PagingMetadataV2;
3613
+ }
3614
+ interface SubscriptionHistoryEntry {
3615
+ /** @format GUID */
3616
+ entryId?: string;
3617
+ /** TODO: add max length? it is not defined in domainevents, so should we? */
3618
+ slug?: string;
3619
+ entryTime?: Date | null;
3620
+ event?: SubscriptionEvent;
3621
+ }
3622
+ interface SubscriptionEvent extends SubscriptionEventPayloadOneOf {
3623
+ created?: SubscriptionCreated;
3624
+ updated?: SubscriptionUpdated;
3625
+ deleted?: SubscriptionDeleted;
3626
+ activated?: SubscriptionActivated;
3627
+ ended?: SubscriptionEnded;
3628
+ canceled?: SubscriptionCanceled;
3629
+ paused?: SubscriptionPaused;
3630
+ resumed?: SubscriptionResumed;
3631
+ pauseRequested?: PauseSubscriptionRequested;
3632
+ resumeRequested?: ResumeSubscriptionRequested;
3633
+ scheduledPauseCanceled?: ScheduledPauseCanceled;
3634
+ scheduledResumeCanceled?: ScheduledResumeCanceled;
3635
+ billingCycleStarted?: SubscriptionBillingCycleStarted;
3636
+ autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn;
3637
+ autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff;
3638
+ cycleReadyToPay?: SubscriptionCycleReadyToPay;
3639
+ extended?: SubscriptionExtended;
3640
+ initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted;
3641
+ latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid;
3642
+ revived?: SubscriptionRevived;
3643
+ billingDateUpdated?: SubscriptionBillingDateUpdated;
3644
+ futureUpdatesRequested?: FutureUpdatesRequested;
3645
+ updatesApplied?: UpdatesApplied;
3646
+ resetPendingUpdates?: ResetPendingUpdates;
3647
+ gracePeriodStarted?: GracePeriodStarted;
3648
+ gracePeriodEnded?: GracePeriodEnded;
3649
+ paymentMethodUpdated?: PaymentMethodUpdated;
3650
+ collectionMethodUpdated?: SubscriptionCollectionMethodUpdated;
3651
+ freeTrailStarted?: FreeTrailStarted;
3652
+ freeTrailEnded?: FreeTrailEnded;
3653
+ billingCyclePaid?: SubscriptionBillingCyclePaid;
3654
+ initiatePaymentMethodSetup?: InitiatedPaymentMethodSetup;
3655
+ futurePriceUpdatesRequested?: FuturePriceUpdatesRequested;
3656
+ subscriptionBoAction?: SubscriptionBackOfficeAction;
3657
+ unknown?: UnknownSubscriptionEvent;
3658
+ }
3659
+ /** @oneof */
3660
+ interface SubscriptionEventPayloadOneOf {
3661
+ created?: SubscriptionCreated;
3662
+ updated?: SubscriptionUpdated;
3663
+ deleted?: SubscriptionDeleted;
3664
+ activated?: SubscriptionActivated;
3665
+ ended?: SubscriptionEnded;
3666
+ canceled?: SubscriptionCanceled;
3667
+ paused?: SubscriptionPaused;
3668
+ resumed?: SubscriptionResumed;
3669
+ pauseRequested?: PauseSubscriptionRequested;
3670
+ resumeRequested?: ResumeSubscriptionRequested;
3671
+ scheduledPauseCanceled?: ScheduledPauseCanceled;
3672
+ scheduledResumeCanceled?: ScheduledResumeCanceled;
3673
+ billingCycleStarted?: SubscriptionBillingCycleStarted;
3674
+ autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn;
3675
+ autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff;
3676
+ cycleReadyToPay?: SubscriptionCycleReadyToPay;
3677
+ extended?: SubscriptionExtended;
3678
+ initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted;
3679
+ latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid;
3680
+ revived?: SubscriptionRevived;
3681
+ billingDateUpdated?: SubscriptionBillingDateUpdated;
3682
+ futureUpdatesRequested?: FutureUpdatesRequested;
3683
+ updatesApplied?: UpdatesApplied;
3684
+ resetPendingUpdates?: ResetPendingUpdates;
3685
+ gracePeriodStarted?: GracePeriodStarted;
3686
+ gracePeriodEnded?: GracePeriodEnded;
3687
+ paymentMethodUpdated?: PaymentMethodUpdated;
3688
+ collectionMethodUpdated?: SubscriptionCollectionMethodUpdated;
3689
+ freeTrailStarted?: FreeTrailStarted;
3690
+ freeTrailEnded?: FreeTrailEnded;
3691
+ billingCyclePaid?: SubscriptionBillingCyclePaid;
3692
+ initiatePaymentMethodSetup?: InitiatedPaymentMethodSetup;
3693
+ futurePriceUpdatesRequested?: FuturePriceUpdatesRequested;
3694
+ subscriptionBoAction?: SubscriptionBackOfficeAction;
3695
+ unknown?: UnknownSubscriptionEvent;
3696
+ }
3697
+ interface SubscriptionCreated {
3698
+ subscription?: Subscription;
3699
+ }
3700
+ interface SubscriptionUpdated {
3701
+ current?: Subscription;
3702
+ previous?: Subscription;
3703
+ diff?: SubscriptionDiff;
3704
+ }
3705
+ interface SubscriptionDiff {
3706
+ added?: string | null;
3707
+ changed?: string | null;
3708
+ deleted?: string | null;
3709
+ }
3710
+ interface SubscriptionDeleted {
3711
+ subscriptionId?: string;
3712
+ }
3713
+ interface FutureUpdatesRequested {
3714
+ subscription?: Subscription;
3715
+ requestedUpdateData?: SubscriptionUpdateData;
3716
+ }
3717
+ interface UpdatesApplied {
3718
+ subscription?: Subscription;
3719
+ updateAction?: UpdateActionWithLiterals;
3720
+ appliedUpdateData?: SubscriptionUpdateData;
3721
+ }
3722
+ interface ResetPendingUpdates {
3723
+ subscription?: Subscription;
3724
+ }
3725
+ interface GracePeriodStarted {
3726
+ subscription?: Subscription;
3727
+ }
3728
+ interface GracePeriodEnded {
3729
+ subscription?: Subscription;
3730
+ /** Indication for the payment settlement method. */
3731
+ paymentSettlementMethod?: PaymentSettlementMethodWithLiterals;
3732
+ }
3733
+ declare enum PaymentSettlementMethod {
3734
+ UNKNOWN = "UNKNOWN",
3735
+ /** System-defined payment settlement. */
3736
+ SYSTEM = "SYSTEM",
3737
+ /** Manually mark the payment as paid. */
3738
+ MARK_AS_PAID = "MARK_AS_PAID",
3739
+ /** Require the customer to pay immediately, by insert a new payment method. */
3740
+ CUSTOMER_PAY_NOW = "CUSTOMER_PAY_NOW"
3741
+ }
3742
+ /** @enumType */
3743
+ type PaymentSettlementMethodWithLiterals = PaymentSettlementMethod | 'UNKNOWN' | 'SYSTEM' | 'MARK_AS_PAID' | 'CUSTOMER_PAY_NOW';
3744
+ interface PaymentMethodUpdated {
3745
+ subscription?: Subscription;
3746
+ initiator?: HistoryActionInitiatorWithLiterals;
3747
+ paymentMode?: PaymentModeWithLiterals;
3748
+ }
3749
+ interface SubscriptionCollectionMethodUpdated {
3750
+ subscription?: Subscription;
3751
+ newCollectionMethod?: CollectionMethodEnumCollectionMethodWithLiterals;
3752
+ previousCollectionMethod?: CollectionMethodEnumCollectionMethodWithLiterals;
3753
+ }
3754
+ interface FreeTrailStarted {
3755
+ subscription?: Subscription;
3756
+ }
3757
+ interface FreeTrailEnded {
3758
+ subscription?: Subscription;
3759
+ }
3760
+ interface InitiatedPaymentMethodSetup {
3761
+ subscription?: Subscription;
3762
+ }
3763
+ interface FuturePriceUpdatesRequested {
3764
+ subscription?: Subscription;
3765
+ requestedUpdateData?: SubscriptionUpdateData;
3766
+ }
3767
+ interface SubscriptionBackOfficeAction {
3768
+ subscription?: Subscription;
3769
+ /** The backoffice method name */
3770
+ name?: string;
3771
+ /** json as string format, to store the flatted request object */
3772
+ params?: string;
3773
+ }
3774
+ /** Defines unknown events restored from the logs */
3775
+ interface UnknownSubscriptionEvent {
3776
+ subscriptionAsString?: string | null;
3777
+ }
3778
+ /** @docsIgnore */
3779
+ type CustomerCancelSubscriptionApplicationErrors = {
3780
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3781
+ description?: string;
3782
+ data?: Record<string, any>;
3783
+ };
3784
+ /** @docsIgnore */
3785
+ type CustomerTurnOnSubscriptionAutoRenewalApplicationErrors = {
3786
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3787
+ description?: string;
3788
+ data?: Record<string, any>;
3789
+ };
3790
+ /** @docsIgnore */
3791
+ type CustomerTurnOffSubscriptionAutoRenewalApplicationErrors = {
3792
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3793
+ description?: string;
3794
+ data?: Record<string, any>;
3795
+ };
3796
+ /** @docsIgnore */
3797
+ type CustomerExtendSubscriptionApplicationErrors = {
3798
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3799
+ description?: string;
3800
+ data?: Record<string, any>;
3801
+ };
3802
+ /** @docsIgnore */
3803
+ type UpdateSubscriptionBillingDateApplicationErrors = {
3804
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3805
+ description?: string;
3806
+ data?: Record<string, any>;
3807
+ };
3808
+ /** @docsIgnore */
3809
+ type CancelSubscriptionApplicationErrors = {
3810
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3811
+ description?: string;
3812
+ data?: Record<string, any>;
3813
+ };
3814
+ /** @docsIgnore */
3815
+ type PauseSubscriptionApplicationErrors = {
3816
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3817
+ description?: string;
3818
+ data?: Record<string, any>;
3819
+ };
3820
+ /** @docsIgnore */
3821
+ type ResumeSubscriptionApplicationErrors = {
3822
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3823
+ description?: string;
3824
+ data?: Record<string, any>;
3825
+ };
3826
+ /** @docsIgnore */
3827
+ type TurnOnSubscriptionAutoRenewalApplicationErrors = {
3828
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3829
+ description?: string;
3830
+ data?: Record<string, any>;
3831
+ };
3832
+ /** @docsIgnore */
3833
+ type TurnOffSubscriptionAutoRenewalApplicationErrors = {
3834
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3835
+ description?: string;
3836
+ data?: Record<string, any>;
3837
+ };
3838
+ /** @docsIgnore */
3839
+ type MarkLatestInvoiceAsPaidApplicationErrors = {
3840
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3841
+ description?: string;
3842
+ data?: Record<string, any>;
3843
+ } | {
3844
+ code?: 'SUBSCRIPTION_PART_OF_ORDER';
3845
+ description?: string;
3846
+ data?: MultipleSubscriptionsOnOrdersInvoice;
3847
+ };
3848
+ /** @docsIgnore */
3849
+ type MarkBillingCycleAsPaidApplicationErrors = {
3850
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3851
+ description?: string;
3852
+ data?: Record<string, any>;
3853
+ } | {
3854
+ code?: 'SUBSCRIPTION_PART_OF_ORDER';
3855
+ description?: string;
3856
+ data?: MultipleSubscriptionsOnOrdersInvoice;
3857
+ } | {
3858
+ code?: 'INVOICE_NOT_FOUND';
3859
+ description?: string;
3860
+ data?: Record<string, any>;
3861
+ } | {
3862
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_COLLECTION_METHOD';
3863
+ description?: string;
3864
+ data?: Record<string, any>;
3865
+ };
3866
+ /** @docsIgnore */
3867
+ type ExtendSubscriptionApplicationErrors = {
3868
+ code?: 'OPERATION_NOT_SUPPORTED_FOR_STATUS';
3869
+ description?: string;
3870
+ data?: Record<string, any>;
3871
+ };
3872
+ interface BaseEventMetadata {
3873
+ /**
3874
+ * App instance ID.
3875
+ * @format GUID
3876
+ */
3877
+ instanceId?: string | null;
3878
+ /**
3879
+ * Event type.
3880
+ * @maxLength 150
3881
+ */
3882
+ eventType?: string;
3883
+ /** The identification type and identity data. */
3884
+ identity?: IdentificationData;
3885
+ }
3886
+ interface EventMetadata extends BaseEventMetadata {
3887
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
3888
+ _id?: string;
3889
+ /**
3890
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
3891
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
3892
+ */
3893
+ entityFqdn?: string;
3894
+ /**
3895
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
3896
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
3897
+ */
3898
+ slug?: string;
3899
+ /** ID of the entity associated with the event. */
3900
+ entityId?: string;
3901
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
3902
+ eventTime?: Date | null;
3903
+ /**
3904
+ * Whether the event was triggered as a result of a privacy regulation application
3905
+ * (for example, GDPR).
3906
+ */
3907
+ triggeredByAnonymizeRequest?: boolean | null;
3908
+ /** If present, indicates the action that triggered the event. */
3909
+ originatedFrom?: string | null;
3910
+ /**
3911
+ * 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.
3912
+ * 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.
3913
+ */
3914
+ entityEventSequence?: string | null;
3915
+ }
3916
+ interface SubscriptionCanceledEnvelope {
3917
+ data: SubscriptionCanceled;
3918
+ metadata: EventMetadata;
3919
+ }
3920
+ /**
3921
+ * Triggered when a subscription is canceled.
3922
+ * @permissionScope Manage Stores
3923
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
3924
+ * @permissionScope Manage Events
3925
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
3926
+ * @permissionId subscriptions.view
3927
+ * @webhook
3928
+ * @eventType wix.billing.v1.subscription_canceled
3929
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService
3930
+ * @slug canceled
3931
+ * @documentationMaturity preview
3932
+ */
3933
+ declare function onSubscriptionCanceled(handler: (event: SubscriptionCanceledEnvelope) => void | Promise<void>): void;
3934
+ interface SubscriptionExtendedEnvelope {
3935
+ data: SubscriptionExtended;
3936
+ metadata: EventMetadata;
3937
+ }
3938
+ /**
3939
+ * Triggered when subscription has been extended
3940
+ * @permissionScope Manage Stores
3941
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
3942
+ * @permissionScope Manage Events
3943
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
3944
+ * @permissionId subscriptions.view
3945
+ * @webhook
3946
+ * @eventType wix.billing.v1.subscription_extended
3947
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService
3948
+ * @slug extended
3949
+ * @documentationMaturity preview
3950
+ */
3951
+ declare function onSubscriptionExtended(handler: (event: SubscriptionExtendedEnvelope) => void | Promise<void>): void;
3952
+ interface SubscriptionUpdatedEnvelope {
3953
+ entity: Subscription;
3954
+ metadata: EventMetadata;
3955
+ }
3956
+ /**
3957
+ * Triggered when a subscription is updated.
3958
+ * @permissionScope Manage Stores
3959
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
3960
+ * @permissionScope Manage Events
3961
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
3962
+ * @permissionId subscriptions.view
3963
+ * @webhook
3964
+ * @eventType wix.billing.v1.subscription_updated
3965
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService
3966
+ * @slug updated
3967
+ * @documentationMaturity preview
3968
+ */
3969
+ declare function onSubscriptionUpdated(handler: (event: SubscriptionUpdatedEnvelope) => void | Promise<void>): void;
3970
+ interface SubscriptionAutoRenewalTurnedOffEnvelope {
3971
+ data: SubscriptionAutoRenewalTurnedOff;
3972
+ metadata: EventMetadata;
3973
+ }
3974
+ /**
3975
+ * Triggered when a subscription cycleAutoRenew was turned off.
3976
+ * @permissionScope Manage Stores
3977
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
3978
+ * @permissionScope Manage Events
3979
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
3980
+ * @permissionId subscriptions.view
3981
+ * @webhook
3982
+ * @eventType wix.billing.v1.subscription_auto_renewal_turned_off
3983
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.SubscriptionsService
3984
+ * @slug auto_renewal_turned_off
3985
+ * @documentationMaturity preview
3986
+ */
3987
+ declare function onSubscriptionAutoRenewalTurnedOff(handler: (event: SubscriptionAutoRenewalTurnedOffEnvelope) => void | Promise<void>): void;
3988
+ interface SubscriptionAutoRenewalTurnedOnEnvelope {
3989
+ data: SubscriptionAutoRenewalTurnedOn;
3990
+ metadata: EventMetadata;
3991
+ }
3992
+ /**
3993
+ * Triggered when a subscription cycleAutoRenew was turned on.
3994
+ * @permissionScope Manage Stores
3995
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
3996
+ * @permissionScope Manage Events
3997
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
3998
+ * @permissionId subscriptions.view
3999
+ * @webhook
4000
+ * @eventType wix.billing.v1.subscription_auto_renewal_turned_on
4001
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.SubscriptionsService
4002
+ * @slug auto_renewal_turned_on
4003
+ * @documentationMaturity preview
4004
+ */
4005
+ declare function onSubscriptionAutoRenewalTurnedOn(handler: (event: SubscriptionAutoRenewalTurnedOnEnvelope) => void | Promise<void>): void;
4006
+ interface SubscriptionBillingDateUpdatedEnvelope {
4007
+ data: SubscriptionBillingDateUpdated;
4008
+ metadata: EventMetadata;
4009
+ }
4010
+ /**
4011
+ * Triggered when subscription has been extended
4012
+ * @permissionScope Manage Stores
4013
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4014
+ * @permissionScope Manage Events
4015
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
4016
+ * @permissionId subscriptions.view
4017
+ * @webhook
4018
+ * @eventType wix.billing.v1.subscription_billing_date_updated
4019
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.SubscriptionsService
4020
+ * @slug billing_date_updated
4021
+ * @documentationMaturity preview
4022
+ */
4023
+ declare function onSubscriptionBillingDateUpdated(handler: (event: SubscriptionBillingDateUpdatedEnvelope) => void | Promise<void>): void;
4024
+ interface SubscriptionLatestInvoiceMarkedAsPaidEnvelope {
4025
+ data: LatestInvoiceMarkedAsPaid;
4026
+ metadata: EventMetadata;
4027
+ }
4028
+ /** @permissionScope Manage Stores
4029
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4030
+ * @permissionScope Manage Events
4031
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
4032
+ * @permissionId subscriptions.view
4033
+ * @webhook
4034
+ * @eventType wix.billing.v1.subscription_latest_invoice_marked_as_paid
4035
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.SubscriptionsService
4036
+ * @slug latest_invoice_marked_as_paid
4037
+ * @documentationMaturity preview
4038
+ */
4039
+ declare function onSubscriptionLatestInvoiceMarkedAsPaid(handler: (event: SubscriptionLatestInvoiceMarkedAsPaidEnvelope) => void | Promise<void>): void;
4040
+ interface SubscriptionPauseScheduleCanceledEnvelope {
4041
+ data: ScheduledPauseCanceled;
4042
+ metadata: EventMetadata;
4043
+ }
4044
+ /**
4045
+ * Triggered when scheduled pause canceled
4046
+ * @permissionScope Manage Stores
4047
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4048
+ * @permissionScope Manage Events
4049
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
4050
+ * @permissionId subscriptions.view
4051
+ * @webhook
4052
+ * @eventType wix.billing.v1.subscription_pause_schedule_canceled
4053
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.SubscriptionsService
4054
+ * @slug pause_schedule_canceled
4055
+ * @documentationMaturity preview
4056
+ */
4057
+ declare function onSubscriptionPauseScheduleCanceled(handler: (event: SubscriptionPauseScheduleCanceledEnvelope) => void | Promise<void>): void;
4058
+ interface SubscriptionPauseScheduledEnvelope {
4059
+ data: PauseSubscriptionRequested;
4060
+ metadata: EventMetadata;
4061
+ }
4062
+ /**
4063
+ * Triggered when pause subscription requested
4064
+ * @permissionScope Manage Stores
4065
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4066
+ * @permissionScope Manage Events
4067
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
4068
+ * @permissionId subscriptions.view
4069
+ * @webhook
4070
+ * @eventType wix.billing.v1.subscription_pause_scheduled
4071
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.SubscriptionsService
4072
+ * @slug pause_scheduled
4073
+ * @documentationMaturity preview
4074
+ */
4075
+ declare function onSubscriptionPauseScheduled(handler: (event: SubscriptionPauseScheduledEnvelope) => void | Promise<void>): void;
4076
+ interface SubscriptionPausedEnvelope {
4077
+ data: SubscriptionPaused;
4078
+ metadata: EventMetadata;
4079
+ }
4080
+ /**
4081
+ * Triggered when a subscription is paused.
4082
+ * @permissionScope Manage Stores
4083
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4084
+ * @permissionScope Manage Events
4085
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
4086
+ * @permissionId subscriptions.view
4087
+ * @webhook
4088
+ * @eventType wix.billing.v1.subscription_paused
4089
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.SubscriptionsService
4090
+ * @slug paused
4091
+ * @documentationMaturity preview
4092
+ */
4093
+ declare function onSubscriptionPaused(handler: (event: SubscriptionPausedEnvelope) => void | Promise<void>): void;
4094
+ interface SubscriptionResumeScheduleCanceledEnvelope {
4095
+ data: ScheduledResumeCanceled;
4096
+ metadata: EventMetadata;
4097
+ }
4098
+ /**
4099
+ * Triggered when scheduled pause canceled
4100
+ * @permissionScope Manage Stores
4101
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4102
+ * @permissionScope Manage Events
4103
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
4104
+ * @permissionId subscriptions.view
4105
+ * @webhook
4106
+ * @eventType wix.billing.v1.subscription_resume_schedule_canceled
4107
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.SubscriptionsService
4108
+ * @slug resume_schedule_canceled
4109
+ * @documentationMaturity preview
4110
+ */
4111
+ declare function onSubscriptionResumeScheduleCanceled(handler: (event: SubscriptionResumeScheduleCanceledEnvelope) => void | Promise<void>): void;
4112
+ interface SubscriptionResumeScheduledEnvelope {
4113
+ data: ResumeSubscriptionRequested;
4114
+ metadata: EventMetadata;
4115
+ }
4116
+ /**
4117
+ * Triggered when resume subscription requested
4118
+ * @permissionScope Manage Stores
4119
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4120
+ * @permissionScope Manage Events
4121
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
4122
+ * @permissionId subscriptions.view
4123
+ * @webhook
4124
+ * @eventType wix.billing.v1.subscription_resume_scheduled
4125
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.SubscriptionsService
4126
+ * @slug resume_scheduled
4127
+ * @documentationMaturity preview
4128
+ */
4129
+ declare function onSubscriptionResumeScheduled(handler: (event: SubscriptionResumeScheduledEnvelope) => void | Promise<void>): void;
4130
+ interface SubscriptionResumedEnvelope {
4131
+ data: SubscriptionResumed;
4132
+ metadata: EventMetadata;
4133
+ }
4134
+ /**
4135
+ * Triggered when a subscription is resumed.
4136
+ * @permissionScope Manage Stores
4137
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
4138
+ * @permissionScope Manage Events
4139
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
4140
+ * @permissionId subscriptions.view
4141
+ * @webhook
4142
+ * @eventType wix.billing.v1.subscription_resumed
4143
+ * @serviceIdentifier com.wixpress.billing.subscriptions.api.v1.SubscriptionsService
4144
+ * @slug resumed
4145
+ * @documentationMaturity preview
4146
+ */
4147
+ declare function onSubscriptionResumed(handler: (event: SubscriptionResumedEnvelope) => void | Promise<void>): void;
4148
+ /**
4149
+ * Identity must be a site member and customer subscription belongs to
4150
+ * @public
4151
+ * @documentationMaturity preview
4152
+ * @requiredField _id
4153
+ * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.GetSubscription
4154
+ */
4155
+ declare function customerGetSubscription(_id: string): Promise<NonNullablePaths<GetSubscriptionResponse, `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.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>>;
4156
+ /**
4157
+ * Identity must be a site member and customer subscription belongs to
4158
+ * @public
4159
+ * @documentationMaturity preview
4160
+ * @requiredField _id
4161
+ * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.CancelSubscription
4162
+ */
4163
+ declare function customerCancelSubscription(_id: string, options?: CustomerCancelSubscriptionOptions): Promise<NonNullablePaths<CustomerCancelSubscriptionResponse, `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.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> & {
4164
+ __applicationErrorsType?: CustomerCancelSubscriptionApplicationErrors;
4165
+ }>;
4166
+ interface CustomerCancelSubscriptionOptions {
4167
+ /** Optional action reason message */
4168
+ reason?: string | null;
4169
+ }
4170
+ /**
4171
+ * Identity must be a site member and customer subscription belongs to
4172
+ * @public
4173
+ * @documentationMaturity preview
4174
+ * @requiredField _id
4175
+ * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.TurnOnSubscriptionAutoRenewal
4176
+ */
4177
+ declare function customerTurnOnSubscriptionAutoRenewal(_id: string, options?: CustomerTurnOnSubscriptionAutoRenewalOptions): Promise<NonNullablePaths<CustomerTurnOnAutoRenewalResponse, `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.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> & {
4178
+ __applicationErrorsType?: CustomerTurnOnSubscriptionAutoRenewalApplicationErrors;
4179
+ }>;
4180
+ interface CustomerTurnOnSubscriptionAutoRenewalOptions {
4181
+ /** Optional action reason message */
4182
+ reason?: string | null;
4183
+ }
4184
+ /**
4185
+ * Identity must be a site member and customer subscription belongs to
4186
+ * @public
4187
+ * @documentationMaturity preview
4188
+ * @requiredField _id
4189
+ * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.TurnOffSubscriptionAutoRenewal
4190
+ */
4191
+ declare function customerTurnOffSubscriptionAutoRenewal(_id: string, options?: CustomerTurnOffSubscriptionAutoRenewalOptions): Promise<NonNullablePaths<CustomerTurnOffAutoRenewalResponse, `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.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> & {
4192
+ __applicationErrorsType?: CustomerTurnOffSubscriptionAutoRenewalApplicationErrors;
4193
+ }>;
4194
+ interface CustomerTurnOffSubscriptionAutoRenewalOptions {
4195
+ /** Optional action reason message */
4196
+ reason?: string | null;
4197
+ }
4198
+ /** @param _id - The ID of the subscription to be extended
4199
+ * @public
4200
+ * @documentationMaturity preview
4201
+ * @requiredField _id
4202
+ * @requiredField options.billingCyclesToAdd
4203
+ * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.ExtendSubscription
4204
+ */
4205
+ declare function customerExtendSubscription(_id: string, options?: NonNullablePaths<CustomerExtendSubscriptionOptions, `billingCyclesToAdd`, 2>): Promise<NonNullablePaths<CustomerExtendSubscriptionResponse, `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.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> & {
4206
+ __applicationErrorsType?: CustomerExtendSubscriptionApplicationErrors;
4207
+ }>;
4208
+ interface CustomerExtendSubscriptionOptions {
4209
+ /** Optional action reason message */
4210
+ reason?: string | null;
4211
+ /**
4212
+ * For termed - Subscription end date will be updated with the extension period and number of cycles will be added
4213
+ * @min 1
4214
+ */
4215
+ billingCyclesToAdd: number | null;
4216
+ }
4217
+ /**
4218
+ * identity must be a site member
4219
+ * @public
4220
+ * @documentationMaturity preview
4221
+ * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.QuerySubscriptions
4222
+ */
4223
+ declare function customerQuerySubscriptions(options?: CustomerQuerySubscriptionsOptions): Promise<NonNullablePaths<QuerySubscriptionsResponse, `subscriptions` | `subscriptions.${number}.name` | `subscriptions.${number}.customer.visitorId` | `subscriptions.${number}.customer.contactId` | `subscriptions.${number}.customer.memberId` | `subscriptions.${number}.customer.accountId` | `subscriptions.${number}.status` | `subscriptions.${number}.billingSettings.currency` | `subscriptions.${number}.billingSettings.paymentMethod._id` | `subscriptions.${number}.billingSettings.collectionMethod` | `subscriptions.${number}.billingSettings.cycleDuration.unit` | `subscriptions.${number}.billingSettings.cycleAutoRenew` | `subscriptions.${number}.billingSettings.taxSettings.inclusive` | `subscriptions.${number}.billingSettings.shippingCharges.amount` | `subscriptions.${number}.billingSettings.externalCollectionDetails.collectorName` | `subscriptions.${number}.billingStatus.currentCycle` | `subscriptions.${number}.billingStatus.latestPaymentData.invoiceId` | `subscriptions.${number}.billingStatus.latestPaymentData.paymentStatus` | `subscriptions.${number}.policies.customerCanCancel` | `subscriptions.${number}.policies.businessCanExtend` | `subscriptions.${number}.policies.allowEndOfCycleCancellation` | `subscriptions.${number}.pauseInfo.pausePolicy` | `subscriptions.${number}.pauseInfo.pauseAt` | `subscriptions.${number}.pauseInfo.resumeAt` | `subscriptions.${number}.cancellationInfo.initiator` | `subscriptions.${number}.pendingUpdateData.numberOfRequests`, 6>>;
4224
+ interface CustomerQuerySubscriptionsOptions {
4225
+ query?: QueryV2;
4226
+ }
4227
+ /**
4228
+ * Update subscription's payment method.
4229
+ * Supported only for recurring subscriptions or one time subscriptions during free trial.
4230
+ * @param _id - Subscription ID
4231
+ * @public
4232
+ * @documentationMaturity preview
4233
+ * @requiredField _id
4234
+ * @requiredField paymentMethodId
4235
+ * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.UpdateSubscriptionPaymentMethod
4236
+ */
4237
+ declare function customerUpdateSubscriptionPaymentMethod(_id: string, paymentMethodId: string): Promise<NonNullablePaths<UpdateSubscriptionPaymentMethodResponse, `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.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>>;
4238
+ /** @public
4239
+ * @documentationMaturity preview
4240
+ * @requiredField _id
4241
+ * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.AllowedActions
4242
+ */
4243
+ declare function customerAllowedActions(_id: string): Promise<NonNullablePaths<CustomerAllowedActionsResponse, `actions` | `actions.${number}.actionType`, 4>>;
4244
+ /**
4245
+ * List future subscriptions charges.
4246
+ * @param _id - Subscription id upcoming charge to be previewed for
4247
+ * @public
4248
+ * @documentationMaturity preview
4249
+ * @requiredField _id
4250
+ * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.ListUpcomingCharges
4251
+ */
4252
+ declare function customerListUpcomingCharges(_id: string): Promise<NonNullablePaths<CustomerListUpcomingChargesResponse, `upcomingCharge.cycle` | `upcomingCharge.totals.totalPrice` | `upcomingCharge.totals.subtotal` | `upcomingCharge.invoiceItems` | `upcomingCharge.invoiceItems.${number}.recurring.cycleNumber` | `upcomingCharge.invoiceItems.${number}._id` | `upcomingCharge.invoiceItems.${number}.name` | `upcomingCharge.invoiceItems.${number}.catalogReference.catalogItemId` | `upcomingCharge.invoiceItems.${number}.category` | `upcomingCharge.invoiceItems.${number}.quantity` | `upcomingCharge.invoiceItems.${number}.priceDetails.price` | `upcomingCharge.invoiceItems.${number}.priceDetails.tax.amount` | `upcomingCharge.invoiceItems.${number}.priceDetails.tax.percentage` | `upcomingCharge.invoiceItems.${number}.priceDetails.discount.amount` | `upcomingCharge.invoiceItems.${number}.priceDetails.discount.percentage` | `upcomingCharge.invoiceItems.${number}.priceDetails.applicationFeeDetails.amount` | `upcomingCharge.invoiceItems.${number}.taxData.lineItemTaxSummary.aggregatedTaxAmount` | `upcomingCharge.invoiceItems.${number}.taxData.lineItemTaxSummary.aggregatedTaxRate` | `upcomingCharge.invoiceItems.${number}.taxData.lineItemTaxSummary.taxableAmount`, 7>>;
4253
+ /**
4254
+ * Creates auto-charge order that can be paid by customer
4255
+ * @public
4256
+ * @documentationMaturity preview
4257
+ * @requiredField _id
4258
+ * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.InitiatePaymentMethodSetup
4259
+ */
4260
+ declare function customerInitiatePaymentMethodSetup(_id: string, options?: CustomerInitiatePaymentMethodSetupOptions): Promise<NonNullablePaths<InitiatePaymentMethodSetupResponse, `paymentOrderId`, 2>>;
4261
+ interface CustomerInitiatePaymentMethodSetupOptions {
4262
+ paymentMode?: PaymentModeWithLiterals;
4263
+ paymentSettings?: PaymentSettings;
4264
+ }
4265
+ /**
4266
+ * This used only for automation and permitted tenants (QA & testing)
4267
+ * @public
4268
+ * @documentationMaturity preview
4269
+ * @requiredField options.tenantId
4270
+ * @requiredField subscriptionId
4271
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsBackOfficeService.PayCycle
4272
+ */
4273
+ 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.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>>;
4274
+ interface PayCycleOptions {
4275
+ paymentTestMode?: PaymentTestModeWithLiterals;
4276
+ /** @format GUID */
4277
+ tenantId: string;
4278
+ }
4279
+ /**
4280
+ * Returns a single subscription by its id
4281
+ * @public
4282
+ * @documentationMaturity preview
4283
+ * @requiredField _id
4284
+ * @permissionId subscriptions.view
4285
+ * @applicableIdentity APP
4286
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.GetSubscription
4287
+ */
4288
+ declare function getSubscription(_id: string): Promise<NonNullablePaths<GetSubscriptionResponse, `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.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>>;
4289
+ /**
4290
+ * Update subscription's payment method.
4291
+ * Supported only for recurring subscriptions or one time subscriptions during free trial.
4292
+ * @param _id - Subscription ID
4293
+ * @public
4294
+ * @documentationMaturity preview
4295
+ * @requiredField _id
4296
+ * @requiredField paymentMethodId
4297
+ * @permissionId subscriptions.manage
4298
+ * @applicableIdentity APP
4299
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.UpdateSubscriptionPaymentMethod
4300
+ */
4301
+ declare function updateSubscriptionPaymentMethod(_id: string, paymentMethodId: string): Promise<NonNullablePaths<UpdateSubscriptionPaymentMethodResponse, `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.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>>;
4302
+ /**
4303
+ * Updates the next billing date for a subscription.
4304
+ *
4305
+ *
4306
+ * Updating the billing date may add a proration charge or credit to the next
4307
+ * invoice. The customer must pay more in case you extend the current billing
4308
+ * cycle. They pay less in case you shorten the current billing cycle. You can
4309
+ * choose whether BASS automatically calculates the proration amount based on
4310
+ * the number of days added to or removed from the current billing cycle.
4311
+ * Alternatively, you can pass a proration amount based on your own custom
4312
+ * calculation. The custom proration amount can't exceed the total of the
4313
+ * current billing cycle.
4314
+ * @param _id - ID of the subscription to update the billing date for.
4315
+ * @param billingDate - New billing date in `YYYY-MM-DDThh:mm:ss:sssZ` format.
4316
+ * @public
4317
+ * @documentationMaturity preview
4318
+ * @requiredField _id
4319
+ * @requiredField billingDate
4320
+ * @permissionId subscriptions.manage
4321
+ * @applicableIdentity APP
4322
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.UpdateSubscriptionBillingDate
4323
+ */
4324
+ declare function updateSubscriptionBillingDate(_id: string, billingDate: Date, options?: UpdateSubscriptionBillingDateOptions): Promise<NonNullablePaths<UpdateSubscriptionBillingDateResponse, `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.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> & {
4325
+ __applicationErrorsType?: UpdateSubscriptionBillingDateApplicationErrors;
4326
+ }>;
4327
+ interface UpdateSubscriptionBillingDateOptions {
4328
+ /**
4329
+ * Information about how BASS adjusts the total of the next invoice. Extending
4330
+ * the current billing cycle results in a higher payment, while shortening it
4331
+ * leads to a lower payment. BASS offers automatic calculation of the proration
4332
+ * amount based on the number of days added to or removed from the current billing
4333
+ * cycle. Alternatively, you can use your own custom method to calculate the
4334
+ * proration amount. The custom proration amount can't exceed the total of the
4335
+ * current billing cycle.
4336
+ */
4337
+ proration?: Proration;
4338
+ }
4339
+ /**
4340
+ * Cancels subscription immediately. Can be canceled by member if subscription policy allows it
4341
+ * Only PENDING, ACTIVE or PAUSED subscriptions can be canceled
4342
+ * @public
4343
+ * @documentationMaturity preview
4344
+ * @requiredField _id
4345
+ * @requiredField actionContext
4346
+ * @permissionId subscriptions.manage
4347
+ * @applicableIdentity APP
4348
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.CancelSubscription
4349
+ */
4350
+ declare function cancelSubscription(_id: string, actionContext: ActionContext): Promise<NonNullablePaths<CancelSubscriptionResponse, `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.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> & {
4351
+ __applicationErrorsType?: CancelSubscriptionApplicationErrors;
4352
+ }>;
4353
+ /**
4354
+ * Pauses subscription now or in future. Possible to pause also payments schedule.
4355
+ * @public
4356
+ * @documentationMaturity preview
4357
+ * @requiredField _id
4358
+ * @requiredField options.actionContext
4359
+ * @permissionId subscriptions.manage
4360
+ * @applicableIdentity APP
4361
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PauseSubscription
4362
+ */
4363
+ declare function pauseSubscription(_id: string, options?: NonNullablePaths<PauseSubscriptionOptions, `actionContext`, 2>): Promise<NonNullablePaths<PauseSubscriptionResponse, `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.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> & {
4364
+ __applicationErrorsType?: PauseSubscriptionApplicationErrors;
4365
+ }>;
4366
+ interface PauseSubscriptionOptions {
4367
+ pausePolicy?: PausePolicyWithLiterals;
4368
+ pauseAt?: PauseAtWithLiterals;
4369
+ /** contains additional scheduling information for certain pause_at options (for example: SPECIFIC_DATE & NUMBER_OF_CYCLES_FROM_TODAY) */
4370
+ pauseAtSchedule?: ScheduleAdditionalInfo;
4371
+ /** contains additional scheduling information for certain auto_resume_at either specific date */
4372
+ autoResumeAtSchedule?: ScheduleAdditionalInfo;
4373
+ actionContext: ActionContext;
4374
+ }
4375
+ /**
4376
+ * Resumes paused subscription now or in future.
4377
+ * @public
4378
+ * @documentationMaturity preview
4379
+ * @requiredField _id
4380
+ * @requiredField options.actionContext
4381
+ * @permissionId subscriptions.manage
4382
+ * @applicableIdentity APP
4383
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ResumeSubscription
4384
+ */
4385
+ declare function resumeSubscription(_id: string, options?: NonNullablePaths<ResumeSubscriptionOptions, `actionContext`, 2>): Promise<NonNullablePaths<ResumeSubscriptionResponse, `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.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> & {
4386
+ __applicationErrorsType?: ResumeSubscriptionApplicationErrors;
4387
+ }>;
4388
+ interface ResumeSubscriptionOptions {
4389
+ resumeAt?: ResumeAtWithLiterals;
4390
+ /** contains additional scheduling information for certain resume_at options (for example: SPECIFIC_DATE) */
4391
+ resumeAtSchedule?: ScheduleAdditionalInfo;
4392
+ actionContext: ActionContext;
4393
+ }
4394
+ /**
4395
+ * Lists subscriptions based on specified filters.
4396
+ * By default non-draft subscriptions returned.
4397
+ * @public
4398
+ * @documentationMaturity preview
4399
+ * @requiredField query
4400
+ * @permissionId subscriptions.view
4401
+ * @applicableIdentity APP
4402
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.QuerySubscriptions
4403
+ */
4404
+ declare function querySubscriptions(query: QueryV2): Promise<NonNullablePaths<QuerySubscriptionsResponse, `subscriptions` | `subscriptions.${number}.name` | `subscriptions.${number}.customer.visitorId` | `subscriptions.${number}.customer.contactId` | `subscriptions.${number}.customer.memberId` | `subscriptions.${number}.customer.accountId` | `subscriptions.${number}.status` | `subscriptions.${number}.billingSettings.currency` | `subscriptions.${number}.billingSettings.paymentMethod._id` | `subscriptions.${number}.billingSettings.collectionMethod` | `subscriptions.${number}.billingSettings.cycleDuration.unit` | `subscriptions.${number}.billingSettings.cycleAutoRenew` | `subscriptions.${number}.billingSettings.taxSettings.inclusive` | `subscriptions.${number}.billingSettings.shippingCharges.amount` | `subscriptions.${number}.billingSettings.externalCollectionDetails.collectorName` | `subscriptions.${number}.billingStatus.currentCycle` | `subscriptions.${number}.billingStatus.latestPaymentData.invoiceId` | `subscriptions.${number}.billingStatus.latestPaymentData.paymentStatus` | `subscriptions.${number}.policies.customerCanCancel` | `subscriptions.${number}.policies.businessCanExtend` | `subscriptions.${number}.policies.allowEndOfCycleCancellation` | `subscriptions.${number}.pauseInfo.pausePolicy` | `subscriptions.${number}.pauseInfo.pauseAt` | `subscriptions.${number}.pauseInfo.resumeAt` | `subscriptions.${number}.cancellationInfo.initiator` | `subscriptions.${number}.pendingUpdateData.numberOfRequests`, 6>>;
4405
+ /** @public
4406
+ * @documentationMaturity preview
4407
+ * @permissionId subscriptions.view
4408
+ * @applicableIdentity APP
4409
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.SearchSubscriptions
4410
+ */
4411
+ declare function searchSubscriptions(options?: SearchSubscriptionsOptions): Promise<NonNullablePaths<SearchSubscriptionsResponse, `subscriptions` | `subscriptions.${number}.name` | `subscriptions.${number}.customer.visitorId` | `subscriptions.${number}.customer.contactId` | `subscriptions.${number}.customer.memberId` | `subscriptions.${number}.customer.accountId` | `subscriptions.${number}.status` | `subscriptions.${number}.billingSettings.currency` | `subscriptions.${number}.billingSettings.paymentMethod._id` | `subscriptions.${number}.billingSettings.collectionMethod` | `subscriptions.${number}.billingSettings.cycleDuration.unit` | `subscriptions.${number}.billingSettings.cycleAutoRenew` | `subscriptions.${number}.billingSettings.taxSettings.inclusive` | `subscriptions.${number}.billingSettings.shippingCharges.amount` | `subscriptions.${number}.billingSettings.externalCollectionDetails.collectorName` | `subscriptions.${number}.billingStatus.currentCycle` | `subscriptions.${number}.billingStatus.latestPaymentData.invoiceId` | `subscriptions.${number}.billingStatus.latestPaymentData.paymentStatus` | `subscriptions.${number}.policies.customerCanCancel` | `subscriptions.${number}.policies.businessCanExtend` | `subscriptions.${number}.policies.allowEndOfCycleCancellation` | `subscriptions.${number}.pauseInfo.pausePolicy` | `subscriptions.${number}.pauseInfo.pauseAt` | `subscriptions.${number}.pauseInfo.resumeAt` | `subscriptions.${number}.cancellationInfo.initiator` | `subscriptions.${number}.pendingUpdateData.numberOfRequests`, 6>>;
4412
+ interface SearchSubscriptionsOptions extends SearchSubscriptionsOptionsPagingMethodOneOf {
4413
+ /** A filter object */
4414
+ filter?: any;
4415
+ /** Limit number of results and enable to skip rows. The default limit is 25. */
4416
+ paging?: Paging;
4417
+ /** A Cursor option for efficient paging. Pass this field from the previous search response to continue to the next page. */
4418
+ cursor?: CursorPaging;
4419
+ /** A Sorting option by field name and order. */
4420
+ sorting?: SortingClauses;
4421
+ }
4422
+ /** @oneof */
4423
+ interface SearchSubscriptionsOptionsPagingMethodOneOf {
4424
+ /** Limit number of results and enable to skip rows. The default limit is 25. */
4425
+ paging?: Paging;
4426
+ /** A Cursor option for efficient paging. Pass this field from the previous search response to continue to the next page. */
4427
+ cursor?: CursorPaging;
4428
+ }
4429
+ /**
4430
+ * Counts subscriptions given the provided filters. Returns the total number
4431
+ * of subscriptions matching the filters and a count per status.
4432
+ *
4433
+ *
4434
+ * You can either pass a list of statuses or a `statusGroup`, which is a
4435
+ * pre-defined combination of statuses.
4436
+ *
4437
+ * If you don't provide any filters, all subscription statuses with the
4438
+ * exception of `"DRAFT"` are counted.
4439
+ *
4440
+ * You may also specify a `customerId` as filter. Then, only subscriptions for
4441
+ * this customer are counted. When providing a `customerId`, you must also
4442
+ * specify a `paymentMethodId`.
4443
+ * @public
4444
+ * @documentationMaturity preview
4445
+ * @permissionId subscriptions.view
4446
+ * @applicableIdentity APP
4447
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.CountSubscriptions
4448
+ */
4449
+ declare function countSubscriptions(options?: CountSubscriptionsOptions): Promise<NonNullablePaths<CountSubscriptionsResponse, `countByStatus` | `countByStatus.${number}.status` | `countByStatus.${number}.count` | `total`, 4>>;
4450
+ interface CountSubscriptionsOptions {
4451
+ /** Filters to specify which subscriptions are counted. */
4452
+ filter?: CountSubscriptionFilter;
4453
+ }
4454
+ /**
4455
+ * Turn on auto-renew subscription in case auto-renew was turned off. The operation changes back cycle_auto_renew
4456
+ * to true, which will ensure subscription billing will continue. Also cancellation info holding information about
4457
+ * auto renew off will be cleared.
4458
+ * @public
4459
+ * @documentationMaturity preview
4460
+ * @requiredField _id
4461
+ * @requiredField actionContext
4462
+ * @permissionId subscriptions.manage
4463
+ * @applicableIdentity APP
4464
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.TurnOnSubscriptionAutoRenewal
4465
+ */
4466
+ declare function turnOnSubscriptionAutoRenewal(_id: string, actionContext: ActionContext): Promise<NonNullablePaths<TurnOnSubscriptionAutoRenewalResponse, `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.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> & {
4467
+ __applicationErrorsType?: TurnOnSubscriptionAutoRenewalApplicationErrors;
4468
+ }>;
4469
+ /**
4470
+ * Turn off auto-renew of subscription. At next billing date subscription will be canceled.
4471
+ * Billing settings flag cycle_auto_renew is set to false and information about this operation stored
4472
+ * in cancellation info for future usage in cancellation.
4473
+ * @public
4474
+ * @documentationMaturity preview
4475
+ * @requiredField _id
4476
+ * @requiredField actionContext
4477
+ * @permissionId subscriptions.manage
4478
+ * @applicableIdentity APP
4479
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.TurnOffSubscriptionAutoRenewal
4480
+ */
4481
+ declare function turnOffSubscriptionAutoRenewal(_id: string, actionContext: ActionContext): Promise<NonNullablePaths<TurnOffSubscriptionAutoRenewalResponse, `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.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> & {
4482
+ __applicationErrorsType?: TurnOffSubscriptionAutoRenewalApplicationErrors;
4483
+ }>;
4484
+ /**
4485
+ * Marks the last invoice as paid used for the following scenarios:
4486
+ * * Offline subscriptions.
4487
+ * * Online subscriptions during grace period. The operation will convert invoice to offline, remove grace period
4488
+ * and will send BillingCycleStarted event after invoice closing.
4489
+ * * Online one time payment subscription with total price of zero during purchase flow.
4490
+ * Activated event will be sent after invoice closing and subscription will be activated.
4491
+ * @param subscriptionId - The ID of the offline subscription to mark as paid its latest invoice
4492
+ * @public
4493
+ * @documentationMaturity preview
4494
+ * @requiredField subscriptionId
4495
+ * @permissionId subscriptions.manage
4496
+ * @applicableIdentity APP
4497
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkLatestInvoiceAsPaid
4498
+ * @deprecated
4499
+ * @replacedBy com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkInvoiceAsPaid
4500
+ * @targetRemovalDate 2025-09-30
4501
+ */
4502
+ declare function markLatestInvoiceAsPaid(subscriptionId: string): Promise<NonNullablePaths<MarkLatestInvoiceAsPaidResponse, `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.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> & {
4503
+ __applicationErrorsType?: MarkLatestInvoiceAsPaidApplicationErrors;
4504
+ }>;
4505
+ /**
4506
+ * Marks the invoice associated with given subscription cycle as paid for the following scenarios:
4507
+ * If `paid_cycle` is left empty, the most recent invoice will be marked as paid.
4508
+ * If the invoice contains items other than subscription items, an error will be thrown.
4509
+ *
4510
+ * Marks the invoice as paid for the following scenarios:
4511
+ * 1. Offline subscriptions.
4512
+ * 2. Online subscriptions during the grace period.
4513
+ * This operation will convert the invoice to offline, remove the grace period,
4514
+ * and send a BillingCycleStarted event after the invoice is closed.
4515
+ * 3. Online one-time payment subscriptions with a total price of zero during the purchase flow.
4516
+ * An Activated event will be sent after the invoice is closed, and the subscription will be activated.
4517
+ * 4. For external subscriptions, where the payment occurs outside of BASS, an invoice is created and marked as paid
4518
+ * @param subscriptionId - The ID of the subscription to mark as paid its invoice.
4519
+ * @internal
4520
+ * @documentationMaturity preview
4521
+ * @requiredField subscriptionId
4522
+ * @permissionId subscriptions.manage
4523
+ * @applicableIdentity APP
4524
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkBillingCycleAsPaid
4525
+ */
4526
+ declare function markBillingCycleAsPaid(subscriptionId: string, options?: MarkBillingCycleAsPaidOptions): Promise<NonNullablePaths<MarkBillingCycleAsPaidResponse, `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.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> & {
4527
+ __applicationErrorsType?: MarkBillingCycleAsPaidApplicationErrors;
4528
+ }>;
4529
+ interface MarkBillingCycleAsPaidOptions {
4530
+ /**
4531
+ * The subscription cycle for which the invoice is to be marked as paid.
4532
+ * If left empty, the most recent cycle will be selected.
4533
+ * @min 1
4534
+ */
4535
+ paidCycle?: number | null;
4536
+ }
4537
+ /**
4538
+ * Returns number of subscriptions in each state.
4539
+ * @public
4540
+ * @documentationMaturity preview
4541
+ * @permissionId subscriptions.view
4542
+ * @applicableIdentity APP
4543
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.GetSubscriptionsStats
4544
+ */
4545
+ declare function getSubscriptionsStats(): Promise<NonNullablePaths<GetSubscriptionsStatsResponse, `amountByStatuses` | `amountByStatuses.${number}.status` | `amountByStatuses.${number}.amount` | `total`, 4>>;
4546
+ /**
4547
+ * Extends subscription by moving end date with or without billing cycles addition.
4548
+ * @param _id - The ID of the subscription to be extended
4549
+ * @public
4550
+ * @documentationMaturity preview
4551
+ * @requiredField _id
4552
+ * @requiredField actionContext
4553
+ * @requiredField options
4554
+ * @requiredField options.extendPolicy
4555
+ * @permissionId subscriptions.manage
4556
+ * @applicableIdentity APP
4557
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ExtendSubscription
4558
+ */
4559
+ declare function extendSubscription(_id: string, actionContext: ActionContext, options: ExtendSubscriptionOptions): Promise<NonNullablePaths<ExtendSubscriptionResponse, `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.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> & {
4560
+ __applicationErrorsType?: ExtendSubscriptionApplicationErrors;
4561
+ }>;
4562
+ interface ExtendSubscriptionOptions extends ExtendSubscriptionOptionsExtendPolicyOneOf {
4563
+ /** User won't be charged for additional period added on top of subscription end date. */
4564
+ extensionPeriod?: Duration;
4565
+ /**
4566
+ * user will be charged for billing cycles added
4567
+ * @min 1
4568
+ */
4569
+ extensionBillingCycles?: number;
4570
+ }
4571
+ /** @oneof */
4572
+ interface ExtendSubscriptionOptionsExtendPolicyOneOf {
4573
+ /** User won't be charged for additional period added on top of subscription end date. */
4574
+ extensionPeriod?: Duration;
4575
+ /**
4576
+ * user will be charged for billing cycles added
4577
+ * @min 1
4578
+ */
4579
+ extensionBillingCycles?: number;
4580
+ }
4581
+ /** @public
4582
+ * @documentationMaturity preview
4583
+ * @requiredField _id
4584
+ * @permissionId subscriptions.manage
4585
+ * @applicableIdentity APP
4586
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.AllowedActions
4587
+ */
4588
+ declare function allowedActions(_id: string, options?: AllowedActionsOptions): Promise<NonNullablePaths<AllowedActionsResponse, `actions` | `actions.${number}.actionType` | `unsupportedActions` | `unsupportedActions.${number}.actionType`, 4>>;
4589
+ interface AllowedActionsOptions {
4590
+ /**
4591
+ * List of additional fields to be included in the response.
4592
+ * @maxSize 1
4593
+ */
4594
+ fields?: RequestedFieldsWithLiterals[];
4595
+ }
4596
+ /**
4597
+ * List future subscriptions charges
4598
+ * @param subscriptionId - Subscription id charges to be previewed for
4599
+ * @public
4600
+ * @documentationMaturity preview
4601
+ * @requiredField subscriptionId
4602
+ * @permissionId subscriptions.view
4603
+ * @applicableIdentity APP
4604
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ListUpcomingCharges
4605
+ */
4606
+ declare function listUpcomingCharges(subscriptionId: string, options?: ListUpcomingChargesOptions): Promise<NonNullablePaths<ListUpcomingChargesResponse, `upcomingCharges` | `upcomingCharges.${number}.cycle` | `upcomingCharges.${number}.totals.totalPrice` | `upcomingCharges.${number}.totals.subtotal` | `upcomingCharges.${number}.discount.amount` | `upcomingCharges.${number}.discount.percentage` | `upcomingCharges.${number}.discount.origin.appId` | `upcomingCharges.${number}.discount.origin.entityId`, 6>>;
4607
+ interface ListUpcomingChargesOptions {
4608
+ /** Period of time to provide charged for. If not provided,then only next charge will be returned. */
4609
+ customDuration?: Duration;
4610
+ /**
4611
+ * Date of the next billing cycle so that the upcoming charges will be calculated accordingly.
4612
+ * If not provided, the upcoming charges will be calculated according to the existing next billing date.
4613
+ */
4614
+ nextBillingDate?: Date | null;
4615
+ }
4616
+ /**
4617
+ * Retrieves the preview of subscription charges.
4618
+ * Returns all the charges applicable to a subscription based on the provided subscription information.
4619
+ * @public
4620
+ * @documentationMaturity preview
4621
+ * @requiredField options.subscription.subscriptionInfo
4622
+ * @requiredField options.subscription.subscriptionInfo.billingSettings
4623
+ * @requiredField options.subscription.subscriptionInfo.items
4624
+ * @requiredField options.subscription.subscriptionInfo.items.pricingModel
4625
+ * @permissionId subscriptions.view
4626
+ * @applicableIdentity APP
4627
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionCharges
4628
+ * @deprecated
4629
+ * @replacedBy com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionsCharges
4630
+ * @targetRemovalDate 2025-06-30
4631
+ */
4632
+ declare function previewSubscriptionCharges(options?: PreviewSubscriptionChargesOptions): Promise<NonNullablePaths<PreviewSubscriptionChargesResponse, `charges` | `charges.${number}.cycleFrom` | `charges.${number}.totals.totalPrice` | `charges.${number}.totals.subtotal`, 5>>;
4633
+ interface PreviewSubscriptionChargesOptions extends PreviewSubscriptionChargesOptionsSubscriptionOneOf {
4634
+ /** Information about a non-existing subscription. */
4635
+ subscriptionInfo?: SubscriptionInfo;
4636
+ }
4637
+ /** @oneof */
4638
+ interface PreviewSubscriptionChargesOptionsSubscriptionOneOf {
4639
+ /** Information about a non-existing subscription. */
4640
+ subscriptionInfo?: SubscriptionInfo;
4641
+ }
4642
+ /**
4643
+ * Retrieves the preview of subscription charges for a bulk of subscriptions.
4644
+ * Returns all the charges applicable to all subscriptions, based on the provided subscriptions information.
4645
+ * @public
4646
+ * @documentationMaturity preview
4647
+ * @requiredField options.subscriptionsBillingDetails.billingSettings
4648
+ * @requiredField options.subscriptionsBillingDetails.externalId
4649
+ * @requiredField options.subscriptionsBillingDetails.items
4650
+ * @requiredField options.subscriptionsBillingDetails.items.pricingModel
4651
+ * @permissionId subscriptions.view
4652
+ * @applicableIdentity APP
4653
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionsCharges
4654
+ */
4655
+ declare function previewSubscriptionsCharges(options?: NonNullablePaths<PreviewSubscriptionsChargesOptions, `subscriptionsBillingDetails.${number}.billingSettings` | `subscriptionsBillingDetails.${number}.externalId` | `subscriptionsBillingDetails.${number}.items` | `subscriptionsBillingDetails.${number}.items.${number}.pricingModel`, 6>): Promise<NonNullablePaths<PreviewSubscriptionsChargesResponse, `subscriptionsCharges`, 2>>;
4656
+ interface PreviewSubscriptionsChargesOptions {
4657
+ /**
4658
+ * Information required to calculate the preview charges for the subscriptions, including an identifier.
4659
+ * @minSize 1
4660
+ * @maxSize 10
4661
+ */
4662
+ subscriptionsBillingDetails?: SubscriptionBillingDetails[];
4663
+ /**
4664
+ * Specifies the number of upcoming billing charges to preview for all subscriptions in the order.
4665
+ * For instance, if a subscription costs $10 for the first 3 cycles, $12 for cycles 4 through 7,
4666
+ * $15 for cycles 8 through 10, and $20 for cycle 11 onwards:
4667
+ * - Sending "1" will calculate and return charges for cycles 4 through 7 since it's the first charge in the future.
4668
+ * - Sending "2" will provide a response with charges for cycles 4 through 7 and cycles 8 through 10.
4669
+ * - Sending "3" or more will include totals for cycles 4 through 7, cycles 8 through 10, and from cycle 11 onwards.
4670
+ * If no value is provided, the response will include charges for all upcoming cycles, including the existing one,
4671
+ * in this case, charges for cycle 1 through 3.
4672
+ * If there is a single charge for a subscription, meaning that subscription price remains consistent across all cycles,
4673
+ * then even if future_charges_count is set, it will be ignored and the only charge this subscription has will be returned.
4674
+ * @min 1
4675
+ * @max 10
4676
+ */
4677
+ numberOfNextRecurringCharges?: number | null;
4678
+ }
4679
+ /**
4680
+ * Creates authorization invoice with Moto settings in order to create
4681
+ * @public
4682
+ * @documentationMaturity preview
4683
+ * @requiredField _id
4684
+ * @permissionId subscriptions.manage
4685
+ * @applicableIdentity APP
4686
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.InitiatePaymentMethodSetup
4687
+ */
4688
+ declare function initiatePaymentMethodSetup(_id: string, options?: InitiatePaymentMethodSetupOptions): Promise<NonNullablePaths<InitiatePaymentMethodSetupResponse, `paymentOrderId`, 2>>;
4689
+ interface InitiatePaymentMethodSetupOptions {
4690
+ paymentMode?: PaymentModeWithLiterals;
4691
+ paymentSettings?: PaymentSettings;
4692
+ }
4693
+ /** @public
4694
+ * @documentationMaturity preview
4695
+ * @requiredField subscriptionId
4696
+ * @permissionId subscriptions.view
4697
+ * @applicableIdentity APP
4698
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionHistoryService.ListSubscriptionHistory
4699
+ */
4700
+ declare function listSubscriptionHistory(subscriptionId: string, options?: ListSubscriptionHistoryOptions): Promise<NonNullablePaths<ListSubscriptionHistoryResponse, `historyEntries` | `historyEntries.${number}.entryId` | `historyEntries.${number}.slug` | `historyEntries.${number}.event.deleted.subscriptionId` | `historyEntries.${number}.event.paused.pausePolicy` | `historyEntries.${number}.event.pauseRequested.pauseAt` | `historyEntries.${number}.event.pauseRequested.pausePolicy` | `historyEntries.${number}.event.resumeRequested.resumeAt` | `historyEntries.${number}.event.extended.extensionBillingCycles` | `historyEntries.${number}.event.updatesApplied.updateAction` | `historyEntries.${number}.event.gracePeriodEnded.paymentSettlementMethod` | `historyEntries.${number}.event.paymentMethodUpdated.initiator` | `historyEntries.${number}.event.paymentMethodUpdated.paymentMode` | `historyEntries.${number}.event.collectionMethodUpdated.newCollectionMethod` | `historyEntries.${number}.event.collectionMethodUpdated.previousCollectionMethod` | `historyEntries.${number}.event.billingCyclePaid.paidCycle` | `historyEntries.${number}.event.billingCyclePaid.invoiceId` | `historyEntries.${number}.event.subscriptionBoAction.name` | `historyEntries.${number}.event.subscriptionBoAction.params`, 6>>;
4701
+ interface ListSubscriptionHistoryOptions {
4702
+ /** Determines the type of view for the history: either a comprehensive backoffice view or a user-centric view. */
4703
+ mode?: HistoryViewModeWithLiterals;
4704
+ /** Cursor for efficient paging. If paging through results, pass this field from the previous search response to continue to the next page. */
4705
+ cursor?: CursorPaging;
4706
+ }
4707
+
4708
+ export { 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 BillingSettings, type BillingStatus, type BulkItemChange, type BulkUpdateSubscriptionItemsByFilterRequest, type BulkUpdateSubscriptionItemsByFilterResponse, type BusinessOrigin, type BusinessOriginData, type Cancel, type CancelSubscriptionApplicationErrors, type CancelSubscriptionBORequest, type CancelSubscriptionBOResponse, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CancelTimeCapsuleTaskRequest, type CancellationInfo, CancellationInitiator, type CancellationInitiatorWithLiterals, type CatalogReference, 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 Cursors, type CustomBillingSchedule, type CustomProration, type CustomProrationAmountOneOf, type Customer, type CustomerAllowedActionsRequest, type CustomerAllowedActionsResponse, 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 CustomerQuerySubscriptionsOptions, type CustomerTurnOffAutoRenewalRequest, type CustomerTurnOffAutoRenewalResponse, type CustomerTurnOffSubscriptionAutoRenewalApplicationErrors, type CustomerTurnOffSubscriptionAutoRenewalOptions, type CustomerTurnOnAutoRenewalRequest, type CustomerTurnOnAutoRenewalResponse, type CustomerTurnOnSubscriptionAutoRenewalApplicationErrors, type CustomerTurnOnSubscriptionAutoRenewalOptions, 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 FinishFreeTrialNowRequest, type FinishFreeTrialNowResponse, type FixSubscriptionInvoicesRequest, type FixSubscriptionInvoicesRequestModeOneOf, type FixSubscriptionInvoicesResponse, type FixSubscriptionTimeCapsuleTasksRequest, type FixSubscriptionTimeCapsuleTasksResponse, type FixedPrice, 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 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, PauseAt, type PauseAtWithLiterals, type PauseInfo, type PausePeriod, PausePolicy, type PausePolicyWithLiterals, 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, PaymentTestMode, type PaymentTestModeWithLiterals, type PlatformOrigin, type PreviewSubscriptionChargesOptions, type PreviewSubscriptionChargesOptionsSubscriptionOneOf, type PreviewSubscriptionChargesRequest, type PreviewSubscriptionChargesRequestSubscriptionOneOf, type PreviewSubscriptionChargesResponse, type PreviewSubscriptionsChargesOptions, type PreviewSubscriptionsChargesRequest, type PreviewSubscriptionsChargesResponse, type PriceAdjustment, type PriceAdjustmentAdjustmentTypeOneOf, type PriceAdjustmentValue, type PriceAdjustmentValueAdjustmentValueTypeOneOf, type PriceDetails, type PricingModel, type PricingModelModelOneOf, type Proration, type ProrationTypeOneOf, type QuerySubscriptionsRequest, type QuerySubscriptionsResponse, type QueryV2, type QueryV2PagingMethodOneOf, type Recurring, type RedirectUrls, type Refund, type RefundInfo, RefundReason, type RefundReasonWithLiterals, 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 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, 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 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 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 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 UpdateSubscriptionInvoiceCycleRequest, type UpdateSubscriptionInvoiceCycleResponse, type UpdateSubscriptionItemsRequest, type UpdateSubscriptionItemsResponse, type UpdateSubscriptionOriginRequest, type UpdateSubscriptionOriginResponse, type UpdateSubscriptionPaymentMethodRequest, type UpdateSubscriptionPaymentMethodResponse, type UpdateSubscriptionPoliciesRequest, type UpdateSubscriptionPoliciesResponse, type UpdateSubscriptionRequest, type UpdateSubscriptionResponse, type UpdateSubscriptionStartDateRequest, type UpdateSubscriptionStartDateResponse, type UpdatesApplied, 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, markBillingCycleAsPaid, 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 };