stripe 17.2.0-beta.2 → 17.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/CHANGELOG.md +112 -900
  2. package/README.md +4 -4
  3. package/VERSION +1 -1
  4. package/cjs/resources/FinancialConnections/Accounts.js +0 -5
  5. package/cjs/resources/Invoices.js +0 -17
  6. package/cjs/resources/PaymentIntents.js +0 -4
  7. package/cjs/resources/Quotes.js +0 -32
  8. package/cjs/resources/SubscriptionSchedules.js +0 -4
  9. package/cjs/resources/Terminal/Readers.js +0 -12
  10. package/cjs/resources/TestHelpers/Issuing/Cards.js +0 -4
  11. package/cjs/resources/V2/Core/Events.js +50 -7
  12. package/cjs/resources.js +10 -42
  13. package/cjs/stripe.core.js +1 -1
  14. package/esm/resources/FinancialConnections/Accounts.js +0 -5
  15. package/esm/resources/Invoices.js +0 -17
  16. package/esm/resources/PaymentIntents.js +0 -4
  17. package/esm/resources/Quotes.js +0 -32
  18. package/esm/resources/SubscriptionSchedules.js +0 -4
  19. package/esm/resources/Terminal/Readers.js +0 -12
  20. package/esm/resources/TestHelpers/Issuing/Cards.js +0 -4
  21. package/esm/resources/V2/Core/Events.js +50 -7
  22. package/esm/resources.js +0 -29
  23. package/esm/stripe.core.js +1 -1
  24. package/package.json +1 -1
  25. package/types/AccountLinksResource.d.ts +1 -5
  26. package/types/AccountSessions.d.ts +5 -75
  27. package/types/AccountSessionsResource.d.ts +5 -354
  28. package/types/Accounts.d.ts +3 -127
  29. package/types/AccountsResource.d.ts +2 -296
  30. package/types/Billing/CreditGrants.d.ts +2 -2
  31. package/types/Billing/CreditGrantsResource.d.ts +2 -2
  32. package/types/Billing/Meters.d.ts +0 -2
  33. package/types/Charges.d.ts +0 -152
  34. package/types/ChargesResource.d.ts +0 -1294
  35. package/types/Checkout/Sessions.d.ts +5 -309
  36. package/types/Checkout/SessionsResource.d.ts +5 -356
  37. package/types/ConfirmationTokens.d.ts +0 -137
  38. package/types/Coupons.d.ts +1 -1
  39. package/types/CouponsResource.d.ts +1 -1
  40. package/types/CreditNotes.d.ts +0 -21
  41. package/types/CreditNotesResource.d.ts +0 -51
  42. package/types/CustomersResource.d.ts +2 -22
  43. package/types/Disputes.d.ts +0 -152
  44. package/types/DisputesResource.d.ts +0 -120
  45. package/types/EventTypes.d.ts +2 -564
  46. package/types/Events.d.ts +0 -91
  47. package/types/FinancialConnections/Accounts.d.ts +1 -29
  48. package/types/FinancialConnections/AccountsResource.d.ts +3 -35
  49. package/types/FinancialConnections/Sessions.d.ts +1 -49
  50. package/types/FinancialConnections/SessionsResource.d.ts +1 -38
  51. package/types/Forwarding/Requests.d.ts +0 -5
  52. package/types/InvoiceItems.d.ts +0 -5
  53. package/types/InvoiceItemsResource.d.ts +0 -98
  54. package/types/InvoiceLineItems.d.ts +1 -31
  55. package/types/Invoices.d.ts +3 -134
  56. package/types/InvoicesResource.d.ts +1836 -5515
  57. package/types/Issuing/Authorizations.d.ts +1 -1
  58. package/types/Issuing/AuthorizationsResource.d.ts +1 -1
  59. package/types/Issuing/CardholdersResource.d.ts +1 -2
  60. package/types/Issuing/Transactions.d.ts +0 -2
  61. package/types/Issuing/TransactionsResource.d.ts +0 -5
  62. package/types/LineItems.d.ts +0 -7
  63. package/types/Mandates.d.ts +0 -85
  64. package/types/PaymentIntents.d.ts +1 -643
  65. package/types/PaymentIntentsResource.d.ts +3463 -7739
  66. package/types/PaymentLinks.d.ts +0 -3
  67. package/types/PaymentLinksResource.d.ts +0 -6
  68. package/types/PaymentMethodConfigurations.d.ts +0 -36
  69. package/types/PaymentMethodConfigurationsResource.d.ts +2 -52
  70. package/types/PaymentMethods.d.ts +0 -137
  71. package/types/PaymentMethodsResource.d.ts +0 -158
  72. package/types/Persons.d.ts +1 -1
  73. package/types/Prices.d.ts +0 -22
  74. package/types/PricesResource.d.ts +0 -22
  75. package/types/Products.d.ts +0 -39
  76. package/types/ProductsResource.d.ts +0 -36
  77. package/types/Quotes.d.ts +1 -591
  78. package/types/QuotesResource.d.ts +199 -2531
  79. package/types/SetupAttempts.d.ts +0 -19
  80. package/types/SetupIntents.d.ts +1 -112
  81. package/types/SetupIntentsResource.d.ts +3 -669
  82. package/types/Sources.d.ts +0 -23
  83. package/types/SubscriptionItems.d.ts +0 -21
  84. package/types/SubscriptionItemsResource.d.ts +0 -109
  85. package/types/SubscriptionSchedules.d.ts +0 -200
  86. package/types/SubscriptionSchedulesResource.d.ts +13 -1231
  87. package/types/Subscriptions.d.ts +1 -82
  88. package/types/SubscriptionsResource.d.ts +3 -348
  89. package/types/Tax/CalculationLineItems.d.ts +0 -1
  90. package/types/Tax/Calculations.d.ts +1 -33
  91. package/types/Tax/CalculationsResource.d.ts +1 -7
  92. package/types/Tax/Registrations.d.ts +0 -82
  93. package/types/Tax/RegistrationsResource.d.ts +0 -109
  94. package/types/Tax/Transactions.d.ts +1 -8
  95. package/types/TaxIds.d.ts +1 -7
  96. package/types/TaxIdsResource.d.ts +1 -7
  97. package/types/TaxRates.d.ts +0 -25
  98. package/types/TaxRatesResource.d.ts +0 -2
  99. package/types/Terminal/Readers.d.ts +0 -278
  100. package/types/Terminal/ReadersResource.d.ts +0 -215
  101. package/types/TestHelpers/ConfirmationTokensResource.d.ts +0 -112
  102. package/types/TestHelpers/Issuing/CardsResource.d.ts +0 -22
  103. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +0 -26
  104. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +0 -26
  105. package/types/TokensResource.d.ts +1 -1
  106. package/types/Treasury/FinancialAccounts.d.ts +1 -6
  107. package/types/Treasury/FinancialAccountsResource.d.ts +0 -10
  108. package/types/Treasury/OutboundTransfers.d.ts +0 -26
  109. package/types/Treasury/OutboundTransfersResource.d.ts +0 -26
  110. package/types/Treasury/ReceivedCredits.d.ts +0 -26
  111. package/types/Treasury/ReceivedDebits.d.ts +0 -31
  112. package/types/UsageRecordSummaries.d.ts +1 -1
  113. package/types/V2/EventTypes.d.ts +3 -1
  114. package/types/WebhookEndpointsResource.d.ts +0 -66
  115. package/types/index.d.ts +0 -53
  116. package/cjs/resources/AccountNotices.js +0 -21
  117. package/cjs/resources/Capital/FinancingOffers.js +0 -21
  118. package/cjs/resources/Capital/FinancingSummary.js +0 -12
  119. package/cjs/resources/Capital/FinancingTransactions.js +0 -17
  120. package/cjs/resources/FinancialConnections/Institutions.js +0 -17
  121. package/cjs/resources/GiftCards/Cards.js +0 -23
  122. package/cjs/resources/GiftCards/Transactions.js +0 -33
  123. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +0 -33
  124. package/cjs/resources/Issuing/DisputeSettlementDetails.js +0 -17
  125. package/cjs/resources/Margins.js +0 -22
  126. package/cjs/resources/Orders.js +0 -24
  127. package/cjs/resources/Tax/Associations.js +0 -9
  128. package/cjs/resources/Tax/Forms.js +0 -20
  129. package/cjs/resources/Terminal/ReaderCollectedData.js +0 -12
  130. package/esm/resources/AccountNotices.js +0 -18
  131. package/esm/resources/Capital/FinancingOffers.js +0 -18
  132. package/esm/resources/Capital/FinancingSummary.js +0 -9
  133. package/esm/resources/Capital/FinancingTransactions.js +0 -14
  134. package/esm/resources/FinancialConnections/Institutions.js +0 -14
  135. package/esm/resources/GiftCards/Cards.js +0 -20
  136. package/esm/resources/GiftCards/Transactions.js +0 -30
  137. package/esm/resources/Issuing/CreditUnderwritingRecords.js +0 -30
  138. package/esm/resources/Issuing/DisputeSettlementDetails.js +0 -14
  139. package/esm/resources/Margins.js +0 -19
  140. package/esm/resources/Orders.js +0 -21
  141. package/esm/resources/Tax/Associations.js +0 -6
  142. package/esm/resources/Tax/Forms.js +0 -17
  143. package/esm/resources/Terminal/ReaderCollectedData.js +0 -9
  144. package/types/AccountNotices.d.ts +0 -113
  145. package/types/AccountNoticesResource.d.ts +0 -98
  146. package/types/Billing/MeterErrorReports.d.ts +0 -106
  147. package/types/Capital/FinancingOffers.d.ts +0 -188
  148. package/types/Capital/FinancingOffersResource.d.ts +0 -97
  149. package/types/Capital/FinancingSummary.d.ts +0 -106
  150. package/types/Capital/FinancingSummaryResource.d.ts +0 -27
  151. package/types/Capital/FinancingTransactions.d.ts +0 -135
  152. package/types/Capital/FinancingTransactionsResource.d.ts +0 -68
  153. package/types/FinancialConnections/AccountInferredBalances.d.ts +0 -38
  154. package/types/FinancialConnections/Institutions.d.ts +0 -93
  155. package/types/FinancialConnections/InstitutionsResource.d.ts +0 -47
  156. package/types/GiftCards/Cards.d.ts +0 -118
  157. package/types/GiftCards/CardsResource.d.ts +0 -159
  158. package/types/GiftCards/Transactions.d.ts +0 -129
  159. package/types/GiftCards/TransactionsResource.d.ts +0 -201
  160. package/types/InvoicePayments.d.ts +0 -138
  161. package/types/Issuing/CreditUnderwritingRecords.d.ts +0 -451
  162. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +0 -1032
  163. package/types/Issuing/DisputeSettlementDetails.d.ts +0 -73
  164. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +0 -52
  165. package/types/Issuing/Settlements.d.ts +0 -103
  166. package/types/Margins.d.ts +0 -56
  167. package/types/MarginsResource.d.ts +0 -114
  168. package/types/Orders.d.ts +0 -1154
  169. package/types/OrdersResource.d.ts +0 -2911
  170. package/types/QuoteLines.d.ts +0 -634
  171. package/types/QuotePreviewInvoices.d.ts +0 -1596
  172. package/types/QuotePreviewSubscriptionSchedules.d.ts +0 -814
  173. package/types/Tax/Associations.d.ts +0 -126
  174. package/types/Tax/AssociationsResource.d.ts +0 -29
  175. package/types/Tax/Forms.d.ts +0 -133
  176. package/types/Tax/FormsResource.d.ts +0 -90
  177. package/types/Terminal/ReaderCollectedData.d.ts +0 -51
  178. package/types/Terminal/ReaderCollectedDataResource.d.ts +0 -29
@@ -3,11 +3,6 @@
3
3
  declare module 'stripe' {
4
4
  namespace Stripe {
5
5
  interface SubscriptionScheduleCreateParams {
6
- /**
7
- * Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
8
- */
9
- billing_behavior?: SubscriptionScheduleCreateParams.BillingBehavior;
10
-
11
6
  /**
12
7
  * The identifier of the customer to create the subscription schedule for.
13
8
  */
@@ -43,11 +38,6 @@ declare module 'stripe' {
43
38
  */
44
39
  phases?: Array<SubscriptionScheduleCreateParams.Phase>;
45
40
 
46
- /**
47
- * If specified, the invoicing for the given billing cycle iterations will be processed now.
48
- */
49
- prebilling?: SubscriptionScheduleCreateParams.Prebilling;
50
-
51
41
  /**
52
42
  * When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on.
53
43
  */
@@ -55,8 +45,6 @@ declare module 'stripe' {
55
45
  }
56
46
 
57
47
  namespace SubscriptionScheduleCreateParams {
58
- type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
59
-
60
48
  interface DefaultSettings {
61
49
  /**
62
50
  * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
@@ -299,11 +287,6 @@ declare module 'stripe' {
299
287
  */
300
288
  on_behalf_of?: string;
301
289
 
302
- /**
303
- * If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment).
304
- */
305
- pause_collection?: Phase.PauseCollection;
306
-
307
290
  /**
308
291
  * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
309
292
  */
@@ -319,20 +302,10 @@ declare module 'stripe' {
319
302
  */
320
303
  trial?: boolean;
321
304
 
322
- /**
323
- * Specify trial behavior when crossing phase boundaries
324
- */
325
- trial_continuation?: Phase.TrialContinuation;
326
-
327
305
  /**
328
306
  * Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
329
307
  */
330
308
  trial_end?: number;
331
-
332
- /**
333
- * Settings related to subscription trials.
334
- */
335
- trial_settings?: Phase.TrialSettings;
336
309
  }
337
310
 
338
311
  namespace Phase {
@@ -375,56 +348,12 @@ declare module 'stripe' {
375
348
  */
376
349
  discount?: string;
377
350
 
378
- /**
379
- * Details to determine how long the discount should be applied for.
380
- */
381
- discount_end?: Discount.DiscountEnd;
382
-
383
351
  /**
384
352
  * ID of the promotion code to create a new discount for.
385
353
  */
386
354
  promotion_code?: string;
387
355
  }
388
356
 
389
- namespace Discount {
390
- interface DiscountEnd {
391
- /**
392
- * Time span for the redeemed discount.
393
- */
394
- duration?: DiscountEnd.Duration;
395
-
396
- /**
397
- * A precise Unix timestamp for the discount to end. Must be in the future.
398
- */
399
- timestamp?: number;
400
-
401
- /**
402
- * The type of calculation made to determine when the discount ends.
403
- */
404
- type: DiscountEnd.Type;
405
- }
406
-
407
- namespace DiscountEnd {
408
- interface Duration {
409
- /**
410
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
411
- */
412
- interval: Duration.Interval;
413
-
414
- /**
415
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
416
- */
417
- interval_count: number;
418
- }
419
-
420
- namespace Duration {
421
- type Interval = 'day' | 'month' | 'week' | 'year';
422
- }
423
-
424
- type Type = 'duration' | 'timestamp';
425
- }
426
- }
427
-
428
357
  interface PriceData {
429
358
  /**
430
359
  * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
@@ -514,56 +443,12 @@ declare module 'stripe' {
514
443
  */
515
444
  discount?: string;
516
445
 
517
- /**
518
- * Details to determine how long the discount should be applied for.
519
- */
520
- discount_end?: Discount.DiscountEnd;
521
-
522
446
  /**
523
447
  * ID of the promotion code to create a new discount for.
524
448
  */
525
449
  promotion_code?: string;
526
450
  }
527
451
 
528
- namespace Discount {
529
- interface DiscountEnd {
530
- /**
531
- * Time span for the redeemed discount.
532
- */
533
- duration?: DiscountEnd.Duration;
534
-
535
- /**
536
- * A precise Unix timestamp for the discount to end. Must be in the future.
537
- */
538
- timestamp?: number;
539
-
540
- /**
541
- * The type of calculation made to determine when the discount ends.
542
- */
543
- type: DiscountEnd.Type;
544
- }
545
-
546
- namespace DiscountEnd {
547
- interface Duration {
548
- /**
549
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
550
- */
551
- interval: Duration.Interval;
552
-
553
- /**
554
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
555
- */
556
- interval_count: number;
557
- }
558
-
559
- namespace Duration {
560
- type Interval = 'day' | 'month' | 'week' | 'year';
561
- }
562
-
563
- type Type = 'duration' | 'timestamp';
564
- }
565
- }
566
-
567
452
  interface InvoiceSettings {
568
453
  /**
569
454
  * The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
@@ -639,11 +524,6 @@ declare module 'stripe' {
639
524
  * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
640
525
  */
641
526
  tax_rates?: Stripe.Emptyable<Array<string>>;
642
-
643
- /**
644
- * Options that configure the trial on the subscription item.
645
- */
646
- trial?: Item.Trial;
647
527
  }
648
528
 
649
529
  namespace Item {
@@ -665,56 +545,12 @@ declare module 'stripe' {
665
545
  */
666
546
  discount?: string;
667
547
 
668
- /**
669
- * Details to determine how long the discount should be applied for.
670
- */
671
- discount_end?: Discount.DiscountEnd;
672
-
673
548
  /**
674
549
  * ID of the promotion code to create a new discount for.
675
550
  */
676
551
  promotion_code?: string;
677
552
  }
678
553
 
679
- namespace Discount {
680
- interface DiscountEnd {
681
- /**
682
- * Time span for the redeemed discount.
683
- */
684
- duration?: DiscountEnd.Duration;
685
-
686
- /**
687
- * A precise Unix timestamp for the discount to end. Must be in the future.
688
- */
689
- timestamp?: number;
690
-
691
- /**
692
- * The type of calculation made to determine when the discount ends.
693
- */
694
- type: DiscountEnd.Type;
695
- }
696
-
697
- namespace DiscountEnd {
698
- interface Duration {
699
- /**
700
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
701
- */
702
- interval: Duration.Interval;
703
-
704
- /**
705
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
706
- */
707
- interval_count: number;
708
- }
709
-
710
- namespace Duration {
711
- type Interval = 'day' | 'month' | 'week' | 'year';
712
- }
713
-
714
- type Type = 'duration' | 'timestamp';
715
- }
716
- }
717
-
718
554
  interface PriceData {
719
555
  /**
720
556
  * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
@@ -766,33 +602,6 @@ declare module 'stripe' {
766
602
 
767
603
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
768
604
  }
769
-
770
- interface Trial {
771
- /**
772
- * List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
773
- */
774
- converts_to?: Array<string>;
775
-
776
- /**
777
- * Determines the type of trial for this item.
778
- */
779
- type: Trial.Type;
780
- }
781
-
782
- namespace Trial {
783
- type Type = 'free' | 'paid';
784
- }
785
- }
786
-
787
- interface PauseCollection {
788
- /**
789
- * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
790
- */
791
- behavior: PauseCollection.Behavior;
792
- }
793
-
794
- namespace PauseCollection {
795
- type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
796
605
  }
797
606
 
798
607
  type ProrationBehavior =
@@ -811,44 +620,6 @@ declare module 'stripe' {
811
620
  */
812
621
  destination: string;
813
622
  }
814
-
815
- type TrialContinuation = 'continue' | 'none';
816
-
817
- interface TrialSettings {
818
- /**
819
- * Defines how the subscription should behave when a trial ends.
820
- */
821
- end_behavior?: TrialSettings.EndBehavior;
822
- }
823
-
824
- namespace TrialSettings {
825
- interface EndBehavior {
826
- /**
827
- * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
828
- */
829
- prorate_up_front?: EndBehavior.ProrateUpFront;
830
- }
831
-
832
- namespace EndBehavior {
833
- type ProrateUpFront = 'defer' | 'include';
834
- }
835
- }
836
- }
837
-
838
- interface Prebilling {
839
- /**
840
- * This is used to determine the number of billing cycles to prebill.
841
- */
842
- iterations: number;
843
-
844
- /**
845
- * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
846
- */
847
- update_behavior?: Prebilling.UpdateBehavior;
848
- }
849
-
850
- namespace Prebilling {
851
- type UpdateBehavior = 'prebill' | 'reset';
852
623
  }
853
624
  }
854
625
 
@@ -860,11 +631,6 @@ declare module 'stripe' {
860
631
  }
861
632
 
862
633
  interface SubscriptionScheduleUpdateParams {
863
- /**
864
- * Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
865
- */
866
- billing_behavior?: SubscriptionScheduleUpdateParams.BillingBehavior;
867
-
868
634
  /**
869
635
  * Object representing the subscription schedule's default settings.
870
636
  */
@@ -890,11 +656,6 @@ declare module 'stripe' {
890
656
  */
891
657
  phases?: Array<SubscriptionScheduleUpdateParams.Phase>;
892
658
 
893
- /**
894
- * If specified, the invoicing for the given billing cycle iterations will be processed now.
895
- */
896
- prebilling?: SubscriptionScheduleUpdateParams.Prebilling;
897
-
898
659
  /**
899
660
  * If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
900
661
  */
@@ -902,8 +663,6 @@ declare module 'stripe' {
902
663
  }
903
664
 
904
665
  namespace SubscriptionScheduleUpdateParams {
905
- type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
906
-
907
666
  interface DefaultSettings {
908
667
  /**
909
668
  * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
@@ -1146,11 +905,6 @@ declare module 'stripe' {
1146
905
  */
1147
906
  on_behalf_of?: string;
1148
907
 
1149
- /**
1150
- * If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment).
1151
- */
1152
- pause_collection?: Phase.PauseCollection;
1153
-
1154
908
  /**
1155
909
  * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
1156
910
  */
@@ -1171,20 +925,10 @@ declare module 'stripe' {
1171
925
  */
1172
926
  trial?: boolean;
1173
927
 
1174
- /**
1175
- * Specify trial behavior when crossing phase boundaries
1176
- */
1177
- trial_continuation?: Phase.TrialContinuation;
1178
-
1179
928
  /**
1180
929
  * Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
1181
930
  */
1182
931
  trial_end?: number | 'now';
1183
-
1184
- /**
1185
- * Settings related to subscription trials.
1186
- */
1187
- trial_settings?: Phase.TrialSettings;
1188
932
  }
1189
933
 
1190
934
  namespace Phase {
@@ -1227,56 +971,12 @@ declare module 'stripe' {
1227
971
  */
1228
972
  discount?: string;
1229
973
 
1230
- /**
1231
- * Details to determine how long the discount should be applied for.
1232
- */
1233
- discount_end?: Discount.DiscountEnd;
1234
-
1235
974
  /**
1236
975
  * ID of the promotion code to create a new discount for.
1237
976
  */
1238
977
  promotion_code?: string;
1239
978
  }
1240
979
 
1241
- namespace Discount {
1242
- interface DiscountEnd {
1243
- /**
1244
- * Time span for the redeemed discount.
1245
- */
1246
- duration?: DiscountEnd.Duration;
1247
-
1248
- /**
1249
- * A precise Unix timestamp for the discount to end. Must be in the future.
1250
- */
1251
- timestamp?: number;
1252
-
1253
- /**
1254
- * The type of calculation made to determine when the discount ends.
1255
- */
1256
- type: DiscountEnd.Type;
1257
- }
1258
-
1259
- namespace DiscountEnd {
1260
- interface Duration {
1261
- /**
1262
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1263
- */
1264
- interval: Duration.Interval;
1265
-
1266
- /**
1267
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1268
- */
1269
- interval_count: number;
1270
- }
1271
-
1272
- namespace Duration {
1273
- type Interval = 'day' | 'month' | 'week' | 'year';
1274
- }
1275
-
1276
- type Type = 'duration' | 'timestamp';
1277
- }
1278
- }
1279
-
1280
980
  interface PriceData {
1281
981
  /**
1282
982
  * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
@@ -1366,56 +1066,12 @@ declare module 'stripe' {
1366
1066
  */
1367
1067
  discount?: string;
1368
1068
 
1369
- /**
1370
- * Details to determine how long the discount should be applied for.
1371
- */
1372
- discount_end?: Discount.DiscountEnd;
1373
-
1374
1069
  /**
1375
1070
  * ID of the promotion code to create a new discount for.
1376
1071
  */
1377
1072
  promotion_code?: string;
1378
1073
  }
1379
1074
 
1380
- namespace Discount {
1381
- interface DiscountEnd {
1382
- /**
1383
- * Time span for the redeemed discount.
1384
- */
1385
- duration?: DiscountEnd.Duration;
1386
-
1387
- /**
1388
- * A precise Unix timestamp for the discount to end. Must be in the future.
1389
- */
1390
- timestamp?: number;
1391
-
1392
- /**
1393
- * The type of calculation made to determine when the discount ends.
1394
- */
1395
- type: DiscountEnd.Type;
1396
- }
1397
-
1398
- namespace DiscountEnd {
1399
- interface Duration {
1400
- /**
1401
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1402
- */
1403
- interval: Duration.Interval;
1404
-
1405
- /**
1406
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1407
- */
1408
- interval_count: number;
1409
- }
1410
-
1411
- namespace Duration {
1412
- type Interval = 'day' | 'month' | 'week' | 'year';
1413
- }
1414
-
1415
- type Type = 'duration' | 'timestamp';
1416
- }
1417
- }
1418
-
1419
1075
  interface InvoiceSettings {
1420
1076
  /**
1421
1077
  * The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
@@ -1491,11 +1147,6 @@ declare module 'stripe' {
1491
1147
  * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
1492
1148
  */
1493
1149
  tax_rates?: Stripe.Emptyable<Array<string>>;
1494
-
1495
- /**
1496
- * Options that configure the trial on the subscription item.
1497
- */
1498
- trial?: Item.Trial;
1499
1150
  }
1500
1151
 
1501
1152
  namespace Item {
@@ -1517,56 +1168,12 @@ declare module 'stripe' {
1517
1168
  */
1518
1169
  discount?: string;
1519
1170
 
1520
- /**
1521
- * Details to determine how long the discount should be applied for.
1522
- */
1523
- discount_end?: Discount.DiscountEnd;
1524
-
1525
1171
  /**
1526
1172
  * ID of the promotion code to create a new discount for.
1527
1173
  */
1528
1174
  promotion_code?: string;
1529
1175
  }
1530
1176
 
1531
- namespace Discount {
1532
- interface DiscountEnd {
1533
- /**
1534
- * Time span for the redeemed discount.
1535
- */
1536
- duration?: DiscountEnd.Duration;
1537
-
1538
- /**
1539
- * A precise Unix timestamp for the discount to end. Must be in the future.
1540
- */
1541
- timestamp?: number;
1542
-
1543
- /**
1544
- * The type of calculation made to determine when the discount ends.
1545
- */
1546
- type: DiscountEnd.Type;
1547
- }
1548
-
1549
- namespace DiscountEnd {
1550
- interface Duration {
1551
- /**
1552
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1553
- */
1554
- interval: Duration.Interval;
1555
-
1556
- /**
1557
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1558
- */
1559
- interval_count: number;
1560
- }
1561
-
1562
- namespace Duration {
1563
- type Interval = 'day' | 'month' | 'week' | 'year';
1564
- }
1565
-
1566
- type Type = 'duration' | 'timestamp';
1567
- }
1568
- }
1569
-
1570
1177
  interface PriceData {
1571
1178
  /**
1572
1179
  * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
@@ -1618,33 +1225,6 @@ declare module 'stripe' {
1618
1225
 
1619
1226
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
1620
1227
  }
1621
-
1622
- interface Trial {
1623
- /**
1624
- * List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
1625
- */
1626
- converts_to?: Array<string>;
1627
-
1628
- /**
1629
- * Determines the type of trial for this item.
1630
- */
1631
- type: Trial.Type;
1632
- }
1633
-
1634
- namespace Trial {
1635
- type Type = 'free' | 'paid';
1636
- }
1637
- }
1638
-
1639
- interface PauseCollection {
1640
- /**
1641
- * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1642
- */
1643
- behavior: PauseCollection.Behavior;
1644
- }
1645
-
1646
- namespace PauseCollection {
1647
- type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
1648
1228
  }
1649
1229
 
1650
1230
  type ProrationBehavior =
@@ -1663,44 +1243,6 @@ declare module 'stripe' {
1663
1243
  */
1664
1244
  destination: string;
1665
1245
  }
1666
-
1667
- type TrialContinuation = 'continue' | 'none';
1668
-
1669
- interface TrialSettings {
1670
- /**
1671
- * Defines how the subscription should behave when a trial ends.
1672
- */
1673
- end_behavior?: TrialSettings.EndBehavior;
1674
- }
1675
-
1676
- namespace TrialSettings {
1677
- interface EndBehavior {
1678
- /**
1679
- * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1680
- */
1681
- prorate_up_front?: EndBehavior.ProrateUpFront;
1682
- }
1683
-
1684
- namespace EndBehavior {
1685
- type ProrateUpFront = 'defer' | 'include';
1686
- }
1687
- }
1688
- }
1689
-
1690
- interface Prebilling {
1691
- /**
1692
- * This is used to determine the number of billing cycles to prebill.
1693
- */
1694
- iterations: number;
1695
-
1696
- /**
1697
- * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1698
- */
1699
- update_behavior?: Prebilling.UpdateBehavior;
1700
- }
1701
-
1702
- namespace Prebilling {
1703
- type UpdateBehavior = 'prebill' | 'reset';
1704
1246
  }
1705
1247
 
1706
1248
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
@@ -1743,780 +1285,33 @@ declare module 'stripe' {
1743
1285
  scheduled?: boolean;
1744
1286
  }
1745
1287
 
1746
- interface SubscriptionScheduleAmendParams {
1288
+ interface SubscriptionScheduleCancelParams {
1747
1289
  /**
1748
- * Changes to apply to the phases of the subscription schedule, in the order provided.
1290
+ * Specifies which fields in the response should be expanded.
1749
1291
  */
1750
- amendments?: Array<SubscriptionScheduleAmendParams.Amendment>;
1292
+ expand?: Array<string>;
1751
1293
 
1752
1294
  /**
1753
- * Specifies which fields in the response should be expanded.
1295
+ * If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`.
1754
1296
  */
1755
- expand?: Array<string>;
1297
+ invoice_now?: boolean;
1756
1298
 
1757
1299
  /**
1758
- * Provide any time periods to bill in advance.
1300
+ * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`.
1759
1301
  */
1760
- prebilling?: Stripe.Emptyable<
1761
- Array<SubscriptionScheduleAmendParams.Prebilling>
1762
- >;
1302
+ prorate?: boolean;
1303
+ }
1763
1304
 
1305
+ interface SubscriptionScheduleReleaseParams {
1764
1306
  /**
1765
- * In cases where the amendment changes the currently active phase,
1766
- * specifies if and how to prorate at the time of the request.
1307
+ * Specifies which fields in the response should be expanded.
1767
1308
  */
1768
- proration_behavior?: SubscriptionScheduleAmendParams.ProrationBehavior;
1309
+ expand?: Array<string>;
1769
1310
 
1770
1311
  /**
1771
- * Changes to apply to the subscription schedule.
1312
+ * Keep any cancellation on the subscription that the schedule has set
1772
1313
  */
1773
- schedule_settings?: SubscriptionScheduleAmendParams.ScheduleSettings;
1774
- }
1775
-
1776
- namespace SubscriptionScheduleAmendParams {
1777
- interface Amendment {
1778
- /**
1779
- * Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.
1780
- */
1781
- amendment_end?: Amendment.AmendmentEnd;
1782
-
1783
- /**
1784
- * Details to identify the earliest timestamp where the proposed change should take effect.
1785
- */
1786
- amendment_start: Amendment.AmendmentStart;
1787
-
1788
- /**
1789
- * For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment.
1790
- */
1791
- billing_cycle_anchor?: Amendment.BillingCycleAnchor;
1792
-
1793
- /**
1794
- * Changes to the coupons being redeemed or discounts being applied during the amendment time span.
1795
- */
1796
- discount_actions?: Array<Amendment.DiscountAction>;
1797
-
1798
- /**
1799
- * Changes to the subscription items during the amendment time span.
1800
- */
1801
- item_actions?: Array<Amendment.ItemAction>;
1802
-
1803
- /**
1804
- * Instructions for how to modify phase metadata
1805
- */
1806
- metadata_actions?: Array<Amendment.MetadataAction>;
1807
-
1808
- /**
1809
- * Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.
1810
- */
1811
- proration_behavior?: Amendment.ProrationBehavior;
1812
-
1813
- /**
1814
- * Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
1815
- */
1816
- set_pause_collection?: Amendment.SetPauseCollection;
1817
-
1818
- /**
1819
- * Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
1820
- */
1821
- set_schedule_end?: Amendment.SetScheduleEnd;
1822
-
1823
- /**
1824
- * Settings related to subscription trials.
1825
- */
1826
- trial_settings?: Amendment.TrialSettings;
1827
- }
1828
-
1829
- namespace Amendment {
1830
- interface AmendmentEnd {
1831
- /**
1832
- * Use the `end` time of a given discount.
1833
- */
1834
- discount_end?: AmendmentEnd.DiscountEnd;
1835
-
1836
- /**
1837
- * Time span for the amendment starting from the `amendment_start`.
1838
- */
1839
- duration?: AmendmentEnd.Duration;
1840
-
1841
- /**
1842
- * A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
1843
- */
1844
- timestamp?: number;
1845
-
1846
- /**
1847
- * Select one of three ways to pass the `amendment_end`.
1848
- */
1849
- type: AmendmentEnd.Type;
1850
- }
1851
-
1852
- namespace AmendmentEnd {
1853
- interface DiscountEnd {
1854
- /**
1855
- * The ID of a specific discount.
1856
- */
1857
- discount: string;
1858
- }
1859
-
1860
- interface Duration {
1861
- /**
1862
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1863
- */
1864
- interval: Duration.Interval;
1865
-
1866
- /**
1867
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1868
- */
1869
- interval_count: number;
1870
- }
1871
-
1872
- namespace Duration {
1873
- type Interval = 'day' | 'month' | 'week' | 'year';
1874
- }
1875
-
1876
- type Type =
1877
- | 'discount_end'
1878
- | 'duration'
1879
- | 'schedule_end'
1880
- | 'timestamp'
1881
- | 'trial_end'
1882
- | 'trial_start'
1883
- | 'upcoming_invoice';
1884
- }
1885
-
1886
- interface AmendmentStart {
1887
- /**
1888
- * Details of another amendment in the same array, immediately after which this amendment should begin.
1889
- */
1890
- amendment_end?: AmendmentStart.AmendmentEnd;
1891
-
1892
- /**
1893
- * Use the `end` time of a given discount.
1894
- */
1895
- discount_end?: AmendmentStart.DiscountEnd;
1896
-
1897
- /**
1898
- * A precise Unix timestamp for the amendment to start.
1899
- */
1900
- timestamp?: number;
1901
-
1902
- /**
1903
- * Select one of three ways to pass the `amendment_start`.
1904
- */
1905
- type: AmendmentStart.Type;
1906
- }
1907
-
1908
- namespace AmendmentStart {
1909
- interface AmendmentEnd {
1910
- /**
1911
- * The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.
1912
- */
1913
- index: number;
1914
- }
1915
-
1916
- interface DiscountEnd {
1917
- /**
1918
- * The ID of a specific discount.
1919
- */
1920
- discount: string;
1921
- }
1922
-
1923
- type Type =
1924
- | 'amendment_end'
1925
- | 'discount_end'
1926
- | 'now'
1927
- | 'schedule_end'
1928
- | 'timestamp'
1929
- | 'trial_end'
1930
- | 'trial_start'
1931
- | 'upcoming_invoice';
1932
- }
1933
-
1934
- type BillingCycleAnchor = 'amendment_start' | 'automatic';
1935
-
1936
- interface DiscountAction {
1937
- /**
1938
- * Details of the discount to add.
1939
- */
1940
- add?: DiscountAction.Add;
1941
-
1942
- /**
1943
- * Details of the discount to remove.
1944
- */
1945
- remove?: DiscountAction.Remove;
1946
-
1947
- /**
1948
- * Details of the discount to replace the existing discounts with.
1949
- */
1950
- set?: DiscountAction.Set;
1951
-
1952
- /**
1953
- * Determines the type of discount action.
1954
- */
1955
- type: DiscountAction.Type;
1956
- }
1957
-
1958
- namespace DiscountAction {
1959
- interface Add {
1960
- /**
1961
- * The coupon code to redeem.
1962
- */
1963
- coupon?: string;
1964
-
1965
- /**
1966
- * An ID of an existing discount for a coupon that was already redeemed.
1967
- */
1968
- discount?: string;
1969
-
1970
- /**
1971
- * Details to determine how long the discount should be applied for.
1972
- */
1973
- discount_end?: Add.DiscountEnd;
1974
-
1975
- /**
1976
- * The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
1977
- */
1978
- index?: number;
1979
-
1980
- /**
1981
- * The promotion code to redeem.
1982
- */
1983
- promotion_code?: string;
1984
- }
1985
-
1986
- namespace Add {
1987
- interface DiscountEnd {
1988
- /**
1989
- * The type of calculation made to determine when the discount ends.
1990
- */
1991
- type: 'amendment_end';
1992
- }
1993
- }
1994
-
1995
- interface Remove {
1996
- /**
1997
- * The coupon code to remove from the `discounts` array.
1998
- */
1999
- coupon?: string;
2000
-
2001
- /**
2002
- * The ID of a discount to remove from the `discounts` array.
2003
- */
2004
- discount?: string;
2005
-
2006
- /**
2007
- * The ID of a promotion code to remove from the `discounts` array.
2008
- */
2009
- promotion_code?: string;
2010
- }
2011
-
2012
- interface Set {
2013
- /**
2014
- * The coupon code to replace the `discounts` array with.
2015
- */
2016
- coupon?: string;
2017
-
2018
- /**
2019
- * An ID of an existing discount to replace the `discounts` array with.
2020
- */
2021
- discount?: string;
2022
-
2023
- /**
2024
- * An ID of an existing promotion code to replace the `discounts` array with.
2025
- */
2026
- promotion_code?: string;
2027
- }
2028
-
2029
- type Type = 'add' | 'remove' | 'set';
2030
- }
2031
-
2032
- interface ItemAction {
2033
- /**
2034
- * Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.
2035
- */
2036
- add?: ItemAction.Add;
2037
-
2038
- /**
2039
- * Details of the subscription item to remove.
2040
- */
2041
- remove?: ItemAction.Remove;
2042
-
2043
- /**
2044
- * Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.
2045
- */
2046
- set?: ItemAction.Set;
2047
-
2048
- /**
2049
- * Determines the type of item action.
2050
- */
2051
- type: ItemAction.Type;
2052
- }
2053
-
2054
- namespace ItemAction {
2055
- interface Add {
2056
- /**
2057
- * The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
2058
- */
2059
- discounts?: Array<Add.Discount>;
2060
-
2061
- /**
2062
- * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2063
- */
2064
- metadata?: Stripe.MetadataParam;
2065
-
2066
- /**
2067
- * The ID of the price object.
2068
- */
2069
- price: string;
2070
-
2071
- /**
2072
- * Quantity for this item.
2073
- */
2074
- quantity?: number;
2075
-
2076
- /**
2077
- * The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
2078
- */
2079
- tax_rates?: Array<string>;
2080
-
2081
- /**
2082
- * Options that configure the trial on the subscription item.
2083
- */
2084
- trial?: Add.Trial;
2085
- }
2086
-
2087
- namespace Add {
2088
- interface Discount {
2089
- /**
2090
- * ID of the coupon to create a new discount for.
2091
- */
2092
- coupon?: string;
2093
-
2094
- /**
2095
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
2096
- */
2097
- discount?: string;
2098
-
2099
- /**
2100
- * Details to determine how long the discount should be applied for.
2101
- */
2102
- discount_end?: Discount.DiscountEnd;
2103
-
2104
- /**
2105
- * ID of the promotion code to create a new discount for.
2106
- */
2107
- promotion_code?: string;
2108
- }
2109
-
2110
- namespace Discount {
2111
- interface DiscountEnd {
2112
- /**
2113
- * Time span for the redeemed discount.
2114
- */
2115
- duration?: DiscountEnd.Duration;
2116
-
2117
- /**
2118
- * A precise Unix timestamp for the discount to end. Must be in the future.
2119
- */
2120
- timestamp?: number;
2121
-
2122
- /**
2123
- * The type of calculation made to determine when the discount ends.
2124
- */
2125
- type: DiscountEnd.Type;
2126
- }
2127
-
2128
- namespace DiscountEnd {
2129
- interface Duration {
2130
- /**
2131
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2132
- */
2133
- interval: Duration.Interval;
2134
-
2135
- /**
2136
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2137
- */
2138
- interval_count: number;
2139
- }
2140
-
2141
- namespace Duration {
2142
- type Interval = 'day' | 'month' | 'week' | 'year';
2143
- }
2144
-
2145
- type Type = 'duration' | 'timestamp';
2146
- }
2147
- }
2148
-
2149
- interface Trial {
2150
- /**
2151
- * List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
2152
- */
2153
- converts_to?: Array<string>;
2154
-
2155
- /**
2156
- * Determines the type of trial for this item.
2157
- */
2158
- type: Trial.Type;
2159
- }
2160
-
2161
- namespace Trial {
2162
- type Type = 'free' | 'paid';
2163
- }
2164
- }
2165
-
2166
- interface Remove {
2167
- /**
2168
- * ID of a price to remove.
2169
- */
2170
- price: string;
2171
- }
2172
-
2173
- interface Set {
2174
- /**
2175
- * If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
2176
- */
2177
- discounts?: Array<Set.Discount>;
2178
-
2179
- /**
2180
- * If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
2181
- */
2182
- metadata?: Stripe.MetadataParam;
2183
-
2184
- /**
2185
- * The ID of the price object.
2186
- */
2187
- price: string;
2188
-
2189
- /**
2190
- * If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
2191
- */
2192
- quantity?: number;
2193
-
2194
- /**
2195
- * If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
2196
- */
2197
- tax_rates?: Array<string>;
2198
-
2199
- /**
2200
- * If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
2201
- */
2202
- trial?: Set.Trial;
2203
- }
2204
-
2205
- namespace Set {
2206
- interface Discount {
2207
- /**
2208
- * ID of the coupon to create a new discount for.
2209
- */
2210
- coupon?: string;
2211
-
2212
- /**
2213
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
2214
- */
2215
- discount?: string;
2216
-
2217
- /**
2218
- * Details to determine how long the discount should be applied for.
2219
- */
2220
- discount_end?: Discount.DiscountEnd;
2221
-
2222
- /**
2223
- * ID of the promotion code to create a new discount for.
2224
- */
2225
- promotion_code?: string;
2226
- }
2227
-
2228
- namespace Discount {
2229
- interface DiscountEnd {
2230
- /**
2231
- * Time span for the redeemed discount.
2232
- */
2233
- duration?: DiscountEnd.Duration;
2234
-
2235
- /**
2236
- * A precise Unix timestamp for the discount to end. Must be in the future.
2237
- */
2238
- timestamp?: number;
2239
-
2240
- /**
2241
- * The type of calculation made to determine when the discount ends.
2242
- */
2243
- type: DiscountEnd.Type;
2244
- }
2245
-
2246
- namespace DiscountEnd {
2247
- interface Duration {
2248
- /**
2249
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2250
- */
2251
- interval: Duration.Interval;
2252
-
2253
- /**
2254
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2255
- */
2256
- interval_count: number;
2257
- }
2258
-
2259
- namespace Duration {
2260
- type Interval = 'day' | 'month' | 'week' | 'year';
2261
- }
2262
-
2263
- type Type = 'duration' | 'timestamp';
2264
- }
2265
- }
2266
-
2267
- interface Trial {
2268
- /**
2269
- * List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
2270
- */
2271
- converts_to?: Array<string>;
2272
-
2273
- /**
2274
- * Determines the type of trial for this item.
2275
- */
2276
- type: Trial.Type;
2277
- }
2278
-
2279
- namespace Trial {
2280
- type Type = 'free' | 'paid';
2281
- }
2282
- }
2283
-
2284
- type Type = 'add' | 'remove' | 'set';
2285
- }
2286
-
2287
- interface MetadataAction {
2288
- /**
2289
- * Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
2290
- */
2291
- add?: {
2292
- [key: string]: string;
2293
- };
2294
-
2295
- /**
2296
- * Keys to remove from schedule phase metadata.
2297
- */
2298
- remove?: Array<string>;
2299
-
2300
- /**
2301
- * Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
2302
- */
2303
- set?: Stripe.Emptyable<{
2304
- [key: string]: string;
2305
- }>;
2306
-
2307
- /**
2308
- * Select one of three ways to update phase-level `metadata` on subscription schedules.
2309
- */
2310
- type: MetadataAction.Type;
2311
- }
2312
-
2313
- namespace MetadataAction {
2314
- type Type = 'add' | 'remove' | 'set';
2315
- }
2316
-
2317
- type ProrationBehavior =
2318
- | 'always_invoice'
2319
- | 'create_prorations'
2320
- | 'none';
2321
-
2322
- interface SetPauseCollection {
2323
- /**
2324
- * Details of the pause_collection behavior to apply to the amendment.
2325
- */
2326
- set?: SetPauseCollection.Set;
2327
-
2328
- /**
2329
- * Determines the type of the pause_collection amendment.
2330
- */
2331
- type: SetPauseCollection.Type;
2332
- }
2333
-
2334
- namespace SetPauseCollection {
2335
- interface Set {
2336
- /**
2337
- * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2338
- */
2339
- behavior: Set.Behavior;
2340
- }
2341
-
2342
- namespace Set {
2343
- type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
2344
- }
2345
-
2346
- type Type = 'remove' | 'set';
2347
- }
2348
-
2349
- type SetScheduleEnd = 'amendment_end' | 'amendment_start';
2350
-
2351
- interface TrialSettings {
2352
- /**
2353
- * Defines how the subscription should behave when a trial ends.
2354
- */
2355
- end_behavior?: TrialSettings.EndBehavior;
2356
- }
2357
-
2358
- namespace TrialSettings {
2359
- interface EndBehavior {
2360
- /**
2361
- * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2362
- */
2363
- prorate_up_front?: EndBehavior.ProrateUpFront;
2364
- }
2365
-
2366
- namespace EndBehavior {
2367
- type ProrateUpFront = 'defer' | 'include';
2368
- }
2369
- }
2370
- }
2371
-
2372
- interface Prebilling {
2373
- /**
2374
- * The beginning of the prebilled time period. The default value is `now`.
2375
- */
2376
- bill_from?: Prebilling.BillFrom;
2377
-
2378
- /**
2379
- * The end of the prebilled time period.
2380
- */
2381
- bill_until?: Prebilling.BillUntil;
2382
-
2383
- /**
2384
- * When the prebilling invoice should be created. The default value is `now`.
2385
- */
2386
- invoice_at?: 'now';
2387
-
2388
- /**
2389
- * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2390
- */
2391
- update_behavior?: Prebilling.UpdateBehavior;
2392
- }
2393
-
2394
- namespace Prebilling {
2395
- interface BillFrom {
2396
- /**
2397
- * Start the prebilled period when a specified amendment begins.
2398
- */
2399
- amendment_start?: BillFrom.AmendmentStart;
2400
-
2401
- /**
2402
- * Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2403
- */
2404
- timestamp?: number;
2405
-
2406
- /**
2407
- * Select one of several ways to pass the `bill_from` value.
2408
- */
2409
- type: BillFrom.Type;
2410
- }
2411
-
2412
- namespace BillFrom {
2413
- interface AmendmentStart {
2414
- /**
2415
- * The position of the amendment in the `amendments` array with which prebilling should begin. Indexes start from 0 and must be less than the total number of supplied amendments.
2416
- */
2417
- index: number;
2418
- }
2419
-
2420
- type Type = 'amendment_start' | 'now' | 'timestamp';
2421
- }
2422
-
2423
- interface BillUntil {
2424
- /**
2425
- * End the prebilled period when a specified amendment ends.
2426
- */
2427
- amendment_end?: BillUntil.AmendmentEnd;
2428
-
2429
- /**
2430
- * Time span for prebilling, starting from `bill_from`.
2431
- */
2432
- duration?: BillUntil.Duration;
2433
-
2434
- /**
2435
- * End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2436
- */
2437
- timestamp?: number;
2438
-
2439
- /**
2440
- * Select one of several ways to pass the `bill_until` value.
2441
- */
2442
- type: BillUntil.Type;
2443
- }
2444
-
2445
- namespace BillUntil {
2446
- interface AmendmentEnd {
2447
- /**
2448
- * The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments.
2449
- */
2450
- index: number;
2451
- }
2452
-
2453
- interface Duration {
2454
- /**
2455
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2456
- */
2457
- interval: Duration.Interval;
2458
-
2459
- /**
2460
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2461
- */
2462
- interval_count: number;
2463
- }
2464
-
2465
- namespace Duration {
2466
- type Interval = 'day' | 'month' | 'week' | 'year';
2467
- }
2468
-
2469
- type Type =
2470
- | 'amendment_end'
2471
- | 'duration'
2472
- | 'schedule_end'
2473
- | 'timestamp';
2474
- }
2475
-
2476
- type UpdateBehavior = 'prebill' | 'reset';
2477
- }
2478
-
2479
- type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
2480
-
2481
- interface ScheduleSettings {
2482
- /**
2483
- * Behavior of the subscription schedule and underlying subscription when it ends.
2484
- */
2485
- end_behavior?: ScheduleSettings.EndBehavior;
2486
- }
2487
-
2488
- namespace ScheduleSettings {
2489
- type EndBehavior = 'cancel' | 'release';
2490
- }
2491
- }
2492
-
2493
- interface SubscriptionScheduleCancelParams {
2494
- /**
2495
- * Specifies which fields in the response should be expanded.
2496
- */
2497
- expand?: Array<string>;
2498
-
2499
- /**
2500
- * If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`.
2501
- */
2502
- invoice_now?: boolean;
2503
-
2504
- /**
2505
- * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`.
2506
- */
2507
- prorate?: boolean;
2508
- }
2509
-
2510
- interface SubscriptionScheduleReleaseParams {
2511
- /**
2512
- * Specifies which fields in the response should be expanded.
2513
- */
2514
- expand?: Array<string>;
2515
-
2516
- /**
2517
- * Keep any cancellation on the subscription that the schedule has set
2518
- */
2519
- preserve_cancel_date?: boolean;
1314
+ preserve_cancel_date?: boolean;
2520
1315
  }
2521
1316
 
2522
1317
  class SubscriptionSchedulesResource {
@@ -2564,19 +1359,6 @@ declare module 'stripe' {
2564
1359
  options?: RequestOptions
2565
1360
  ): ApiListPromise<Stripe.SubscriptionSchedule>;
2566
1361
 
2567
- /**
2568
- * Amends an existing subscription schedule.
2569
- */
2570
- amend(
2571
- id: string,
2572
- params?: SubscriptionScheduleAmendParams,
2573
- options?: RequestOptions
2574
- ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2575
- amend(
2576
- id: string,
2577
- options?: RequestOptions
2578
- ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2579
-
2580
1362
  /**
2581
1363
  * Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
2582
1364
  */