stripe 17.5.0 → 17.6.0-beta.2

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 (181) hide show
  1. package/CHANGELOG.md +1052 -109
  2. package/README.md +24 -16
  3. package/VERSION +1 -1
  4. package/cjs/apiVersion.js +1 -1
  5. package/cjs/resources/AccountNotices.js +21 -0
  6. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  7. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  8. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  9. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  10. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  11. package/cjs/resources/GiftCards/Cards.js +23 -0
  12. package/cjs/resources/GiftCards/Transactions.js +33 -0
  13. package/cjs/resources/Invoices.js +17 -0
  14. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  15. package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
  16. package/cjs/resources/Issuing/FraudLiabilityDebits.js +17 -0
  17. package/cjs/resources/Margins.js +22 -0
  18. package/cjs/resources/Orders.js +24 -0
  19. package/cjs/resources/PaymentAttemptRecords.js +17 -0
  20. package/cjs/resources/PaymentIntents.js +8 -0
  21. package/cjs/resources/PaymentRecords.js +29 -0
  22. package/cjs/resources/Quotes.js +32 -0
  23. package/cjs/resources/SubscriptionSchedules.js +4 -0
  24. package/cjs/resources/Tax/Associations.js +9 -0
  25. package/cjs/resources/Tax/Forms.js +20 -0
  26. package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
  27. package/cjs/resources/Terminal/Readers.js +12 -0
  28. package/cjs/resources/Treasury/FinancialAccounts.js +4 -0
  29. package/cjs/resources.js +48 -10
  30. package/cjs/stripe.core.js +1 -1
  31. package/esm/apiVersion.js +1 -1
  32. package/esm/resources/AccountNotices.js +18 -0
  33. package/esm/resources/Capital/FinancingOffers.js +18 -0
  34. package/esm/resources/Capital/FinancingSummary.js +9 -0
  35. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  36. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  37. package/esm/resources/FinancialConnections/Institutions.js +14 -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 +17 -0
  41. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  42. package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
  43. package/esm/resources/Issuing/FraudLiabilityDebits.js +14 -0
  44. package/esm/resources/Margins.js +19 -0
  45. package/esm/resources/Orders.js +21 -0
  46. package/esm/resources/PaymentAttemptRecords.js +14 -0
  47. package/esm/resources/PaymentIntents.js +8 -0
  48. package/esm/resources/PaymentRecords.js +26 -0
  49. package/esm/resources/Quotes.js +32 -0
  50. package/esm/resources/SubscriptionSchedules.js +4 -0
  51. package/esm/resources/Tax/Associations.js +6 -0
  52. package/esm/resources/Tax/Forms.js +17 -0
  53. package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
  54. package/esm/resources/Terminal/Readers.js +12 -0
  55. package/esm/resources/Treasury/FinancialAccounts.js +4 -0
  56. package/esm/resources.js +33 -0
  57. package/esm/stripe.core.js +1 -1
  58. package/package.json +3 -15
  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 +175 -0
  63. package/types/AccountSessionsResource.d.ts +376 -0
  64. package/types/Accounts.d.ts +225 -1
  65. package/types/AccountsResource.d.ts +628 -0
  66. package/types/Billing/CreditBalanceTransactions.d.ts +1 -1
  67. package/types/Billing/MeterErrorReports.d.ts +106 -0
  68. package/types/BillingPortal/ConfigurationsResource.d.ts +2 -2
  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/Cards.d.ts +6 -1
  76. package/types/Charges.d.ts +159 -2
  77. package/types/ChargesResource.d.ts +1294 -0
  78. package/types/Checkout/Sessions.d.ts +359 -5
  79. package/types/Checkout/SessionsResource.d.ts +456 -5
  80. package/types/ConfirmationTokens.d.ts +110 -1
  81. package/types/Coupons.d.ts +1 -1
  82. package/types/CouponsResource.d.ts +1 -1
  83. package/types/CreditNoteLineItems.d.ts +1 -1
  84. package/types/CreditNotes.d.ts +22 -1
  85. package/types/CreditNotesResource.d.ts +51 -0
  86. package/types/CustomersResource.d.ts +8 -0
  87. package/types/EventTypes.d.ts +596 -0
  88. package/types/Events.d.ts +93 -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/FinancialConnections/TransactionsResource.d.ts +1 -1
  97. package/types/GiftCards/Cards.d.ts +118 -0
  98. package/types/GiftCards/CardsResource.d.ts +159 -0
  99. package/types/GiftCards/Transactions.d.ts +129 -0
  100. package/types/GiftCards/TransactionsResource.d.ts +201 -0
  101. package/types/InvoiceItems.d.ts +5 -0
  102. package/types/InvoiceItemsResource.d.ts +98 -0
  103. package/types/InvoiceLineItems.d.ts +29 -2
  104. package/types/InvoicePayments.d.ts +113 -0
  105. package/types/Invoices.d.ts +143 -3
  106. package/types/InvoicesResource.d.ts +4618 -933
  107. package/types/Issuing/Authorizations.d.ts +2 -1
  108. package/types/Issuing/CardholdersResource.d.ts +2 -1
  109. package/types/Issuing/CreditUnderwritingRecords.d.ts +451 -0
  110. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1032 -0
  111. package/types/Issuing/DisputeSettlementDetails.d.ts +73 -0
  112. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
  113. package/types/Issuing/FraudLiabilityDebits.d.ts +52 -0
  114. package/types/Issuing/FraudLiabilityDebitsResource.d.ts +52 -0
  115. package/types/Issuing/Settlements.d.ts +103 -0
  116. package/types/Issuing/Transactions.d.ts +3 -1
  117. package/types/Issuing/TransactionsResource.d.ts +5 -0
  118. package/types/LineItems.d.ts +32 -0
  119. package/types/Mandates.d.ts +77 -0
  120. package/types/Margins.d.ts +56 -0
  121. package/types/MarginsResource.d.ts +114 -0
  122. package/types/Orders.d.ts +1179 -0
  123. package/types/OrdersResource.d.ts +2961 -0
  124. package/types/PaymentAttemptRecords.d.ts +242 -0
  125. package/types/PaymentAttemptRecordsResource.d.ts +47 -0
  126. package/types/PaymentIntents.d.ts +653 -1
  127. package/types/PaymentIntentsResource.d.ts +8018 -3686
  128. package/types/PaymentLinks.d.ts +8 -0
  129. package/types/PaymentLinksResource.d.ts +30 -0
  130. package/types/PaymentMethodConfigurations.d.ts +216 -0
  131. package/types/PaymentMethodConfigurationsResource.d.ts +300 -0
  132. package/types/PaymentMethods.d.ts +110 -1
  133. package/types/PaymentMethodsResource.d.ts +149 -0
  134. package/types/PaymentRecords.d.ts +242 -0
  135. package/types/PaymentRecordsResource.d.ts +455 -0
  136. package/types/Prices.d.ts +22 -0
  137. package/types/PricesResource.d.ts +22 -0
  138. package/types/Products.d.ts +39 -0
  139. package/types/ProductsResource.d.ts +36 -0
  140. package/types/QuoteLines.d.ts +634 -0
  141. package/types/QuotePreviewInvoices.d.ts +1658 -0
  142. package/types/QuotePreviewSubscriptionSchedules.d.ts +824 -0
  143. package/types/Quotes.d.ts +591 -1
  144. package/types/QuotesResource.d.ts +2526 -194
  145. package/types/Refunds.d.ts +14 -0
  146. package/types/SetupAttempts.d.ts +43 -0
  147. package/types/SetupIntents.d.ts +116 -1
  148. package/types/SetupIntentsResource.d.ts +669 -3
  149. package/types/Sources.d.ts +29 -0
  150. package/types/SubscriptionItems.d.ts +21 -0
  151. package/types/SubscriptionItemsResource.d.ts +109 -0
  152. package/types/SubscriptionSchedules.d.ts +200 -0
  153. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  154. package/types/Subscriptions.d.ts +91 -1
  155. package/types/SubscriptionsResource.d.ts +369 -2
  156. package/types/Tax/Associations.d.ts +126 -0
  157. package/types/Tax/AssociationsResource.d.ts +29 -0
  158. package/types/Tax/Forms.d.ts +220 -0
  159. package/types/Tax/FormsResource.d.ts +107 -0
  160. package/types/Terminal/Configurations.d.ts +19 -0
  161. package/types/Terminal/ConfigurationsResource.d.ts +44 -0
  162. package/types/Terminal/ReaderCollectedData.d.ts +51 -0
  163. package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
  164. package/types/Terminal/Readers.d.ts +310 -0
  165. package/types/Terminal/ReadersResource.d.ts +215 -0
  166. package/types/TestHelpers/ConfirmationTokensResource.d.ts +112 -0
  167. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  168. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  169. package/types/TokensResource.d.ts +30 -0
  170. package/types/Treasury/FinancialAccountFeatures.d.ts +7 -0
  171. package/types/Treasury/FinancialAccounts.d.ts +12 -0
  172. package/types/Treasury/FinancialAccountsResource.d.ts +121 -0
  173. package/types/Treasury/OutboundTransfers.d.ts +43 -1
  174. package/types/Treasury/OutboundTransfersResource.d.ts +43 -0
  175. package/types/Treasury/ReceivedCredits.d.ts +36 -0
  176. package/types/Treasury/ReceivedCreditsResource.d.ts +1 -0
  177. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  178. package/types/WebhookEndpointsResource.d.ts +72 -1
  179. package/types/index.d.ts +62 -0
  180. package/types/lib.d.ts +1 -1
  181. package/types/test/typescriptTest.ts +3 -3
@@ -105,6 +105,8 @@ declare module 'stripe' {
105
105
 
106
106
  p24?: Source.P24;
107
107
 
108
+ paypal?: Source.Paypal;
109
+
108
110
  receiver?: Source.Receiver;
109
111
 
110
112
  redirect?: Source.Redirect;
@@ -236,6 +238,8 @@ declare module 'stripe' {
236
238
 
237
239
  brand?: string | null;
238
240
 
241
+ brand_product?: string | null;
242
+
239
243
  country?: string | null;
240
244
 
241
245
  cvc_check?: string | null;
@@ -276,6 +280,8 @@ declare module 'stripe' {
276
280
 
277
281
  brand?: string | null;
278
282
 
283
+ brand_product?: string | null;
284
+
279
285
  country?: string | null;
280
286
 
281
287
  cvm_type?: string;
@@ -479,6 +485,26 @@ declare module 'stripe' {
479
485
  reference?: string | null;
480
486
  }
481
487
 
488
+ interface Paypal {
489
+ billing_agreement?: string | null;
490
+
491
+ fingerprint?: string | null;
492
+
493
+ payer_id?: string | null;
494
+
495
+ reference_id?: string;
496
+
497
+ reference_transaction_amount?: string;
498
+
499
+ reference_transaction_charged?: boolean;
500
+
501
+ statement_descriptor?: string | null;
502
+
503
+ transaction_id?: string;
504
+
505
+ verified_email?: string | null;
506
+ }
507
+
482
508
  interface Receiver {
483
509
  /**
484
510
  * The address of the receiver source. This is the value that should be communicated to the customer to send their funds to.
@@ -680,6 +706,8 @@ declare module 'stripe' {
680
706
 
681
707
  brand?: string | null;
682
708
 
709
+ brand_product?: string | null;
710
+
683
711
  card?: string | null;
684
712
 
685
713
  country?: string | null;
@@ -728,6 +756,7 @@ declare module 'stripe' {
728
756
  | 'klarna'
729
757
  | 'multibanco'
730
758
  | 'p24'
759
+ | 'paypal'
731
760
  | 'sepa_credit_transfer'
732
761
  | 'sepa_debit'
733
762
  | 'sofort'
@@ -98,6 +98,11 @@ declare module 'stripe' {
98
98
  * The tax rates which apply to this `subscription_item`. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
99
99
  */
100
100
  tax_rates: Array<Stripe.TaxRate> | null;
101
+
102
+ /**
103
+ * Options that configure the trial on the subscription item.
104
+ */
105
+ trial?: SubscriptionItem.Trial | null;
101
106
  }
102
107
 
103
108
  namespace SubscriptionItem {
@@ -107,6 +112,22 @@ declare module 'stripe' {
107
112
  */
108
113
  usage_gte: number | null;
109
114
  }
115
+
116
+ interface Trial {
117
+ /**
118
+ * List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial.
119
+ */
120
+ converts_to?: Array<string> | null;
121
+
122
+ /**
123
+ * Determines the type of trial for this item.
124
+ */
125
+ type: Trial.Type;
126
+ }
127
+
128
+ namespace Trial {
129
+ type Type = 'free' | 'paid';
130
+ }
110
131
  }
111
132
  }
112
133
  }
@@ -77,6 +77,11 @@ declare module 'stripe' {
77
77
  * 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.
78
78
  */
79
79
  tax_rates?: Stripe.Emptyable<Array<string>>;
80
+
81
+ /**
82
+ * Options that configure the trial on the subscription item.
83
+ */
84
+ trial?: SubscriptionItemCreateParams.Trial;
80
85
  }
81
86
 
82
87
  namespace SubscriptionItemCreateParams {
@@ -98,12 +103,56 @@ declare module 'stripe' {
98
103
  */
99
104
  discount?: string;
100
105
 
106
+ /**
107
+ * Details to determine how long the discount should be applied for.
108
+ */
109
+ discount_end?: Discount.DiscountEnd;
110
+
101
111
  /**
102
112
  * ID of the promotion code to create a new discount for.
103
113
  */
104
114
  promotion_code?: string;
105
115
  }
106
116
 
117
+ namespace Discount {
118
+ interface DiscountEnd {
119
+ /**
120
+ * Time span for the redeemed discount.
121
+ */
122
+ duration?: DiscountEnd.Duration;
123
+
124
+ /**
125
+ * A precise Unix timestamp for the discount to end. Must be in the future.
126
+ */
127
+ timestamp?: number;
128
+
129
+ /**
130
+ * The type of calculation made to determine when the discount ends.
131
+ */
132
+ type: DiscountEnd.Type;
133
+ }
134
+
135
+ namespace DiscountEnd {
136
+ interface Duration {
137
+ /**
138
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
139
+ */
140
+ interval: Duration.Interval;
141
+
142
+ /**
143
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
144
+ */
145
+ interval_count: number;
146
+ }
147
+
148
+ namespace Duration {
149
+ type Interval = 'day' | 'month' | 'week' | 'year';
150
+ }
151
+
152
+ type Type = 'duration' | 'timestamp';
153
+ }
154
+ }
155
+
107
156
  type PaymentBehavior =
108
157
  | 'allow_incomplete'
109
158
  | 'default_incomplete'
@@ -163,6 +212,22 @@ declare module 'stripe' {
163
212
  }
164
213
 
165
214
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
215
+
216
+ interface Trial {
217
+ /**
218
+ * 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.
219
+ */
220
+ converts_to?: Array<string>;
221
+
222
+ /**
223
+ * Determines the type of trial for this item.
224
+ */
225
+ type: Trial.Type;
226
+ }
227
+
228
+ namespace Trial {
229
+ type Type = 'free' | 'paid';
230
+ }
166
231
  }
167
232
 
168
233
  interface SubscriptionItemRetrieveParams {
@@ -268,12 +333,56 @@ declare module 'stripe' {
268
333
  */
269
334
  discount?: string;
270
335
 
336
+ /**
337
+ * Details to determine how long the discount should be applied for.
338
+ */
339
+ discount_end?: Discount.DiscountEnd;
340
+
271
341
  /**
272
342
  * ID of the promotion code to create a new discount for.
273
343
  */
274
344
  promotion_code?: string;
275
345
  }
276
346
 
347
+ namespace Discount {
348
+ interface DiscountEnd {
349
+ /**
350
+ * Time span for the redeemed discount.
351
+ */
352
+ duration?: DiscountEnd.Duration;
353
+
354
+ /**
355
+ * A precise Unix timestamp for the discount to end. Must be in the future.
356
+ */
357
+ timestamp?: number;
358
+
359
+ /**
360
+ * The type of calculation made to determine when the discount ends.
361
+ */
362
+ type: DiscountEnd.Type;
363
+ }
364
+
365
+ namespace DiscountEnd {
366
+ interface Duration {
367
+ /**
368
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
369
+ */
370
+ interval: Duration.Interval;
371
+
372
+ /**
373
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
374
+ */
375
+ interval_count: number;
376
+ }
377
+
378
+ namespace Duration {
379
+ type Interval = 'day' | 'month' | 'week' | 'year';
380
+ }
381
+
382
+ type Type = 'duration' | 'timestamp';
383
+ }
384
+ }
385
+
277
386
  type PaymentBehavior =
278
387
  | 'allow_incomplete'
279
388
  | 'default_incomplete'
@@ -27,6 +27,11 @@ declare module 'stripe' {
27
27
  | Stripe.DeletedApplication
28
28
  | null;
29
29
 
30
+ /**
31
+ * Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
32
+ */
33
+ billing_behavior?: SubscriptionSchedule.BillingBehavior;
34
+
30
35
  /**
31
36
  * Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
32
37
  */
@@ -59,6 +64,11 @@ declare module 'stripe' {
59
64
  */
60
65
  end_behavior: SubscriptionSchedule.EndBehavior;
61
66
 
67
+ /**
68
+ * Details of the most recent price migration that failed for the subscription schedule.
69
+ */
70
+ last_price_migration_error?: SubscriptionSchedule.LastPriceMigrationError | null;
71
+
62
72
  /**
63
73
  * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
64
74
  */
@@ -74,6 +84,11 @@ declare module 'stripe' {
74
84
  */
75
85
  phases: Array<SubscriptionSchedule.Phase>;
76
86
 
87
+ /**
88
+ * Time period and invoice for a Subscription billed in advance.
89
+ */
90
+ prebilling?: SubscriptionSchedule.Prebilling | null;
91
+
77
92
  /**
78
93
  * Time at which the subscription schedule was released. Measured in seconds since the Unix epoch.
79
94
  */
@@ -101,6 +116,8 @@ declare module 'stripe' {
101
116
  }
102
117
 
103
118
  namespace SubscriptionSchedule {
119
+ type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
120
+
104
121
  interface CurrentPhase {
105
122
  /**
106
123
  * The end of this phase of the subscription schedule.
@@ -260,6 +277,37 @@ declare module 'stripe' {
260
277
 
261
278
  type EndBehavior = 'cancel' | 'none' | 'release' | 'renew';
262
279
 
280
+ interface LastPriceMigrationError {
281
+ /**
282
+ * The time at which the price migration encountered an error.
283
+ */
284
+ errored_at: number;
285
+
286
+ /**
287
+ * The involved price pairs in each failed transition.
288
+ */
289
+ failed_transitions: Array<LastPriceMigrationError.FailedTransition>;
290
+
291
+ /**
292
+ * The type of error encountered by the price migration.
293
+ */
294
+ type: 'price_uniqueness_violation';
295
+ }
296
+
297
+ namespace LastPriceMigrationError {
298
+ interface FailedTransition {
299
+ /**
300
+ * The original price to be migrated.
301
+ */
302
+ source_price: string;
303
+
304
+ /**
305
+ * The intended resulting price of the migration.
306
+ */
307
+ target_price: string;
308
+ }
309
+ }
310
+
263
311
  interface Phase {
264
312
  /**
265
313
  * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase.
@@ -343,6 +391,11 @@ declare module 'stripe' {
343
391
  */
344
392
  on_behalf_of: string | Stripe.Account | null;
345
393
 
394
+ /**
395
+ * If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
396
+ */
397
+ pause_collection?: Phase.PauseCollection | null;
398
+
346
399
  /**
347
400
  * If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`.
348
401
  */
@@ -358,10 +411,20 @@ declare module 'stripe' {
358
411
  */
359
412
  transfer_data: Phase.TransferData | null;
360
413
 
414
+ /**
415
+ * Specify behavior of the trial when crossing schedule phase boundaries
416
+ */
417
+ trial_continuation?: Phase.TrialContinuation | null;
418
+
361
419
  /**
362
420
  * When the trial ends within the phase.
363
421
  */
364
422
  trial_end: number | null;
423
+
424
+ /**
425
+ * Settings related to any trials on the subscription during this phase.
426
+ */
427
+ trial_settings?: Phase.TrialSettings | null;
365
428
  }
366
429
 
367
430
  namespace Phase {
@@ -399,11 +462,30 @@ declare module 'stripe' {
399
462
  */
400
463
  discount: string | Stripe.Discount | null;
401
464
 
465
+ /**
466
+ * Details to determine how long the discount should be applied for.
467
+ */
468
+ discount_end?: Discount.DiscountEnd | null;
469
+
402
470
  /**
403
471
  * ID of the promotion code to create a new discount for.
404
472
  */
405
473
  promotion_code: string | Stripe.PromotionCode | null;
406
474
  }
475
+
476
+ namespace Discount {
477
+ interface DiscountEnd {
478
+ /**
479
+ * The discount end timestamp.
480
+ */
481
+ timestamp: number | null;
482
+
483
+ /**
484
+ * The discount end type.
485
+ */
486
+ type: 'timestamp';
487
+ }
488
+ }
407
489
  }
408
490
 
409
491
  interface AutomaticTax {
@@ -468,12 +550,31 @@ declare module 'stripe' {
468
550
  */
469
551
  discount: string | Stripe.Discount | null;
470
552
 
553
+ /**
554
+ * Details to determine how long the discount should be applied for.
555
+ */
556
+ discount_end?: Discount.DiscountEnd | null;
557
+
471
558
  /**
472
559
  * ID of the promotion code to create a new discount for.
473
560
  */
474
561
  promotion_code: string | Stripe.PromotionCode | null;
475
562
  }
476
563
 
564
+ namespace Discount {
565
+ interface DiscountEnd {
566
+ /**
567
+ * The discount end timestamp.
568
+ */
569
+ timestamp: number | null;
570
+
571
+ /**
572
+ * The discount end type.
573
+ */
574
+ type: 'timestamp';
575
+ }
576
+ }
577
+
477
578
  interface InvoiceSettings {
478
579
  /**
479
580
  * The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
@@ -546,6 +647,11 @@ declare module 'stripe' {
546
647
  * The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`.
547
648
  */
548
649
  tax_rates?: Array<Stripe.TaxRate> | null;
650
+
651
+ /**
652
+ * Options that configure the trial on the subscription item.
653
+ */
654
+ trial?: Item.Trial | null;
549
655
  }
550
656
 
551
657
  namespace Item {
@@ -567,11 +673,57 @@ declare module 'stripe' {
567
673
  */
568
674
  discount: string | Stripe.Discount | null;
569
675
 
676
+ /**
677
+ * Details to determine how long the discount should be applied for.
678
+ */
679
+ discount_end?: Discount.DiscountEnd | null;
680
+
570
681
  /**
571
682
  * ID of the promotion code to create a new discount for.
572
683
  */
573
684
  promotion_code: string | Stripe.PromotionCode | null;
574
685
  }
686
+
687
+ namespace Discount {
688
+ interface DiscountEnd {
689
+ /**
690
+ * The discount end timestamp.
691
+ */
692
+ timestamp: number | null;
693
+
694
+ /**
695
+ * The discount end type.
696
+ */
697
+ type: 'timestamp';
698
+ }
699
+ }
700
+
701
+ interface Trial {
702
+ /**
703
+ * List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial.
704
+ */
705
+ converts_to?: Array<string> | null;
706
+
707
+ /**
708
+ * Determines the type of trial for this item.
709
+ */
710
+ type: Trial.Type;
711
+ }
712
+
713
+ namespace Trial {
714
+ type Type = 'free' | 'paid';
715
+ }
716
+ }
717
+
718
+ interface PauseCollection {
719
+ /**
720
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
721
+ */
722
+ behavior: PauseCollection.Behavior;
723
+ }
724
+
725
+ namespace PauseCollection {
726
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
575
727
  }
576
728
 
577
729
  type ProrationBehavior =
@@ -590,6 +742,54 @@ declare module 'stripe' {
590
742
  */
591
743
  destination: string | Stripe.Account;
592
744
  }
745
+
746
+ type TrialContinuation = 'continue' | 'none';
747
+
748
+ interface TrialSettings {
749
+ /**
750
+ * Defines how the subscription should behave when a trial ends.
751
+ */
752
+ end_behavior: TrialSettings.EndBehavior | null;
753
+ }
754
+
755
+ namespace TrialSettings {
756
+ interface EndBehavior {
757
+ /**
758
+ * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
759
+ */
760
+ prorate_up_front: EndBehavior.ProrateUpFront | null;
761
+ }
762
+
763
+ namespace EndBehavior {
764
+ type ProrateUpFront = 'defer' | 'include';
765
+ }
766
+ }
767
+ }
768
+
769
+ interface Prebilling {
770
+ /**
771
+ * ID of the prebilling invoice.
772
+ */
773
+ invoice: string | Stripe.Invoice;
774
+
775
+ /**
776
+ * The end of the last period for which the invoice pre-bills.
777
+ */
778
+ period_end: number;
779
+
780
+ /**
781
+ * The start of the first period for which the invoice pre-bills.
782
+ */
783
+ period_start: number;
784
+
785
+ /**
786
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
787
+ */
788
+ update_behavior?: Prebilling.UpdateBehavior;
789
+ }
790
+
791
+ namespace Prebilling {
792
+ type UpdateBehavior = 'prebill' | 'reset';
593
793
  }
594
794
 
595
795
  type Status =