stripe 16.2.0 → 16.3.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 (152) hide show
  1. package/CHANGELOG.md +761 -114
  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 +13 -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/Forms.js +20 -0
  26. package/cjs/resources/Terminal/Readers.js +12 -0
  27. package/cjs/resources.js +38 -10
  28. package/cjs/stripe.core.js +6 -3
  29. package/cjs/utils.js +30 -3
  30. package/esm/RequestSender.js +67 -6
  31. package/esm/StripeResource.js +2 -2
  32. package/esm/apiVersion.js +1 -0
  33. package/esm/multipart.js +2 -2
  34. package/esm/resources/AccountNotices.js +18 -0
  35. package/esm/resources/Capital/FinancingOffers.js +18 -0
  36. package/esm/resources/Capital/FinancingSummary.js +9 -0
  37. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  38. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  39. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  40. package/esm/resources/GiftCards/Cards.js +20 -0
  41. package/esm/resources/GiftCards/Transactions.js +30 -0
  42. package/esm/resources/Invoices.js +13 -0
  43. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  44. package/esm/resources/Margins.js +19 -0
  45. package/esm/resources/OAuth.js +2 -2
  46. package/esm/resources/Orders.js +21 -0
  47. package/esm/resources/PaymentIntents.js +4 -0
  48. package/esm/resources/QuotePhases.js +19 -0
  49. package/esm/resources/Quotes.js +32 -0
  50. package/esm/resources/SubscriptionSchedules.js +4 -0
  51. package/esm/resources/Tax/Forms.js +17 -0
  52. package/esm/resources/Terminal/Readers.js +12 -0
  53. package/esm/resources.js +24 -0
  54. package/esm/stripe.core.js +6 -3
  55. package/esm/utils.js +27 -1
  56. package/package.json +1 -1
  57. package/types/AccountLinksResource.d.ts +5 -1
  58. package/types/AccountNotices.d.ts +110 -0
  59. package/types/AccountNoticesResource.d.ts +98 -0
  60. package/types/AccountSessions.d.ts +15 -0
  61. package/types/AccountSessionsResource.d.ts +205 -0
  62. package/types/Accounts.d.ts +88 -1
  63. package/types/AccountsResource.d.ts +204 -0
  64. package/types/Capital/FinancingOffers.d.ts +188 -0
  65. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  66. package/types/Capital/FinancingSummary.d.ts +106 -0
  67. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  68. package/types/Capital/FinancingTransactions.d.ts +135 -0
  69. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  70. package/types/Charges.d.ts +67 -0
  71. package/types/ChargesResource.d.ts +1294 -0
  72. package/types/Checkout/Sessions.d.ts +28 -1
  73. package/types/Checkout/SessionsResource.d.ts +15 -1
  74. package/types/ConfirmationTokens.d.ts +83 -0
  75. package/types/Coupons.d.ts +1 -1
  76. package/types/CouponsResource.d.ts +1 -1
  77. package/types/CreditNotes.d.ts +21 -0
  78. package/types/CreditNotesResource.d.ts +51 -0
  79. package/types/CustomerSessions.d.ts +76 -0
  80. package/types/CustomerSessionsResource.d.ts +76 -0
  81. package/types/CustomersResource.d.ts +2 -0
  82. package/types/Disputes.d.ts +167 -0
  83. package/types/DisputesResource.d.ts +120 -0
  84. package/types/EventTypes.d.ts +426 -0
  85. package/types/Events.d.ts +83 -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 +91 -0
  101. package/types/Invoices.d.ts +116 -1
  102. package/types/InvoicesResource.d.ts +5395 -1818
  103. package/types/Issuing/CardholdersResource.d.ts +2 -1
  104. package/types/Issuing/Cards.d.ts +34 -0
  105. package/types/Issuing/CardsResource.d.ts +125 -0
  106. package/types/Issuing/CreditUnderwritingRecords.d.ts +446 -0
  107. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1017 -0
  108. package/types/LineItems.d.ts +7 -0
  109. package/types/Mandates.d.ts +77 -0
  110. package/types/Margins.d.ts +56 -0
  111. package/types/MarginsResource.d.ts +114 -0
  112. package/types/Orders.d.ts +1057 -0
  113. package/types/OrdersResource.d.ts +2711 -0
  114. package/types/PaymentIntents.d.ts +469 -1
  115. package/types/PaymentIntentsResource.d.ts +6721 -3373
  116. package/types/PaymentMethods.d.ts +62 -0
  117. package/types/PaymentMethodsResource.d.ts +110 -0
  118. package/types/Prices.d.ts +22 -0
  119. package/types/PricesResource.d.ts +22 -0
  120. package/types/Products.d.ts +39 -0
  121. package/types/ProductsResource.d.ts +36 -0
  122. package/types/QuoteLines.d.ts +634 -0
  123. package/types/QuotePhases.d.ts +198 -0
  124. package/types/QuotePhasesResource.d.ts +67 -0
  125. package/types/QuotePreviewInvoices.d.ts +1535 -0
  126. package/types/QuotePreviewSubscriptionSchedules.d.ts +778 -0
  127. package/types/Quotes.d.ts +578 -1
  128. package/types/QuotesResource.d.ts +3174 -265
  129. package/types/SetupAttempts.d.ts +9 -0
  130. package/types/SetupIntents.d.ts +110 -1
  131. package/types/SetupIntentsResource.d.ts +498 -3
  132. package/types/Sources.d.ts +23 -0
  133. package/types/SubscriptionItems.d.ts +21 -0
  134. package/types/SubscriptionItemsResource.d.ts +109 -0
  135. package/types/SubscriptionSchedules.d.ts +164 -0
  136. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  137. package/types/Subscriptions.d.ts +46 -1
  138. package/types/SubscriptionsResource.d.ts +347 -2
  139. package/types/Tax/Forms.d.ts +133 -0
  140. package/types/Tax/FormsResource.d.ts +90 -0
  141. package/types/Terminal/Readers.d.ts +278 -0
  142. package/types/Terminal/ReadersResource.d.ts +208 -0
  143. package/types/TestHelpers/ConfirmationTokensResource.d.ts +55 -0
  144. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  145. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  146. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  147. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  148. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  149. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  150. package/types/WebhookEndpointsResource.d.ts +50 -0
  151. package/types/index.d.ts +64 -0
  152. package/types/lib.d.ts +12 -0
@@ -196,6 +196,11 @@ declare module 'stripe' {
196
196
  */
197
197
  pending_update: Subscription.PendingUpdate | null;
198
198
 
199
+ /**
200
+ * Time period and invoice for a Subscription billed in advance.
201
+ */
202
+ prebilling?: Subscription.Prebilling | null;
203
+
199
204
  /**
200
205
  * The schedule attached to the subscription
201
206
  */
@@ -608,6 +613,11 @@ declare module 'stripe' {
608
613
  * The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
609
614
  */
610
615
  account_subcategories?: Array<Filters.AccountSubcategory>;
616
+
617
+ /**
618
+ * The institution to use to filter for possible accounts to link.
619
+ */
620
+ institution?: string;
611
621
  }
612
622
 
613
623
  namespace Filters {
@@ -620,7 +630,11 @@ declare module 'stripe' {
620
630
  | 'payment_method'
621
631
  | 'transactions';
622
632
 
623
- type Prefetch = 'balances' | 'ownership' | 'transactions';
633
+ type Prefetch =
634
+ | 'balances'
635
+ | 'inferred_balances'
636
+ | 'ownership'
637
+ | 'transactions';
624
638
  }
625
639
 
626
640
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -688,6 +702,11 @@ declare module 'stripe' {
688
702
  */
689
703
  expires_at: number;
690
704
 
705
+ /**
706
+ * The number of iterations of prebilling to apply.
707
+ */
708
+ prebilling_iterations?: number | null;
709
+
691
710
  /**
692
711
  * List of subscription items, each with an attached plan, that will be set if the update is applied.
693
712
  */
@@ -704,6 +723,32 @@ declare module 'stripe' {
704
723
  trial_from_plan: boolean | null;
705
724
  }
706
725
 
726
+ interface Prebilling {
727
+ /**
728
+ * ID of the prebilling invoice.
729
+ */
730
+ invoice: string | Stripe.Invoice;
731
+
732
+ /**
733
+ * The end of the last period for which the invoice pre-bills.
734
+ */
735
+ period_end: number;
736
+
737
+ /**
738
+ * The start of the first period for which the invoice pre-bills.
739
+ */
740
+ period_start: number;
741
+
742
+ /**
743
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
744
+ */
745
+ update_behavior?: Prebilling.UpdateBehavior;
746
+ }
747
+
748
+ namespace Prebilling {
749
+ type UpdateBehavior = 'prebill' | 'reset';
750
+ }
751
+
707
752
  type Status =
708
753
  | 'active'
709
754
  | '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';
@@ -814,6 +981,22 @@ declare module 'stripe' {
814
981
  type Interval = 'day' | 'month' | 'week' | 'year';
815
982
  }
816
983
 
984
+ interface Prebilling {
985
+ /**
986
+ * This is used to determine the number of billing cycles to prebill.
987
+ */
988
+ iterations: number;
989
+
990
+ /**
991
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
992
+ */
993
+ update_behavior?: Prebilling.UpdateBehavior;
994
+ }
995
+
996
+ namespace Prebilling {
997
+ type UpdateBehavior = 'prebill' | 'reset';
998
+ }
999
+
817
1000
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
818
1001
 
819
1002
  interface TransferData {
@@ -999,6 +1182,11 @@ declare module 'stripe' {
999
1182
  SubscriptionUpdateParams.PendingInvoiceItemInterval
1000
1183
  >;
1001
1184
 
1185
+ /**
1186
+ * If specified, the invoicing for the given billing cycle iterations will be processed now.
1187
+ */
1188
+ prebilling?: SubscriptionUpdateParams.Prebilling;
1189
+
1002
1190
  /**
1003
1191
  * The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription.
1004
1192
  */
@@ -1075,12 +1263,56 @@ declare module 'stripe' {
1075
1263
  */
1076
1264
  discount?: string;
1077
1265
 
1266
+ /**
1267
+ * Details to determine how long the discount should be applied for.
1268
+ */
1269
+ discount_end?: Discount.DiscountEnd;
1270
+
1078
1271
  /**
1079
1272
  * ID of the promotion code to create a new discount for.
1080
1273
  */
1081
1274
  promotion_code?: string;
1082
1275
  }
1083
1276
 
1277
+ namespace Discount {
1278
+ interface DiscountEnd {
1279
+ /**
1280
+ * Time span for the redeemed discount.
1281
+ */
1282
+ duration?: DiscountEnd.Duration;
1283
+
1284
+ /**
1285
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1286
+ */
1287
+ timestamp?: number;
1288
+
1289
+ /**
1290
+ * The type of calculation made to determine when the discount ends.
1291
+ */
1292
+ type: DiscountEnd.Type;
1293
+ }
1294
+
1295
+ namespace DiscountEnd {
1296
+ interface Duration {
1297
+ /**
1298
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1299
+ */
1300
+ interval: Duration.Interval;
1301
+
1302
+ /**
1303
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1304
+ */
1305
+ interval_count: number;
1306
+ }
1307
+
1308
+ namespace Duration {
1309
+ type Interval = 'day' | 'month' | 'week' | 'year';
1310
+ }
1311
+
1312
+ type Type = 'duration' | 'timestamp';
1313
+ }
1314
+ }
1315
+
1084
1316
  interface PriceData {
1085
1317
  /**
1086
1318
  * 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).
@@ -1194,12 +1426,56 @@ declare module 'stripe' {
1194
1426
  */
1195
1427
  discount?: string;
1196
1428
 
1429
+ /**
1430
+ * Details to determine how long the discount should be applied for.
1431
+ */
1432
+ discount_end?: Discount.DiscountEnd;
1433
+
1197
1434
  /**
1198
1435
  * ID of the promotion code to create a new discount for.
1199
1436
  */
1200
1437
  promotion_code?: string;
1201
1438
  }
1202
1439
 
1440
+ namespace Discount {
1441
+ interface DiscountEnd {
1442
+ /**
1443
+ * Time span for the redeemed discount.
1444
+ */
1445
+ duration?: DiscountEnd.Duration;
1446
+
1447
+ /**
1448
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1449
+ */
1450
+ timestamp?: number;
1451
+
1452
+ /**
1453
+ * The type of calculation made to determine when the discount ends.
1454
+ */
1455
+ type: DiscountEnd.Type;
1456
+ }
1457
+
1458
+ namespace DiscountEnd {
1459
+ interface Duration {
1460
+ /**
1461
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1462
+ */
1463
+ interval: Duration.Interval;
1464
+
1465
+ /**
1466
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1467
+ */
1468
+ interval_count: number;
1469
+ }
1470
+
1471
+ namespace Duration {
1472
+ type Interval = 'day' | 'month' | 'week' | 'year';
1473
+ }
1474
+
1475
+ type Type = 'duration' | 'timestamp';
1476
+ }
1477
+ }
1478
+
1203
1479
  interface InvoiceSettings {
1204
1480
  /**
1205
1481
  * The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
@@ -1306,12 +1582,56 @@ declare module 'stripe' {
1306
1582
  */
1307
1583
  discount?: string;
1308
1584
 
1585
+ /**
1586
+ * Details to determine how long the discount should be applied for.
1587
+ */
1588
+ discount_end?: Discount.DiscountEnd;
1589
+
1309
1590
  /**
1310
1591
  * ID of the promotion code to create a new discount for.
1311
1592
  */
1312
1593
  promotion_code?: string;
1313
1594
  }
1314
1595
 
1596
+ namespace Discount {
1597
+ interface DiscountEnd {
1598
+ /**
1599
+ * Time span for the redeemed discount.
1600
+ */
1601
+ duration?: DiscountEnd.Duration;
1602
+
1603
+ /**
1604
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1605
+ */
1606
+ timestamp?: number;
1607
+
1608
+ /**
1609
+ * The type of calculation made to determine when the discount ends.
1610
+ */
1611
+ type: DiscountEnd.Type;
1612
+ }
1613
+
1614
+ namespace DiscountEnd {
1615
+ interface Duration {
1616
+ /**
1617
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1618
+ */
1619
+ interval: Duration.Interval;
1620
+
1621
+ /**
1622
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1623
+ */
1624
+ interval_count: number;
1625
+ }
1626
+
1627
+ namespace Duration {
1628
+ type Interval = 'day' | 'month' | 'week' | 'year';
1629
+ }
1630
+
1631
+ type Type = 'duration' | 'timestamp';
1632
+ }
1633
+ }
1634
+
1315
1635
  interface PriceData {
1316
1636
  /**
1317
1637
  * 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).
@@ -1617,6 +1937,11 @@ declare module 'stripe' {
1617
1937
  * The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1618
1938
  */
1619
1939
  account_subcategories?: Array<Filters.AccountSubcategory>;
1940
+
1941
+ /**
1942
+ * ID of the institution to use to filter for selectable accounts.
1943
+ */
1944
+ institution?: string;
1620
1945
  }
1621
1946
 
1622
1947
  namespace Filters {
@@ -1629,7 +1954,11 @@ declare module 'stripe' {
1629
1954
  | 'payment_method'
1630
1955
  | 'transactions';
1631
1956
 
1632
- type Prefetch = 'balances' | 'ownership' | 'transactions';
1957
+ type Prefetch =
1958
+ | 'balances'
1959
+ | 'inferred_balances'
1960
+ | 'ownership'
1961
+ | 'transactions';
1633
1962
  }
1634
1963
 
1635
1964
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -1686,6 +2015,22 @@ declare module 'stripe' {
1686
2015
  type Interval = 'day' | 'month' | 'week' | 'year';
1687
2016
  }
1688
2017
 
2018
+ interface Prebilling {
2019
+ /**
2020
+ * This is used to determine the number of billing cycles to prebill.
2021
+ */
2022
+ iterations: number;
2023
+
2024
+ /**
2025
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2026
+ */
2027
+ update_behavior?: Prebilling.UpdateBehavior;
2028
+ }
2029
+
2030
+ namespace Prebilling {
2031
+ type UpdateBehavior = 'prebill' | 'reset';
2032
+ }
2033
+
1689
2034
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
1690
2035
 
1691
2036
  interface TransferData {
@@ -0,0 +1,133 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Tax {
6
+ /**
7
+ * Tax forms are legal documents which are delivered to one or more tax authorities for information reporting purposes.
8
+ *
9
+ * Related guide: [US tax reporting for Connect platforms](https://stripe.com/docs/connect/tax-reporting)
10
+ */
11
+ interface Form {
12
+ /**
13
+ * Unique identifier for the object.
14
+ */
15
+ id: string;
16
+
17
+ /**
18
+ * String representing the object's type. Objects of the same type share the same value.
19
+ */
20
+ object: 'tax.form';
21
+
22
+ /**
23
+ * The form that corrects this form, if any.
24
+ */
25
+ corrected_by: string | Stripe.Tax.Form | null;
26
+
27
+ /**
28
+ * Time at which the object was created. Measured in seconds since the Unix epoch.
29
+ */
30
+ created: number;
31
+
32
+ /**
33
+ * A list of tax filing statuses. Note that a filing status will only be included if the form has been filed directly with the jurisdiction's tax authority.
34
+ */
35
+ filing_statuses: Array<Form.FilingStatus>;
36
+
37
+ /**
38
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
39
+ */
40
+ livemode: boolean;
41
+
42
+ payee: Form.Payee;
43
+
44
+ /**
45
+ * The type of the tax form. An additional hash is included on the tax form with a name matching this value. It contains additional information specific to the tax form type.
46
+ */
47
+ type: Form.Type;
48
+
49
+ us_1099_k?: Form.Us1099K;
50
+
51
+ us_1099_misc?: Form.Us1099Misc;
52
+
53
+ us_1099_nec?: Form.Us1099Nec;
54
+ }
55
+
56
+ namespace Form {
57
+ interface FilingStatus {
58
+ /**
59
+ * Time when the filing status was updated.
60
+ */
61
+ effective_at: number;
62
+
63
+ jurisdiction: FilingStatus.Jurisdiction;
64
+
65
+ /**
66
+ * The current status of the filed form.
67
+ */
68
+ value: FilingStatus.Value;
69
+ }
70
+
71
+ namespace FilingStatus {
72
+ interface Jurisdiction {
73
+ /**
74
+ * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). Always `US`.
75
+ */
76
+ country: string;
77
+
78
+ /**
79
+ * Indicates the level of the jurisdiction where the form was filed.
80
+ */
81
+ level: Jurisdiction.Level;
82
+
83
+ /**
84
+ * [ISO 3166-2 U.S. state code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix, if any. For example, "NY" for New York, United States.
85
+ */
86
+ state: string | null;
87
+ }
88
+
89
+ namespace Jurisdiction {
90
+ type Level = 'country' | 'state';
91
+ }
92
+
93
+ type Value = 'accepted' | 'filed' | 'rejected';
94
+ }
95
+
96
+ interface Payee {
97
+ /**
98
+ * The ID of the payee's Stripe account.
99
+ */
100
+ account: string | Stripe.Account | null;
101
+
102
+ /**
103
+ * Always `account`.
104
+ */
105
+ type: 'account';
106
+ }
107
+
108
+ type Type = 'us_1099_k' | 'us_1099_misc' | 'us_1099_nec';
109
+
110
+ interface Us1099K {
111
+ /**
112
+ * Year represented by the information reported on the tax form.
113
+ */
114
+ reporting_year: number;
115
+ }
116
+
117
+ interface Us1099Misc {
118
+ /**
119
+ * Year represented by the information reported on the tax form.
120
+ */
121
+ reporting_year: number;
122
+ }
123
+
124
+ interface Us1099Nec {
125
+ /**
126
+ * Year represented by the information reported on the tax form.
127
+ */
128
+ reporting_year: number;
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }