@wix/subscription 1.0.35 → 1.0.37

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