stripe 16.7.0 → 16.8.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 (161) hide show
  1. package/CHANGELOG.md +799 -110
  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/Capital/FinancingOffers.js +21 -0
  10. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  11. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  12. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  13. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  14. package/cjs/resources/GiftCards/Cards.js +23 -0
  15. package/cjs/resources/GiftCards/Transactions.js +33 -0
  16. package/cjs/resources/Invoices.js +17 -0
  17. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  18. package/cjs/resources/Margins.js +22 -0
  19. package/cjs/resources/OAuth.js +1 -1
  20. package/cjs/resources/Orders.js +24 -0
  21. package/cjs/resources/PaymentIntents.js +4 -0
  22. package/cjs/resources/QuotePhases.js +22 -0
  23. package/cjs/resources/Quotes.js +32 -0
  24. package/cjs/resources/SubscriptionSchedules.js +4 -0
  25. package/cjs/resources/Tax/Associations.js +9 -0
  26. package/cjs/resources/Tax/Forms.js +20 -0
  27. package/cjs/resources/Terminal/Readers.js +12 -0
  28. package/cjs/resources.js +40 -10
  29. package/cjs/stripe.core.js +6 -3
  30. package/cjs/utils.js +30 -3
  31. package/esm/RequestSender.js +67 -6
  32. package/esm/StripeResource.js +2 -2
  33. package/esm/apiVersion.js +1 -0
  34. package/esm/multipart.js +2 -2
  35. package/esm/resources/AccountNotices.js +18 -0
  36. package/esm/resources/Capital/FinancingOffers.js +18 -0
  37. package/esm/resources/Capital/FinancingSummary.js +9 -0
  38. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  39. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  40. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  41. package/esm/resources/GiftCards/Cards.js +20 -0
  42. package/esm/resources/GiftCards/Transactions.js +30 -0
  43. package/esm/resources/Invoices.js +17 -0
  44. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  45. package/esm/resources/Margins.js +19 -0
  46. package/esm/resources/OAuth.js +2 -2
  47. package/esm/resources/Orders.js +21 -0
  48. package/esm/resources/PaymentIntents.js +4 -0
  49. package/esm/resources/QuotePhases.js +19 -0
  50. package/esm/resources/Quotes.js +32 -0
  51. package/esm/resources/SubscriptionSchedules.js +4 -0
  52. package/esm/resources/Tax/Associations.js +6 -0
  53. package/esm/resources/Tax/Forms.js +17 -0
  54. package/esm/resources/Terminal/Readers.js +12 -0
  55. package/esm/resources.js +26 -0
  56. package/esm/stripe.core.js +6 -3
  57. package/esm/utils.js +27 -1
  58. package/package.json +1 -1
  59. package/types/AccountLinksResource.d.ts +5 -1
  60. package/types/AccountNotices.d.ts +113 -0
  61. package/types/AccountNoticesResource.d.ts +98 -0
  62. package/types/AccountSessions.d.ts +45 -0
  63. package/types/AccountSessionsResource.d.ts +215 -0
  64. package/types/Accounts.d.ts +106 -1
  65. package/types/AccountsResource.d.ts +247 -1
  66. package/types/Capital/FinancingOffers.d.ts +188 -0
  67. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  68. package/types/Capital/FinancingSummary.d.ts +106 -0
  69. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  70. package/types/Capital/FinancingTransactions.d.ts +135 -0
  71. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  72. package/types/Charges.d.ts +72 -0
  73. package/types/ChargesResource.d.ts +1294 -0
  74. package/types/Checkout/Sessions.d.ts +116 -4
  75. package/types/Checkout/SessionsResource.d.ts +111 -5
  76. package/types/ConfirmationTokens.d.ts +62 -0
  77. package/types/Coupons.d.ts +1 -1
  78. package/types/CouponsResource.d.ts +1 -1
  79. package/types/CreditNotes.d.ts +21 -0
  80. package/types/CreditNotesResource.d.ts +51 -0
  81. package/types/CustomersResource.d.ts +2 -0
  82. package/types/Disputes.d.ts +158 -0
  83. package/types/DisputesResource.d.ts +120 -0
  84. package/types/EventTypes.d.ts +460 -0
  85. package/types/Events.d.ts +85 -0
  86. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  87. package/types/FinancialConnections/Accounts.d.ts +29 -1
  88. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  89. package/types/FinancialConnections/Institutions.d.ts +93 -0
  90. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  91. package/types/FinancialConnections/Sessions.d.ts +49 -1
  92. package/types/FinancialConnections/SessionsResource.d.ts +38 -1
  93. package/types/GiftCards/Cards.d.ts +118 -0
  94. package/types/GiftCards/CardsResource.d.ts +159 -0
  95. package/types/GiftCards/Transactions.d.ts +129 -0
  96. package/types/GiftCards/TransactionsResource.d.ts +201 -0
  97. package/types/InvoiceItems.d.ts +5 -0
  98. package/types/InvoiceItemsResource.d.ts +98 -0
  99. package/types/InvoiceLineItems.d.ts +22 -0
  100. package/types/InvoicePayments.d.ts +138 -0
  101. package/types/Invoices.d.ts +116 -1
  102. package/types/InvoicesResource.d.ts +5455 -1797
  103. package/types/Issuing/CardholdersResource.d.ts +2 -1
  104. package/types/Issuing/CreditUnderwritingRecords.d.ts +446 -0
  105. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1017 -0
  106. package/types/LineItems.d.ts +7 -0
  107. package/types/Mandates.d.ts +77 -0
  108. package/types/Margins.d.ts +56 -0
  109. package/types/MarginsResource.d.ts +114 -0
  110. package/types/Orders.d.ts +1083 -0
  111. package/types/OrdersResource.d.ts +2763 -0
  112. package/types/PaymentIntents.d.ts +491 -1
  113. package/types/PaymentIntentsResource.d.ts +7001 -3464
  114. package/types/PaymentLinks.d.ts +1 -0
  115. package/types/PaymentLinksResource.d.ts +2 -0
  116. package/types/PaymentMethodConfigurations.d.ts +36 -0
  117. package/types/PaymentMethodConfigurationsResource.d.ts +50 -0
  118. package/types/PaymentMethods.d.ts +62 -0
  119. package/types/PaymentMethodsResource.d.ts +110 -0
  120. package/types/Prices.d.ts +22 -0
  121. package/types/PricesResource.d.ts +22 -0
  122. package/types/Products.d.ts +39 -0
  123. package/types/ProductsResource.d.ts +36 -0
  124. package/types/QuoteLines.d.ts +634 -0
  125. package/types/QuotePhases.d.ts +198 -0
  126. package/types/QuotePhasesResource.d.ts +67 -0
  127. package/types/QuotePreviewInvoices.d.ts +1530 -0
  128. package/types/QuotePreviewSubscriptionSchedules.d.ts +814 -0
  129. package/types/Quotes.d.ts +596 -1
  130. package/types/QuotesResource.d.ts +3174 -265
  131. package/types/SetupAttempts.d.ts +9 -0
  132. package/types/SetupIntents.d.ts +120 -1
  133. package/types/SetupIntentsResource.d.ts +546 -3
  134. package/types/Sources.d.ts +23 -0
  135. package/types/SubscriptionItems.d.ts +21 -0
  136. package/types/SubscriptionItemsResource.d.ts +109 -0
  137. package/types/SubscriptionSchedules.d.ts +200 -0
  138. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  139. package/types/Subscriptions.d.ts +82 -1
  140. package/types/SubscriptionsResource.d.ts +347 -2
  141. package/types/Tax/Associations.d.ts +126 -0
  142. package/types/Tax/AssociationsResource.d.ts +29 -0
  143. package/types/Tax/Forms.d.ts +133 -0
  144. package/types/Tax/FormsResource.d.ts +90 -0
  145. package/types/Terminal/Readers.d.ts +278 -0
  146. package/types/Terminal/ReadersResource.d.ts +208 -0
  147. package/types/TestHelpers/ConfirmationTokensResource.d.ts +55 -0
  148. package/types/TestHelpers/Treasury/OutboundPaymentsResource.d.ts +5 -0
  149. package/types/TestHelpers/Treasury/OutboundTransfersResource.d.ts +5 -0
  150. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  151. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  152. package/types/Treasury/FinancialAccounts.d.ts +5 -0
  153. package/types/Treasury/FinancialAccountsResource.d.ts +10 -0
  154. package/types/Treasury/OutboundPayments.d.ts +6 -1
  155. package/types/Treasury/OutboundTransfers.d.ts +32 -1
  156. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  157. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  158. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  159. package/types/WebhookEndpointsResource.d.ts +54 -0
  160. package/types/index.d.ts +67 -0
  161. 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`.
@@ -609,6 +650,11 @@ declare module 'stripe' {
609
650
  * The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
610
651
  */
611
652
  account_subcategories?: Array<Filters.AccountSubcategory>;
653
+
654
+ /**
655
+ * The institution to use to filter for possible accounts to link.
656
+ */
657
+ institution?: string;
612
658
  }
613
659
 
614
660
  namespace Filters {
@@ -621,7 +667,11 @@ declare module 'stripe' {
621
667
  | 'payment_method'
622
668
  | 'transactions';
623
669
 
624
- type Prefetch = 'balances' | 'ownership' | 'transactions';
670
+ type Prefetch =
671
+ | 'balances'
672
+ | 'inferred_balances'
673
+ | 'ownership'
674
+ | 'transactions';
625
675
  }
626
676
 
627
677
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -690,6 +740,11 @@ declare module 'stripe' {
690
740
  */
691
741
  expires_at: number;
692
742
 
743
+ /**
744
+ * The number of iterations of prebilling to apply.
745
+ */
746
+ prebilling_iterations?: number | null;
747
+
693
748
  /**
694
749
  * List of subscription items, each with an attached plan, that will be set if the update is applied.
695
750
  */
@@ -706,6 +761,32 @@ declare module 'stripe' {
706
761
  trial_from_plan: boolean | null;
707
762
  }
708
763
 
764
+ interface Prebilling {
765
+ /**
766
+ * ID of the prebilling invoice.
767
+ */
768
+ invoice: string | Stripe.Invoice;
769
+
770
+ /**
771
+ * The end of the last period for which the invoice pre-bills.
772
+ */
773
+ period_end: number;
774
+
775
+ /**
776
+ * The start of the first period for which the invoice pre-bills.
777
+ */
778
+ period_start: number;
779
+
780
+ /**
781
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
782
+ */
783
+ update_behavior?: Prebilling.UpdateBehavior;
784
+ }
785
+
786
+ namespace Prebilling {
787
+ type UpdateBehavior = 'prebill' | 'reset';
788
+ }
789
+
709
790
  type Status =
710
791
  | 'active'
711
792
  | '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 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 =
@@ -746,6 +904,11 @@ declare module 'stripe' {
746
904
  * The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
747
905
  */
748
906
  account_subcategories?: Array<Filters.AccountSubcategory>;
907
+
908
+ /**
909
+ * ID of the institution to use to filter for selectable accounts.
910
+ */
911
+ institution?: string;
749
912
  }
750
913
 
751
914
  namespace Filters {
@@ -758,7 +921,11 @@ declare module 'stripe' {
758
921
  | 'payment_method'
759
922
  | 'transactions';
760
923
 
761
- type Prefetch = 'balances' | 'ownership' | 'transactions';
924
+ type Prefetch =
925
+ | 'balances'
926
+ | 'inferred_balances'
927
+ | 'ownership'
928
+ | 'transactions';
762
929
  }
763
930
 
764
931
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -816,6 +983,22 @@ declare module 'stripe' {
816
983
  type Interval = 'day' | 'month' | 'week' | 'year';
817
984
  }
818
985
 
986
+ interface Prebilling {
987
+ /**
988
+ * This is used to determine the number of billing cycles to prebill.
989
+ */
990
+ iterations: number;
991
+
992
+ /**
993
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
994
+ */
995
+ update_behavior?: Prebilling.UpdateBehavior;
996
+ }
997
+
998
+ namespace Prebilling {
999
+ type UpdateBehavior = 'prebill' | 'reset';
1000
+ }
1001
+
819
1002
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
820
1003
 
821
1004
  interface TransferData {
@@ -1001,6 +1184,11 @@ declare module 'stripe' {
1001
1184
  SubscriptionUpdateParams.PendingInvoiceItemInterval
1002
1185
  >;
1003
1186
 
1187
+ /**
1188
+ * If specified, the invoicing for the given billing cycle iterations will be processed now.
1189
+ */
1190
+ prebilling?: SubscriptionUpdateParams.Prebilling;
1191
+
1004
1192
  /**
1005
1193
  * The 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.
1006
1194
  */
@@ -1077,12 +1265,56 @@ declare module 'stripe' {
1077
1265
  */
1078
1266
  discount?: string;
1079
1267
 
1268
+ /**
1269
+ * Details to determine how long the discount should be applied for.
1270
+ */
1271
+ discount_end?: Discount.DiscountEnd;
1272
+
1080
1273
  /**
1081
1274
  * ID of the promotion code to create a new discount for.
1082
1275
  */
1083
1276
  promotion_code?: string;
1084
1277
  }
1085
1278
 
1279
+ namespace Discount {
1280
+ interface DiscountEnd {
1281
+ /**
1282
+ * Time span for the redeemed discount.
1283
+ */
1284
+ duration?: DiscountEnd.Duration;
1285
+
1286
+ /**
1287
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1288
+ */
1289
+ timestamp?: number;
1290
+
1291
+ /**
1292
+ * The type of calculation made to determine when the discount ends.
1293
+ */
1294
+ type: DiscountEnd.Type;
1295
+ }
1296
+
1297
+ namespace DiscountEnd {
1298
+ interface Duration {
1299
+ /**
1300
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1301
+ */
1302
+ interval: Duration.Interval;
1303
+
1304
+ /**
1305
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1306
+ */
1307
+ interval_count: number;
1308
+ }
1309
+
1310
+ namespace Duration {
1311
+ type Interval = 'day' | 'month' | 'week' | 'year';
1312
+ }
1313
+
1314
+ type Type = 'duration' | 'timestamp';
1315
+ }
1316
+ }
1317
+
1086
1318
  interface PriceData {
1087
1319
  /**
1088
1320
  * 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).
@@ -1196,12 +1428,56 @@ declare module 'stripe' {
1196
1428
  */
1197
1429
  discount?: string;
1198
1430
 
1431
+ /**
1432
+ * Details to determine how long the discount should be applied for.
1433
+ */
1434
+ discount_end?: Discount.DiscountEnd;
1435
+
1199
1436
  /**
1200
1437
  * ID of the promotion code to create a new discount for.
1201
1438
  */
1202
1439
  promotion_code?: string;
1203
1440
  }
1204
1441
 
1442
+ namespace Discount {
1443
+ interface DiscountEnd {
1444
+ /**
1445
+ * Time span for the redeemed discount.
1446
+ */
1447
+ duration?: DiscountEnd.Duration;
1448
+
1449
+ /**
1450
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1451
+ */
1452
+ timestamp?: number;
1453
+
1454
+ /**
1455
+ * The type of calculation made to determine when the discount ends.
1456
+ */
1457
+ type: DiscountEnd.Type;
1458
+ }
1459
+
1460
+ namespace DiscountEnd {
1461
+ interface Duration {
1462
+ /**
1463
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1464
+ */
1465
+ interval: Duration.Interval;
1466
+
1467
+ /**
1468
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1469
+ */
1470
+ interval_count: number;
1471
+ }
1472
+
1473
+ namespace Duration {
1474
+ type Interval = 'day' | 'month' | 'week' | 'year';
1475
+ }
1476
+
1477
+ type Type = 'duration' | 'timestamp';
1478
+ }
1479
+ }
1480
+
1205
1481
  interface InvoiceSettings {
1206
1482
  /**
1207
1483
  * The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
@@ -1308,12 +1584,56 @@ declare module 'stripe' {
1308
1584
  */
1309
1585
  discount?: string;
1310
1586
 
1587
+ /**
1588
+ * Details to determine how long the discount should be applied for.
1589
+ */
1590
+ discount_end?: Discount.DiscountEnd;
1591
+
1311
1592
  /**
1312
1593
  * ID of the promotion code to create a new discount for.
1313
1594
  */
1314
1595
  promotion_code?: string;
1315
1596
  }
1316
1597
 
1598
+ namespace Discount {
1599
+ interface DiscountEnd {
1600
+ /**
1601
+ * Time span for the redeemed discount.
1602
+ */
1603
+ duration?: DiscountEnd.Duration;
1604
+
1605
+ /**
1606
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1607
+ */
1608
+ timestamp?: number;
1609
+
1610
+ /**
1611
+ * The type of calculation made to determine when the discount ends.
1612
+ */
1613
+ type: DiscountEnd.Type;
1614
+ }
1615
+
1616
+ namespace DiscountEnd {
1617
+ interface Duration {
1618
+ /**
1619
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1620
+ */
1621
+ interval: Duration.Interval;
1622
+
1623
+ /**
1624
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1625
+ */
1626
+ interval_count: number;
1627
+ }
1628
+
1629
+ namespace Duration {
1630
+ type Interval = 'day' | 'month' | 'week' | 'year';
1631
+ }
1632
+
1633
+ type Type = 'duration' | 'timestamp';
1634
+ }
1635
+ }
1636
+
1317
1637
  interface PriceData {
1318
1638
  /**
1319
1639
  * 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).
@@ -1620,6 +1940,11 @@ declare module 'stripe' {
1620
1940
  * The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1621
1941
  */
1622
1942
  account_subcategories?: Array<Filters.AccountSubcategory>;
1943
+
1944
+ /**
1945
+ * ID of the institution to use to filter for selectable accounts.
1946
+ */
1947
+ institution?: string;
1623
1948
  }
1624
1949
 
1625
1950
  namespace Filters {
@@ -1632,7 +1957,11 @@ declare module 'stripe' {
1632
1957
  | 'payment_method'
1633
1958
  | 'transactions';
1634
1959
 
1635
- type Prefetch = 'balances' | 'ownership' | 'transactions';
1960
+ type Prefetch =
1961
+ | 'balances'
1962
+ | 'inferred_balances'
1963
+ | 'ownership'
1964
+ | 'transactions';
1636
1965
  }
1637
1966
 
1638
1967
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -1690,6 +2019,22 @@ declare module 'stripe' {
1690
2019
  type Interval = 'day' | 'month' | 'week' | 'year';
1691
2020
  }
1692
2021
 
2022
+ interface Prebilling {
2023
+ /**
2024
+ * This is used to determine the number of billing cycles to prebill.
2025
+ */
2026
+ iterations: number;
2027
+
2028
+ /**
2029
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2030
+ */
2031
+ update_behavior?: Prebilling.UpdateBehavior;
2032
+ }
2033
+
2034
+ namespace Prebilling {
2035
+ type UpdateBehavior = 'prebill' | 'reset';
2036
+ }
2037
+
1693
2038
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
1694
2039
 
1695
2040
  interface TransferData {