stripe 16.1.0 → 16.2.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 (148) hide show
  1. package/CHANGELOG.md +753 -109
  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/GiftCards/Cards.js +23 -0
  14. package/cjs/resources/GiftCards/Transactions.js +33 -0
  15. package/cjs/resources/Invoices.js +25 -0
  16. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  17. package/cjs/resources/Margins.js +22 -0
  18. package/cjs/resources/OAuth.js +1 -1
  19. package/cjs/resources/Orders.js +24 -0
  20. package/cjs/resources/PaymentIntents.js +4 -0
  21. package/cjs/resources/QuotePhases.js +22 -0
  22. package/cjs/resources/Quotes.js +32 -0
  23. package/cjs/resources/SubscriptionSchedules.js +4 -0
  24. package/cjs/resources/Tax/Forms.js +20 -0
  25. package/cjs/resources/Terminal/Readers.js +12 -0
  26. package/cjs/resources.js +36 -10
  27. package/cjs/stripe.core.js +6 -3
  28. package/cjs/utils.js +30 -3
  29. package/esm/RequestSender.js +67 -6
  30. package/esm/StripeResource.js +2 -2
  31. package/esm/apiVersion.js +1 -0
  32. package/esm/multipart.js +2 -2
  33. package/esm/resources/AccountNotices.js +18 -0
  34. package/esm/resources/Capital/FinancingOffers.js +18 -0
  35. package/esm/resources/Capital/FinancingSummary.js +9 -0
  36. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  37. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  38. package/esm/resources/GiftCards/Cards.js +20 -0
  39. package/esm/resources/GiftCards/Transactions.js +30 -0
  40. package/esm/resources/Invoices.js +25 -0
  41. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  42. package/esm/resources/Margins.js +19 -0
  43. package/esm/resources/OAuth.js +2 -2
  44. package/esm/resources/Orders.js +21 -0
  45. package/esm/resources/PaymentIntents.js +4 -0
  46. package/esm/resources/QuotePhases.js +19 -0
  47. package/esm/resources/Quotes.js +32 -0
  48. package/esm/resources/SubscriptionSchedules.js +4 -0
  49. package/esm/resources/Tax/Forms.js +17 -0
  50. package/esm/resources/Terminal/Readers.js +12 -0
  51. package/esm/resources.js +22 -0
  52. package/esm/stripe.core.js +6 -3
  53. package/esm/utils.js +27 -1
  54. package/package.json +1 -1
  55. package/types/AccountLinksResource.d.ts +5 -1
  56. package/types/AccountNotices.d.ts +110 -0
  57. package/types/AccountNoticesResource.d.ts +98 -0
  58. package/types/AccountSessions.d.ts +15 -0
  59. package/types/AccountSessionsResource.d.ts +205 -0
  60. package/types/Accounts.d.ts +88 -1
  61. package/types/AccountsResource.d.ts +204 -0
  62. package/types/Capital/FinancingOffers.d.ts +188 -0
  63. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  64. package/types/Capital/FinancingSummary.d.ts +106 -0
  65. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  66. package/types/Capital/FinancingTransactions.d.ts +135 -0
  67. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  68. package/types/Charges.d.ts +67 -0
  69. package/types/ChargesResource.d.ts +1294 -0
  70. package/types/Checkout/Sessions.d.ts +23 -1
  71. package/types/Checkout/SessionsResource.d.ts +15 -1
  72. package/types/ConfirmationTokens.d.ts +83 -0
  73. package/types/Coupons.d.ts +1 -1
  74. package/types/CouponsResource.d.ts +1 -1
  75. package/types/CreditNotes.d.ts +21 -0
  76. package/types/CreditNotesResource.d.ts +51 -0
  77. package/types/CustomerSessions.d.ts +48 -0
  78. package/types/CustomerSessionsResource.d.ts +48 -0
  79. package/types/CustomersResource.d.ts +2 -0
  80. package/types/Disputes.d.ts +167 -0
  81. package/types/DisputesResource.d.ts +120 -0
  82. package/types/EventTypes.d.ts +426 -0
  83. package/types/Events.d.ts +83 -0
  84. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  85. package/types/FinancialConnections/Accounts.d.ts +29 -1
  86. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  87. package/types/FinancialConnections/Sessions.d.ts +44 -1
  88. package/types/FinancialConnections/SessionsResource.d.ts +33 -1
  89. package/types/GiftCards/Cards.d.ts +118 -0
  90. package/types/GiftCards/CardsResource.d.ts +159 -0
  91. package/types/GiftCards/Transactions.d.ts +129 -0
  92. package/types/GiftCards/TransactionsResource.d.ts +201 -0
  93. package/types/InvoiceItems.d.ts +5 -0
  94. package/types/InvoiceItemsResource.d.ts +98 -0
  95. package/types/InvoiceLineItems.d.ts +22 -0
  96. package/types/InvoicePayments.d.ts +91 -0
  97. package/types/Invoices.d.ts +110 -1
  98. package/types/InvoicesResource.d.ts +6404 -2261
  99. package/types/Issuing/CardholdersResource.d.ts +2 -1
  100. package/types/Issuing/Cards.d.ts +34 -0
  101. package/types/Issuing/CardsResource.d.ts +125 -0
  102. package/types/Issuing/CreditUnderwritingRecords.d.ts +446 -0
  103. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1017 -0
  104. package/types/LineItems.d.ts +7 -0
  105. package/types/Mandates.d.ts +77 -0
  106. package/types/Margins.d.ts +56 -0
  107. package/types/MarginsResource.d.ts +114 -0
  108. package/types/Orders.d.ts +1057 -0
  109. package/types/OrdersResource.d.ts +2711 -0
  110. package/types/PaymentIntents.d.ts +463 -1
  111. package/types/PaymentIntentsResource.d.ts +6682 -3349
  112. package/types/PaymentMethods.d.ts +62 -0
  113. package/types/PaymentMethodsResource.d.ts +110 -0
  114. package/types/Prices.d.ts +22 -0
  115. package/types/PricesResource.d.ts +22 -0
  116. package/types/Products.d.ts +39 -0
  117. package/types/ProductsResource.d.ts +36 -0
  118. package/types/QuoteLines.d.ts +634 -0
  119. package/types/QuotePhases.d.ts +198 -0
  120. package/types/QuotePhasesResource.d.ts +67 -0
  121. package/types/QuotePreviewInvoices.d.ts +1528 -0
  122. package/types/QuotePreviewSubscriptionSchedules.d.ts +778 -0
  123. package/types/Quotes.d.ts +578 -1
  124. package/types/QuotesResource.d.ts +3174 -265
  125. package/types/SetupAttempts.d.ts +8 -0
  126. package/types/SetupIntents.d.ts +104 -1
  127. package/types/SetupIntentsResource.d.ts +483 -3
  128. package/types/Sources.d.ts +23 -0
  129. package/types/SubscriptionItems.d.ts +21 -0
  130. package/types/SubscriptionItemsResource.d.ts +109 -0
  131. package/types/SubscriptionSchedules.d.ts +164 -0
  132. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  133. package/types/Subscriptions.d.ts +41 -1
  134. package/types/SubscriptionsResource.d.ts +337 -2
  135. package/types/Tax/Forms.d.ts +133 -0
  136. package/types/Tax/FormsResource.d.ts +90 -0
  137. package/types/Terminal/Readers.d.ts +278 -0
  138. package/types/Terminal/ReadersResource.d.ts +208 -0
  139. package/types/TestHelpers/ConfirmationTokensResource.d.ts +55 -0
  140. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  141. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  142. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  143. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  144. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  145. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  146. package/types/WebhookEndpointsResource.d.ts +50 -0
  147. package/types/index.d.ts +61 -0
  148. 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
  */
@@ -620,7 +625,11 @@ declare module 'stripe' {
620
625
  | 'payment_method'
621
626
  | 'transactions';
622
627
 
623
- type Prefetch = 'balances' | 'ownership' | 'transactions';
628
+ type Prefetch =
629
+ | 'balances'
630
+ | 'inferred_balances'
631
+ | 'ownership'
632
+ | 'transactions';
624
633
  }
625
634
 
626
635
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -688,6 +697,11 @@ declare module 'stripe' {
688
697
  */
689
698
  expires_at: number;
690
699
 
700
+ /**
701
+ * The number of iterations of prebilling to apply.
702
+ */
703
+ prebilling_iterations?: number | null;
704
+
691
705
  /**
692
706
  * List of subscription items, each with an attached plan, that will be set if the update is applied.
693
707
  */
@@ -704,6 +718,32 @@ declare module 'stripe' {
704
718
  trial_from_plan: boolean | null;
705
719
  }
706
720
 
721
+ interface Prebilling {
722
+ /**
723
+ * ID of the prebilling invoice.
724
+ */
725
+ invoice: string | Stripe.Invoice;
726
+
727
+ /**
728
+ * The end of the last period for which the invoice pre-bills.
729
+ */
730
+ period_end: number;
731
+
732
+ /**
733
+ * The start of the first period for which the invoice pre-bills.
734
+ */
735
+ period_start: number;
736
+
737
+ /**
738
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
739
+ */
740
+ update_behavior?: Prebilling.UpdateBehavior;
741
+ }
742
+
743
+ namespace Prebilling {
744
+ type UpdateBehavior = 'prebill' | 'reset';
745
+ }
746
+
707
747
  type Status =
708
748
  | 'active'
709
749
  | '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 =
@@ -757,7 +915,11 @@ declare module 'stripe' {
757
915
  | 'payment_method'
758
916
  | 'transactions';
759
917
 
760
- type Prefetch = 'balances' | 'ownership' | 'transactions';
918
+ type Prefetch =
919
+ | 'balances'
920
+ | 'inferred_balances'
921
+ | 'ownership'
922
+ | 'transactions';
761
923
  }
762
924
 
763
925
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -814,6 +976,22 @@ declare module 'stripe' {
814
976
  type Interval = 'day' | 'month' | 'week' | 'year';
815
977
  }
816
978
 
979
+ interface Prebilling {
980
+ /**
981
+ * This is used to determine the number of billing cycles to prebill.
982
+ */
983
+ iterations: number;
984
+
985
+ /**
986
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
987
+ */
988
+ update_behavior?: Prebilling.UpdateBehavior;
989
+ }
990
+
991
+ namespace Prebilling {
992
+ type UpdateBehavior = 'prebill' | 'reset';
993
+ }
994
+
817
995
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
818
996
 
819
997
  interface TransferData {
@@ -999,6 +1177,11 @@ declare module 'stripe' {
999
1177
  SubscriptionUpdateParams.PendingInvoiceItemInterval
1000
1178
  >;
1001
1179
 
1180
+ /**
1181
+ * If specified, the invoicing for the given billing cycle iterations will be processed now.
1182
+ */
1183
+ prebilling?: SubscriptionUpdateParams.Prebilling;
1184
+
1002
1185
  /**
1003
1186
  * 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
1187
  */
@@ -1075,12 +1258,56 @@ declare module 'stripe' {
1075
1258
  */
1076
1259
  discount?: string;
1077
1260
 
1261
+ /**
1262
+ * Details to determine how long the discount should be applied for.
1263
+ */
1264
+ discount_end?: Discount.DiscountEnd;
1265
+
1078
1266
  /**
1079
1267
  * ID of the promotion code to create a new discount for.
1080
1268
  */
1081
1269
  promotion_code?: string;
1082
1270
  }
1083
1271
 
1272
+ namespace Discount {
1273
+ interface DiscountEnd {
1274
+ /**
1275
+ * Time span for the redeemed discount.
1276
+ */
1277
+ duration?: DiscountEnd.Duration;
1278
+
1279
+ /**
1280
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1281
+ */
1282
+ timestamp?: number;
1283
+
1284
+ /**
1285
+ * The type of calculation made to determine when the discount ends.
1286
+ */
1287
+ type: DiscountEnd.Type;
1288
+ }
1289
+
1290
+ namespace DiscountEnd {
1291
+ interface Duration {
1292
+ /**
1293
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1294
+ */
1295
+ interval: Duration.Interval;
1296
+
1297
+ /**
1298
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1299
+ */
1300
+ interval_count: number;
1301
+ }
1302
+
1303
+ namespace Duration {
1304
+ type Interval = 'day' | 'month' | 'week' | 'year';
1305
+ }
1306
+
1307
+ type Type = 'duration' | 'timestamp';
1308
+ }
1309
+ }
1310
+
1084
1311
  interface PriceData {
1085
1312
  /**
1086
1313
  * 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 +1421,56 @@ declare module 'stripe' {
1194
1421
  */
1195
1422
  discount?: string;
1196
1423
 
1424
+ /**
1425
+ * Details to determine how long the discount should be applied for.
1426
+ */
1427
+ discount_end?: Discount.DiscountEnd;
1428
+
1197
1429
  /**
1198
1430
  * ID of the promotion code to create a new discount for.
1199
1431
  */
1200
1432
  promotion_code?: string;
1201
1433
  }
1202
1434
 
1435
+ namespace Discount {
1436
+ interface DiscountEnd {
1437
+ /**
1438
+ * Time span for the redeemed discount.
1439
+ */
1440
+ duration?: DiscountEnd.Duration;
1441
+
1442
+ /**
1443
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1444
+ */
1445
+ timestamp?: number;
1446
+
1447
+ /**
1448
+ * The type of calculation made to determine when the discount ends.
1449
+ */
1450
+ type: DiscountEnd.Type;
1451
+ }
1452
+
1453
+ namespace DiscountEnd {
1454
+ interface Duration {
1455
+ /**
1456
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1457
+ */
1458
+ interval: Duration.Interval;
1459
+
1460
+ /**
1461
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1462
+ */
1463
+ interval_count: number;
1464
+ }
1465
+
1466
+ namespace Duration {
1467
+ type Interval = 'day' | 'month' | 'week' | 'year';
1468
+ }
1469
+
1470
+ type Type = 'duration' | 'timestamp';
1471
+ }
1472
+ }
1473
+
1203
1474
  interface InvoiceSettings {
1204
1475
  /**
1205
1476
  * The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
@@ -1306,12 +1577,56 @@ declare module 'stripe' {
1306
1577
  */
1307
1578
  discount?: string;
1308
1579
 
1580
+ /**
1581
+ * Details to determine how long the discount should be applied for.
1582
+ */
1583
+ discount_end?: Discount.DiscountEnd;
1584
+
1309
1585
  /**
1310
1586
  * ID of the promotion code to create a new discount for.
1311
1587
  */
1312
1588
  promotion_code?: string;
1313
1589
  }
1314
1590
 
1591
+ namespace Discount {
1592
+ interface DiscountEnd {
1593
+ /**
1594
+ * Time span for the redeemed discount.
1595
+ */
1596
+ duration?: DiscountEnd.Duration;
1597
+
1598
+ /**
1599
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1600
+ */
1601
+ timestamp?: number;
1602
+
1603
+ /**
1604
+ * The type of calculation made to determine when the discount ends.
1605
+ */
1606
+ type: DiscountEnd.Type;
1607
+ }
1608
+
1609
+ namespace DiscountEnd {
1610
+ interface Duration {
1611
+ /**
1612
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1613
+ */
1614
+ interval: Duration.Interval;
1615
+
1616
+ /**
1617
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1618
+ */
1619
+ interval_count: number;
1620
+ }
1621
+
1622
+ namespace Duration {
1623
+ type Interval = 'day' | 'month' | 'week' | 'year';
1624
+ }
1625
+
1626
+ type Type = 'duration' | 'timestamp';
1627
+ }
1628
+ }
1629
+
1315
1630
  interface PriceData {
1316
1631
  /**
1317
1632
  * 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).
@@ -1629,7 +1944,11 @@ declare module 'stripe' {
1629
1944
  | 'payment_method'
1630
1945
  | 'transactions';
1631
1946
 
1632
- type Prefetch = 'balances' | 'ownership' | 'transactions';
1947
+ type Prefetch =
1948
+ | 'balances'
1949
+ | 'inferred_balances'
1950
+ | 'ownership'
1951
+ | 'transactions';
1633
1952
  }
1634
1953
 
1635
1954
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -1686,6 +2005,22 @@ declare module 'stripe' {
1686
2005
  type Interval = 'day' | 'month' | 'week' | 'year';
1687
2006
  }
1688
2007
 
2008
+ interface Prebilling {
2009
+ /**
2010
+ * This is used to determine the number of billing cycles to prebill.
2011
+ */
2012
+ iterations: number;
2013
+
2014
+ /**
2015
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2016
+ */
2017
+ update_behavior?: Prebilling.UpdateBehavior;
2018
+ }
2019
+
2020
+ namespace Prebilling {
2021
+ type UpdateBehavior = 'prebill' | 'reset';
2022
+ }
2023
+
1689
2024
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
1690
2025
 
1691
2026
  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
+ }