stripe 16.6.0 → 16.7.0-beta.1

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 (159) hide show
  1. package/CHANGELOG.md +787 -116
  2. package/README.md +33 -0
  3. package/VERSION +1 -1
  4. package/cjs/RequestSender.js +66 -5
  5. package/cjs/StripeResource.js +1 -1
  6. package/cjs/apiVersion.js +2 -1
  7. package/cjs/multipart.js +1 -1
  8. package/cjs/resources/AccountNotices.js +21 -0
  9. package/cjs/resources/Billing/Alerts.js +27 -0
  10. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  11. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  12. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  13. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  14. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  15. package/cjs/resources/GiftCards/Cards.js +23 -0
  16. package/cjs/resources/GiftCards/Transactions.js +33 -0
  17. package/cjs/resources/Invoices.js +17 -0
  18. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  19. package/cjs/resources/Margins.js +22 -0
  20. package/cjs/resources/OAuth.js +1 -1
  21. package/cjs/resources/Orders.js +24 -0
  22. package/cjs/resources/PaymentIntents.js +4 -0
  23. package/cjs/resources/QuotePhases.js +22 -0
  24. package/cjs/resources/Quotes.js +32 -0
  25. package/cjs/resources/SubscriptionSchedules.js +4 -0
  26. package/cjs/resources/Tax/Associations.js +9 -0
  27. package/cjs/resources/Tax/Forms.js +20 -0
  28. package/cjs/resources/Terminal/Readers.js +12 -0
  29. package/cjs/resources.js +42 -10
  30. package/cjs/stripe.core.js +6 -3
  31. package/cjs/utils.js +30 -3
  32. package/esm/RequestSender.js +67 -6
  33. package/esm/StripeResource.js +2 -2
  34. package/esm/apiVersion.js +1 -0
  35. package/esm/multipart.js +2 -2
  36. package/esm/resources/AccountNotices.js +18 -0
  37. package/esm/resources/Billing/Alerts.js +24 -0
  38. package/esm/resources/Capital/FinancingOffers.js +18 -0
  39. package/esm/resources/Capital/FinancingSummary.js +9 -0
  40. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  41. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  42. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  43. package/esm/resources/GiftCards/Cards.js +20 -0
  44. package/esm/resources/GiftCards/Transactions.js +30 -0
  45. package/esm/resources/Invoices.js +17 -0
  46. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  47. package/esm/resources/Margins.js +19 -0
  48. package/esm/resources/OAuth.js +2 -2
  49. package/esm/resources/Orders.js +21 -0
  50. package/esm/resources/PaymentIntents.js +4 -0
  51. package/esm/resources/QuotePhases.js +19 -0
  52. package/esm/resources/Quotes.js +32 -0
  53. package/esm/resources/SubscriptionSchedules.js +4 -0
  54. package/esm/resources/Tax/Associations.js +6 -0
  55. package/esm/resources/Tax/Forms.js +17 -0
  56. package/esm/resources/Terminal/Readers.js +12 -0
  57. package/esm/resources.js +28 -0
  58. package/esm/stripe.core.js +6 -3
  59. package/esm/utils.js +27 -1
  60. package/package.json +1 -1
  61. package/types/AccountLinksResource.d.ts +5 -1
  62. package/types/AccountNotices.d.ts +113 -0
  63. package/types/AccountNoticesResource.d.ts +98 -0
  64. package/types/AccountSessions.d.ts +15 -0
  65. package/types/AccountSessionsResource.d.ts +215 -0
  66. package/types/Accounts.d.ts +106 -1
  67. package/types/AccountsResource.d.ts +246 -0
  68. package/types/Billing/AlertsResource.d.ts +176 -0
  69. package/types/Capital/FinancingOffers.d.ts +188 -0
  70. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  71. package/types/Capital/FinancingSummary.d.ts +106 -0
  72. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  73. package/types/Capital/FinancingTransactions.d.ts +135 -0
  74. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  75. package/types/Charges.d.ts +67 -0
  76. package/types/ChargesResource.d.ts +1294 -0
  77. package/types/Checkout/Sessions.d.ts +28 -1
  78. package/types/Checkout/SessionsResource.d.ts +15 -1
  79. package/types/ConfirmationTokens.d.ts +62 -0
  80. package/types/Coupons.d.ts +1 -1
  81. package/types/CouponsResource.d.ts +1 -1
  82. package/types/CreditNotes.d.ts +21 -0
  83. package/types/CreditNotesResource.d.ts +51 -0
  84. package/types/CustomersResource.d.ts +2 -0
  85. package/types/Disputes.d.ts +158 -0
  86. package/types/DisputesResource.d.ts +120 -0
  87. package/types/EventTypes.d.ts +460 -0
  88. package/types/Events.d.ts +85 -0
  89. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  90. package/types/FinancialConnections/Accounts.d.ts +29 -1
  91. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  92. package/types/FinancialConnections/Institutions.d.ts +93 -0
  93. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  94. package/types/FinancialConnections/Sessions.d.ts +49 -1
  95. package/types/FinancialConnections/SessionsResource.d.ts +38 -1
  96. package/types/GiftCards/Cards.d.ts +118 -0
  97. package/types/GiftCards/CardsResource.d.ts +159 -0
  98. package/types/GiftCards/Transactions.d.ts +129 -0
  99. package/types/GiftCards/TransactionsResource.d.ts +201 -0
  100. package/types/InvoiceItems.d.ts +5 -0
  101. package/types/InvoiceItemsResource.d.ts +98 -0
  102. package/types/InvoiceLineItems.d.ts +22 -0
  103. package/types/InvoicePayments.d.ts +138 -0
  104. package/types/Invoices.d.ts +116 -1
  105. package/types/InvoicesResource.d.ts +5455 -1797
  106. package/types/Issuing/CardholdersResource.d.ts +2 -1
  107. package/types/Issuing/CreditUnderwritingRecords.d.ts +446 -0
  108. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1017 -0
  109. package/types/LineItems.d.ts +7 -0
  110. package/types/Mandates.d.ts +77 -0
  111. package/types/Margins.d.ts +56 -0
  112. package/types/MarginsResource.d.ts +114 -0
  113. package/types/Orders.d.ts +1083 -0
  114. package/types/OrdersResource.d.ts +2763 -0
  115. package/types/PaymentIntents.d.ts +492 -1
  116. package/types/PaymentIntentsResource.d.ts +6992 -3461
  117. package/types/PaymentMethodConfigurations.d.ts +36 -0
  118. package/types/PaymentMethodConfigurationsResource.d.ts +50 -0
  119. package/types/PaymentMethods.d.ts +62 -0
  120. package/types/PaymentMethodsResource.d.ts +110 -0
  121. package/types/Prices.d.ts +22 -0
  122. package/types/PricesResource.d.ts +22 -0
  123. package/types/Products.d.ts +39 -0
  124. package/types/ProductsResource.d.ts +36 -0
  125. package/types/QuoteLines.d.ts +634 -0
  126. package/types/QuotePhases.d.ts +198 -0
  127. package/types/QuotePhasesResource.d.ts +67 -0
  128. package/types/QuotePreviewInvoices.d.ts +1529 -0
  129. package/types/QuotePreviewSubscriptionSchedules.d.ts +814 -0
  130. package/types/Quotes.d.ts +596 -1
  131. package/types/QuotesResource.d.ts +3174 -265
  132. package/types/SetupAttempts.d.ts +9 -0
  133. package/types/SetupIntents.d.ts +110 -1
  134. package/types/SetupIntentsResource.d.ts +498 -3
  135. package/types/Sources.d.ts +23 -0
  136. package/types/SubscriptionItems.d.ts +21 -0
  137. package/types/SubscriptionItemsResource.d.ts +109 -0
  138. package/types/SubscriptionSchedules.d.ts +200 -0
  139. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  140. package/types/Subscriptions.d.ts +82 -1
  141. package/types/SubscriptionsResource.d.ts +347 -2
  142. package/types/Tax/Associations.d.ts +126 -0
  143. package/types/Tax/AssociationsResource.d.ts +29 -0
  144. package/types/Tax/Forms.d.ts +133 -0
  145. package/types/Tax/FormsResource.d.ts +90 -0
  146. package/types/Terminal/Readers.d.ts +278 -0
  147. package/types/Terminal/ReadersResource.d.ts +208 -0
  148. package/types/TestHelpers/ConfirmationTokensResource.d.ts +55 -0
  149. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  150. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  151. package/types/Treasury/FinancialAccounts.d.ts +5 -0
  152. package/types/Treasury/FinancialAccountsResource.d.ts +10 -0
  153. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  154. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  155. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  156. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  157. package/types/WebhookEndpointsResource.d.ts +54 -0
  158. package/types/index.d.ts +69 -0
  159. package/types/lib.d.ts +12 -0
@@ -146,6 +146,11 @@ declare module 'stripe' {
146
146
  */
147
147
  items: ApiList<Stripe.SubscriptionItem>;
148
148
 
149
+ /**
150
+ * Details of the most recent price migration that failed for the subscription.
151
+ */
152
+ last_price_migration_error?: Subscription.LastPriceMigrationError | null;
153
+
149
154
  /**
150
155
  * The most recent invoice this subscription has generated.
151
156
  */
@@ -196,6 +201,11 @@ declare module 'stripe' {
196
201
  */
197
202
  pending_update: Subscription.PendingUpdate | null;
198
203
 
204
+ /**
205
+ * Time period and invoice for a Subscription billed in advance.
206
+ */
207
+ prebilling?: Subscription.Prebilling | null;
208
+
199
209
  /**
200
210
  * The schedule attached to the subscription
201
211
  */
@@ -382,6 +392,37 @@ declare module 'stripe' {
382
392
  }
383
393
  }
384
394
 
395
+ interface LastPriceMigrationError {
396
+ /**
397
+ * The time at which the price migration encountered an error.
398
+ */
399
+ errored_at: number;
400
+
401
+ /**
402
+ * The involved price pairs in each failed transition.
403
+ */
404
+ failed_transitions: Array<LastPriceMigrationError.FailedTransition>;
405
+
406
+ /**
407
+ * The type of error encountered by the price migration.
408
+ */
409
+ type: 'price_uniqueness_violation';
410
+ }
411
+
412
+ namespace LastPriceMigrationError {
413
+ interface FailedTransition {
414
+ /**
415
+ * The original price to be migrated.
416
+ */
417
+ source_price: string;
418
+
419
+ /**
420
+ * The intended resulting price of the migration.
421
+ */
422
+ target_price: string;
423
+ }
424
+ }
425
+
385
426
  interface PauseCollection {
386
427
  /**
387
428
  * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
@@ -608,6 +649,11 @@ declare module 'stripe' {
608
649
  * The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
609
650
  */
610
651
  account_subcategories?: Array<Filters.AccountSubcategory>;
652
+
653
+ /**
654
+ * The institution to use to filter for possible accounts to link.
655
+ */
656
+ institution?: string;
611
657
  }
612
658
 
613
659
  namespace Filters {
@@ -620,7 +666,11 @@ declare module 'stripe' {
620
666
  | 'payment_method'
621
667
  | 'transactions';
622
668
 
623
- type Prefetch = 'balances' | 'ownership' | 'transactions';
669
+ type Prefetch =
670
+ | 'balances'
671
+ | 'inferred_balances'
672
+ | 'ownership'
673
+ | 'transactions';
624
674
  }
625
675
 
626
676
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -689,6 +739,11 @@ declare module 'stripe' {
689
739
  */
690
740
  expires_at: number;
691
741
 
742
+ /**
743
+ * The number of iterations of prebilling to apply.
744
+ */
745
+ prebilling_iterations?: number | null;
746
+
692
747
  /**
693
748
  * List of subscription items, each with an attached plan, that will be set if the update is applied.
694
749
  */
@@ -705,6 +760,32 @@ declare module 'stripe' {
705
760
  trial_from_plan: boolean | null;
706
761
  }
707
762
 
763
+ interface Prebilling {
764
+ /**
765
+ * ID of the prebilling invoice.
766
+ */
767
+ invoice: string | Stripe.Invoice;
768
+
769
+ /**
770
+ * The end of the last period for which the invoice pre-bills.
771
+ */
772
+ period_end: number;
773
+
774
+ /**
775
+ * The start of the first period for which the invoice pre-bills.
776
+ */
777
+ period_start: number;
778
+
779
+ /**
780
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
781
+ */
782
+ update_behavior?: Prebilling.UpdateBehavior;
783
+ }
784
+
785
+ namespace Prebilling {
786
+ type UpdateBehavior = 'prebill' | 'reset';
787
+ }
788
+
708
789
  type Status =
709
790
  | 'active'
710
791
  | 'canceled'
@@ -157,6 +157,11 @@ declare module 'stripe' {
157
157
  SubscriptionCreateParams.PendingInvoiceItemInterval
158
158
  >;
159
159
 
160
+ /**
161
+ * If specified, the invoicing for the given billing cycle iterations will be processed now.
162
+ */
163
+ prebilling?: SubscriptionCreateParams.Prebilling;
164
+
160
165
  /**
161
166
  * The ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead.
162
167
  */
@@ -233,12 +238,56 @@ declare module 'stripe' {
233
238
  */
234
239
  discount?: string;
235
240
 
241
+ /**
242
+ * Details to determine how long the discount should be applied for.
243
+ */
244
+ discount_end?: Discount.DiscountEnd;
245
+
236
246
  /**
237
247
  * ID of the promotion code to create a new discount for.
238
248
  */
239
249
  promotion_code?: string;
240
250
  }
241
251
 
252
+ namespace Discount {
253
+ interface DiscountEnd {
254
+ /**
255
+ * Time span for the redeemed discount.
256
+ */
257
+ duration?: DiscountEnd.Duration;
258
+
259
+ /**
260
+ * A precise Unix timestamp for the discount to end. Must be in the future.
261
+ */
262
+ timestamp?: number;
263
+
264
+ /**
265
+ * The type of calculation made to determine when the discount ends.
266
+ */
267
+ type: DiscountEnd.Type;
268
+ }
269
+
270
+ namespace DiscountEnd {
271
+ interface Duration {
272
+ /**
273
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
274
+ */
275
+ interval: Duration.Interval;
276
+
277
+ /**
278
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
279
+ */
280
+ interval_count: number;
281
+ }
282
+
283
+ namespace Duration {
284
+ type Interval = 'day' | 'month' | 'week' | 'year';
285
+ }
286
+
287
+ type Type = 'duration' | 'timestamp';
288
+ }
289
+ }
290
+
242
291
  interface PriceData {
243
292
  /**
244
293
  * 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).
@@ -353,12 +402,56 @@ declare module 'stripe' {
353
402
  */
354
403
  discount?: string;
355
404
 
405
+ /**
406
+ * Details to determine how long the discount should be applied for.
407
+ */
408
+ discount_end?: Discount.DiscountEnd;
409
+
356
410
  /**
357
411
  * ID of the promotion code to create a new discount for.
358
412
  */
359
413
  promotion_code?: string;
360
414
  }
361
415
 
416
+ namespace Discount {
417
+ interface DiscountEnd {
418
+ /**
419
+ * Time span for the redeemed discount.
420
+ */
421
+ duration?: DiscountEnd.Duration;
422
+
423
+ /**
424
+ * A precise Unix timestamp for the discount to end. Must be in the future.
425
+ */
426
+ timestamp?: number;
427
+
428
+ /**
429
+ * The type of calculation made to determine when the discount ends.
430
+ */
431
+ type: DiscountEnd.Type;
432
+ }
433
+
434
+ namespace DiscountEnd {
435
+ interface Duration {
436
+ /**
437
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
438
+ */
439
+ interval: Duration.Interval;
440
+
441
+ /**
442
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
443
+ */
444
+ interval_count: number;
445
+ }
446
+
447
+ namespace Duration {
448
+ type Interval = 'day' | 'month' | 'week' | 'year';
449
+ }
450
+
451
+ type Type = 'duration' | 'timestamp';
452
+ }
453
+ }
454
+
362
455
  interface InvoiceSettings {
363
456
  /**
364
457
  * The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
@@ -429,6 +522,11 @@ declare module 'stripe' {
429
522
  * 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.
430
523
  */
431
524
  tax_rates?: Stripe.Emptyable<Array<string>>;
525
+
526
+ /**
527
+ * Define options to configure the trial on the subscription item.
528
+ */
529
+ trial?: Item.Trial;
432
530
  }
433
531
 
434
532
  namespace Item {
@@ -450,12 +548,56 @@ declare module 'stripe' {
450
548
  */
451
549
  discount?: string;
452
550
 
551
+ /**
552
+ * Details to determine how long the discount should be applied for.
553
+ */
554
+ discount_end?: Discount.DiscountEnd;
555
+
453
556
  /**
454
557
  * ID of the promotion code to create a new discount for.
455
558
  */
456
559
  promotion_code?: string;
457
560
  }
458
561
 
562
+ namespace Discount {
563
+ interface DiscountEnd {
564
+ /**
565
+ * Time span for the redeemed discount.
566
+ */
567
+ duration?: DiscountEnd.Duration;
568
+
569
+ /**
570
+ * A precise Unix timestamp for the discount to end. Must be in the future.
571
+ */
572
+ timestamp?: number;
573
+
574
+ /**
575
+ * The type of calculation made to determine when the discount ends.
576
+ */
577
+ type: DiscountEnd.Type;
578
+ }
579
+
580
+ namespace DiscountEnd {
581
+ interface Duration {
582
+ /**
583
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
584
+ */
585
+ interval: Duration.Interval;
586
+
587
+ /**
588
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
589
+ */
590
+ interval_count: number;
591
+ }
592
+
593
+ namespace Duration {
594
+ type Interval = 'day' | 'month' | 'week' | 'year';
595
+ }
596
+
597
+ type Type = 'duration' | 'timestamp';
598
+ }
599
+ }
600
+
459
601
  interface PriceData {
460
602
  /**
461
603
  * 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).
@@ -507,6 +649,22 @@ declare module 'stripe' {
507
649
 
508
650
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
509
651
  }
652
+
653
+ interface Trial {
654
+ /**
655
+ * 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.
656
+ */
657
+ converts_to?: Array<string>;
658
+
659
+ /**
660
+ * Determines the type of trial for this item.
661
+ */
662
+ type: Trial.Type;
663
+ }
664
+
665
+ namespace Trial {
666
+ type Type = 'free' | 'paid';
667
+ }
510
668
  }
511
669
 
512
670
  type PaymentBehavior =
@@ -745,6 +903,11 @@ declare module 'stripe' {
745
903
  * The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
746
904
  */
747
905
  account_subcategories?: Array<Filters.AccountSubcategory>;
906
+
907
+ /**
908
+ * ID of the institution to use to filter for selectable accounts.
909
+ */
910
+ institution?: string;
748
911
  }
749
912
 
750
913
  namespace Filters {
@@ -757,7 +920,11 @@ declare module 'stripe' {
757
920
  | 'payment_method'
758
921
  | 'transactions';
759
922
 
760
- type Prefetch = 'balances' | 'ownership' | 'transactions';
923
+ type Prefetch =
924
+ | 'balances'
925
+ | 'inferred_balances'
926
+ | 'ownership'
927
+ | 'transactions';
761
928
  }
762
929
 
763
930
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -815,6 +982,22 @@ declare module 'stripe' {
815
982
  type Interval = 'day' | 'month' | 'week' | 'year';
816
983
  }
817
984
 
985
+ interface Prebilling {
986
+ /**
987
+ * This is used to determine the number of billing cycles to prebill.
988
+ */
989
+ iterations: number;
990
+
991
+ /**
992
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
993
+ */
994
+ update_behavior?: Prebilling.UpdateBehavior;
995
+ }
996
+
997
+ namespace Prebilling {
998
+ type UpdateBehavior = 'prebill' | 'reset';
999
+ }
1000
+
818
1001
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
819
1002
 
820
1003
  interface TransferData {
@@ -1000,6 +1183,11 @@ declare module 'stripe' {
1000
1183
  SubscriptionUpdateParams.PendingInvoiceItemInterval
1001
1184
  >;
1002
1185
 
1186
+ /**
1187
+ * If specified, the invoicing for the given billing cycle iterations will be processed now.
1188
+ */
1189
+ prebilling?: SubscriptionUpdateParams.Prebilling;
1190
+
1003
1191
  /**
1004
1192
  * The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription.
1005
1193
  */
@@ -1076,12 +1264,56 @@ declare module 'stripe' {
1076
1264
  */
1077
1265
  discount?: string;
1078
1266
 
1267
+ /**
1268
+ * Details to determine how long the discount should be applied for.
1269
+ */
1270
+ discount_end?: Discount.DiscountEnd;
1271
+
1079
1272
  /**
1080
1273
  * ID of the promotion code to create a new discount for.
1081
1274
  */
1082
1275
  promotion_code?: string;
1083
1276
  }
1084
1277
 
1278
+ namespace Discount {
1279
+ interface DiscountEnd {
1280
+ /**
1281
+ * Time span for the redeemed discount.
1282
+ */
1283
+ duration?: DiscountEnd.Duration;
1284
+
1285
+ /**
1286
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1287
+ */
1288
+ timestamp?: number;
1289
+
1290
+ /**
1291
+ * The type of calculation made to determine when the discount ends.
1292
+ */
1293
+ type: DiscountEnd.Type;
1294
+ }
1295
+
1296
+ namespace DiscountEnd {
1297
+ interface Duration {
1298
+ /**
1299
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1300
+ */
1301
+ interval: Duration.Interval;
1302
+
1303
+ /**
1304
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1305
+ */
1306
+ interval_count: number;
1307
+ }
1308
+
1309
+ namespace Duration {
1310
+ type Interval = 'day' | 'month' | 'week' | 'year';
1311
+ }
1312
+
1313
+ type Type = 'duration' | 'timestamp';
1314
+ }
1315
+ }
1316
+
1085
1317
  interface PriceData {
1086
1318
  /**
1087
1319
  * 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).
@@ -1195,12 +1427,56 @@ declare module 'stripe' {
1195
1427
  */
1196
1428
  discount?: string;
1197
1429
 
1430
+ /**
1431
+ * Details to determine how long the discount should be applied for.
1432
+ */
1433
+ discount_end?: Discount.DiscountEnd;
1434
+
1198
1435
  /**
1199
1436
  * ID of the promotion code to create a new discount for.
1200
1437
  */
1201
1438
  promotion_code?: string;
1202
1439
  }
1203
1440
 
1441
+ namespace Discount {
1442
+ interface DiscountEnd {
1443
+ /**
1444
+ * Time span for the redeemed discount.
1445
+ */
1446
+ duration?: DiscountEnd.Duration;
1447
+
1448
+ /**
1449
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1450
+ */
1451
+ timestamp?: number;
1452
+
1453
+ /**
1454
+ * The type of calculation made to determine when the discount ends.
1455
+ */
1456
+ type: DiscountEnd.Type;
1457
+ }
1458
+
1459
+ namespace DiscountEnd {
1460
+ interface Duration {
1461
+ /**
1462
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1463
+ */
1464
+ interval: Duration.Interval;
1465
+
1466
+ /**
1467
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1468
+ */
1469
+ interval_count: number;
1470
+ }
1471
+
1472
+ namespace Duration {
1473
+ type Interval = 'day' | 'month' | 'week' | 'year';
1474
+ }
1475
+
1476
+ type Type = 'duration' | 'timestamp';
1477
+ }
1478
+ }
1479
+
1204
1480
  interface InvoiceSettings {
1205
1481
  /**
1206
1482
  * The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
@@ -1307,12 +1583,56 @@ declare module 'stripe' {
1307
1583
  */
1308
1584
  discount?: string;
1309
1585
 
1586
+ /**
1587
+ * Details to determine how long the discount should be applied for.
1588
+ */
1589
+ discount_end?: Discount.DiscountEnd;
1590
+
1310
1591
  /**
1311
1592
  * ID of the promotion code to create a new discount for.
1312
1593
  */
1313
1594
  promotion_code?: string;
1314
1595
  }
1315
1596
 
1597
+ namespace Discount {
1598
+ interface DiscountEnd {
1599
+ /**
1600
+ * Time span for the redeemed discount.
1601
+ */
1602
+ duration?: DiscountEnd.Duration;
1603
+
1604
+ /**
1605
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1606
+ */
1607
+ timestamp?: number;
1608
+
1609
+ /**
1610
+ * The type of calculation made to determine when the discount ends.
1611
+ */
1612
+ type: DiscountEnd.Type;
1613
+ }
1614
+
1615
+ namespace DiscountEnd {
1616
+ interface Duration {
1617
+ /**
1618
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1619
+ */
1620
+ interval: Duration.Interval;
1621
+
1622
+ /**
1623
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1624
+ */
1625
+ interval_count: number;
1626
+ }
1627
+
1628
+ namespace Duration {
1629
+ type Interval = 'day' | 'month' | 'week' | 'year';
1630
+ }
1631
+
1632
+ type Type = 'duration' | 'timestamp';
1633
+ }
1634
+ }
1635
+
1316
1636
  interface PriceData {
1317
1637
  /**
1318
1638
  * 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,6 +1938,11 @@ declare module 'stripe' {
1618
1938
  * The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1619
1939
  */
1620
1940
  account_subcategories?: Array<Filters.AccountSubcategory>;
1941
+
1942
+ /**
1943
+ * ID of the institution to use to filter for selectable accounts.
1944
+ */
1945
+ institution?: string;
1621
1946
  }
1622
1947
 
1623
1948
  namespace Filters {
@@ -1630,7 +1955,11 @@ declare module 'stripe' {
1630
1955
  | 'payment_method'
1631
1956
  | 'transactions';
1632
1957
 
1633
- type Prefetch = 'balances' | 'ownership' | 'transactions';
1958
+ type Prefetch =
1959
+ | 'balances'
1960
+ | 'inferred_balances'
1961
+ | 'ownership'
1962
+ | 'transactions';
1634
1963
  }
1635
1964
 
1636
1965
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -1688,6 +2017,22 @@ declare module 'stripe' {
1688
2017
  type Interval = 'day' | 'month' | 'week' | 'year';
1689
2018
  }
1690
2019
 
2020
+ interface Prebilling {
2021
+ /**
2022
+ * This is used to determine the number of billing cycles to prebill.
2023
+ */
2024
+ iterations: number;
2025
+
2026
+ /**
2027
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2028
+ */
2029
+ update_behavior?: Prebilling.UpdateBehavior;
2030
+ }
2031
+
2032
+ namespace Prebilling {
2033
+ type UpdateBehavior = 'prebill' | 'reset';
2034
+ }
2035
+
1691
2036
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
1692
2037
 
1693
2038
  interface TransferData {