stripe 16.11.0-beta.1 → 16.11.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 (170) hide show
  1. package/CHANGELOG.md +124 -831
  2. package/README.md +0 -33
  3. package/VERSION +1 -1
  4. package/cjs/RequestSender.js +5 -66
  5. package/cjs/StripeResource.js +2 -2
  6. package/cjs/apiVersion.js +1 -2
  7. package/cjs/multipart.js +1 -1
  8. package/cjs/resources/FinancialConnections/Accounts.js +0 -5
  9. package/cjs/resources/InvoiceRenderingTemplates.js +25 -0
  10. package/cjs/resources/Invoices.js +0 -17
  11. package/cjs/resources/OAuth.js +1 -1
  12. package/cjs/resources/PaymentIntents.js +0 -4
  13. package/cjs/resources/Quotes.js +0 -32
  14. package/cjs/resources/SubscriptionSchedules.js +0 -4
  15. package/cjs/resources/Terminal/Readers.js +0 -12
  16. package/cjs/resources.js +12 -42
  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 +3 -3
  21. package/esm/apiVersion.js +0 -1
  22. package/esm/multipart.js +2 -2
  23. package/esm/resources/FinancialConnections/Accounts.js +0 -5
  24. package/esm/resources/InvoiceRenderingTemplates.js +22 -0
  25. package/esm/resources/Invoices.js +0 -17
  26. package/esm/resources/OAuth.js +2 -2
  27. package/esm/resources/PaymentIntents.js +0 -4
  28. package/esm/resources/Quotes.js +0 -32
  29. package/esm/resources/SubscriptionSchedules.js +0 -4
  30. package/esm/resources/Terminal/Readers.js +0 -12
  31. package/esm/resources.js +1 -28
  32. package/esm/stripe.core.js +3 -6
  33. package/esm/utils.js +1 -27
  34. package/package.json +1 -1
  35. package/types/AccountLinksResource.d.ts +1 -5
  36. package/types/AccountSessions.d.ts +0 -45
  37. package/types/AccountSessionsResource.d.ts +0 -278
  38. package/types/Accounts.d.ts +1 -113
  39. package/types/AccountsResource.d.ts +0 -270
  40. package/types/Charges.d.ts +0 -71
  41. package/types/ChargesResource.d.ts +0 -1294
  42. package/types/Checkout/Sessions.d.ts +13 -296
  43. package/types/Checkout/SessionsResource.d.ts +14 -350
  44. package/types/ConfirmationTokens.d.ts +0 -67
  45. package/types/Coupons.d.ts +1 -1
  46. package/types/CouponsResource.d.ts +1 -1
  47. package/types/CreditNotes.d.ts +0 -21
  48. package/types/CreditNotesResource.d.ts +0 -51
  49. package/types/Customers.d.ts +5 -0
  50. package/types/CustomersResource.d.ts +10 -3
  51. package/types/Disputes.d.ts +0 -152
  52. package/types/DisputesResource.d.ts +0 -120
  53. package/types/EventTypes.d.ts +0 -477
  54. package/types/Events.d.ts +0 -86
  55. package/types/FinancialConnections/Accounts.d.ts +1 -29
  56. package/types/FinancialConnections/AccountsResource.d.ts +3 -35
  57. package/types/FinancialConnections/Sessions.d.ts +1 -49
  58. package/types/FinancialConnections/SessionsResource.d.ts +1 -38
  59. package/types/InvoiceItems.d.ts +0 -5
  60. package/types/InvoiceItemsResource.d.ts +0 -98
  61. package/types/InvoiceLineItems.d.ts +2 -24
  62. package/types/{Margins.d.ts → InvoiceRenderingTemplates.d.ts} +13 -15
  63. package/types/InvoiceRenderingTemplatesResource.d.ts +93 -0
  64. package/types/Invoices.d.ts +11 -117
  65. package/types/InvoicesResource.d.ts +1855 -5493
  66. package/types/Issuing/CardholdersResource.d.ts +1 -2
  67. package/types/Issuing/Cards.d.ts +2 -1
  68. package/types/LineItems.d.ts +0 -7
  69. package/types/Mandates.d.ts +0 -77
  70. package/types/PaymentIntents.d.ts +1 -503
  71. package/types/PaymentIntentsResource.d.ts +3464 -7064
  72. package/types/PaymentLinks.d.ts +6 -2
  73. package/types/PaymentLinksResource.d.ts +18 -4
  74. package/types/PaymentMethodConfigurations.d.ts +0 -36
  75. package/types/PaymentMethodConfigurationsResource.d.ts +0 -50
  76. package/types/PaymentMethods.d.ts +0 -67
  77. package/types/PaymentMethodsResource.d.ts +0 -88
  78. package/types/Prices.d.ts +0 -22
  79. package/types/PricesResource.d.ts +0 -22
  80. package/types/Products.d.ts +0 -39
  81. package/types/ProductsResource.d.ts +0 -36
  82. package/types/Quotes.d.ts +1 -596
  83. package/types/QuotesResource.d.ts +200 -2532
  84. package/types/SetupAttempts.d.ts +0 -10
  85. package/types/SetupIntents.d.ts +1 -111
  86. package/types/SetupIntentsResource.d.ts +3 -522
  87. package/types/Sources.d.ts +0 -23
  88. package/types/SubscriptionItems.d.ts +0 -21
  89. package/types/SubscriptionItemsResource.d.ts +0 -109
  90. package/types/SubscriptionSchedules.d.ts +0 -200
  91. package/types/SubscriptionSchedulesResource.d.ts +13 -1231
  92. package/types/Subscriptions.d.ts +1 -82
  93. package/types/SubscriptionsResource.d.ts +8 -347
  94. package/types/Terminal/LocationsResource.d.ts +1 -1
  95. package/types/Terminal/Readers.d.ts +0 -278
  96. package/types/Terminal/ReadersResource.d.ts +0 -208
  97. package/types/TestHelpers/ConfirmationTokensResource.d.ts +0 -63
  98. package/types/TestHelpers/TestClocks.d.ts +1 -1
  99. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +0 -26
  100. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +0 -26
  101. package/types/Treasury/FinancialAccounts.d.ts +0 -5
  102. package/types/Treasury/FinancialAccountsResource.d.ts +0 -10
  103. package/types/Treasury/OutboundTransfers.d.ts +0 -26
  104. package/types/Treasury/OutboundTransfersResource.d.ts +0 -26
  105. package/types/Treasury/ReceivedCredits.d.ts +0 -26
  106. package/types/Treasury/ReceivedDebits.d.ts +0 -31
  107. package/types/WebhookEndpointsResource.d.ts +0 -56
  108. package/types/index.d.ts +3 -71
  109. package/types/lib.d.ts +0 -12
  110. package/cjs/resources/AccountNotices.js +0 -21
  111. package/cjs/resources/Capital/FinancingOffers.js +0 -21
  112. package/cjs/resources/Capital/FinancingSummary.js +0 -12
  113. package/cjs/resources/Capital/FinancingTransactions.js +0 -17
  114. package/cjs/resources/FinancialConnections/Institutions.js +0 -17
  115. package/cjs/resources/GiftCards/Cards.js +0 -23
  116. package/cjs/resources/GiftCards/Transactions.js +0 -33
  117. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +0 -33
  118. package/cjs/resources/Margins.js +0 -22
  119. package/cjs/resources/Orders.js +0 -24
  120. package/cjs/resources/QuotePhases.js +0 -22
  121. package/cjs/resources/Tax/Associations.js +0 -9
  122. package/cjs/resources/Tax/Forms.js +0 -20
  123. package/cjs/resources/Terminal/ReaderCollectedData.js +0 -12
  124. package/esm/resources/AccountNotices.js +0 -18
  125. package/esm/resources/Capital/FinancingOffers.js +0 -18
  126. package/esm/resources/Capital/FinancingSummary.js +0 -9
  127. package/esm/resources/Capital/FinancingTransactions.js +0 -14
  128. package/esm/resources/FinancialConnections/Institutions.js +0 -14
  129. package/esm/resources/GiftCards/Cards.js +0 -20
  130. package/esm/resources/GiftCards/Transactions.js +0 -30
  131. package/esm/resources/Issuing/CreditUnderwritingRecords.js +0 -30
  132. package/esm/resources/Margins.js +0 -19
  133. package/esm/resources/Orders.js +0 -21
  134. package/esm/resources/QuotePhases.js +0 -19
  135. package/esm/resources/Tax/Associations.js +0 -6
  136. package/esm/resources/Tax/Forms.js +0 -17
  137. package/esm/resources/Terminal/ReaderCollectedData.js +0 -9
  138. package/types/AccountNotices.d.ts +0 -113
  139. package/types/AccountNoticesResource.d.ts +0 -98
  140. package/types/Billing/MeterErrorReports.d.ts +0 -106
  141. package/types/Capital/FinancingOffers.d.ts +0 -188
  142. package/types/Capital/FinancingOffersResource.d.ts +0 -97
  143. package/types/Capital/FinancingSummary.d.ts +0 -106
  144. package/types/Capital/FinancingSummaryResource.d.ts +0 -27
  145. package/types/Capital/FinancingTransactions.d.ts +0 -135
  146. package/types/Capital/FinancingTransactionsResource.d.ts +0 -68
  147. package/types/FinancialConnections/AccountInferredBalances.d.ts +0 -38
  148. package/types/FinancialConnections/Institutions.d.ts +0 -93
  149. package/types/FinancialConnections/InstitutionsResource.d.ts +0 -47
  150. package/types/GiftCards/Cards.d.ts +0 -118
  151. package/types/GiftCards/CardsResource.d.ts +0 -159
  152. package/types/GiftCards/Transactions.d.ts +0 -129
  153. package/types/GiftCards/TransactionsResource.d.ts +0 -201
  154. package/types/InvoicePayments.d.ts +0 -138
  155. package/types/Issuing/CreditUnderwritingRecords.d.ts +0 -451
  156. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +0 -1032
  157. package/types/MarginsResource.d.ts +0 -114
  158. package/types/Orders.d.ts +0 -1084
  159. package/types/OrdersResource.d.ts +0 -2765
  160. package/types/QuoteLines.d.ts +0 -634
  161. package/types/QuotePhases.d.ts +0 -198
  162. package/types/QuotePhasesResource.d.ts +0 -67
  163. package/types/QuotePreviewInvoices.d.ts +0 -1532
  164. package/types/QuotePreviewSubscriptionSchedules.d.ts +0 -814
  165. package/types/Tax/Associations.d.ts +0 -126
  166. package/types/Tax/AssociationsResource.d.ts +0 -29
  167. package/types/Tax/Forms.d.ts +0 -133
  168. package/types/Tax/FormsResource.d.ts +0 -90
  169. package/types/Terminal/ReaderCollectedData.d.ts +0 -51
  170. package/types/Terminal/ReaderCollectedDataResource.d.ts +0 -29
package/types/Quotes.d.ts CHANGED
@@ -17,11 +17,6 @@ declare module 'stripe' {
17
17
  */
18
18
  object: 'quote';
19
19
 
20
- /**
21
- * Allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
22
- */
23
- allow_backdated_lines?: boolean | null;
24
-
25
20
  /**
26
21
  * Total before any discounts or taxes are applied.
27
22
  */
@@ -122,11 +117,6 @@ declare module 'stripe' {
122
117
  */
123
118
  line_items?: ApiList<Stripe.LineItem>;
124
119
 
125
- /**
126
- * 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.
127
- */
128
- lines?: Array<string> | null;
129
-
130
120
  /**
131
121
  * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
132
122
  */
@@ -152,11 +142,6 @@ declare module 'stripe' {
152
142
  */
153
143
  status: Quote.Status;
154
144
 
155
- /**
156
- * Details on when and why a quote has been marked as stale or canceled.
157
- */
158
- status_details?: Quote.StatusDetails | null;
159
-
160
145
  status_transitions: Quote.StatusTransitions;
161
146
 
162
147
  /**
@@ -166,23 +151,11 @@ declare module 'stripe' {
166
151
 
167
152
  subscription_data: Quote.SubscriptionData;
168
153
 
169
- /**
170
- * List representing overrides for `subscription_data` configurations for specific subscription schedules.
171
- */
172
- subscription_data_overrides?: Array<
173
- Quote.SubscriptionDataOverride
174
- > | null;
175
-
176
154
  /**
177
155
  * The subscription schedule that was created or updated from this quote.
178
156
  */
179
157
  subscription_schedule: string | Stripe.SubscriptionSchedule | null;
180
158
 
181
- /**
182
- * The subscription schedules that were created or updated from this quote.
183
- */
184
- subscription_schedules?: Array<Quote.SubscriptionSchedule> | null;
185
-
186
159
  /**
187
160
  * ID of the test clock this quote belongs to.
188
161
  */
@@ -237,62 +210,15 @@ declare module 'stripe' {
237
210
  type CollectionMethod = 'charge_automatically' | 'send_invoice';
238
211
 
239
212
  interface Computed {
240
- /**
241
- * Details of the most recent reestimate of the quote's preview schedules and upcoming invoices, including the status of Stripe's calculation.
242
- */
243
- last_reestimation_details?: Computed.LastReestimationDetails | null;
244
-
245
213
  /**
246
214
  * The definitive totals and line items the customer will be charged on a recurring basis. Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. Defaults to `null` if no inputted line items with recurring prices.
247
215
  */
248
216
  recurring: Computed.Recurring | null;
249
217
 
250
- /**
251
- * The time at which the quote's estimated schedules and upcoming invoices were generated.
252
- */
253
- updated_at?: number | null;
254
-
255
218
  upfront: Computed.Upfront;
256
219
  }
257
220
 
258
221
  namespace Computed {
259
- interface LastReestimationDetails {
260
- /**
261
- * When `status` is `failed`, provides details about the quote reestimation failure.
262
- */
263
- failed: LastReestimationDetails.Failed | null;
264
-
265
- /**
266
- * Latest status of the reestimation.
267
- */
268
- status: LastReestimationDetails.Status;
269
- }
270
-
271
- namespace LastReestimationDetails {
272
- interface Failed {
273
- /**
274
- * The failure `code` is more granular than the `reason` provided and may correspond to a Stripe error code. For automation errors, this field is one of: `reverse_api_failure`, `reverse_api_deadline_exceeeded`, or `reverse_api_response_validation_error`, which are Stripe error codes and map to the error `message` field.
275
- */
276
- failure_code: string | null;
277
-
278
- /**
279
- * Information derived from the `failure_code` or a freeform message that explains the error as a human-readable English string. For example, "margin ID is not a valid ID".
280
- */
281
- message: string | null;
282
-
283
- /**
284
- * The reason the reestimation failed.
285
- */
286
- reason: Failed.Reason;
287
- }
288
-
289
- namespace Failed {
290
- type Reason = 'automation_failure' | 'internal_error';
291
- }
292
-
293
- type Status = 'failed' | 'in_progress' | 'succeeded';
294
- }
295
-
296
222
  interface Recurring {
297
223
  /**
298
224
  * Total before any discounts or taxes are applied.
@@ -568,153 +494,7 @@ declare module 'stripe' {
568
494
  }
569
495
  }
570
496
 
571
- type Status =
572
- | 'accepted'
573
- | 'accepting'
574
- | 'canceled'
575
- | 'draft'
576
- | 'open'
577
- | 'stale';
578
-
579
- interface StatusDetails {
580
- canceled?: StatusDetails.Canceled;
581
-
582
- stale?: StatusDetails.Stale;
583
- }
584
-
585
- namespace StatusDetails {
586
- interface Canceled {
587
- /**
588
- * The reason this quote was marked as canceled.
589
- */
590
- reason: Canceled.Reason | null;
591
-
592
- /**
593
- * Time at which the quote was marked as canceled. Measured in seconds since the Unix epoch.
594
- */
595
- transitioned_at: number | null;
596
- }
597
-
598
- namespace Canceled {
599
- type Reason =
600
- | 'canceled'
601
- | 'quote_accepted'
602
- | 'quote_expired'
603
- | 'quote_superseded'
604
- | 'subscription_canceled';
605
- }
606
-
607
- interface Stale {
608
- /**
609
- * Time at which the quote expires. Measured in seconds since the Unix epoch.
610
- */
611
- expires_at: number | null;
612
-
613
- /**
614
- * The most recent reason this quote was marked as stale.
615
- */
616
- last_reason: Stale.LastReason | null;
617
-
618
- /**
619
- * Time at which the stale reason was updated. Measured in seconds since the Unix epoch.
620
- */
621
- last_updated_at: number | null;
622
-
623
- /**
624
- * Time at which the quote was marked as stale. Measured in seconds since the Unix epoch.
625
- */
626
- transitioned_at: number | null;
627
- }
628
-
629
- namespace Stale {
630
- interface LastReason {
631
- /**
632
- * The ID of the line that is invalid if the stale reason type is `line_invalid`.
633
- */
634
- line_invalid?: string;
635
-
636
- /**
637
- * The IDs of the lines that are invalid if the stale reason type is `lines_invalid`.
638
- */
639
- lines_invalid?: Array<LastReason.LinesInvalid>;
640
-
641
- /**
642
- * The user supplied mark stale reason.
643
- */
644
- marked_stale?: string | null;
645
-
646
- /**
647
- * The ID of the subscription that was canceled.
648
- */
649
- subscription_canceled?: string;
650
-
651
- subscription_changed?: LastReason.SubscriptionChanged;
652
-
653
- /**
654
- * The ID of the subscription that was expired.
655
- */
656
- subscription_expired?: string;
657
-
658
- /**
659
- * The ID of the subscription schedule that was canceled.
660
- */
661
- subscription_schedule_canceled?: string;
662
-
663
- subscription_schedule_changed?: LastReason.SubscriptionScheduleChanged;
664
-
665
- /**
666
- * The ID of the subscription schedule that was released.
667
- */
668
- subscription_schedule_released?: string;
669
-
670
- /**
671
- * The reason the quote was marked as stale.
672
- */
673
- type: LastReason.Type | null;
674
- }
675
-
676
- namespace LastReason {
677
- interface LinesInvalid {
678
- /**
679
- * The timestamp at which the lines were marked as invalid.
680
- */
681
- invalid_at: number;
682
-
683
- /**
684
- * The list of lines that became invalid at the given timestamp.
685
- */
686
- lines: Array<string>;
687
- }
688
-
689
- interface SubscriptionChanged {
690
- /**
691
- * The subscription's state before the quote was marked as stale.
692
- */
693
- previous_subscription: Stripe.Subscription | null;
694
- }
695
-
696
- interface SubscriptionScheduleChanged {
697
- /**
698
- * The subscription schedule's state before the quote was marked as stale.
699
- */
700
- previous_subscription_schedule: Stripe.SubscriptionSchedule | null;
701
- }
702
-
703
- type Type =
704
- | 'accept_failed_validations'
705
- | 'bill_on_acceptance_invalid'
706
- | 'line_invalid'
707
- | 'lines_invalid'
708
- | 'marked_stale'
709
- | 'subscription_canceled'
710
- | 'subscription_changed'
711
- | 'subscription_expired'
712
- | 'subscription_schedule_canceled'
713
- | 'subscription_schedule_changed'
714
- | 'subscription_schedule_released';
715
- }
716
- }
717
- }
497
+ type Status = 'accepted' | 'canceled' | 'draft' | 'open';
718
498
 
719
499
  interface StatusTransitions {
720
500
  /**
@@ -734,21 +514,6 @@ declare module 'stripe' {
734
514
  }
735
515
 
736
516
  interface SubscriptionData {
737
- /**
738
- * Describes the period to bill for upon accepting the quote.
739
- */
740
- bill_on_acceptance?: SubscriptionData.BillOnAcceptance | null;
741
-
742
- /**
743
- * 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.
744
- */
745
- billing_behavior?: SubscriptionData.BillingBehavior;
746
-
747
- /**
748
- * Whether the subscription will always start a new billing period when the quote is accepted.
749
- */
750
- billing_cycle_anchor?: 'reset' | null;
751
-
752
517
  /**
753
518
  * 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.
754
519
  */
@@ -759,377 +524,17 @@ declare module 'stripe' {
759
524
  */
760
525
  effective_date: number | null;
761
526
 
762
- /**
763
- * Behavior of the subscription schedule and underlying subscription when it ends.
764
- */
765
- end_behavior?: SubscriptionData.EndBehavior | null;
766
-
767
- /**
768
- * The id of the subscription schedule that will be updated when the quote is accepted.
769
- */
770
- from_schedule?: string | Stripe.SubscriptionSchedule | null;
771
-
772
- /**
773
- * The id of the subscription that will be updated when the quote is accepted.
774
- */
775
- from_subscription?: string | Stripe.Subscription | null;
776
-
777
527
  /**
778
528
  * 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.
779
529
  */
780
530
  metadata: Stripe.Metadata | null;
781
531
 
782
- /**
783
- * If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
784
- */
785
- prebilling?: SubscriptionData.Prebilling | null;
786
-
787
- /**
788
- * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted.
789
- */
790
- proration_behavior?: SubscriptionData.ProrationBehavior;
791
-
792
532
  /**
793
533
  * Integer representing the number of trial period days before the customer is charged for the first time.
794
534
  */
795
535
  trial_period_days: number | null;
796
536
  }
797
537
 
798
- namespace SubscriptionData {
799
- type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
800
-
801
- interface BillOnAcceptance {
802
- /**
803
- * The start of the period to bill from when the Quote is accepted.
804
- */
805
- bill_from: BillOnAcceptance.BillFrom | null;
806
-
807
- /**
808
- * The end of the period to bill until when the Quote is accepted.
809
- */
810
- bill_until: BillOnAcceptance.BillUntil | null;
811
- }
812
-
813
- namespace BillOnAcceptance {
814
- interface BillFrom {
815
- /**
816
- * The materialized time.
817
- */
818
- computed: number | null;
819
-
820
- /**
821
- * The timestamp the given line starts at.
822
- */
823
- line_starts_at: BillFrom.LineStartsAt | null;
824
-
825
- /**
826
- * A precise Unix timestamp.
827
- */
828
- timestamp: number | null;
829
-
830
- /**
831
- * The type of method to specify the `bill_from` time.
832
- */
833
- type: BillFrom.Type;
834
- }
835
-
836
- namespace BillFrom {
837
- interface LineStartsAt {
838
- /**
839
- * Unique identifier for the object.
840
- */
841
- id: string;
842
- }
843
-
844
- type Type =
845
- | 'line_starts_at'
846
- | 'now'
847
- | 'pause_collection_start'
848
- | 'quote_acceptance_date'
849
- | 'timestamp';
850
- }
851
-
852
- interface BillUntil {
853
- /**
854
- * The materialized time.
855
- */
856
- computed: number | null;
857
-
858
- /**
859
- * Time span for the quote line starting from the `starts_at` date.
860
- */
861
- duration: BillUntil.Duration | null;
862
-
863
- /**
864
- * The timestamp the given line ends at.
865
- */
866
- line_ends_at: BillUntil.LineEndsAt | null;
867
-
868
- /**
869
- * A precise Unix timestamp.
870
- */
871
- timestamp: number | null;
872
-
873
- /**
874
- * The type of method to specify the `bill_until` time.
875
- */
876
- type: BillUntil.Type;
877
- }
878
-
879
- namespace BillUntil {
880
- interface Duration {
881
- /**
882
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
883
- */
884
- interval: Duration.Interval;
885
-
886
- /**
887
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
888
- */
889
- interval_count: number;
890
- }
891
-
892
- namespace Duration {
893
- type Interval = 'day' | 'month' | 'week' | 'year';
894
- }
895
-
896
- interface LineEndsAt {
897
- /**
898
- * Unique identifier for the object.
899
- */
900
- id: string;
901
- }
902
-
903
- type Type =
904
- | 'duration'
905
- | 'line_ends_at'
906
- | 'schedule_end'
907
- | 'timestamp'
908
- | 'upcoming_invoice';
909
- }
910
- }
911
-
912
- type EndBehavior = 'cancel' | 'release';
913
-
914
- interface Prebilling {
915
- iterations: number;
916
- }
917
-
918
- type ProrationBehavior =
919
- | 'always_invoice'
920
- | 'create_prorations'
921
- | 'none';
922
- }
923
-
924
- interface SubscriptionDataOverride {
925
- applies_to: SubscriptionDataOverride.AppliesTo;
926
-
927
- /**
928
- * Describes the period to bill for upon accepting the quote.
929
- */
930
- bill_on_acceptance?: SubscriptionDataOverride.BillOnAcceptance | null;
931
-
932
- /**
933
- * 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.
934
- */
935
- billing_behavior?: SubscriptionDataOverride.BillingBehavior;
936
-
937
- /**
938
- * The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
939
- */
940
- customer: string | null;
941
-
942
- /**
943
- * 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.
944
- */
945
- description: string | null;
946
-
947
- /**
948
- * Behavior of the subscription schedule and underlying subscription when it ends.
949
- */
950
- end_behavior: SubscriptionDataOverride.EndBehavior | null;
951
-
952
- /**
953
- * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted.
954
- */
955
- proration_behavior?: SubscriptionDataOverride.ProrationBehavior | null;
956
- }
957
-
958
- namespace SubscriptionDataOverride {
959
- interface AppliesTo {
960
- /**
961
- * 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.
962
- */
963
- new_reference: string | null;
964
-
965
- /**
966
- * The ID of the schedule the line applies to.
967
- */
968
- subscription_schedule: string | null;
969
-
970
- /**
971
- * Describes whether the quote line is affecting a new schedule or an existing schedule.
972
- */
973
- type: AppliesTo.Type;
974
- }
975
-
976
- namespace AppliesTo {
977
- type Type = 'new_reference' | 'subscription_schedule';
978
- }
979
-
980
- type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
981
-
982
- interface BillOnAcceptance {
983
- /**
984
- * The start of the period to bill from when the Quote is accepted.
985
- */
986
- bill_from: BillOnAcceptance.BillFrom | null;
987
-
988
- /**
989
- * The end of the period to bill until when the Quote is accepted.
990
- */
991
- bill_until: BillOnAcceptance.BillUntil | null;
992
- }
993
-
994
- namespace BillOnAcceptance {
995
- interface BillFrom {
996
- /**
997
- * The materialized time.
998
- */
999
- computed: number | null;
1000
-
1001
- /**
1002
- * The timestamp the given line starts at.
1003
- */
1004
- line_starts_at: BillFrom.LineStartsAt | null;
1005
-
1006
- /**
1007
- * A precise Unix timestamp.
1008
- */
1009
- timestamp: number | null;
1010
-
1011
- /**
1012
- * The type of method to specify the `bill_from` time.
1013
- */
1014
- type: BillFrom.Type;
1015
- }
1016
-
1017
- namespace BillFrom {
1018
- interface LineStartsAt {
1019
- /**
1020
- * Unique identifier for the object.
1021
- */
1022
- id: string;
1023
- }
1024
-
1025
- type Type =
1026
- | 'line_starts_at'
1027
- | 'now'
1028
- | 'pause_collection_start'
1029
- | 'quote_acceptance_date'
1030
- | 'timestamp';
1031
- }
1032
-
1033
- interface BillUntil {
1034
- /**
1035
- * The materialized time.
1036
- */
1037
- computed: number | null;
1038
-
1039
- /**
1040
- * Time span for the quote line starting from the `starts_at` date.
1041
- */
1042
- duration: BillUntil.Duration | null;
1043
-
1044
- /**
1045
- * The timestamp the given line ends at.
1046
- */
1047
- line_ends_at: BillUntil.LineEndsAt | null;
1048
-
1049
- /**
1050
- * A precise Unix timestamp.
1051
- */
1052
- timestamp: number | null;
1053
-
1054
- /**
1055
- * The type of method to specify the `bill_until` time.
1056
- */
1057
- type: BillUntil.Type;
1058
- }
1059
-
1060
- namespace BillUntil {
1061
- interface Duration {
1062
- /**
1063
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1064
- */
1065
- interval: Duration.Interval;
1066
-
1067
- /**
1068
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1069
- */
1070
- interval_count: number;
1071
- }
1072
-
1073
- namespace Duration {
1074
- type Interval = 'day' | 'month' | 'week' | 'year';
1075
- }
1076
-
1077
- interface LineEndsAt {
1078
- /**
1079
- * Unique identifier for the object.
1080
- */
1081
- id: string;
1082
- }
1083
-
1084
- type Type =
1085
- | 'duration'
1086
- | 'line_ends_at'
1087
- | 'schedule_end'
1088
- | 'timestamp'
1089
- | 'upcoming_invoice';
1090
- }
1091
- }
1092
-
1093
- type EndBehavior = 'cancel' | 'release';
1094
-
1095
- type ProrationBehavior =
1096
- | 'always_invoice'
1097
- | 'create_prorations'
1098
- | 'none';
1099
- }
1100
-
1101
- interface SubscriptionSchedule {
1102
- applies_to: SubscriptionSchedule.AppliesTo;
1103
-
1104
- /**
1105
- * The subscription schedule that was created or updated from this quote.
1106
- */
1107
- subscription_schedule: string;
1108
- }
1109
-
1110
- namespace SubscriptionSchedule {
1111
- interface AppliesTo {
1112
- /**
1113
- * 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.
1114
- */
1115
- new_reference: string | null;
1116
-
1117
- /**
1118
- * The ID of the schedule the line applies to.
1119
- */
1120
- subscription_schedule: string | null;
1121
-
1122
- /**
1123
- * Describes whether the quote line is affecting a new schedule or an existing schedule.
1124
- */
1125
- type: AppliesTo.Type;
1126
- }
1127
-
1128
- namespace AppliesTo {
1129
- type Type = 'new_reference' | 'subscription_schedule';
1130
- }
1131
- }
1132
-
1133
538
  interface TotalDetails {
1134
539
  /**
1135
540
  * This is the sum of all the discounts.