@wix/subscription 1.0.0

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