stripe 15.12.0-beta.1 → 16.0.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 (167) hide show
  1. package/CHANGELOG.md +155 -746
  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 +2 -3
  7. package/cjs/multipart.js +1 -1
  8. package/cjs/resources/FinancialConnections/Accounts.js +0 -5
  9. package/cjs/resources/Invoices.js +0 -25
  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/TestHelpers/Issuing/Authorizations.js +4 -0
  16. package/cjs/resources.js +10 -36
  17. package/cjs/stripe.core.js +3 -6
  18. package/cjs/utils.js +3 -30
  19. package/esm/RequestSender.js +6 -67
  20. package/esm/StripeResource.js +2 -2
  21. package/esm/apiVersion.js +1 -2
  22. package/esm/multipart.js +2 -2
  23. package/esm/resources/FinancialConnections/Accounts.js +0 -5
  24. package/esm/resources/Invoices.js +0 -25
  25. package/esm/resources/OAuth.js +2 -2
  26. package/esm/resources/PaymentIntents.js +0 -4
  27. package/esm/resources/Quotes.js +0 -32
  28. package/esm/resources/SubscriptionSchedules.js +0 -4
  29. package/esm/resources/Terminal/Readers.js +0 -12
  30. package/esm/resources/TestHelpers/Issuing/Authorizations.js +4 -0
  31. package/esm/resources.js +0 -22
  32. package/esm/stripe.core.js +3 -6
  33. package/esm/utils.js +1 -27
  34. package/package.json +5 -1
  35. package/types/AccountLinksResource.d.ts +1 -5
  36. package/types/AccountSessions.d.ts +0 -15
  37. package/types/AccountSessionsResource.d.ts +0 -205
  38. package/types/Accounts.d.ts +1 -88
  39. package/types/AccountsResource.d.ts +1 -205
  40. package/types/BalanceTransactionSources.d.ts +0 -1
  41. package/types/Capabilities.d.ts +27 -7
  42. package/types/Charges.d.ts +0 -67
  43. package/types/ChargesResource.d.ts +0 -1294
  44. package/types/Checkout/Sessions.d.ts +3 -24
  45. package/types/Checkout/SessionsResource.d.ts +3 -17
  46. package/types/ConfirmationTokens.d.ts +0 -83
  47. package/types/Coupons.d.ts +1 -1
  48. package/types/CouponsResource.d.ts +1 -1
  49. package/types/CreditNotes.d.ts +0 -21
  50. package/types/CreditNotesResource.d.ts +0 -51
  51. package/types/CustomerSessions.d.ts +0 -55
  52. package/types/CustomerSessionsResource.d.ts +0 -55
  53. package/types/CustomersResource.d.ts +4 -4
  54. package/types/Disputes.d.ts +0 -167
  55. package/types/DisputesResource.d.ts +0 -120
  56. package/types/EventTypes.d.ts +0 -426
  57. package/types/Events.d.ts +0 -83
  58. package/types/FinancialConnections/Accounts.d.ts +1 -29
  59. package/types/FinancialConnections/AccountsResource.d.ts +3 -35
  60. package/types/FinancialConnections/Sessions.d.ts +1 -44
  61. package/types/FinancialConnections/SessionsResource.d.ts +1 -33
  62. package/types/InvoiceItems.d.ts +0 -5
  63. package/types/InvoiceItemsResource.d.ts +0 -98
  64. package/types/InvoiceLineItems.d.ts +0 -22
  65. package/types/Invoices.d.ts +3 -111
  66. package/types/InvoicesResource.d.ts +2171 -6311
  67. package/types/Issuing/Authorizations.d.ts +173 -0
  68. package/types/Issuing/CardholdersResource.d.ts +1 -2
  69. package/types/Issuing/Cards.d.ts +0 -34
  70. package/types/Issuing/CardsResource.d.ts +0 -125
  71. package/types/Issuing/Transactions.d.ts +112 -6
  72. package/types/LineItems.d.ts +0 -7
  73. package/types/Mandates.d.ts +0 -77
  74. package/types/PaymentIntents.d.ts +1 -463
  75. package/types/PaymentIntentsResource.d.ts +3360 -6731
  76. package/types/PaymentLinks.d.ts +1 -0
  77. package/types/PaymentLinksResource.d.ts +15 -1
  78. package/types/PaymentMethods.d.ts +0 -62
  79. package/types/PaymentMethodsResource.d.ts +12 -124
  80. package/types/Prices.d.ts +0 -22
  81. package/types/PricesResource.d.ts +0 -22
  82. package/types/Products.d.ts +0 -39
  83. package/types/ProductsResource.d.ts +0 -36
  84. package/types/Quotes.d.ts +1 -578
  85. package/types/QuotesResource.d.ts +266 -3175
  86. package/types/SetupAttempts.d.ts +0 -8
  87. package/types/SetupIntents.d.ts +1 -104
  88. package/types/SetupIntentsResource.d.ts +9 -527
  89. package/types/Sources.d.ts +0 -23
  90. package/types/SubscriptionItems.d.ts +0 -21
  91. package/types/SubscriptionItemsResource.d.ts +0 -109
  92. package/types/SubscriptionSchedules.d.ts +0 -164
  93. package/types/SubscriptionSchedulesResource.d.ts +13 -1231
  94. package/types/Subscriptions.d.ts +1 -41
  95. package/types/SubscriptionsResource.d.ts +2 -337
  96. package/types/Tax/Calculations.d.ts +2 -1
  97. package/types/Tax/CalculationsResource.d.ts +4 -3
  98. package/types/Tax/Transactions.d.ts +2 -1
  99. package/types/TaxIds.d.ts +2 -1
  100. package/types/TaxIdsResource.d.ts +2 -1
  101. package/types/Terminal/ConnectionTokens.d.ts +1 -1
  102. package/types/Terminal/ConnectionTokensResource.d.ts +1 -1
  103. package/types/Terminal/Readers.d.ts +0 -278
  104. package/types/Terminal/ReadersResource.d.ts +0 -208
  105. package/types/TestHelpers/ConfirmationTokensResource.d.ts +0 -55
  106. package/types/TestHelpers/Issuing/AuthorizationsResource.d.ts +480 -7
  107. package/types/TestHelpers/Issuing/TransactionsResource.d.ts +262 -14
  108. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +0 -26
  109. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +0 -26
  110. package/types/Treasury/OutboundTransfers.d.ts +0 -26
  111. package/types/Treasury/OutboundTransfersResource.d.ts +0 -26
  112. package/types/Treasury/ReceivedCredits.d.ts +0 -26
  113. package/types/Treasury/ReceivedDebits.d.ts +0 -31
  114. package/types/WebhookEndpointsResource.d.ts +2 -51
  115. package/types/index.d.ts +0 -62
  116. package/types/lib.d.ts +1 -13
  117. package/types/test/typescriptTest.ts +3 -3
  118. package/cjs/resources/AccountNotices.js +0 -21
  119. package/cjs/resources/Capital/FinancingOffers.js +0 -21
  120. package/cjs/resources/Capital/FinancingSummary.js +0 -12
  121. package/cjs/resources/Capital/FinancingTransactions.js +0 -17
  122. package/cjs/resources/GiftCards/Cards.js +0 -23
  123. package/cjs/resources/GiftCards/Transactions.js +0 -33
  124. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +0 -33
  125. package/cjs/resources/Margins.js +0 -22
  126. package/cjs/resources/Orders.js +0 -24
  127. package/cjs/resources/QuotePhases.js +0 -22
  128. package/cjs/resources/Tax/Forms.js +0 -20
  129. package/esm/resources/AccountNotices.js +0 -18
  130. package/esm/resources/Capital/FinancingOffers.js +0 -18
  131. package/esm/resources/Capital/FinancingSummary.js +0 -9
  132. package/esm/resources/Capital/FinancingTransactions.js +0 -14
  133. package/esm/resources/GiftCards/Cards.js +0 -20
  134. package/esm/resources/GiftCards/Transactions.js +0 -30
  135. package/esm/resources/Issuing/CreditUnderwritingRecords.js +0 -30
  136. package/esm/resources/Margins.js +0 -19
  137. package/esm/resources/Orders.js +0 -21
  138. package/esm/resources/QuotePhases.js +0 -19
  139. package/esm/resources/Tax/Forms.js +0 -17
  140. package/types/AccountNotices.d.ts +0 -110
  141. package/types/AccountNoticesResource.d.ts +0 -98
  142. package/types/Capital/FinancingOffers.d.ts +0 -188
  143. package/types/Capital/FinancingOffersResource.d.ts +0 -97
  144. package/types/Capital/FinancingSummary.d.ts +0 -106
  145. package/types/Capital/FinancingSummaryResource.d.ts +0 -27
  146. package/types/Capital/FinancingTransactions.d.ts +0 -135
  147. package/types/Capital/FinancingTransactionsResource.d.ts +0 -68
  148. package/types/FinancialConnections/AccountInferredBalances.d.ts +0 -38
  149. package/types/GiftCards/Cards.d.ts +0 -118
  150. package/types/GiftCards/CardsResource.d.ts +0 -159
  151. package/types/GiftCards/Transactions.d.ts +0 -129
  152. package/types/GiftCards/TransactionsResource.d.ts +0 -201
  153. package/types/InvoicePayments.d.ts +0 -91
  154. package/types/Issuing/CreditUnderwritingRecords.d.ts +0 -446
  155. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +0 -1017
  156. package/types/Margins.d.ts +0 -56
  157. package/types/MarginsResource.d.ts +0 -114
  158. package/types/Orders.d.ts +0 -1056
  159. package/types/OrdersResource.d.ts +0 -2709
  160. package/types/PlatformTaxFees.d.ts +0 -35
  161. package/types/QuoteLines.d.ts +0 -634
  162. package/types/QuotePhases.d.ts +0 -198
  163. package/types/QuotePhasesResource.d.ts +0 -67
  164. package/types/QuotePreviewInvoices.d.ts +0 -1514
  165. package/types/QuotePreviewSubscriptionSchedules.d.ts +0 -778
  166. package/types/Tax/Forms.d.ts +0 -133
  167. package/types/Tax/FormsResource.d.ts +0 -90
@@ -3,11 +3,6 @@
3
3
  declare module 'stripe' {
4
4
  namespace Stripe {
5
5
  interface QuoteCreateParams {
6
- /**
7
- * Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
8
- */
9
- allow_backdated_lines?: boolean;
10
-
11
6
  /**
12
7
  * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
13
8
  */
@@ -83,11 +78,6 @@ declare module 'stripe' {
83
78
  */
84
79
  line_items?: Array<QuoteCreateParams.LineItem>;
85
80
 
86
- /**
87
- * A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
88
- */
89
- lines?: Array<QuoteCreateParams.Line>;
90
-
91
81
  /**
92
82
  * 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
93
83
  */
@@ -98,23 +88,11 @@ declare module 'stripe' {
98
88
  */
99
89
  on_behalf_of?: Stripe.Emptyable<string>;
100
90
 
101
- /**
102
- * List representing phases of the Quote. Each phase can be customized to have different durations, prices, and coupons.
103
- */
104
- phases?: Array<QuoteCreateParams.Phase>;
105
-
106
91
  /**
107
92
  * When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
108
93
  */
109
94
  subscription_data?: QuoteCreateParams.SubscriptionData;
110
95
 
111
- /**
112
- * List representing overrides for `subscription_data` configurations for specific subscription schedules.
113
- */
114
- subscription_data_overrides?: Array<
115
- QuoteCreateParams.SubscriptionDataOverride
116
- >;
117
-
118
96
  /**
119
97
  * ID of the test clock to attach to the quote.
120
98
  */
@@ -170,56 +148,12 @@ declare module 'stripe' {
170
148
  */
171
149
  discount?: string;
172
150
 
173
- /**
174
- * Details to determine how long the discount should be applied for.
175
- */
176
- discount_end?: Discount.DiscountEnd;
177
-
178
151
  /**
179
152
  * ID of the promotion code to create a new discount for.
180
153
  */
181
154
  promotion_code?: string;
182
155
  }
183
156
 
184
- namespace Discount {
185
- interface DiscountEnd {
186
- /**
187
- * Time span for the redeemed discount.
188
- */
189
- duration?: DiscountEnd.Duration;
190
-
191
- /**
192
- * A precise Unix timestamp for the discount to end. Must be in the future.
193
- */
194
- timestamp?: number;
195
-
196
- /**
197
- * The type of calculation made to determine when the discount ends.
198
- */
199
- type: DiscountEnd.Type;
200
- }
201
-
202
- namespace DiscountEnd {
203
- interface Duration {
204
- /**
205
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
206
- */
207
- interval: Duration.Interval;
208
-
209
- /**
210
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
211
- */
212
- interval_count: number;
213
- }
214
-
215
- namespace Duration {
216
- type Interval = 'day' | 'month' | 'week' | 'year';
217
- }
218
-
219
- type Type = 'duration' | 'timestamp';
220
- }
221
- }
222
-
223
157
  interface FromQuote {
224
158
  /**
225
159
  * Whether this quote is a revision of the previous quote.
@@ -262,3130 +196,446 @@ declare module 'stripe' {
262
196
  }
263
197
  }
264
198
 
265
- interface Line {
266
- /**
267
- * An array of operations the quote line performs.
268
- */
269
- actions?: Array<Line.Action>;
270
-
271
- /**
272
- * Details to identify the subscription schedule the quote line applies to.
273
- */
274
- applies_to?: Line.AppliesTo;
275
-
276
- /**
277
- * For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
278
- */
279
- billing_cycle_anchor?: Line.BillingCycleAnchor;
280
-
281
- /**
282
- * A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
283
- */
284
- cancel_subscription_schedule?: Line.CancelSubscriptionSchedule;
285
-
286
- /**
287
- * Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
288
- */
289
- ends_at?: Line.EndsAt;
290
-
199
+ interface LineItem {
291
200
  /**
292
- * Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
201
+ * The discounts applied to this line item.
293
202
  */
294
- proration_behavior?: Line.ProrationBehavior;
203
+ discounts?: Stripe.Emptyable<Array<LineItem.Discount>>;
295
204
 
296
205
  /**
297
- * Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
206
+ * The ID of the price object. One of `price` or `price_data` is required.
298
207
  */
299
- set_pause_collection?: Line.SetPauseCollection;
208
+ price?: string;
300
209
 
301
210
  /**
302
- * Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
211
+ * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
303
212
  */
304
- set_schedule_end?: Line.SetScheduleEnd;
213
+ price_data?: LineItem.PriceData;
305
214
 
306
215
  /**
307
- * Details to identify the earliest timestamp where the proposed change should take effect.
216
+ * The quantity of the line item.
308
217
  */
309
- starts_at?: Line.StartsAt;
218
+ quantity?: number;
310
219
 
311
220
  /**
312
- * Settings related to subscription trials.
221
+ * The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item.
313
222
  */
314
- trial_settings?: Line.TrialSettings;
223
+ tax_rates?: Stripe.Emptyable<Array<string>>;
315
224
  }
316
225
 
317
- namespace Line {
318
- interface Action {
319
- /**
320
- * Details for the `add_discount` type.
321
- */
322
- add_discount?: Action.AddDiscount;
323
-
226
+ namespace LineItem {
227
+ interface Discount {
324
228
  /**
325
- * Details for the `add_item` type.
229
+ * ID of the coupon to create a new discount for.
326
230
  */
327
- add_item?: Action.AddItem;
231
+ coupon?: string;
328
232
 
329
233
  /**
330
- * Details for the `add_metadata` type: specify a hash of key-value pairs.
234
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
331
235
  */
332
- add_metadata?: {
333
- [key: string]: string;
334
- };
236
+ discount?: string;
335
237
 
336
238
  /**
337
- * Details for the `remove_discount` type.
239
+ * ID of the promotion code to create a new discount for.
338
240
  */
339
- remove_discount?: Action.RemoveDiscount;
241
+ promotion_code?: string;
242
+ }
340
243
 
244
+ interface PriceData {
341
245
  /**
342
- * Details for the `remove_item` type.
246
+ * 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).
343
247
  */
344
- remove_item?: Action.RemoveItem;
248
+ currency: string;
345
249
 
346
250
  /**
347
- * Details for the `remove_metadata` type: specify an array of metadata keys.
251
+ * The ID of the product that this price will belong to.
348
252
  */
349
- remove_metadata?: Array<string>;
253
+ product: string;
350
254
 
351
255
  /**
352
- * Details for the `set_discounts` type.
256
+ * The recurring components of a price such as `interval` and `interval_count`.
353
257
  */
354
- set_discounts?: Array<Action.SetDiscount>;
258
+ recurring?: PriceData.Recurring;
355
259
 
356
260
  /**
357
- * Details for the `set_items` type.
261
+ * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
358
262
  */
359
- set_items?: Array<Action.SetItem>;
263
+ tax_behavior?: PriceData.TaxBehavior;
360
264
 
361
265
  /**
362
- * Details for the `set_metadata` type: specify an array of key-value pairs.
266
+ * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
363
267
  */
364
- set_metadata?: Stripe.Emptyable<{
365
- [key: string]: string;
366
- }>;
268
+ unit_amount?: number;
367
269
 
368
270
  /**
369
- * The type of action the quote line performs.
271
+ * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
370
272
  */
371
- type: Action.Type;
273
+ unit_amount_decimal?: string;
372
274
  }
373
275
 
374
- namespace Action {
375
- interface AddDiscount {
376
- /**
377
- * The coupon code to redeem.
378
- */
379
- coupon?: string;
380
-
381
- /**
382
- * An ID of an existing discount for a coupon that was already redeemed.
383
- */
384
- discount?: string;
385
-
386
- /**
387
- * Details to determine how long the discount should be applied for.
388
- */
389
- discount_end?: AddDiscount.DiscountEnd;
390
-
276
+ namespace PriceData {
277
+ interface Recurring {
391
278
  /**
392
- * The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
279
+ * Specifies billing frequency. Either `day`, `week`, `month` or `year`.
393
280
  */
394
- index?: number;
281
+ interval: Recurring.Interval;
395
282
 
396
283
  /**
397
- * The promotion code to redeem.
284
+ * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
398
285
  */
399
- promotion_code?: string;
286
+ interval_count?: number;
400
287
  }
401
288
 
402
- namespace AddDiscount {
403
- interface DiscountEnd {
404
- /**
405
- * The type of calculation made to determine when the discount ends.
406
- */
407
- type: 'line_ends_at';
408
- }
289
+ namespace Recurring {
290
+ type Interval = 'day' | 'month' | 'week' | 'year';
409
291
  }
410
292
 
411
- interface AddItem {
412
- /**
413
- * The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
414
- */
415
- discounts?: Array<AddItem.Discount>;
416
-
417
- /**
418
- * 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
419
- */
420
- metadata?: Stripe.MetadataParam;
293
+ type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
294
+ }
295
+ }
421
296
 
422
- /**
423
- * The ID of the price object.
424
- */
425
- price: string;
297
+ interface SubscriptionData {
298
+ /**
299
+ * The subscription's 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.
300
+ */
301
+ description?: string;
426
302
 
427
- /**
428
- * Quantity for this item.
429
- */
430
- quantity?: number;
303
+ /**
304
+ * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
305
+ */
306
+ effective_date?: Stripe.Emptyable<'current_period_end' | number>;
431
307
 
432
- /**
433
- * The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
434
- */
435
- tax_rates?: Array<string>;
308
+ /**
309
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
310
+ */
311
+ metadata?: Stripe.MetadataParam;
436
312
 
437
- /**
438
- * Options that configure the trial on the subscription item.
439
- */
440
- trial?: AddItem.Trial;
441
- }
313
+ /**
314
+ * Integer representing the number of trial period days before the customer is charged for the first time.
315
+ */
316
+ trial_period_days?: Stripe.Emptyable<number>;
317
+ }
442
318
 
443
- namespace AddItem {
444
- interface Discount {
445
- /**
446
- * ID of the coupon to create a new discount for.
447
- */
448
- coupon?: string;
449
-
450
- /**
451
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
452
- */
453
- discount?: string;
454
-
455
- /**
456
- * Details to determine how long the discount should be applied for.
457
- */
458
- discount_end?: Discount.DiscountEnd;
459
-
460
- /**
461
- * ID of the promotion code to create a new discount for.
462
- */
463
- promotion_code?: string;
464
- }
465
-
466
- namespace Discount {
467
- interface DiscountEnd {
468
- /**
469
- * Time span for the redeemed discount.
470
- */
471
- duration?: DiscountEnd.Duration;
472
-
473
- /**
474
- * A precise Unix timestamp for the discount to end. Must be in the future.
475
- */
476
- timestamp?: number;
477
-
478
- /**
479
- * The type of calculation made to determine when the discount ends.
480
- */
481
- type: DiscountEnd.Type;
482
- }
483
-
484
- namespace DiscountEnd {
485
- interface Duration {
486
- /**
487
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
488
- */
489
- interval: Duration.Interval;
490
-
491
- /**
492
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
493
- */
494
- interval_count: number;
495
- }
496
-
497
- namespace Duration {
498
- type Interval = 'day' | 'month' | 'week' | 'year';
499
- }
500
-
501
- type Type = 'duration' | 'timestamp';
502
- }
503
- }
504
-
505
- interface Trial {
506
- /**
507
- * 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.
508
- */
509
- converts_to?: Array<string>;
510
-
511
- /**
512
- * Determines the type of trial for this item.
513
- */
514
- type: Trial.Type;
515
- }
516
-
517
- namespace Trial {
518
- type Type = 'free' | 'paid';
519
- }
520
- }
319
+ interface TransferData {
320
+ /**
321
+ * The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
322
+ */
323
+ amount?: number;
521
324
 
522
- interface RemoveDiscount {
523
- /**
524
- * The coupon code to remove from the `discounts` array.
525
- */
526
- coupon?: string;
325
+ /**
326
+ * 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. There must be at least 1 line item with a recurring price to use this field.
327
+ */
328
+ amount_percent?: number;
527
329
 
528
- /**
529
- * The ID of a discount to remove from the `discounts` array.
530
- */
531
- discount?: string;
330
+ /**
331
+ * ID of an existing, connected Stripe account.
332
+ */
333
+ destination: string;
334
+ }
335
+ }
532
336
 
533
- /**
534
- * The ID of a promotion code to remove from the `discounts` array.
535
- */
536
- promotion_code?: string;
537
- }
337
+ interface QuoteRetrieveParams {
338
+ /**
339
+ * Specifies which fields in the response should be expanded.
340
+ */
341
+ expand?: Array<string>;
342
+ }
538
343
 
539
- interface RemoveItem {
540
- /**
541
- * ID of a price to remove.
542
- */
543
- price: string;
544
- }
344
+ interface QuoteUpdateParams {
345
+ /**
346
+ * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
347
+ */
348
+ application_fee_amount?: Stripe.Emptyable<number>;
545
349
 
546
- interface SetDiscount {
547
- /**
548
- * The coupon code to replace the `discounts` array with.
549
- */
550
- coupon?: string;
350
+ /**
351
+ * 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. There must be at least 1 line item with a recurring price to use this field.
352
+ */
353
+ application_fee_percent?: Stripe.Emptyable<number>;
551
354
 
552
- /**
553
- * An ID of an existing discount to replace the `discounts` array with.
554
- */
555
- discount?: string;
355
+ /**
356
+ * Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.
357
+ */
358
+ automatic_tax?: QuoteUpdateParams.AutomaticTax;
556
359
 
557
- /**
558
- * An ID of an existing promotion code to replace the `discounts` array with.
559
- */
560
- promotion_code?: string;
561
- }
360
+ /**
361
+ * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.
362
+ */
363
+ collection_method?: QuoteUpdateParams.CollectionMethod;
562
364
 
563
- interface SetItem {
564
- /**
565
- * If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
566
- */
567
- discounts?: Array<SetItem.Discount>;
365
+ /**
366
+ * The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
367
+ */
368
+ customer?: string;
568
369
 
569
- /**
570
- * If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
571
- */
572
- metadata?: Stripe.MetadataParam;
370
+ /**
371
+ * The tax rates that will apply to any line item that does not have `tax_rates` set.
372
+ */
373
+ default_tax_rates?: Stripe.Emptyable<Array<string>>;
573
374
 
574
- /**
575
- * The ID of the price object.
576
- */
577
- price: string;
375
+ /**
376
+ * A description that will be displayed on the quote PDF.
377
+ */
378
+ description?: Stripe.Emptyable<string>;
578
379
 
579
- /**
580
- * If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
581
- */
582
- quantity?: number;
380
+ /**
381
+ * The discounts applied to the quote. You can only set up to one discount.
382
+ */
383
+ discounts?: Stripe.Emptyable<Array<QuoteUpdateParams.Discount>>;
583
384
 
584
- /**
585
- * If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
586
- */
587
- tax_rates?: Array<string>;
385
+ /**
386
+ * Specifies which fields in the response should be expanded.
387
+ */
388
+ expand?: Array<string>;
588
389
 
589
- /**
590
- * If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
591
- */
592
- trial?: SetItem.Trial;
593
- }
390
+ /**
391
+ * A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.
392
+ */
393
+ expires_at?: number;
594
394
 
595
- namespace SetItem {
596
- interface Discount {
597
- /**
598
- * ID of the coupon to create a new discount for.
599
- */
600
- coupon?: string;
601
-
602
- /**
603
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
604
- */
605
- discount?: string;
606
-
607
- /**
608
- * Details to determine how long the discount should be applied for.
609
- */
610
- discount_end?: Discount.DiscountEnd;
611
-
612
- /**
613
- * ID of the promotion code to create a new discount for.
614
- */
615
- promotion_code?: string;
616
- }
617
-
618
- namespace Discount {
619
- interface DiscountEnd {
620
- /**
621
- * Time span for the redeemed discount.
622
- */
623
- duration?: DiscountEnd.Duration;
624
-
625
- /**
626
- * A precise Unix timestamp for the discount to end. Must be in the future.
627
- */
628
- timestamp?: number;
629
-
630
- /**
631
- * The type of calculation made to determine when the discount ends.
632
- */
633
- type: DiscountEnd.Type;
634
- }
635
-
636
- namespace DiscountEnd {
637
- interface Duration {
638
- /**
639
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
640
- */
641
- interval: Duration.Interval;
642
-
643
- /**
644
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
645
- */
646
- interval_count: number;
647
- }
648
-
649
- namespace Duration {
650
- type Interval = 'day' | 'month' | 'week' | 'year';
651
- }
652
-
653
- type Type = 'duration' | 'timestamp';
654
- }
655
- }
656
-
657
- interface Trial {
658
- /**
659
- * 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.
660
- */
661
- converts_to?: Array<string>;
662
-
663
- /**
664
- * Determines the type of trial for this item.
665
- */
666
- type: Trial.Type;
667
- }
668
-
669
- namespace Trial {
670
- type Type = 'free' | 'paid';
671
- }
672
- }
395
+ /**
396
+ * A footer that will be displayed on the quote PDF.
397
+ */
398
+ footer?: Stripe.Emptyable<string>;
673
399
 
674
- type Type =
675
- | 'add_discount'
676
- | 'add_item'
677
- | 'add_metadata'
678
- | 'clear_discounts'
679
- | 'clear_metadata'
680
- | 'remove_discount'
681
- | 'remove_item'
682
- | 'remove_metadata'
683
- | 'set_discounts'
684
- | 'set_items'
685
- | 'set_metadata';
686
- }
400
+ /**
401
+ * A header that will be displayed on the quote PDF.
402
+ */
403
+ header?: Stripe.Emptyable<string>;
687
404
 
688
- interface AppliesTo {
689
- /**
690
- * 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.
691
- */
692
- new_reference?: string;
405
+ /**
406
+ * All invoices will be billed using the specified settings.
407
+ */
408
+ invoice_settings?: QuoteUpdateParams.InvoiceSettings;
693
409
 
694
- /**
695
- * The ID of the schedule the line applies to.
696
- */
697
- subscription_schedule?: string;
410
+ /**
411
+ * A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
412
+ */
413
+ line_items?: Array<QuoteUpdateParams.LineItem>;
698
414
 
699
- /**
700
- * Describes whether the quote line is affecting a new schedule or an existing schedule.
701
- */
702
- type: AppliesTo.Type;
703
- }
704
-
705
- namespace AppliesTo {
706
- type Type = 'new_reference' | 'subscription_schedule';
707
- }
708
-
709
- type BillingCycleAnchor = 'automatic' | 'line_starts_at';
710
-
711
- interface CancelSubscriptionSchedule {
712
- /**
713
- * Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
714
- */
715
- cancel_at: 'line_starts_at';
716
-
717
- /**
718
- * If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`.
719
- */
720
- invoice_now?: boolean;
721
-
722
- /**
723
- * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
724
- */
725
- prorate?: boolean;
726
- }
727
-
728
- interface EndsAt {
729
- /**
730
- * Use the `end` time of a given discount.
731
- */
732
- discount_end?: EndsAt.DiscountEnd;
733
-
734
- /**
735
- * Time span for the quote line starting from the `starts_at` date.
736
- */
737
- duration?: EndsAt.Duration;
738
-
739
- /**
740
- * A precise Unix timestamp.
741
- */
742
- timestamp?: number;
743
-
744
- /**
745
- * Select a way to pass in `ends_at`.
746
- */
747
- type: EndsAt.Type;
748
- }
749
-
750
- namespace EndsAt {
751
- interface DiscountEnd {
752
- /**
753
- * The ID of a specific discount.
754
- */
755
- discount: string;
756
- }
757
-
758
- interface Duration {
759
- /**
760
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
761
- */
762
- interval: Duration.Interval;
763
-
764
- /**
765
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
766
- */
767
- interval_count: number;
768
- }
769
-
770
- namespace Duration {
771
- type Interval = 'day' | 'month' | 'week' | 'year';
772
- }
773
-
774
- type Type =
775
- | 'billing_period_end'
776
- | 'discount_end'
777
- | 'duration'
778
- | 'quote_acceptance_date'
779
- | 'schedule_end'
780
- | 'timestamp'
781
- | 'upcoming_invoice';
782
- }
783
-
784
- type ProrationBehavior =
785
- | 'always_invoice'
786
- | 'create_prorations'
787
- | 'none';
788
-
789
- interface SetPauseCollection {
790
- /**
791
- * Details of the pause_collection behavior to apply to the amendment.
792
- */
793
- set?: SetPauseCollection.Set;
794
-
795
- /**
796
- * Determines the type of the pause_collection amendment.
797
- */
798
- type: SetPauseCollection.Type;
799
- }
800
-
801
- namespace SetPauseCollection {
802
- interface Set {
803
- /**
804
- * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
805
- */
806
- behavior: Set.Behavior;
807
- }
808
-
809
- namespace Set {
810
- type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
811
- }
812
-
813
- type Type = 'remove' | 'set';
814
- }
815
-
816
- type SetScheduleEnd = 'line_ends_at' | 'line_starts_at';
817
-
818
- interface StartsAt {
819
- /**
820
- * Use the `end` time of a given discount.
821
- */
822
- discount_end?: StartsAt.DiscountEnd;
823
-
824
- /**
825
- * The timestamp the given line ends at.
826
- */
827
- line_ends_at?: StartsAt.LineEndsAt;
828
-
829
- /**
830
- * A precise Unix timestamp.
831
- */
832
- timestamp?: number;
833
-
834
- /**
835
- * Select a way to pass in `starts_at`.
836
- */
837
- type: StartsAt.Type;
838
- }
839
-
840
- namespace StartsAt {
841
- interface DiscountEnd {
842
- /**
843
- * The ID of a specific discount.
844
- */
845
- discount: string;
846
- }
847
-
848
- interface LineEndsAt {
849
- /**
850
- * The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
851
- */
852
- index?: number;
853
- }
854
-
855
- type Type =
856
- | 'discount_end'
857
- | 'line_ends_at'
858
- | 'now'
859
- | 'quote_acceptance_date'
860
- | 'schedule_end'
861
- | 'timestamp'
862
- | 'upcoming_invoice';
863
- }
864
-
865
- interface TrialSettings {
866
- /**
867
- * Defines how the subscription should behave when a trial ends.
868
- */
869
- end_behavior?: TrialSettings.EndBehavior;
870
- }
871
-
872
- namespace TrialSettings {
873
- interface EndBehavior {
874
- /**
875
- * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
876
- */
877
- prorate_up_front?: EndBehavior.ProrateUpFront;
878
- }
879
-
880
- namespace EndBehavior {
881
- type ProrateUpFront = 'defer' | 'include';
882
- }
883
- }
884
- }
885
-
886
- interface LineItem {
887
- /**
888
- * The discounts applied to this line item.
889
- */
890
- discounts?: Stripe.Emptyable<Array<LineItem.Discount>>;
891
-
892
- /**
893
- * The ID of the price object. One of `price` or `price_data` is required.
894
- */
895
- price?: string;
896
-
897
- /**
898
- * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
899
- */
900
- price_data?: LineItem.PriceData;
901
-
902
- /**
903
- * The quantity of the line item.
904
- */
905
- quantity?: number;
906
-
907
- /**
908
- * The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item.
909
- */
910
- tax_rates?: Stripe.Emptyable<Array<string>>;
911
- }
912
-
913
- namespace LineItem {
914
- interface Discount {
915
- /**
916
- * ID of the coupon to create a new discount for.
917
- */
918
- coupon?: string;
919
-
920
- /**
921
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
922
- */
923
- discount?: string;
924
-
925
- /**
926
- * Details to determine how long the discount should be applied for.
927
- */
928
- discount_end?: Discount.DiscountEnd;
929
-
930
- /**
931
- * ID of the promotion code to create a new discount for.
932
- */
933
- promotion_code?: string;
934
- }
935
-
936
- namespace Discount {
937
- interface DiscountEnd {
938
- /**
939
- * Time span for the redeemed discount.
940
- */
941
- duration?: DiscountEnd.Duration;
942
-
943
- /**
944
- * A precise Unix timestamp for the discount to end. Must be in the future.
945
- */
946
- timestamp?: number;
947
-
948
- /**
949
- * The type of calculation made to determine when the discount ends.
950
- */
951
- type: DiscountEnd.Type;
952
- }
953
-
954
- namespace DiscountEnd {
955
- interface Duration {
956
- /**
957
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
958
- */
959
- interval: Duration.Interval;
960
-
961
- /**
962
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
963
- */
964
- interval_count: number;
965
- }
966
-
967
- namespace Duration {
968
- type Interval = 'day' | 'month' | 'week' | 'year';
969
- }
970
-
971
- type Type = 'duration' | 'timestamp';
972
- }
973
- }
974
-
975
- interface PriceData {
976
- /**
977
- * 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).
978
- */
979
- currency: string;
980
-
981
- /**
982
- * The ID of the product that this price will belong to.
983
- */
984
- product: string;
985
-
986
- /**
987
- * The recurring components of a price such as `interval` and `interval_count`.
988
- */
989
- recurring?: PriceData.Recurring;
990
-
991
- /**
992
- * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
993
- */
994
- tax_behavior?: PriceData.TaxBehavior;
995
-
996
- /**
997
- * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
998
- */
999
- unit_amount?: number;
1000
-
1001
- /**
1002
- * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
1003
- */
1004
- unit_amount_decimal?: string;
1005
- }
1006
-
1007
- namespace PriceData {
1008
- interface Recurring {
1009
- /**
1010
- * Specifies billing frequency. Either `day`, `week`, `month` or `year`.
1011
- */
1012
- interval: Recurring.Interval;
1013
-
1014
- /**
1015
- * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
1016
- */
1017
- interval_count?: number;
1018
- }
1019
-
1020
- namespace Recurring {
1021
- type Interval = 'day' | 'month' | 'week' | 'year';
1022
- }
1023
-
1024
- type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
1025
- }
1026
- }
1027
-
1028
- interface Phase {
1029
- /**
1030
- * When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
1031
- */
1032
- billing_cycle_anchor?: 'reset';
1033
-
1034
- /**
1035
- * 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`. Defaults to `charge_automatically` on creation.
1036
- */
1037
- collection_method?: Phase.CollectionMethod;
1038
-
1039
- /**
1040
- * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase.
1041
- */
1042
- default_tax_rates?: Stripe.Emptyable<Array<string>>;
1043
-
1044
- /**
1045
- * The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts.
1046
- */
1047
- discounts?: Stripe.Emptyable<Array<Phase.Discount>>;
1048
-
1049
- /**
1050
- * The date at which this phase of the quote ends. If set, `iterations` must not be set.
1051
- */
1052
- end_date?: number;
1053
-
1054
- /**
1055
- * All invoices will be billed using the specified settings.
1056
- */
1057
- invoice_settings?: Phase.InvoiceSettings;
1058
-
1059
- /**
1060
- * Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
1061
- */
1062
- iterations?: number;
1063
-
1064
- /**
1065
- * A list of line items the customer is being quoted for within this phase. Each line item includes information about the product, the quantity, and the resulting cost.
1066
- */
1067
- line_items: Array<Phase.LineItem>;
1068
-
1069
- /**
1070
- * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on the subscription schedule's phases when the quote is accepted.
1071
- */
1072
- metadata?: Stripe.MetadataParam;
1073
-
1074
- /**
1075
- * If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
1076
- */
1077
- proration_behavior?: Phase.ProrationBehavior;
1078
-
1079
- /**
1080
- * If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
1081
- */
1082
- trial?: boolean;
1083
-
1084
- /**
1085
- * Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`.
1086
- */
1087
- trial_end?: number;
1088
- }
1089
-
1090
- namespace Phase {
1091
- type CollectionMethod = 'charge_automatically' | 'send_invoice';
1092
-
1093
- interface Discount {
1094
- /**
1095
- * ID of the coupon to create a new discount for.
1096
- */
1097
- coupon?: string;
1098
-
1099
- /**
1100
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
1101
- */
1102
- discount?: string;
1103
-
1104
- /**
1105
- * Details to determine how long the discount should be applied for.
1106
- */
1107
- discount_end?: Discount.DiscountEnd;
1108
-
1109
- /**
1110
- * ID of the promotion code to create a new discount for.
1111
- */
1112
- promotion_code?: string;
1113
- }
1114
-
1115
- namespace Discount {
1116
- interface DiscountEnd {
1117
- /**
1118
- * Time span for the redeemed discount.
1119
- */
1120
- duration?: DiscountEnd.Duration;
1121
-
1122
- /**
1123
- * A precise Unix timestamp for the discount to end. Must be in the future.
1124
- */
1125
- timestamp?: number;
1126
-
1127
- /**
1128
- * The type of calculation made to determine when the discount ends.
1129
- */
1130
- type: DiscountEnd.Type;
1131
- }
1132
-
1133
- namespace DiscountEnd {
1134
- interface Duration {
1135
- /**
1136
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1137
- */
1138
- interval: Duration.Interval;
1139
-
1140
- /**
1141
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1142
- */
1143
- interval_count: number;
1144
- }
1145
-
1146
- namespace Duration {
1147
- type Interval = 'day' | 'month' | 'week' | 'year';
1148
- }
1149
-
1150
- type Type = 'duration' | 'timestamp';
1151
- }
1152
- }
1153
-
1154
- interface InvoiceSettings {
1155
- /**
1156
- * 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`.
1157
- */
1158
- days_until_due?: number;
1159
- }
1160
-
1161
- interface LineItem {
1162
- /**
1163
- * The discounts applied to this line item.
1164
- */
1165
- discounts?: Stripe.Emptyable<Array<LineItem.Discount>>;
1166
-
1167
- /**
1168
- * The ID of the price object. One of `price` or `price_data` is required.
1169
- */
1170
- price?: string;
1171
-
1172
- /**
1173
- * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
1174
- */
1175
- price_data?: LineItem.PriceData;
1176
-
1177
- /**
1178
- * The quantity of the line item.
1179
- */
1180
- quantity?: number;
1181
-
1182
- /**
1183
- * The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item.
1184
- */
1185
- tax_rates?: Stripe.Emptyable<Array<string>>;
1186
- }
1187
-
1188
- namespace LineItem {
1189
- interface Discount {
1190
- /**
1191
- * ID of the coupon to create a new discount for.
1192
- */
1193
- coupon?: string;
1194
-
1195
- /**
1196
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
1197
- */
1198
- discount?: string;
1199
-
1200
- /**
1201
- * Details to determine how long the discount should be applied for.
1202
- */
1203
- discount_end?: Discount.DiscountEnd;
1204
-
1205
- /**
1206
- * ID of the promotion code to create a new discount for.
1207
- */
1208
- promotion_code?: string;
1209
- }
1210
-
1211
- namespace Discount {
1212
- interface DiscountEnd {
1213
- /**
1214
- * Time span for the redeemed discount.
1215
- */
1216
- duration?: DiscountEnd.Duration;
1217
-
1218
- /**
1219
- * A precise Unix timestamp for the discount to end. Must be in the future.
1220
- */
1221
- timestamp?: number;
1222
-
1223
- /**
1224
- * The type of calculation made to determine when the discount ends.
1225
- */
1226
- type: DiscountEnd.Type;
1227
- }
1228
-
1229
- namespace DiscountEnd {
1230
- interface Duration {
1231
- /**
1232
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1233
- */
1234
- interval: Duration.Interval;
1235
-
1236
- /**
1237
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1238
- */
1239
- interval_count: number;
1240
- }
1241
-
1242
- namespace Duration {
1243
- type Interval = 'day' | 'month' | 'week' | 'year';
1244
- }
1245
-
1246
- type Type = 'duration' | 'timestamp';
1247
- }
1248
- }
1249
-
1250
- interface PriceData {
1251
- /**
1252
- * 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).
1253
- */
1254
- currency: string;
1255
-
1256
- /**
1257
- * The ID of the product that this price will belong to.
1258
- */
1259
- product: string;
1260
-
1261
- /**
1262
- * The recurring components of a price such as `interval` and `interval_count`.
1263
- */
1264
- recurring?: PriceData.Recurring;
1265
-
1266
- /**
1267
- * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
1268
- */
1269
- tax_behavior?: PriceData.TaxBehavior;
1270
-
1271
- /**
1272
- * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1273
- */
1274
- unit_amount?: number;
1275
-
1276
- /**
1277
- * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
1278
- */
1279
- unit_amount_decimal?: string;
1280
- }
1281
-
1282
- namespace PriceData {
1283
- interface Recurring {
1284
- /**
1285
- * Specifies billing frequency. Either `day`, `week`, `month` or `year`.
1286
- */
1287
- interval: Recurring.Interval;
1288
-
1289
- /**
1290
- * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
1291
- */
1292
- interval_count?: number;
1293
- }
1294
-
1295
- namespace Recurring {
1296
- type Interval = 'day' | 'month' | 'week' | 'year';
1297
- }
1298
-
1299
- type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
1300
- }
1301
- }
1302
-
1303
- type ProrationBehavior =
1304
- | 'always_invoice'
1305
- | 'create_prorations'
1306
- | 'none';
1307
- }
1308
-
1309
- interface SubscriptionData {
1310
- /**
1311
- * Describes the period to bill for upon accepting the quote.
1312
- */
1313
- bill_on_acceptance?: SubscriptionData.BillOnAcceptance;
1314
-
1315
- /**
1316
- * 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.
1317
- */
1318
- billing_behavior?: SubscriptionData.BillingBehavior;
1319
-
1320
- /**
1321
- * When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
1322
- */
1323
- billing_cycle_anchor?: Stripe.Emptyable<'reset'>;
1324
-
1325
- /**
1326
- * The subscription's 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.
1327
- */
1328
- description?: string;
1329
-
1330
- /**
1331
- * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
1332
- */
1333
- effective_date?: Stripe.Emptyable<'current_period_end' | number>;
1334
-
1335
- /**
1336
- * Behavior of the subscription schedule and underlying subscription when it ends.
1337
- */
1338
- end_behavior?: SubscriptionData.EndBehavior;
1339
-
1340
- /**
1341
- * The id of a subscription schedule the quote will update. The quote will inherit the state of the subscription schedule, such as `phases`. Cannot be combined with other parameters.
1342
- */
1343
- from_schedule?: string;
1344
-
1345
- /**
1346
- * The id of a subscription that the quote will update. By default, the quote will contain the state of the subscription (such as line items, collection method and billing thresholds) unless overridden.
1347
- */
1348
- from_subscription?: string;
1349
-
1350
- /**
1351
- * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
1352
- */
1353
- metadata?: Stripe.MetadataParam;
1354
-
1355
- /**
1356
- * If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
1357
- */
1358
- prebilling?: Stripe.Emptyable<SubscriptionData.Prebilling>;
1359
-
1360
- /**
1361
- * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
1362
- *
1363
- * When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
1364
- *
1365
- * Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
1366
- *
1367
- * Prorations can be disabled by passing `none`.
1368
- */
1369
- proration_behavior?: SubscriptionData.ProrationBehavior;
1370
-
1371
- /**
1372
- * Integer representing the number of trial period days before the customer is charged for the first time.
1373
- */
1374
- trial_period_days?: Stripe.Emptyable<number>;
1375
- }
1376
-
1377
- namespace SubscriptionData {
1378
- type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
1379
-
1380
- interface BillOnAcceptance {
1381
- /**
1382
- * The start of the period to bill from when the Quote is accepted.
1383
- */
1384
- bill_from?: BillOnAcceptance.BillFrom;
1385
-
1386
- /**
1387
- * The end of the period to bill until when the Quote is accepted.
1388
- */
1389
- bill_until?: BillOnAcceptance.BillUntil;
1390
- }
1391
-
1392
- namespace BillOnAcceptance {
1393
- interface BillFrom {
1394
- /**
1395
- * Details of a Quote line to start the bill period from.
1396
- */
1397
- line_starts_at?: BillFrom.LineStartsAt;
1398
-
1399
- /**
1400
- * A precise Unix timestamp.
1401
- */
1402
- timestamp?: number;
1403
-
1404
- /**
1405
- * The type of method to specify the `bill_from` time.
1406
- */
1407
- type: BillFrom.Type;
1408
- }
1409
-
1410
- namespace BillFrom {
1411
- interface LineStartsAt {
1412
- /**
1413
- * The ID of a quote line.
1414
- */
1415
- id?: string;
1416
-
1417
- /**
1418
- * The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1419
- */
1420
- index?: number;
1421
- }
1422
-
1423
- type Type =
1424
- | 'line_starts_at'
1425
- | 'now'
1426
- | 'pause_collection_start'
1427
- | 'quote_acceptance_date'
1428
- | 'timestamp';
1429
- }
1430
-
1431
- interface BillUntil {
1432
- /**
1433
- * Details of the duration over which to bill.
1434
- */
1435
- duration?: BillUntil.Duration;
1436
-
1437
- /**
1438
- * Details of a Quote line item from which to bill until.
1439
- */
1440
- line_ends_at?: BillUntil.LineEndsAt;
1441
-
1442
- /**
1443
- * A precise Unix timestamp.
1444
- */
1445
- timestamp?: number;
1446
-
1447
- /**
1448
- * The type of method to specify the `bill_until` time.
1449
- */
1450
- type: BillUntil.Type;
1451
- }
1452
-
1453
- namespace BillUntil {
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
- interface LineEndsAt {
1471
- /**
1472
- * The ID of a quote line.
1473
- */
1474
- id?: string;
1475
-
1476
- /**
1477
- * The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1478
- */
1479
- index?: number;
1480
- }
1481
-
1482
- type Type =
1483
- | 'duration'
1484
- | 'line_ends_at'
1485
- | 'schedule_end'
1486
- | 'timestamp'
1487
- | 'upcoming_invoice';
1488
- }
1489
- }
1490
-
1491
- type EndBehavior = 'cancel' | 'release';
1492
-
1493
- interface Prebilling {
1494
- /**
1495
- * This is used to determine the number of billing cycles to prebill.
1496
- */
1497
- iterations: number;
1498
- }
1499
-
1500
- type ProrationBehavior =
1501
- | 'always_invoice'
1502
- | 'create_prorations'
1503
- | 'none';
1504
- }
1505
-
1506
- interface SubscriptionDataOverride {
1507
- /**
1508
- * Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
1509
- */
1510
- applies_to: SubscriptionDataOverride.AppliesTo;
1511
-
1512
- /**
1513
- * Describes the period to bill for upon accepting the quote.
1514
- */
1515
- bill_on_acceptance?: SubscriptionDataOverride.BillOnAcceptance;
1516
-
1517
- /**
1518
- * 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.
1519
- */
1520
- billing_behavior?: SubscriptionDataOverride.BillingBehavior;
1521
-
1522
- /**
1523
- * The customer the Subscription Data override applies to. This is only relevant when `applies_to.type=new_reference`.
1524
- */
1525
- customer?: string;
1526
-
1527
- /**
1528
- * The subscription's 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.
1529
- */
1530
- description?: string;
1531
-
1532
- /**
1533
- * Behavior of the subscription schedule and underlying subscription when it ends.
1534
- */
1535
- end_behavior?: SubscriptionDataOverride.EndBehavior;
1536
-
1537
- /**
1538
- * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
1539
- *
1540
- * When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
1541
- *
1542
- * Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
1543
- *
1544
- * Prorations can be disabled by passing `none`.
1545
- */
1546
- proration_behavior?: SubscriptionDataOverride.ProrationBehavior;
1547
- }
1548
-
1549
- namespace SubscriptionDataOverride {
1550
- interface AppliesTo {
1551
- /**
1552
- * 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.
1553
- */
1554
- new_reference?: string;
1555
-
1556
- /**
1557
- * The ID of the schedule the line applies to.
1558
- */
1559
- subscription_schedule?: string;
1560
-
1561
- /**
1562
- * Describes whether the quote line is affecting a new schedule or an existing schedule.
1563
- */
1564
- type: AppliesTo.Type;
1565
- }
1566
-
1567
- namespace AppliesTo {
1568
- type Type = 'new_reference' | 'subscription_schedule';
1569
- }
1570
-
1571
- type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
1572
-
1573
- interface BillOnAcceptance {
1574
- /**
1575
- * The start of the period to bill from when the Quote is accepted.
1576
- */
1577
- bill_from?: BillOnAcceptance.BillFrom;
1578
-
1579
- /**
1580
- * The end of the period to bill until when the Quote is accepted.
1581
- */
1582
- bill_until?: BillOnAcceptance.BillUntil;
1583
- }
1584
-
1585
- namespace BillOnAcceptance {
1586
- interface BillFrom {
1587
- /**
1588
- * Details of a Quote line to start the bill period from.
1589
- */
1590
- line_starts_at?: BillFrom.LineStartsAt;
1591
-
1592
- /**
1593
- * A precise Unix timestamp.
1594
- */
1595
- timestamp?: number;
1596
-
1597
- /**
1598
- * The type of method to specify the `bill_from` time.
1599
- */
1600
- type: BillFrom.Type;
1601
- }
1602
-
1603
- namespace BillFrom {
1604
- interface LineStartsAt {
1605
- /**
1606
- * The ID of a quote line.
1607
- */
1608
- id?: string;
1609
-
1610
- /**
1611
- * The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1612
- */
1613
- index?: number;
1614
- }
1615
-
1616
- type Type =
1617
- | 'line_starts_at'
1618
- | 'now'
1619
- | 'pause_collection_start'
1620
- | 'quote_acceptance_date'
1621
- | 'timestamp';
1622
- }
1623
-
1624
- interface BillUntil {
1625
- /**
1626
- * Details of the duration over which to bill.
1627
- */
1628
- duration?: BillUntil.Duration;
1629
-
1630
- /**
1631
- * Details of a Quote line item from which to bill until.
1632
- */
1633
- line_ends_at?: BillUntil.LineEndsAt;
1634
-
1635
- /**
1636
- * A precise Unix timestamp.
1637
- */
1638
- timestamp?: number;
1639
-
1640
- /**
1641
- * The type of method to specify the `bill_until` time.
1642
- */
1643
- type: BillUntil.Type;
1644
- }
1645
-
1646
- namespace BillUntil {
1647
- interface Duration {
1648
- /**
1649
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1650
- */
1651
- interval: Duration.Interval;
1652
-
1653
- /**
1654
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1655
- */
1656
- interval_count: number;
1657
- }
1658
-
1659
- namespace Duration {
1660
- type Interval = 'day' | 'month' | 'week' | 'year';
1661
- }
1662
-
1663
- interface LineEndsAt {
1664
- /**
1665
- * The ID of a quote line.
1666
- */
1667
- id?: string;
1668
-
1669
- /**
1670
- * The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1671
- */
1672
- index?: number;
1673
- }
1674
-
1675
- type Type =
1676
- | 'duration'
1677
- | 'line_ends_at'
1678
- | 'schedule_end'
1679
- | 'timestamp'
1680
- | 'upcoming_invoice';
1681
- }
1682
- }
1683
-
1684
- type EndBehavior = 'cancel' | 'release';
1685
-
1686
- type ProrationBehavior =
1687
- | 'always_invoice'
1688
- | 'create_prorations'
1689
- | 'none';
1690
- }
1691
-
1692
- interface TransferData {
1693
- /**
1694
- * The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
1695
- */
1696
- amount?: number;
1697
-
1698
- /**
1699
- * 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. There must be at least 1 line item with a recurring price to use this field.
1700
- */
1701
- amount_percent?: number;
1702
-
1703
- /**
1704
- * ID of an existing, connected Stripe account.
1705
- */
1706
- destination: string;
1707
- }
1708
- }
1709
-
1710
- interface QuoteRetrieveParams {
1711
- /**
1712
- * Specifies which fields in the response should be expanded.
1713
- */
1714
- expand?: Array<string>;
1715
- }
1716
-
1717
- interface QuoteUpdateParams {
1718
- /**
1719
- * Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
1720
- */
1721
- allow_backdated_lines?: boolean;
1722
-
1723
- /**
1724
- * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
1725
- */
1726
- application_fee_amount?: Stripe.Emptyable<number>;
1727
-
1728
- /**
1729
- * 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. There must be at least 1 line item with a recurring price to use this field.
1730
- */
1731
- application_fee_percent?: Stripe.Emptyable<number>;
1732
-
1733
- /**
1734
- * Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.
1735
- */
1736
- automatic_tax?: QuoteUpdateParams.AutomaticTax;
1737
-
1738
- /**
1739
- * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.
1740
- */
1741
- collection_method?: QuoteUpdateParams.CollectionMethod;
1742
-
1743
- /**
1744
- * The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
1745
- */
1746
- customer?: string;
1747
-
1748
- /**
1749
- * The tax rates that will apply to any line item that does not have `tax_rates` set.
1750
- */
1751
- default_tax_rates?: Stripe.Emptyable<Array<string>>;
1752
-
1753
- /**
1754
- * A description that will be displayed on the quote PDF.
1755
- */
1756
- description?: Stripe.Emptyable<string>;
1757
-
1758
- /**
1759
- * The discounts applied to the quote. You can only set up to one discount.
1760
- */
1761
- discounts?: Stripe.Emptyable<Array<QuoteUpdateParams.Discount>>;
1762
-
1763
- /**
1764
- * Specifies which fields in the response should be expanded.
1765
- */
1766
- expand?: Array<string>;
1767
-
1768
- /**
1769
- * A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.
1770
- */
1771
- expires_at?: number;
1772
-
1773
- /**
1774
- * A footer that will be displayed on the quote PDF.
1775
- */
1776
- footer?: Stripe.Emptyable<string>;
1777
-
1778
- /**
1779
- * A header that will be displayed on the quote PDF.
1780
- */
1781
- header?: Stripe.Emptyable<string>;
1782
-
1783
- /**
1784
- * All invoices will be billed using the specified settings.
1785
- */
1786
- invoice_settings?: QuoteUpdateParams.InvoiceSettings;
1787
-
1788
- /**
1789
- * A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
1790
- */
1791
- line_items?: Array<QuoteUpdateParams.LineItem>;
1792
-
1793
- /**
1794
- * A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
1795
- */
1796
- lines?: Array<QuoteUpdateParams.Line>;
1797
-
1798
- /**
1799
- * 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1800
- */
1801
- metadata?: Stripe.MetadataParam;
1802
-
1803
- /**
1804
- * The account on behalf of which to charge.
1805
- */
1806
- on_behalf_of?: Stripe.Emptyable<string>;
1807
-
1808
- /**
1809
- * List representing phases of the Quote. Each phase can be customized to have different durations, prices, and coupons.
1810
- */
1811
- phases?: Array<QuoteUpdateParams.Phase>;
1812
-
1813
- /**
1814
- * When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
1815
- */
1816
- subscription_data?: QuoteUpdateParams.SubscriptionData;
1817
-
1818
- /**
1819
- * List representing overrides for `subscription_data` configurations for specific subscription schedules.
1820
- */
1821
- subscription_data_overrides?: Stripe.Emptyable<
1822
- Array<QuoteUpdateParams.SubscriptionDataOverride>
1823
- >;
1824
-
1825
- /**
1826
- * The data with which to automatically create a Transfer for each of the invoices.
1827
- */
1828
- transfer_data?: Stripe.Emptyable<QuoteUpdateParams.TransferData>;
1829
- }
1830
-
1831
- namespace QuoteUpdateParams {
1832
- interface AutomaticTax {
1833
- /**
1834
- * Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.
1835
- */
1836
- enabled: boolean;
1837
-
1838
- /**
1839
- * 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.
1840
- */
1841
- liability?: AutomaticTax.Liability;
1842
- }
1843
-
1844
- namespace AutomaticTax {
1845
- interface Liability {
1846
- /**
1847
- * The connected account being referenced when `type` is `account`.
1848
- */
1849
- account?: string;
1850
-
1851
- /**
1852
- * Type of the account referenced in the request.
1853
- */
1854
- type: Liability.Type;
1855
- }
1856
-
1857
- namespace Liability {
1858
- type Type = 'account' | 'self';
1859
- }
1860
- }
1861
-
1862
- type CollectionMethod = 'charge_automatically' | 'send_invoice';
1863
-
1864
- interface Discount {
1865
- /**
1866
- * ID of the coupon to create a new discount for.
1867
- */
1868
- coupon?: string;
1869
-
1870
- /**
1871
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
1872
- */
1873
- discount?: string;
1874
-
1875
- /**
1876
- * Details to determine how long the discount should be applied for.
1877
- */
1878
- discount_end?: Discount.DiscountEnd;
1879
-
1880
- /**
1881
- * ID of the promotion code to create a new discount for.
1882
- */
1883
- promotion_code?: string;
1884
- }
1885
-
1886
- namespace Discount {
1887
- interface DiscountEnd {
1888
- /**
1889
- * Time span for the redeemed discount.
1890
- */
1891
- duration?: DiscountEnd.Duration;
1892
-
1893
- /**
1894
- * A precise Unix timestamp for the discount to end. Must be in the future.
1895
- */
1896
- timestamp?: number;
1897
-
1898
- /**
1899
- * The type of calculation made to determine when the discount ends.
1900
- */
1901
- type: DiscountEnd.Type;
1902
- }
1903
-
1904
- namespace DiscountEnd {
1905
- interface Duration {
1906
- /**
1907
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1908
- */
1909
- interval: Duration.Interval;
1910
-
1911
- /**
1912
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1913
- */
1914
- interval_count: number;
1915
- }
1916
-
1917
- namespace Duration {
1918
- type Interval = 'day' | 'month' | 'week' | 'year';
1919
- }
1920
-
1921
- type Type = 'duration' | 'timestamp';
1922
- }
1923
- }
1924
-
1925
- interface InvoiceSettings {
1926
- /**
1927
- * Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.
1928
- */
1929
- days_until_due?: number;
1930
-
1931
- /**
1932
- * The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1933
- */
1934
- issuer?: InvoiceSettings.Issuer;
1935
- }
1936
-
1937
- namespace InvoiceSettings {
1938
- interface Issuer {
1939
- /**
1940
- * The connected account being referenced when `type` is `account`.
1941
- */
1942
- account?: string;
1943
-
1944
- /**
1945
- * Type of the account referenced in the request.
1946
- */
1947
- type: Issuer.Type;
1948
- }
1949
-
1950
- namespace Issuer {
1951
- type Type = 'account' | 'self';
1952
- }
1953
- }
1954
-
1955
- interface Line {
1956
- /**
1957
- * An array of operations the quote line performs.
1958
- */
1959
- actions?: Array<Line.Action>;
1960
-
1961
- /**
1962
- * Details to identify the subscription schedule the quote line applies to.
1963
- */
1964
- applies_to?: Line.AppliesTo;
1965
-
1966
- /**
1967
- * For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
1968
- */
1969
- billing_cycle_anchor?: Line.BillingCycleAnchor;
1970
-
1971
- /**
1972
- * A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
1973
- */
1974
- cancel_subscription_schedule?: Line.CancelSubscriptionSchedule;
1975
-
1976
- /**
1977
- * Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
1978
- */
1979
- ends_at?: Line.EndsAt;
1980
-
1981
- /**
1982
- * The ID of an existing line on the quote.
1983
- */
1984
- id?: string;
1985
-
1986
- /**
1987
- * Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
1988
- */
1989
- proration_behavior?: Line.ProrationBehavior;
1990
-
1991
- /**
1992
- * Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
1993
- */
1994
- set_pause_collection?: Line.SetPauseCollection;
1995
-
1996
- /**
1997
- * Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
1998
- */
1999
- set_schedule_end?: Line.SetScheduleEnd;
2000
-
2001
- /**
2002
- * Details to identify the earliest timestamp where the proposed change should take effect.
2003
- */
2004
- starts_at?: Line.StartsAt;
2005
-
2006
- /**
2007
- * Settings related to subscription trials.
2008
- */
2009
- trial_settings?: Line.TrialSettings;
2010
- }
2011
-
2012
- namespace Line {
2013
- interface Action {
2014
- /**
2015
- * Details for the `add_discount` type.
2016
- */
2017
- add_discount?: Action.AddDiscount;
2018
-
2019
- /**
2020
- * Details for the `add_item` type.
2021
- */
2022
- add_item?: Action.AddItem;
2023
-
2024
- /**
2025
- * Details for the `add_metadata` type: specify a hash of key-value pairs.
2026
- */
2027
- add_metadata?: {
2028
- [key: string]: string;
2029
- };
2030
-
2031
- /**
2032
- * Details for the `remove_discount` type.
2033
- */
2034
- remove_discount?: Action.RemoveDiscount;
2035
-
2036
- /**
2037
- * Details for the `remove_item` type.
2038
- */
2039
- remove_item?: Action.RemoveItem;
2040
-
2041
- /**
2042
- * Details for the `remove_metadata` type: specify an array of metadata keys.
2043
- */
2044
- remove_metadata?: Array<string>;
2045
-
2046
- /**
2047
- * Details for the `set_discounts` type.
2048
- */
2049
- set_discounts?: Array<Action.SetDiscount>;
2050
-
2051
- /**
2052
- * Details for the `set_items` type.
2053
- */
2054
- set_items?: Array<Action.SetItem>;
2055
-
2056
- /**
2057
- * Details for the `set_metadata` type: specify an array of key-value pairs.
2058
- */
2059
- set_metadata?: Stripe.Emptyable<{
2060
- [key: string]: string;
2061
- }>;
2062
-
2063
- /**
2064
- * The type of action the quote line performs.
2065
- */
2066
- type: Action.Type;
2067
- }
2068
-
2069
- namespace Action {
2070
- interface AddDiscount {
2071
- /**
2072
- * The coupon code to redeem.
2073
- */
2074
- coupon?: string;
2075
-
2076
- /**
2077
- * An ID of an existing discount for a coupon that was already redeemed.
2078
- */
2079
- discount?: string;
2080
-
2081
- /**
2082
- * Details to determine how long the discount should be applied for.
2083
- */
2084
- discount_end?: AddDiscount.DiscountEnd;
2085
-
2086
- /**
2087
- * The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
2088
- */
2089
- index?: number;
2090
-
2091
- /**
2092
- * The promotion code to redeem.
2093
- */
2094
- promotion_code?: string;
2095
- }
2096
-
2097
- namespace AddDiscount {
2098
- interface DiscountEnd {
2099
- /**
2100
- * The type of calculation made to determine when the discount ends.
2101
- */
2102
- type: 'line_ends_at';
2103
- }
2104
- }
2105
-
2106
- interface AddItem {
2107
- /**
2108
- * The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
2109
- */
2110
- discounts?: Array<AddItem.Discount>;
2111
-
2112
- /**
2113
- * 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2114
- */
2115
- metadata?: Stripe.MetadataParam;
2116
-
2117
- /**
2118
- * The ID of the price object.
2119
- */
2120
- price: string;
2121
-
2122
- /**
2123
- * Quantity for this item.
2124
- */
2125
- quantity?: number;
2126
-
2127
- /**
2128
- * The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
2129
- */
2130
- tax_rates?: Array<string>;
2131
-
2132
- /**
2133
- * Options that configure the trial on the subscription item.
2134
- */
2135
- trial?: AddItem.Trial;
2136
- }
2137
-
2138
- namespace AddItem {
2139
- interface Discount {
2140
- /**
2141
- * ID of the coupon to create a new discount for.
2142
- */
2143
- coupon?: string;
2144
-
2145
- /**
2146
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
2147
- */
2148
- discount?: string;
2149
-
2150
- /**
2151
- * Details to determine how long the discount should be applied for.
2152
- */
2153
- discount_end?: Discount.DiscountEnd;
2154
-
2155
- /**
2156
- * ID of the promotion code to create a new discount for.
2157
- */
2158
- promotion_code?: string;
2159
- }
2160
-
2161
- namespace Discount {
2162
- interface DiscountEnd {
2163
- /**
2164
- * Time span for the redeemed discount.
2165
- */
2166
- duration?: DiscountEnd.Duration;
2167
-
2168
- /**
2169
- * A precise Unix timestamp for the discount to end. Must be in the future.
2170
- */
2171
- timestamp?: number;
2172
-
2173
- /**
2174
- * The type of calculation made to determine when the discount ends.
2175
- */
2176
- type: DiscountEnd.Type;
2177
- }
2178
-
2179
- namespace DiscountEnd {
2180
- interface Duration {
2181
- /**
2182
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2183
- */
2184
- interval: Duration.Interval;
2185
-
2186
- /**
2187
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2188
- */
2189
- interval_count: number;
2190
- }
2191
-
2192
- namespace Duration {
2193
- type Interval = 'day' | 'month' | 'week' | 'year';
2194
- }
2195
-
2196
- type Type = 'duration' | 'timestamp';
2197
- }
2198
- }
2199
-
2200
- interface Trial {
2201
- /**
2202
- * 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.
2203
- */
2204
- converts_to?: Array<string>;
2205
-
2206
- /**
2207
- * Determines the type of trial for this item.
2208
- */
2209
- type: Trial.Type;
2210
- }
2211
-
2212
- namespace Trial {
2213
- type Type = 'free' | 'paid';
2214
- }
2215
- }
2216
-
2217
- interface RemoveDiscount {
2218
- /**
2219
- * The coupon code to remove from the `discounts` array.
2220
- */
2221
- coupon?: string;
2222
-
2223
- /**
2224
- * The ID of a discount to remove from the `discounts` array.
2225
- */
2226
- discount?: string;
2227
-
2228
- /**
2229
- * The ID of a promotion code to remove from the `discounts` array.
2230
- */
2231
- promotion_code?: string;
2232
- }
2233
-
2234
- interface RemoveItem {
2235
- /**
2236
- * ID of a price to remove.
2237
- */
2238
- price: string;
2239
- }
2240
-
2241
- interface SetDiscount {
2242
- /**
2243
- * The coupon code to replace the `discounts` array with.
2244
- */
2245
- coupon?: string;
2246
-
2247
- /**
2248
- * An ID of an existing discount to replace the `discounts` array with.
2249
- */
2250
- discount?: string;
2251
-
2252
- /**
2253
- * An ID of an existing promotion code to replace the `discounts` array with.
2254
- */
2255
- promotion_code?: string;
2256
- }
2257
-
2258
- interface SetItem {
2259
- /**
2260
- * If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
2261
- */
2262
- discounts?: Array<SetItem.Discount>;
2263
-
2264
- /**
2265
- * If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
2266
- */
2267
- metadata?: Stripe.MetadataParam;
2268
-
2269
- /**
2270
- * The ID of the price object.
2271
- */
2272
- price: string;
2273
-
2274
- /**
2275
- * If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
2276
- */
2277
- quantity?: number;
2278
-
2279
- /**
2280
- * If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
2281
- */
2282
- tax_rates?: Array<string>;
2283
-
2284
- /**
2285
- * If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
2286
- */
2287
- trial?: SetItem.Trial;
2288
- }
2289
-
2290
- namespace SetItem {
2291
- interface Discount {
2292
- /**
2293
- * ID of the coupon to create a new discount for.
2294
- */
2295
- coupon?: string;
2296
-
2297
- /**
2298
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
2299
- */
2300
- discount?: string;
2301
-
2302
- /**
2303
- * Details to determine how long the discount should be applied for.
2304
- */
2305
- discount_end?: Discount.DiscountEnd;
2306
-
2307
- /**
2308
- * ID of the promotion code to create a new discount for.
2309
- */
2310
- promotion_code?: string;
2311
- }
2312
-
2313
- namespace Discount {
2314
- interface DiscountEnd {
2315
- /**
2316
- * Time span for the redeemed discount.
2317
- */
2318
- duration?: DiscountEnd.Duration;
2319
-
2320
- /**
2321
- * A precise Unix timestamp for the discount to end. Must be in the future.
2322
- */
2323
- timestamp?: number;
2324
-
2325
- /**
2326
- * The type of calculation made to determine when the discount ends.
2327
- */
2328
- type: DiscountEnd.Type;
2329
- }
2330
-
2331
- namespace DiscountEnd {
2332
- interface Duration {
2333
- /**
2334
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2335
- */
2336
- interval: Duration.Interval;
2337
-
2338
- /**
2339
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2340
- */
2341
- interval_count: number;
2342
- }
2343
-
2344
- namespace Duration {
2345
- type Interval = 'day' | 'month' | 'week' | 'year';
2346
- }
2347
-
2348
- type Type = 'duration' | 'timestamp';
2349
- }
2350
- }
2351
-
2352
- interface Trial {
2353
- /**
2354
- * 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.
2355
- */
2356
- converts_to?: Array<string>;
2357
-
2358
- /**
2359
- * Determines the type of trial for this item.
2360
- */
2361
- type: Trial.Type;
2362
- }
2363
-
2364
- namespace Trial {
2365
- type Type = 'free' | 'paid';
2366
- }
2367
- }
2368
-
2369
- type Type =
2370
- | 'add_discount'
2371
- | 'add_item'
2372
- | 'add_metadata'
2373
- | 'clear_discounts'
2374
- | 'clear_metadata'
2375
- | 'remove_discount'
2376
- | 'remove_item'
2377
- | 'remove_metadata'
2378
- | 'set_discounts'
2379
- | 'set_items'
2380
- | 'set_metadata';
2381
- }
2382
-
2383
- interface AppliesTo {
2384
- /**
2385
- * 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.
2386
- */
2387
- new_reference?: string;
2388
-
2389
- /**
2390
- * The ID of the schedule the line applies to.
2391
- */
2392
- subscription_schedule?: string;
2393
-
2394
- /**
2395
- * Describes whether the quote line is affecting a new schedule or an existing schedule.
2396
- */
2397
- type: AppliesTo.Type;
2398
- }
2399
-
2400
- namespace AppliesTo {
2401
- type Type = 'new_reference' | 'subscription_schedule';
2402
- }
2403
-
2404
- type BillingCycleAnchor = 'automatic' | 'line_starts_at';
2405
-
2406
- interface CancelSubscriptionSchedule {
2407
- /**
2408
- * Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
2409
- */
2410
- cancel_at: 'line_starts_at';
2411
-
2412
- /**
2413
- * If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`.
2414
- */
2415
- invoice_now?: boolean;
2416
-
2417
- /**
2418
- * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
2419
- */
2420
- prorate?: boolean;
2421
- }
2422
-
2423
- interface EndsAt {
2424
- /**
2425
- * Use the `end` time of a given discount.
2426
- */
2427
- discount_end?: EndsAt.DiscountEnd;
2428
-
2429
- /**
2430
- * Time span for the quote line starting from the `starts_at` date.
2431
- */
2432
- duration?: EndsAt.Duration;
2433
-
2434
- /**
2435
- * A precise Unix timestamp.
2436
- */
2437
- timestamp?: number;
2438
-
2439
- /**
2440
- * Select a way to pass in `ends_at`.
2441
- */
2442
- type: EndsAt.Type;
2443
- }
2444
-
2445
- namespace EndsAt {
2446
- interface DiscountEnd {
2447
- /**
2448
- * The ID of a specific discount.
2449
- */
2450
- discount: string;
2451
- }
2452
-
2453
- interface Duration {
2454
- /**
2455
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2456
- */
2457
- interval: Duration.Interval;
2458
-
2459
- /**
2460
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2461
- */
2462
- interval_count: number;
2463
- }
2464
-
2465
- namespace Duration {
2466
- type Interval = 'day' | 'month' | 'week' | 'year';
2467
- }
2468
-
2469
- type Type =
2470
- | 'billing_period_end'
2471
- | 'discount_end'
2472
- | 'duration'
2473
- | 'quote_acceptance_date'
2474
- | 'schedule_end'
2475
- | 'timestamp'
2476
- | 'upcoming_invoice';
2477
- }
2478
-
2479
- type ProrationBehavior =
2480
- | 'always_invoice'
2481
- | 'create_prorations'
2482
- | 'none';
2483
-
2484
- interface SetPauseCollection {
2485
- /**
2486
- * Details of the pause_collection behavior to apply to the amendment.
2487
- */
2488
- set?: SetPauseCollection.Set;
2489
-
2490
- /**
2491
- * Determines the type of the pause_collection amendment.
2492
- */
2493
- type: SetPauseCollection.Type;
2494
- }
2495
-
2496
- namespace SetPauseCollection {
2497
- interface Set {
2498
- /**
2499
- * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2500
- */
2501
- behavior: Set.Behavior;
2502
- }
2503
-
2504
- namespace Set {
2505
- type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
2506
- }
2507
-
2508
- type Type = 'remove' | 'set';
2509
- }
2510
-
2511
- type SetScheduleEnd = 'line_ends_at' | 'line_starts_at';
2512
-
2513
- interface StartsAt {
2514
- /**
2515
- * Use the `end` time of a given discount.
2516
- */
2517
- discount_end?: StartsAt.DiscountEnd;
2518
-
2519
- /**
2520
- * The timestamp the given line ends at.
2521
- */
2522
- line_ends_at?: StartsAt.LineEndsAt;
2523
-
2524
- /**
2525
- * A precise Unix timestamp.
2526
- */
2527
- timestamp?: number;
2528
-
2529
- /**
2530
- * Select a way to pass in `starts_at`.
2531
- */
2532
- type: StartsAt.Type;
2533
- }
2534
-
2535
- namespace StartsAt {
2536
- interface DiscountEnd {
2537
- /**
2538
- * The ID of a specific discount.
2539
- */
2540
- discount: string;
2541
- }
2542
-
2543
- interface LineEndsAt {
2544
- /**
2545
- * The ID of a quote line.
2546
- */
2547
- id?: string;
2548
-
2549
- /**
2550
- * The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2551
- */
2552
- index?: number;
2553
- }
2554
-
2555
- type Type =
2556
- | 'discount_end'
2557
- | 'line_ends_at'
2558
- | 'now'
2559
- | 'quote_acceptance_date'
2560
- | 'schedule_end'
2561
- | 'timestamp'
2562
- | 'upcoming_invoice';
2563
- }
2564
-
2565
- interface TrialSettings {
2566
- /**
2567
- * Defines how the subscription should behave when a trial ends.
2568
- */
2569
- end_behavior?: TrialSettings.EndBehavior;
2570
- }
2571
-
2572
- namespace TrialSettings {
2573
- interface EndBehavior {
2574
- /**
2575
- * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2576
- */
2577
- prorate_up_front?: EndBehavior.ProrateUpFront;
2578
- }
2579
-
2580
- namespace EndBehavior {
2581
- type ProrateUpFront = 'defer' | 'include';
2582
- }
2583
- }
2584
- }
2585
-
2586
- interface LineItem {
2587
- /**
2588
- * The discounts applied to this line item.
2589
- */
2590
- discounts?: Stripe.Emptyable<Array<LineItem.Discount>>;
2591
-
2592
- /**
2593
- * The ID of an existing line item on the quote.
2594
- */
2595
- id?: string;
2596
-
2597
- /**
2598
- * The ID of the price object. One of `price` or `price_data` is required.
2599
- */
2600
- price?: string;
2601
-
2602
- /**
2603
- * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2604
- */
2605
- price_data?: LineItem.PriceData;
2606
-
2607
- /**
2608
- * The quantity of the line item.
2609
- */
2610
- quantity?: number;
2611
-
2612
- /**
2613
- * The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item.
2614
- */
2615
- tax_rates?: Stripe.Emptyable<Array<string>>;
2616
- }
2617
-
2618
- namespace LineItem {
2619
- interface Discount {
2620
- /**
2621
- * ID of the coupon to create a new discount for.
2622
- */
2623
- coupon?: string;
2624
-
2625
- /**
2626
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
2627
- */
2628
- discount?: string;
2629
-
2630
- /**
2631
- * Details to determine how long the discount should be applied for.
2632
- */
2633
- discount_end?: Discount.DiscountEnd;
2634
-
2635
- /**
2636
- * ID of the promotion code to create a new discount for.
2637
- */
2638
- promotion_code?: string;
2639
- }
2640
-
2641
- namespace Discount {
2642
- interface DiscountEnd {
2643
- /**
2644
- * Time span for the redeemed discount.
2645
- */
2646
- duration?: DiscountEnd.Duration;
2647
-
2648
- /**
2649
- * A precise Unix timestamp for the discount to end. Must be in the future.
2650
- */
2651
- timestamp?: number;
2652
-
2653
- /**
2654
- * The type of calculation made to determine when the discount ends.
2655
- */
2656
- type: DiscountEnd.Type;
2657
- }
2658
-
2659
- namespace DiscountEnd {
2660
- interface Duration {
2661
- /**
2662
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2663
- */
2664
- interval: Duration.Interval;
2665
-
2666
- /**
2667
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2668
- */
2669
- interval_count: number;
2670
- }
2671
-
2672
- namespace Duration {
2673
- type Interval = 'day' | 'month' | 'week' | 'year';
2674
- }
2675
-
2676
- type Type = 'duration' | 'timestamp';
2677
- }
2678
- }
2679
-
2680
- interface PriceData {
2681
- /**
2682
- * 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).
2683
- */
2684
- currency: string;
2685
-
2686
- /**
2687
- * The ID of the product that this price will belong to.
2688
- */
2689
- product: string;
2690
-
2691
- /**
2692
- * The recurring components of a price such as `interval` and `interval_count`.
2693
- */
2694
- recurring?: PriceData.Recurring;
2695
-
2696
- /**
2697
- * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2698
- */
2699
- tax_behavior?: PriceData.TaxBehavior;
2700
-
2701
- /**
2702
- * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2703
- */
2704
- unit_amount?: number;
2705
-
2706
- /**
2707
- * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2708
- */
2709
- unit_amount_decimal?: string;
2710
- }
2711
-
2712
- namespace PriceData {
2713
- interface Recurring {
2714
- /**
2715
- * Specifies billing frequency. Either `day`, `week`, `month` or `year`.
2716
- */
2717
- interval: Recurring.Interval;
2718
-
2719
- /**
2720
- * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
2721
- */
2722
- interval_count?: number;
2723
- }
2724
-
2725
- namespace Recurring {
2726
- type Interval = 'day' | 'month' | 'week' | 'year';
2727
- }
2728
-
2729
- type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
2730
- }
2731
- }
2732
-
2733
- interface Phase {
2734
- /**
2735
- * When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
2736
- */
2737
- billing_cycle_anchor?: 'reset';
2738
-
2739
- /**
2740
- * 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`. Defaults to `charge_automatically` on creation.
2741
- */
2742
- collection_method?: Phase.CollectionMethod;
2743
-
2744
- /**
2745
- * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase.
2746
- */
2747
- default_tax_rates?: Stripe.Emptyable<Array<string>>;
2748
-
2749
- /**
2750
- * The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts.
2751
- */
2752
- discounts?: Stripe.Emptyable<Array<Phase.Discount>>;
2753
-
2754
- /**
2755
- * The date at which this phase of the quote ends. If set, `iterations` must not be set.
2756
- */
2757
- end_date?: number;
2758
-
2759
- /**
2760
- * All invoices will be billed using the specified settings.
2761
- */
2762
- invoice_settings?: Phase.InvoiceSettings;
2763
-
2764
- /**
2765
- * Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
2766
- */
2767
- iterations?: number;
415
+ /**
416
+ * 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
417
+ */
418
+ metadata?: Stripe.MetadataParam;
2768
419
 
2769
- /**
2770
- * A list of line items the customer is being quoted for within this phase. Each line item includes information about the product, the quantity, and the resulting cost.
2771
- */
2772
- line_items: Array<Phase.LineItem>;
420
+ /**
421
+ * The account on behalf of which to charge.
422
+ */
423
+ on_behalf_of?: Stripe.Emptyable<string>;
2773
424
 
2774
- /**
2775
- * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on the subscription schedule's phases when the quote is accepted. After a quote has been finalized, this field can be updated by specifying an identical set of quote phases to what was on the quote originally, excluding changes in metadata and phases that are now in the past.
2776
- */
2777
- metadata?: Stripe.MetadataParam;
425
+ /**
426
+ * When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
427
+ */
428
+ subscription_data?: QuoteUpdateParams.SubscriptionData;
2778
429
 
2779
- /**
2780
- * If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
2781
- */
2782
- proration_behavior?: Phase.ProrationBehavior;
430
+ /**
431
+ * The data with which to automatically create a Transfer for each of the invoices.
432
+ */
433
+ transfer_data?: Stripe.Emptyable<QuoteUpdateParams.TransferData>;
434
+ }
2783
435
 
436
+ namespace QuoteUpdateParams {
437
+ interface AutomaticTax {
2784
438
  /**
2785
- * If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
439
+ * Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.
2786
440
  */
2787
- trial?: boolean;
441
+ enabled: boolean;
2788
442
 
2789
443
  /**
2790
- * Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`.
444
+ * 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.
2791
445
  */
2792
- trial_end?: number;
446
+ liability?: AutomaticTax.Liability;
2793
447
  }
2794
448
 
2795
- namespace Phase {
2796
- type CollectionMethod = 'charge_automatically' | 'send_invoice';
2797
-
2798
- interface Discount {
2799
- /**
2800
- * ID of the coupon to create a new discount for.
2801
- */
2802
- coupon?: string;
2803
-
2804
- /**
2805
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
2806
- */
2807
- discount?: string;
2808
-
2809
- /**
2810
- * Details to determine how long the discount should be applied for.
2811
- */
2812
- discount_end?: Discount.DiscountEnd;
2813
-
2814
- /**
2815
- * ID of the promotion code to create a new discount for.
2816
- */
2817
- promotion_code?: string;
2818
- }
2819
-
2820
- namespace Discount {
2821
- interface DiscountEnd {
2822
- /**
2823
- * Time span for the redeemed discount.
2824
- */
2825
- duration?: DiscountEnd.Duration;
2826
-
2827
- /**
2828
- * A precise Unix timestamp for the discount to end. Must be in the future.
2829
- */
2830
- timestamp?: number;
2831
-
2832
- /**
2833
- * The type of calculation made to determine when the discount ends.
2834
- */
2835
- type: DiscountEnd.Type;
2836
- }
2837
-
2838
- namespace DiscountEnd {
2839
- interface Duration {
2840
- /**
2841
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2842
- */
2843
- interval: Duration.Interval;
2844
-
2845
- /**
2846
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2847
- */
2848
- interval_count: number;
2849
- }
2850
-
2851
- namespace Duration {
2852
- type Interval = 'day' | 'month' | 'week' | 'year';
2853
- }
2854
-
2855
- type Type = 'duration' | 'timestamp';
2856
- }
2857
- }
2858
-
2859
- interface InvoiceSettings {
2860
- /**
2861
- * 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`.
2862
- */
2863
- days_until_due?: number;
2864
- }
2865
-
2866
- interface LineItem {
2867
- /**
2868
- * The discounts applied to this line item.
2869
- */
2870
- discounts?: Stripe.Emptyable<Array<LineItem.Discount>>;
2871
-
2872
- /**
2873
- * The ID of the price object. One of `price` or `price_data` is required.
2874
- */
2875
- price?: string;
2876
-
2877
- /**
2878
- * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2879
- */
2880
- price_data?: LineItem.PriceData;
2881
-
449
+ namespace AutomaticTax {
450
+ interface Liability {
2882
451
  /**
2883
- * The quantity of the line item.
452
+ * The connected account being referenced when `type` is `account`.
2884
453
  */
2885
- quantity?: number;
454
+ account?: string;
2886
455
 
2887
456
  /**
2888
- * The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item.
457
+ * Type of the account referenced in the request.
2889
458
  */
2890
- tax_rates?: Stripe.Emptyable<Array<string>>;
459
+ type: Liability.Type;
2891
460
  }
2892
461
 
2893
- namespace LineItem {
2894
- interface Discount {
2895
- /**
2896
- * ID of the coupon to create a new discount for.
2897
- */
2898
- coupon?: string;
2899
-
2900
- /**
2901
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
2902
- */
2903
- discount?: string;
2904
-
2905
- /**
2906
- * Details to determine how long the discount should be applied for.
2907
- */
2908
- discount_end?: Discount.DiscountEnd;
2909
-
2910
- /**
2911
- * ID of the promotion code to create a new discount for.
2912
- */
2913
- promotion_code?: string;
2914
- }
2915
-
2916
- namespace Discount {
2917
- interface DiscountEnd {
2918
- /**
2919
- * Time span for the redeemed discount.
2920
- */
2921
- duration?: DiscountEnd.Duration;
2922
-
2923
- /**
2924
- * A precise Unix timestamp for the discount to end. Must be in the future.
2925
- */
2926
- timestamp?: number;
2927
-
2928
- /**
2929
- * The type of calculation made to determine when the discount ends.
2930
- */
2931
- type: DiscountEnd.Type;
2932
- }
2933
-
2934
- namespace DiscountEnd {
2935
- interface Duration {
2936
- /**
2937
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2938
- */
2939
- interval: Duration.Interval;
2940
-
2941
- /**
2942
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2943
- */
2944
- interval_count: number;
2945
- }
2946
-
2947
- namespace Duration {
2948
- type Interval = 'day' | 'month' | 'week' | 'year';
2949
- }
2950
-
2951
- type Type = 'duration' | 'timestamp';
2952
- }
2953
- }
2954
-
2955
- interface PriceData {
2956
- /**
2957
- * 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).
2958
- */
2959
- currency: string;
2960
-
2961
- /**
2962
- * The ID of the product that this price will belong to.
2963
- */
2964
- product: string;
2965
-
2966
- /**
2967
- * The recurring components of a price such as `interval` and `interval_count`.
2968
- */
2969
- recurring?: PriceData.Recurring;
2970
-
2971
- /**
2972
- * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2973
- */
2974
- tax_behavior?: PriceData.TaxBehavior;
2975
-
2976
- /**
2977
- * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2978
- */
2979
- unit_amount?: number;
2980
-
2981
- /**
2982
- * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2983
- */
2984
- unit_amount_decimal?: string;
2985
- }
2986
-
2987
- namespace PriceData {
2988
- interface Recurring {
2989
- /**
2990
- * Specifies billing frequency. Either `day`, `week`, `month` or `year`.
2991
- */
2992
- interval: Recurring.Interval;
2993
-
2994
- /**
2995
- * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
2996
- */
2997
- interval_count?: number;
2998
- }
2999
-
3000
- namespace Recurring {
3001
- type Interval = 'day' | 'month' | 'week' | 'year';
3002
- }
3003
-
3004
- type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
3005
- }
462
+ namespace Liability {
463
+ type Type = 'account' | 'self';
3006
464
  }
3007
-
3008
- type ProrationBehavior =
3009
- | 'always_invoice'
3010
- | 'create_prorations'
3011
- | 'none';
3012
465
  }
3013
466
 
3014
- interface SubscriptionData {
3015
- /**
3016
- * Describes the period to bill for upon accepting the quote.
3017
- */
3018
- bill_on_acceptance?: Stripe.Emptyable<
3019
- SubscriptionData.BillOnAcceptance
3020
- >;
3021
-
3022
- /**
3023
- * 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.
3024
- */
3025
- billing_behavior?: SubscriptionData.BillingBehavior;
3026
-
3027
- /**
3028
- * When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
3029
- */
3030
- billing_cycle_anchor?: Stripe.Emptyable<'reset'>;
3031
-
3032
- /**
3033
- * The subscription's 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.
3034
- */
3035
- description?: Stripe.Emptyable<string>;
3036
-
3037
- /**
3038
- * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
3039
- */
3040
- effective_date?: Stripe.Emptyable<'current_period_end' | number>;
467
+ type CollectionMethod = 'charge_automatically' | 'send_invoice';
3041
468
 
469
+ interface Discount {
3042
470
  /**
3043
- * Behavior of the subscription schedule and underlying subscription when it ends.
471
+ * ID of the coupon to create a new discount for.
3044
472
  */
3045
- end_behavior?: SubscriptionData.EndBehavior;
473
+ coupon?: string;
3046
474
 
3047
475
  /**
3048
- * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
476
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
3049
477
  */
3050
- metadata?: Stripe.MetadataParam;
478
+ discount?: string;
3051
479
 
3052
480
  /**
3053
- * If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
481
+ * ID of the promotion code to create a new discount for.
3054
482
  */
3055
- prebilling?: Stripe.Emptyable<SubscriptionData.Prebilling>;
483
+ promotion_code?: string;
484
+ }
3056
485
 
486
+ interface InvoiceSettings {
3057
487
  /**
3058
- * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
3059
- *
3060
- * When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
3061
- *
3062
- * Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
3063
- *
3064
- * Prorations can be disabled by passing `none`.
488
+ * Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.
3065
489
  */
3066
- proration_behavior?: SubscriptionData.ProrationBehavior;
490
+ days_until_due?: number;
3067
491
 
3068
492
  /**
3069
- * Integer representing the number of trial period days before the customer is charged for the first time.
493
+ * The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
3070
494
  */
3071
- trial_period_days?: Stripe.Emptyable<number>;
495
+ issuer?: InvoiceSettings.Issuer;
3072
496
  }
3073
497
 
3074
- namespace SubscriptionData {
3075
- type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
3076
-
3077
- interface BillOnAcceptance {
498
+ namespace InvoiceSettings {
499
+ interface Issuer {
3078
500
  /**
3079
- * The start of the period to bill from when the Quote is accepted.
501
+ * The connected account being referenced when `type` is `account`.
3080
502
  */
3081
- bill_from?: BillOnAcceptance.BillFrom;
503
+ account?: string;
3082
504
 
3083
505
  /**
3084
- * The end of the period to bill until when the Quote is accepted.
506
+ * Type of the account referenced in the request.
3085
507
  */
3086
- bill_until?: BillOnAcceptance.BillUntil;
3087
- }
3088
-
3089
- namespace BillOnAcceptance {
3090
- interface BillFrom {
3091
- /**
3092
- * Details of a Quote line to start the bill period from.
3093
- */
3094
- line_starts_at?: BillFrom.LineStartsAt;
3095
-
3096
- /**
3097
- * A precise Unix timestamp.
3098
- */
3099
- timestamp?: number;
3100
-
3101
- /**
3102
- * The type of method to specify the `bill_from` time.
3103
- */
3104
- type: BillFrom.Type;
3105
- }
3106
-
3107
- namespace BillFrom {
3108
- interface LineStartsAt {
3109
- /**
3110
- * The ID of a quote line.
3111
- */
3112
- id?: string;
3113
-
3114
- /**
3115
- * The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
3116
- */
3117
- index?: number;
3118
- }
3119
-
3120
- type Type =
3121
- | 'line_starts_at'
3122
- | 'now'
3123
- | 'pause_collection_start'
3124
- | 'quote_acceptance_date'
3125
- | 'timestamp';
3126
- }
3127
-
3128
- interface BillUntil {
3129
- /**
3130
- * Details of the duration over which to bill.
3131
- */
3132
- duration?: BillUntil.Duration;
3133
-
3134
- /**
3135
- * Details of a Quote line item from which to bill until.
3136
- */
3137
- line_ends_at?: BillUntil.LineEndsAt;
3138
-
3139
- /**
3140
- * A precise Unix timestamp.
3141
- */
3142
- timestamp?: number;
3143
-
3144
- /**
3145
- * The type of method to specify the `bill_until` time.
3146
- */
3147
- type: BillUntil.Type;
3148
- }
3149
-
3150
- namespace BillUntil {
3151
- interface Duration {
3152
- /**
3153
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3154
- */
3155
- interval: Duration.Interval;
3156
-
3157
- /**
3158
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3159
- */
3160
- interval_count: number;
3161
- }
3162
-
3163
- namespace Duration {
3164
- type Interval = 'day' | 'month' | 'week' | 'year';
3165
- }
3166
-
3167
- interface LineEndsAt {
3168
- /**
3169
- * The ID of a quote line.
3170
- */
3171
- id?: string;
3172
-
3173
- /**
3174
- * The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
3175
- */
3176
- index?: number;
3177
- }
3178
-
3179
- type Type =
3180
- | 'duration'
3181
- | 'line_ends_at'
3182
- | 'schedule_end'
3183
- | 'timestamp'
3184
- | 'upcoming_invoice';
3185
- }
508
+ type: Issuer.Type;
3186
509
  }
3187
510
 
3188
- type EndBehavior = 'cancel' | 'release';
3189
-
3190
- interface Prebilling {
3191
- /**
3192
- * This is used to determine the number of billing cycles to prebill.
3193
- */
3194
- iterations: number;
511
+ namespace Issuer {
512
+ type Type = 'account' | 'self';
3195
513
  }
3196
-
3197
- type ProrationBehavior =
3198
- | 'always_invoice'
3199
- | 'create_prorations'
3200
- | 'none';
3201
514
  }
3202
515
 
3203
- interface SubscriptionDataOverride {
3204
- /**
3205
- * Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
3206
- */
3207
- applies_to: SubscriptionDataOverride.AppliesTo;
3208
-
516
+ interface LineItem {
3209
517
  /**
3210
- * Describes the period to bill for upon accepting the quote.
518
+ * The discounts applied to this line item.
3211
519
  */
3212
- bill_on_acceptance?: Stripe.Emptyable<
3213
- SubscriptionDataOverride.BillOnAcceptance
3214
- >;
520
+ discounts?: Stripe.Emptyable<Array<LineItem.Discount>>;
3215
521
 
3216
522
  /**
3217
- * 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.
523
+ * The ID of an existing line item on the quote.
3218
524
  */
3219
- billing_behavior?: SubscriptionDataOverride.BillingBehavior;
525
+ id?: string;
3220
526
 
3221
527
  /**
3222
- * The customer the Subscription Data override applies to.
528
+ * The ID of the price object. One of `price` or `price_data` is required.
3223
529
  */
3224
- customer?: string;
530
+ price?: string;
3225
531
 
3226
532
  /**
3227
- * The subscription's 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.
533
+ * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
3228
534
  */
3229
- description?: Stripe.Emptyable<string>;
535
+ price_data?: LineItem.PriceData;
3230
536
 
3231
537
  /**
3232
- * Behavior of the subscription schedule and underlying subscription when it ends.
538
+ * The quantity of the line item.
3233
539
  */
3234
- end_behavior?: SubscriptionDataOverride.EndBehavior;
540
+ quantity?: number;
3235
541
 
3236
542
  /**
3237
- * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
3238
- *
3239
- * When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
3240
- *
3241
- * Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
3242
- *
3243
- * Prorations can be disabled by passing `none`.
543
+ * The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item.
3244
544
  */
3245
- proration_behavior?: SubscriptionDataOverride.ProrationBehavior;
545
+ tax_rates?: Stripe.Emptyable<Array<string>>;
3246
546
  }
3247
547
 
3248
- namespace SubscriptionDataOverride {
3249
- interface AppliesTo {
548
+ namespace LineItem {
549
+ interface Discount {
3250
550
  /**
3251
- * 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.
551
+ * ID of the coupon to create a new discount for.
3252
552
  */
3253
- new_reference?: string;
553
+ coupon?: string;
3254
554
 
3255
555
  /**
3256
- * The ID of the schedule the line applies to.
556
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
3257
557
  */
3258
- subscription_schedule?: string;
558
+ discount?: string;
3259
559
 
3260
560
  /**
3261
- * Describes whether the quote line is affecting a new schedule or an existing schedule.
561
+ * ID of the promotion code to create a new discount for.
3262
562
  */
3263
- type: AppliesTo.Type;
563
+ promotion_code?: string;
3264
564
  }
3265
565
 
3266
- namespace AppliesTo {
3267
- type Type = 'new_reference' | 'subscription_schedule';
3268
- }
566
+ interface PriceData {
567
+ /**
568
+ * 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).
569
+ */
570
+ currency: string;
571
+
572
+ /**
573
+ * The ID of the product that this price will belong to.
574
+ */
575
+ product: string;
3269
576
 
3270
- type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
577
+ /**
578
+ * The recurring components of a price such as `interval` and `interval_count`.
579
+ */
580
+ recurring?: PriceData.Recurring;
3271
581
 
3272
- interface BillOnAcceptance {
3273
582
  /**
3274
- * The start of the period to bill from when the Quote is accepted.
583
+ * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
3275
584
  */
3276
- bill_from?: BillOnAcceptance.BillFrom;
585
+ tax_behavior?: PriceData.TaxBehavior;
3277
586
 
3278
587
  /**
3279
- * The end of the period to bill until when the Quote is accepted.
588
+ * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
3280
589
  */
3281
- bill_until?: BillOnAcceptance.BillUntil;
3282
- }
590
+ unit_amount?: number;
3283
591
 
3284
- namespace BillOnAcceptance {
3285
- interface BillFrom {
3286
- /**
3287
- * Details of a Quote line to start the bill period from.
3288
- */
3289
- line_starts_at?: BillFrom.LineStartsAt;
592
+ /**
593
+ * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
594
+ */
595
+ unit_amount_decimal?: string;
596
+ }
3290
597
 
598
+ namespace PriceData {
599
+ interface Recurring {
3291
600
  /**
3292
- * A precise Unix timestamp.
601
+ * Specifies billing frequency. Either `day`, `week`, `month` or `year`.
3293
602
  */
3294
- timestamp?: number;
603
+ interval: Recurring.Interval;
3295
604
 
3296
605
  /**
3297
- * The type of method to specify the `bill_from` time.
606
+ * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
3298
607
  */
3299
- type: BillFrom.Type;
608
+ interval_count?: number;
3300
609
  }
3301
610
 
3302
- namespace BillFrom {
3303
- interface LineStartsAt {
3304
- /**
3305
- * The ID of a quote line.
3306
- */
3307
- id?: string;
3308
-
3309
- /**
3310
- * The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
3311
- */
3312
- index?: number;
3313
- }
3314
-
3315
- type Type =
3316
- | 'line_starts_at'
3317
- | 'now'
3318
- | 'pause_collection_start'
3319
- | 'quote_acceptance_date'
3320
- | 'timestamp';
611
+ namespace Recurring {
612
+ type Interval = 'day' | 'month' | 'week' | 'year';
3321
613
  }
3322
614
 
3323
- interface BillUntil {
3324
- /**
3325
- * Details of the duration over which to bill.
3326
- */
3327
- duration?: BillUntil.Duration;
3328
-
3329
- /**
3330
- * Details of a Quote line item from which to bill until.
3331
- */
3332
- line_ends_at?: BillUntil.LineEndsAt;
3333
-
3334
- /**
3335
- * A precise Unix timestamp.
3336
- */
3337
- timestamp?: number;
615
+ type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
616
+ }
617
+ }
3338
618
 
3339
- /**
3340
- * The type of method to specify the `bill_until` time.
3341
- */
3342
- type: BillUntil.Type;
3343
- }
619
+ interface SubscriptionData {
620
+ /**
621
+ * The subscription's 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.
622
+ */
623
+ description?: Stripe.Emptyable<string>;
3344
624
 
3345
- namespace BillUntil {
3346
- interface Duration {
3347
- /**
3348
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3349
- */
3350
- interval: Duration.Interval;
3351
-
3352
- /**
3353
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3354
- */
3355
- interval_count: number;
3356
- }
3357
-
3358
- namespace Duration {
3359
- type Interval = 'day' | 'month' | 'week' | 'year';
3360
- }
3361
-
3362
- interface LineEndsAt {
3363
- /**
3364
- * The ID of a quote line.
3365
- */
3366
- id?: string;
3367
-
3368
- /**
3369
- * The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
3370
- */
3371
- index?: number;
3372
- }
3373
-
3374
- type Type =
3375
- | 'duration'
3376
- | 'line_ends_at'
3377
- | 'schedule_end'
3378
- | 'timestamp'
3379
- | 'upcoming_invoice';
3380
- }
3381
- }
625
+ /**
626
+ * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
627
+ */
628
+ effective_date?: Stripe.Emptyable<'current_period_end' | number>;
3382
629
 
3383
- type EndBehavior = 'cancel' | 'release';
630
+ /**
631
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
632
+ */
633
+ metadata?: Stripe.MetadataParam;
3384
634
 
3385
- type ProrationBehavior =
3386
- | 'always_invoice'
3387
- | 'create_prorations'
3388
- | 'none';
635
+ /**
636
+ * Integer representing the number of trial period days before the customer is charged for the first time.
637
+ */
638
+ trial_period_days?: Stripe.Emptyable<number>;
3389
639
  }
3390
640
 
3391
641
  interface TransferData {
@@ -3417,11 +667,6 @@ declare module 'stripe' {
3417
667
  */
3418
668
  expand?: Array<string>;
3419
669
 
3420
- /**
3421
- * The subscription which the quote updates.
3422
- */
3423
- from_subscription?: string;
3424
-
3425
670
  /**
3426
671
  * The status of the quote.
3427
672
  */
@@ -3434,13 +679,7 @@ declare module 'stripe' {
3434
679
  }
3435
680
 
3436
681
  namespace QuoteListParams {
3437
- type Status =
3438
- | 'accepted'
3439
- | 'accepting'
3440
- | 'canceled'
3441
- | 'draft'
3442
- | 'open'
3443
- | 'stale';
682
+ type Status = 'accepted' | 'canceled' | 'draft' | 'open';
3444
683
  }
3445
684
 
3446
685
  interface QuoteAcceptParams {
@@ -3469,13 +708,6 @@ declare module 'stripe' {
3469
708
  expires_at?: number;
3470
709
  }
3471
710
 
3472
- interface QuoteListPreviewInvoiceLinesParams extends PaginationParams {
3473
- /**
3474
- * Specifies which fields in the response should be expanded.
3475
- */
3476
- expand?: Array<string>;
3477
- }
3478
-
3479
711
  interface QuoteListComputedUpfrontLineItemsParams extends PaginationParams {
3480
712
  /**
3481
713
  * Specifies which fields in the response should be expanded.
@@ -3490,47 +722,6 @@ declare module 'stripe' {
3490
722
  expand?: Array<string>;
3491
723
  }
3492
724
 
3493
- interface QuoteListLinesParams extends PaginationParams {
3494
- /**
3495
- * Specifies which fields in the response should be expanded.
3496
- */
3497
- expand?: Array<string>;
3498
- }
3499
-
3500
- interface QuoteListPreviewInvoicesParams extends PaginationParams {
3501
- /**
3502
- * Specifies which fields in the response should be expanded.
3503
- */
3504
- expand?: Array<string>;
3505
- }
3506
-
3507
- interface QuoteListPreviewSubscriptionSchedulesParams
3508
- extends PaginationParams {
3509
- /**
3510
- * Specifies which fields in the response should be expanded.
3511
- */
3512
- expand?: Array<string>;
3513
- }
3514
-
3515
- interface QuoteMarkDraftParams {
3516
- /**
3517
- * Specifies which fields in the response should be expanded.
3518
- */
3519
- expand?: Array<string>;
3520
- }
3521
-
3522
- interface QuoteMarkStaleParams {
3523
- /**
3524
- * Specifies which fields in the response should be expanded.
3525
- */
3526
- expand?: Array<string>;
3527
-
3528
- /**
3529
- * Reason the Quote is being marked stale.
3530
- */
3531
- reason?: string;
3532
- }
3533
-
3534
725
  interface QuotePdfParams {
3535
726
  /**
3536
727
  * Specifies which fields in the response should be expanded.
@@ -3538,13 +729,6 @@ declare module 'stripe' {
3538
729
  expand?: Array<string>;
3539
730
  }
3540
731
 
3541
- interface QuoteReestimateParams {
3542
- /**
3543
- * Specifies which fields in the response should be expanded.
3544
- */
3545
- expand?: Array<string>;
3546
- }
3547
-
3548
732
  class QuotesResource {
3549
733
  /**
3550
734
  * A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote).
@@ -3625,21 +809,6 @@ declare module 'stripe' {
3625
809
  options?: RequestOptions
3626
810
  ): Promise<Stripe.Response<Stripe.Quote>>;
3627
811
 
3628
- /**
3629
- * Preview the invoice line items that would be generated by accepting the quote.
3630
- */
3631
- listPreviewInvoiceLines(
3632
- quoteId: string,
3633
- id: string,
3634
- params?: QuoteListPreviewInvoiceLinesParams,
3635
- options?: RequestOptions
3636
- ): ApiListPromise<Stripe.InvoiceLineItem>;
3637
- listPreviewInvoiceLines(
3638
- quoteId: string,
3639
- id: string,
3640
- options?: RequestOptions
3641
- ): ApiListPromise<Stripe.InvoiceLineItem>;
3642
-
3643
812
  /**
3644
813
  * When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
3645
814
  */
@@ -3666,71 +835,6 @@ declare module 'stripe' {
3666
835
  options?: RequestOptions
3667
836
  ): ApiListPromise<Stripe.LineItem>;
3668
837
 
3669
- /**
3670
- * Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
3671
- */
3672
- listLines(
3673
- id: string,
3674
- params?: QuoteListLinesParams,
3675
- options?: RequestOptions
3676
- ): ApiListPromise<Stripe.QuoteLine>;
3677
- listLines(
3678
- id: string,
3679
- options?: RequestOptions
3680
- ): ApiListPromise<Stripe.QuoteLine>;
3681
-
3682
- /**
3683
- * Preview the invoices that would be generated by accepting the quote.
3684
- */
3685
- listPreviewInvoices(
3686
- id: string,
3687
- params?: QuoteListPreviewInvoicesParams,
3688
- options?: RequestOptions
3689
- ): ApiListPromise<Stripe.QuotePreviewInvoice>;
3690
- listPreviewInvoices(
3691
- id: string,
3692
- options?: RequestOptions
3693
- ): ApiListPromise<Stripe.QuotePreviewInvoice>;
3694
-
3695
- /**
3696
- * Preview the schedules that would be generated by accepting the quote
3697
- */
3698
- listPreviewSubscriptionSchedules(
3699
- id: string,
3700
- params?: QuoteListPreviewSubscriptionSchedulesParams,
3701
- options?: RequestOptions
3702
- ): ApiListPromise<Stripe.QuotePreviewSubscriptionSchedule>;
3703
- listPreviewSubscriptionSchedules(
3704
- id: string,
3705
- options?: RequestOptions
3706
- ): ApiListPromise<Stripe.QuotePreviewSubscriptionSchedule>;
3707
-
3708
- /**
3709
- * Converts a stale quote to draft.
3710
- */
3711
- markDraft(
3712
- id: string,
3713
- params?: QuoteMarkDraftParams,
3714
- options?: RequestOptions
3715
- ): Promise<Stripe.Response<Stripe.Quote>>;
3716
- markDraft(
3717
- id: string,
3718
- options?: RequestOptions
3719
- ): Promise<Stripe.Response<Stripe.Quote>>;
3720
-
3721
- /**
3722
- * Converts a draft or open quote to stale.
3723
- */
3724
- markStale(
3725
- id: string,
3726
- params?: QuoteMarkStaleParams,
3727
- options?: RequestOptions
3728
- ): Promise<Stripe.Response<Stripe.Quote>>;
3729
- markStale(
3730
- id: string,
3731
- options?: RequestOptions
3732
- ): Promise<Stripe.Response<Stripe.Quote>>;
3733
-
3734
838
  /**
3735
839
  * Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf)
3736
840
  */
@@ -3740,19 +844,6 @@ declare module 'stripe' {
3740
844
  options?: RequestOptions
3741
845
  ): Promise<StripeStreamResponse>;
3742
846
  pdf(id: string, options?: RequestOptions): Promise<StripeStreamResponse>;
3743
-
3744
- /**
3745
- * Recompute the upcoming invoice estimate for the quote.
3746
- */
3747
- reestimate(
3748
- id: string,
3749
- params?: QuoteReestimateParams,
3750
- options?: RequestOptions
3751
- ): Promise<Stripe.Response<Stripe.Quote>>;
3752
- reestimate(
3753
- id: string,
3754
- options?: RequestOptions
3755
- ): Promise<Stripe.Response<Stripe.Quote>>;
3756
847
  }
3757
848
  }
3758
849
  }