stripe 16.9.0-beta.2 → 16.9.0

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 (164) hide show
  1. package/CHANGELOG.md +123 -822
  2. package/README.md +0 -33
  3. package/VERSION +1 -1
  4. package/cjs/RequestSender.js +5 -66
  5. package/cjs/StripeResource.js +1 -1
  6. package/cjs/apiVersion.js +1 -2
  7. package/cjs/multipart.js +1 -1
  8. package/cjs/resources/FinancialConnections/Accounts.js +0 -5
  9. package/cjs/resources/Invoices.js +0 -17
  10. package/cjs/resources/OAuth.js +1 -1
  11. package/cjs/resources/PaymentIntents.js +0 -4
  12. package/cjs/resources/Quotes.js +0 -32
  13. package/cjs/resources/SubscriptionSchedules.js +0 -4
  14. package/cjs/resources/Terminal/Readers.js +0 -12
  15. package/cjs/resources.js +10 -40
  16. package/cjs/stripe.core.js +3 -6
  17. package/cjs/utils.js +3 -30
  18. package/esm/RequestSender.js +6 -67
  19. package/esm/StripeResource.js +2 -2
  20. package/esm/apiVersion.js +0 -1
  21. package/esm/multipart.js +2 -2
  22. package/esm/resources/FinancialConnections/Accounts.js +0 -5
  23. package/esm/resources/Invoices.js +0 -17
  24. package/esm/resources/OAuth.js +2 -2
  25. package/esm/resources/PaymentIntents.js +0 -4
  26. package/esm/resources/Quotes.js +0 -32
  27. package/esm/resources/SubscriptionSchedules.js +0 -4
  28. package/esm/resources/Terminal/Readers.js +0 -12
  29. package/esm/resources.js +0 -26
  30. package/esm/stripe.core.js +3 -6
  31. package/esm/utils.js +1 -27
  32. package/package.json +1 -1
  33. package/types/AccountLinksResource.d.ts +2 -6
  34. package/types/AccountSessions.d.ts +0 -45
  35. package/types/AccountSessionsResource.d.ts +0 -260
  36. package/types/Accounts.d.ts +1 -113
  37. package/types/AccountsResource.d.ts +0 -270
  38. package/types/Charges.d.ts +0 -71
  39. package/types/ChargesResource.d.ts +0 -1294
  40. package/types/Checkout/Sessions.d.ts +4 -185
  41. package/types/Checkout/SessionsResource.d.ts +5 -349
  42. package/types/ConfirmationTokens.d.ts +0 -67
  43. package/types/Coupons.d.ts +1 -1
  44. package/types/CouponsResource.d.ts +1 -1
  45. package/types/CreditNotes.d.ts +0 -21
  46. package/types/CreditNotesResource.d.ts +0 -51
  47. package/types/CustomersResource.d.ts +0 -3
  48. package/types/Disputes.d.ts +0 -152
  49. package/types/DisputesResource.d.ts +0 -120
  50. package/types/EventTypes.d.ts +0 -460
  51. package/types/Events.d.ts +0 -85
  52. package/types/FileLinksResource.d.ts +1 -1
  53. package/types/Files.d.ts +1 -0
  54. package/types/FilesResource.d.ts +3 -1
  55. package/types/FinancialConnections/Accounts.d.ts +1 -29
  56. package/types/FinancialConnections/AccountsResource.d.ts +3 -35
  57. package/types/FinancialConnections/Sessions.d.ts +1 -49
  58. package/types/FinancialConnections/SessionsResource.d.ts +1 -38
  59. package/types/InvoiceItems.d.ts +0 -5
  60. package/types/InvoiceItemsResource.d.ts +0 -98
  61. package/types/InvoiceLineItems.d.ts +3 -23
  62. package/types/Invoices.d.ts +1 -116
  63. package/types/InvoicesResource.d.ts +1835 -5493
  64. package/types/Issuing/CardholdersResource.d.ts +1 -2
  65. package/types/Issuing/Cards.d.ts +1 -1
  66. package/types/LineItems.d.ts +1 -8
  67. package/types/Mandates.d.ts +0 -77
  68. package/types/PaymentIntents.d.ts +1 -502
  69. package/types/PaymentIntentsResource.d.ts +3464 -7064
  70. package/types/PaymentLinks.d.ts +0 -1
  71. package/types/PaymentLinksResource.d.ts +0 -2
  72. package/types/PaymentMethodConfigurations.d.ts +0 -36
  73. package/types/PaymentMethodConfigurationsResource.d.ts +0 -50
  74. package/types/PaymentMethods.d.ts +0 -67
  75. package/types/PaymentMethodsResource.d.ts +0 -119
  76. package/types/Prices.d.ts +0 -22
  77. package/types/PricesResource.d.ts +0 -22
  78. package/types/Products.d.ts +0 -39
  79. package/types/ProductsResource.d.ts +0 -36
  80. package/types/Quotes.d.ts +1 -596
  81. package/types/QuotesResource.d.ts +199 -2531
  82. package/types/SetupAttempts.d.ts +0 -9
  83. package/types/SetupIntents.d.ts +1 -110
  84. package/types/SetupIntentsResource.d.ts +3 -522
  85. package/types/Sources.d.ts +0 -23
  86. package/types/SubscriptionItems.d.ts +0 -21
  87. package/types/SubscriptionItemsResource.d.ts +0 -109
  88. package/types/SubscriptionSchedules.d.ts +0 -200
  89. package/types/SubscriptionSchedulesResource.d.ts +13 -1231
  90. package/types/Subscriptions.d.ts +1 -82
  91. package/types/SubscriptionsResource.d.ts +2 -347
  92. package/types/Tax/CalculationsResource.d.ts +1 -1
  93. package/types/Terminal/Readers.d.ts +0 -278
  94. package/types/Terminal/ReadersResource.d.ts +0 -208
  95. package/types/TestHelpers/ConfirmationTokensResource.d.ts +0 -63
  96. package/types/TestHelpers/TestClocks.d.ts +15 -0
  97. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +0 -26
  98. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +0 -26
  99. package/types/Treasury/FinancialAccounts.d.ts +0 -5
  100. package/types/Treasury/FinancialAccountsResource.d.ts +0 -10
  101. package/types/Treasury/OutboundTransfers.d.ts +0 -26
  102. package/types/Treasury/OutboundTransfersResource.d.ts +0 -26
  103. package/types/Treasury/ReceivedCredits.d.ts +0 -26
  104. package/types/Treasury/ReceivedDebits.d.ts +0 -31
  105. package/types/WebhookEndpointsResource.d.ts +0 -54
  106. package/types/index.d.ts +0 -67
  107. package/types/lib.d.ts +0 -12
  108. package/cjs/resources/AccountNotices.js +0 -21
  109. package/cjs/resources/Capital/FinancingOffers.js +0 -21
  110. package/cjs/resources/Capital/FinancingSummary.js +0 -12
  111. package/cjs/resources/Capital/FinancingTransactions.js +0 -17
  112. package/cjs/resources/FinancialConnections/Institutions.js +0 -17
  113. package/cjs/resources/GiftCards/Cards.js +0 -23
  114. package/cjs/resources/GiftCards/Transactions.js +0 -33
  115. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +0 -33
  116. package/cjs/resources/Margins.js +0 -22
  117. package/cjs/resources/Orders.js +0 -24
  118. package/cjs/resources/QuotePhases.js +0 -22
  119. package/cjs/resources/Tax/Associations.js +0 -9
  120. package/cjs/resources/Tax/Forms.js +0 -20
  121. package/esm/resources/AccountNotices.js +0 -18
  122. package/esm/resources/Capital/FinancingOffers.js +0 -18
  123. package/esm/resources/Capital/FinancingSummary.js +0 -9
  124. package/esm/resources/Capital/FinancingTransactions.js +0 -14
  125. package/esm/resources/FinancialConnections/Institutions.js +0 -14
  126. package/esm/resources/GiftCards/Cards.js +0 -20
  127. package/esm/resources/GiftCards/Transactions.js +0 -30
  128. package/esm/resources/Issuing/CreditUnderwritingRecords.js +0 -30
  129. package/esm/resources/Margins.js +0 -19
  130. package/esm/resources/Orders.js +0 -21
  131. package/esm/resources/QuotePhases.js +0 -19
  132. package/esm/resources/Tax/Associations.js +0 -6
  133. package/esm/resources/Tax/Forms.js +0 -17
  134. package/types/AccountNotices.d.ts +0 -113
  135. package/types/AccountNoticesResource.d.ts +0 -98
  136. package/types/Capital/FinancingOffers.d.ts +0 -188
  137. package/types/Capital/FinancingOffersResource.d.ts +0 -97
  138. package/types/Capital/FinancingSummary.d.ts +0 -106
  139. package/types/Capital/FinancingSummaryResource.d.ts +0 -27
  140. package/types/Capital/FinancingTransactions.d.ts +0 -135
  141. package/types/Capital/FinancingTransactionsResource.d.ts +0 -68
  142. package/types/FinancialConnections/AccountInferredBalances.d.ts +0 -38
  143. package/types/FinancialConnections/Institutions.d.ts +0 -93
  144. package/types/FinancialConnections/InstitutionsResource.d.ts +0 -47
  145. package/types/GiftCards/Cards.d.ts +0 -118
  146. package/types/GiftCards/CardsResource.d.ts +0 -159
  147. package/types/GiftCards/Transactions.d.ts +0 -129
  148. package/types/GiftCards/TransactionsResource.d.ts +0 -201
  149. package/types/InvoicePayments.d.ts +0 -138
  150. package/types/Issuing/CreditUnderwritingRecords.d.ts +0 -446
  151. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +0 -1017
  152. package/types/Margins.d.ts +0 -56
  153. package/types/MarginsResource.d.ts +0 -114
  154. package/types/Orders.d.ts +0 -1084
  155. package/types/OrdersResource.d.ts +0 -2765
  156. package/types/QuoteLines.d.ts +0 -634
  157. package/types/QuotePhases.d.ts +0 -198
  158. package/types/QuotePhasesResource.d.ts +0 -67
  159. package/types/QuotePreviewInvoices.d.ts +0 -1531
  160. package/types/QuotePreviewSubscriptionSchedules.d.ts +0 -814
  161. package/types/Tax/Associations.d.ts +0 -126
  162. package/types/Tax/AssociationsResource.d.ts +0 -29
  163. package/types/Tax/Forms.d.ts +0 -133
  164. package/types/Tax/FormsResource.d.ts +0 -90
@@ -1,814 +0,0 @@
1
- // File generated from our OpenAPI spec
2
-
3
- declare module 'stripe' {
4
- namespace Stripe {
5
- /**
6
- * The QuotePreviewSubscriptionSchedule object.
7
- */
8
- interface QuotePreviewSubscriptionSchedule {
9
- /**
10
- * Unique identifier for the object.
11
- */
12
- id: string;
13
-
14
- /**
15
- * String representing the object's type. Objects of the same type share the same value.
16
- */
17
- object: 'quote_preview_subscription_schedule';
18
-
19
- /**
20
- * ID of the Connect Application that created the schedule.
21
- */
22
- application:
23
- | string
24
- | Stripe.Application
25
- | Stripe.DeletedApplication
26
- | null;
27
-
28
- applies_to: QuotePreviewSubscriptionSchedule.AppliesTo;
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?: QuotePreviewSubscriptionSchedule.BillingBehavior;
34
-
35
- /**
36
- * Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
37
- */
38
- canceled_at: number | null;
39
-
40
- /**
41
- * Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
42
- */
43
- completed_at: number | null;
44
-
45
- /**
46
- * Time at which the object was created. Measured in seconds since the Unix epoch.
47
- */
48
- created: number;
49
-
50
- /**
51
- * Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`.
52
- */
53
- current_phase: QuotePreviewSubscriptionSchedule.CurrentPhase | null;
54
-
55
- /**
56
- * ID of the customer who owns the subscription schedule.
57
- */
58
- customer: string | Stripe.Customer | Stripe.DeletedCustomer;
59
-
60
- default_settings: QuotePreviewSubscriptionSchedule.DefaultSettings;
61
-
62
- /**
63
- * Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
64
- */
65
- end_behavior: QuotePreviewSubscriptionSchedule.EndBehavior;
66
-
67
- /**
68
- * Details of the most recent price migration that failed for the subscription schedule.
69
- */
70
- last_price_migration_error?: QuotePreviewSubscriptionSchedule.LastPriceMigrationError | null;
71
-
72
- /**
73
- * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
74
- */
75
- livemode: boolean;
76
-
77
- /**
78
- * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
79
- */
80
- metadata: Stripe.Metadata | null;
81
-
82
- /**
83
- * Configuration for the subscription schedule's phases.
84
- */
85
- phases: Array<QuotePreviewSubscriptionSchedule.Phase>;
86
-
87
- /**
88
- * Time period and invoice for a Subscription billed in advance.
89
- */
90
- prebilling?: QuotePreviewSubscriptionSchedule.Prebilling | null;
91
-
92
- /**
93
- * Time at which the subscription schedule was released. Measured in seconds since the Unix epoch.
94
- */
95
- released_at: number | null;
96
-
97
- /**
98
- * ID of the subscription once managed by the subscription schedule (if it is released).
99
- */
100
- released_subscription: string | null;
101
-
102
- /**
103
- * The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules).
104
- */
105
- status: QuotePreviewSubscriptionSchedule.Status;
106
-
107
- /**
108
- * ID of the subscription managed by the subscription schedule.
109
- */
110
- subscription: string | Stripe.Subscription | null;
111
-
112
- /**
113
- * ID of the test clock this subscription schedule belongs to.
114
- */
115
- test_clock: string | Stripe.TestHelpers.TestClock | null;
116
- }
117
-
118
- namespace QuotePreviewSubscriptionSchedule {
119
- interface AppliesTo {
120
- /**
121
- * A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
122
- */
123
- new_reference: string | null;
124
-
125
- /**
126
- * The ID of the schedule the line applies to.
127
- */
128
- subscription_schedule: string | null;
129
-
130
- /**
131
- * Describes whether the quote line is affecting a new schedule or an existing schedule.
132
- */
133
- type: AppliesTo.Type;
134
- }
135
-
136
- namespace AppliesTo {
137
- type Type = 'new_reference' | 'subscription_schedule';
138
- }
139
-
140
- type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
141
-
142
- interface CurrentPhase {
143
- /**
144
- * The end of this phase of the subscription schedule.
145
- */
146
- end_date: number;
147
-
148
- /**
149
- * The start of this phase of the subscription schedule.
150
- */
151
- start_date: number;
152
- }
153
-
154
- interface DefaultSettings {
155
- /**
156
- * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule.
157
- */
158
- application_fee_percent: number | null;
159
-
160
- automatic_tax?: DefaultSettings.AutomaticTax;
161
-
162
- /**
163
- * Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
164
- */
165
- billing_cycle_anchor: DefaultSettings.BillingCycleAnchor;
166
-
167
- /**
168
- * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
169
- */
170
- billing_thresholds: DefaultSettings.BillingThresholds | null;
171
-
172
- /**
173
- * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
174
- */
175
- collection_method: DefaultSettings.CollectionMethod | null;
176
-
177
- /**
178
- * ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
179
- */
180
- default_payment_method: string | Stripe.PaymentMethod | null;
181
-
182
- /**
183
- * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
184
- */
185
- description: string | null;
186
-
187
- invoice_settings: DefaultSettings.InvoiceSettings;
188
-
189
- /**
190
- * The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details.
191
- */
192
- on_behalf_of: string | Stripe.Account | null;
193
-
194
- /**
195
- * The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
196
- */
197
- transfer_data: DefaultSettings.TransferData | null;
198
- }
199
-
200
- namespace DefaultSettings {
201
- interface AutomaticTax {
202
- /**
203
- * Whether Stripe automatically computes tax on invoices created during this phase.
204
- */
205
- enabled: boolean;
206
-
207
- /**
208
- * The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
209
- */
210
- liability: AutomaticTax.Liability | null;
211
- }
212
-
213
- namespace AutomaticTax {
214
- interface Liability {
215
- /**
216
- * The connected account being referenced when `type` is `account`.
217
- */
218
- account?: string | Stripe.Account;
219
-
220
- /**
221
- * Type of the account referenced.
222
- */
223
- type: Liability.Type;
224
- }
225
-
226
- namespace Liability {
227
- type Type = 'account' | 'self';
228
- }
229
- }
230
-
231
- type BillingCycleAnchor = 'automatic' | 'phase_start';
232
-
233
- interface BillingThresholds {
234
- /**
235
- * Monetary threshold that triggers the subscription to create an invoice
236
- */
237
- amount_gte: number | null;
238
-
239
- /**
240
- * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.
241
- */
242
- reset_billing_cycle_anchor: boolean | null;
243
- }
244
-
245
- type CollectionMethod = 'charge_automatically' | 'send_invoice';
246
-
247
- interface InvoiceSettings {
248
- /**
249
- * The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule.
250
- */
251
- account_tax_ids: Array<
252
- string | Stripe.TaxId | Stripe.DeletedTaxId
253
- > | null;
254
-
255
- /**
256
- * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.
257
- */
258
- days_until_due: number | null;
259
-
260
- issuer: InvoiceSettings.Issuer;
261
- }
262
-
263
- namespace InvoiceSettings {
264
- interface Issuer {
265
- /**
266
- * The connected account being referenced when `type` is `account`.
267
- */
268
- account?: string | Stripe.Account;
269
-
270
- /**
271
- * Type of the account referenced.
272
- */
273
- type: Issuer.Type;
274
- }
275
-
276
- namespace Issuer {
277
- type Type = 'account' | 'self';
278
- }
279
- }
280
-
281
- interface TransferData {
282
- /**
283
- * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
284
- */
285
- amount_percent: number | null;
286
-
287
- /**
288
- * The account where funds from the payment will be transferred to upon payment success.
289
- */
290
- destination: string | Stripe.Account;
291
- }
292
- }
293
-
294
- type EndBehavior = 'cancel' | 'none' | 'release' | 'renew';
295
-
296
- interface LastPriceMigrationError {
297
- /**
298
- * The time at which the price migration encountered an error.
299
- */
300
- errored_at: number;
301
-
302
- /**
303
- * The involved price pairs in each failed transition.
304
- */
305
- failed_transitions: Array<LastPriceMigrationError.FailedTransition>;
306
-
307
- /**
308
- * The type of error encountered by the price migration.
309
- */
310
- type: 'price_uniqueness_violation';
311
- }
312
-
313
- namespace LastPriceMigrationError {
314
- interface FailedTransition {
315
- /**
316
- * The original price to be migrated.
317
- */
318
- source_price: string;
319
-
320
- /**
321
- * The intended resulting price of the migration.
322
- */
323
- target_price: string;
324
- }
325
- }
326
-
327
- interface Phase {
328
- /**
329
- * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase.
330
- */
331
- add_invoice_items: Array<Phase.AddInvoiceItem>;
332
-
333
- /**
334
- * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule.
335
- */
336
- application_fee_percent: number | null;
337
-
338
- automatic_tax?: Phase.AutomaticTax;
339
-
340
- /**
341
- * Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
342
- */
343
- billing_cycle_anchor: Phase.BillingCycleAnchor | null;
344
-
345
- /**
346
- * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
347
- */
348
- billing_thresholds: Phase.BillingThresholds | null;
349
-
350
- /**
351
- * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
352
- */
353
- collection_method: Phase.CollectionMethod | null;
354
-
355
- /**
356
- * ID of the coupon to use during this phase of the subscription schedule.
357
- */
358
- coupon: string | Stripe.Coupon | Stripe.DeletedCoupon | null;
359
-
360
- /**
361
- * 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).
362
- */
363
- currency: string;
364
-
365
- /**
366
- * ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
367
- */
368
- default_payment_method: string | Stripe.PaymentMethod | null;
369
-
370
- /**
371
- * The default tax rates to apply to the subscription during this phase of the subscription schedule.
372
- */
373
- default_tax_rates?: Array<Stripe.TaxRate> | null;
374
-
375
- /**
376
- * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
377
- */
378
- description: string | null;
379
-
380
- /**
381
- * The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts.
382
- */
383
- discounts: Array<Phase.Discount>;
384
-
385
- /**
386
- * The end of this phase of the subscription schedule.
387
- */
388
- end_date: number;
389
-
390
- /**
391
- * The invoice settings applicable during this phase.
392
- */
393
- invoice_settings: Phase.InvoiceSettings | null;
394
-
395
- /**
396
- * Subscription items to configure the subscription to during this phase of the subscription schedule.
397
- */
398
- items: Array<Phase.Item>;
399
-
400
- /**
401
- * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`.
402
- */
403
- metadata: Stripe.Metadata | null;
404
-
405
- /**
406
- * The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details.
407
- */
408
- on_behalf_of: string | Stripe.Account | null;
409
-
410
- /**
411
- * 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/billing/subscriptions/pause-payment).
412
- */
413
- pause_collection?: Phase.PauseCollection | null;
414
-
415
- /**
416
- * If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`.
417
- */
418
- proration_behavior: Phase.ProrationBehavior;
419
-
420
- /**
421
- * The start of this phase of the subscription schedule.
422
- */
423
- start_date: number;
424
-
425
- /**
426
- * The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
427
- */
428
- transfer_data: Phase.TransferData | null;
429
-
430
- /**
431
- * Specify behavior of the trial when crossing schedule phase boundaries
432
- */
433
- trial_continuation?: Phase.TrialContinuation | null;
434
-
435
- /**
436
- * When the trial ends within the phase.
437
- */
438
- trial_end: number | null;
439
-
440
- /**
441
- * Settings related to any trials on the subscription during this phase.
442
- */
443
- trial_settings?: Phase.TrialSettings | null;
444
- }
445
-
446
- namespace Phase {
447
- interface AddInvoiceItem {
448
- /**
449
- * The stackable discounts that will be applied to the item.
450
- */
451
- discounts: Array<AddInvoiceItem.Discount>;
452
-
453
- /**
454
- * ID of the price used to generate the invoice item.
455
- */
456
- price: string | Stripe.Price | Stripe.DeletedPrice;
457
-
458
- /**
459
- * The quantity of the invoice item.
460
- */
461
- quantity: number | null;
462
-
463
- /**
464
- * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
465
- */
466
- tax_rates?: Array<Stripe.TaxRate> | null;
467
- }
468
-
469
- namespace AddInvoiceItem {
470
- interface Discount {
471
- /**
472
- * ID of the coupon to create a new discount for.
473
- */
474
- coupon: string | Stripe.Coupon | null;
475
-
476
- /**
477
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
478
- */
479
- discount: string | Stripe.Discount | null;
480
-
481
- /**
482
- * Details to determine how long the discount should be applied for.
483
- */
484
- discount_end?: Discount.DiscountEnd | null;
485
-
486
- /**
487
- * ID of the promotion code to create a new discount for.
488
- */
489
- promotion_code: string | Stripe.PromotionCode | null;
490
- }
491
-
492
- namespace Discount {
493
- interface DiscountEnd {
494
- /**
495
- * The discount end timestamp.
496
- */
497
- timestamp: number | null;
498
-
499
- /**
500
- * The discount end type.
501
- */
502
- type: 'timestamp';
503
- }
504
- }
505
- }
506
-
507
- interface AutomaticTax {
508
- /**
509
- * Whether Stripe automatically computes tax on invoices created during this phase.
510
- */
511
- enabled: boolean;
512
-
513
- /**
514
- * The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
515
- */
516
- liability: AutomaticTax.Liability | null;
517
- }
518
-
519
- namespace AutomaticTax {
520
- interface Liability {
521
- /**
522
- * The connected account being referenced when `type` is `account`.
523
- */
524
- account?: string | Stripe.Account;
525
-
526
- /**
527
- * Type of the account referenced.
528
- */
529
- type: Liability.Type;
530
- }
531
-
532
- namespace Liability {
533
- type Type = 'account' | 'self';
534
- }
535
- }
536
-
537
- type BillingCycleAnchor = 'automatic' | 'phase_start';
538
-
539
- interface BillingThresholds {
540
- /**
541
- * Monetary threshold that triggers the subscription to create an invoice
542
- */
543
- amount_gte: number | null;
544
-
545
- /**
546
- * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.
547
- */
548
- reset_billing_cycle_anchor: boolean | null;
549
- }
550
-
551
- type CollectionMethod = 'charge_automatically' | 'send_invoice';
552
-
553
- interface Discount {
554
- /**
555
- * ID of the coupon to create a new discount for.
556
- */
557
- coupon: string | Stripe.Coupon | null;
558
-
559
- /**
560
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
561
- */
562
- discount: string | Stripe.Discount | null;
563
-
564
- /**
565
- * Details to determine how long the discount should be applied for.
566
- */
567
- discount_end?: Discount.DiscountEnd | null;
568
-
569
- /**
570
- * ID of the promotion code to create a new discount for.
571
- */
572
- promotion_code: string | Stripe.PromotionCode | null;
573
- }
574
-
575
- namespace Discount {
576
- interface DiscountEnd {
577
- /**
578
- * The discount end timestamp.
579
- */
580
- timestamp: number | null;
581
-
582
- /**
583
- * The discount end type.
584
- */
585
- type: 'timestamp';
586
- }
587
- }
588
-
589
- interface InvoiceSettings {
590
- /**
591
- * 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.
592
- */
593
- account_tax_ids: Array<
594
- string | Stripe.TaxId | Stripe.DeletedTaxId
595
- > | null;
596
-
597
- /**
598
- * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.
599
- */
600
- days_until_due: number | null;
601
-
602
- /**
603
- * The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
604
- */
605
- issuer: InvoiceSettings.Issuer | null;
606
- }
607
-
608
- namespace InvoiceSettings {
609
- interface Issuer {
610
- /**
611
- * The connected account being referenced when `type` is `account`.
612
- */
613
- account?: string | Stripe.Account;
614
-
615
- /**
616
- * Type of the account referenced.
617
- */
618
- type: Issuer.Type;
619
- }
620
-
621
- namespace Issuer {
622
- type Type = 'account' | 'self';
623
- }
624
- }
625
-
626
- interface Item {
627
- /**
628
- * Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period
629
- */
630
- billing_thresholds: Item.BillingThresholds | null;
631
-
632
- /**
633
- * The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
634
- */
635
- discounts: Array<Item.Discount>;
636
-
637
- /**
638
- * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered.
639
- */
640
- metadata: Stripe.Metadata | null;
641
-
642
- /**
643
- * ID of the plan to which the customer should be subscribed.
644
- */
645
- plan: string | Stripe.Plan | Stripe.DeletedPlan;
646
-
647
- /**
648
- * ID of the price to which the customer should be subscribed.
649
- */
650
- price: string | Stripe.Price | Stripe.DeletedPrice;
651
-
652
- /**
653
- * Quantity of the plan to which the customer should be subscribed.
654
- */
655
- quantity?: number;
656
-
657
- /**
658
- * 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`.
659
- */
660
- tax_rates?: Array<Stripe.TaxRate> | null;
661
-
662
- /**
663
- * Options that configure the trial on the subscription item.
664
- */
665
- trial?: Item.Trial | null;
666
- }
667
-
668
- namespace Item {
669
- interface BillingThresholds {
670
- /**
671
- * Usage threshold that triggers the subscription to create an invoice
672
- */
673
- usage_gte: number | null;
674
- }
675
-
676
- interface Discount {
677
- /**
678
- * ID of the coupon to create a new discount for.
679
- */
680
- coupon: string | Stripe.Coupon | null;
681
-
682
- /**
683
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
684
- */
685
- discount: string | Stripe.Discount | null;
686
-
687
- /**
688
- * Details to determine how long the discount should be applied for.
689
- */
690
- discount_end?: Discount.DiscountEnd | null;
691
-
692
- /**
693
- * ID of the promotion code to create a new discount for.
694
- */
695
- promotion_code: string | Stripe.PromotionCode | null;
696
- }
697
-
698
- namespace Discount {
699
- interface DiscountEnd {
700
- /**
701
- * The discount end timestamp.
702
- */
703
- timestamp: number | null;
704
-
705
- /**
706
- * The discount end type.
707
- */
708
- type: 'timestamp';
709
- }
710
- }
711
-
712
- interface Trial {
713
- /**
714
- * List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial.
715
- */
716
- converts_to?: Array<string> | null;
717
-
718
- /**
719
- * Determines the type of trial for this item.
720
- */
721
- type: Trial.Type;
722
- }
723
-
724
- namespace Trial {
725
- type Type = 'free' | 'paid';
726
- }
727
- }
728
-
729
- interface PauseCollection {
730
- /**
731
- * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
732
- */
733
- behavior: PauseCollection.Behavior;
734
- }
735
-
736
- namespace PauseCollection {
737
- type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
738
- }
739
-
740
- type ProrationBehavior =
741
- | 'always_invoice'
742
- | 'create_prorations'
743
- | 'none';
744
-
745
- interface TransferData {
746
- /**
747
- * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
748
- */
749
- amount_percent: number | null;
750
-
751
- /**
752
- * The account where funds from the payment will be transferred to upon payment success.
753
- */
754
- destination: string | Stripe.Account;
755
- }
756
-
757
- type TrialContinuation = 'continue' | 'none';
758
-
759
- interface TrialSettings {
760
- /**
761
- * Defines how the subscription should behave when a trial ends.
762
- */
763
- end_behavior: TrialSettings.EndBehavior | null;
764
- }
765
-
766
- namespace TrialSettings {
767
- interface EndBehavior {
768
- /**
769
- * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
770
- */
771
- prorate_up_front: EndBehavior.ProrateUpFront | null;
772
- }
773
-
774
- namespace EndBehavior {
775
- type ProrateUpFront = 'defer' | 'include';
776
- }
777
- }
778
- }
779
-
780
- interface Prebilling {
781
- /**
782
- * ID of the prebilling invoice.
783
- */
784
- invoice: string | Stripe.Invoice;
785
-
786
- /**
787
- * The end of the last period for which the invoice pre-bills.
788
- */
789
- period_end: number;
790
-
791
- /**
792
- * The start of the first period for which the invoice pre-bills.
793
- */
794
- period_start: number;
795
-
796
- /**
797
- * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
798
- */
799
- update_behavior?: Prebilling.UpdateBehavior;
800
- }
801
-
802
- namespace Prebilling {
803
- type UpdateBehavior = 'prebill' | 'reset';
804
- }
805
-
806
- type Status =
807
- | 'active'
808
- | 'canceled'
809
- | 'completed'
810
- | 'not_started'
811
- | 'released';
812
- }
813
- }
814
- }