stripe 20.1.0 → 20.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/CHANGELOG.md +1544 -47
  2. package/OPENAPI_VERSION +1 -1
  3. package/README.md +1 -0
  4. package/VERSION +1 -1
  5. package/cjs/Error.js +115 -1
  6. package/cjs/StripeEventNotificationHandler.js +118 -0
  7. package/cjs/apiVersion.js +2 -3
  8. package/cjs/resources/AccountNotices.js +21 -0
  9. package/cjs/resources/Billing/Analytics/MeterUsage.js +12 -0
  10. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  11. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  12. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  13. package/cjs/resources/ExternalAccounts.js +23 -0
  14. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  15. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  16. package/cjs/resources/FxQuotes.js +15 -0
  17. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  18. package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
  19. package/cjs/resources/Issuing/FraudLiabilityDebits.js +17 -0
  20. package/cjs/resources/Mandates.js +5 -0
  21. package/cjs/resources/Margins.js +22 -0
  22. package/cjs/resources/Orders.js +24 -0
  23. package/cjs/resources/PaymentIntents.js +8 -0
  24. package/cjs/resources/Privacy/RedactionJobs.js +42 -0
  25. package/cjs/resources/Quotes.js +32 -0
  26. package/cjs/resources/Reserve/Holds.js +14 -0
  27. package/cjs/resources/Reserve/Plans.js +9 -0
  28. package/cjs/resources/Reserve/Releases.js +17 -0
  29. package/cjs/resources/SubscriptionSchedules.js +4 -0
  30. package/cjs/resources/Subscriptions.js +4 -0
  31. package/cjs/resources/Tax/Forms.js +20 -0
  32. package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
  33. package/cjs/resources/V2/Billing/BillSettings/Versions.js +17 -0
  34. package/cjs/resources/V2/Billing/BillSettings.js +27 -0
  35. package/cjs/resources/V2/Billing/Cadences.js +23 -0
  36. package/cjs/resources/V2/Billing/CollectionSettings/Versions.js +17 -0
  37. package/cjs/resources/V2/Billing/CollectionSettings.js +30 -0
  38. package/cjs/resources/V2/Billing/Profiles.js +19 -0
  39. package/cjs/resources/V2/Core/Vault/GbBankAccounts.js +33 -0
  40. package/cjs/resources/V2/Core/Vault/UsBankAccounts.js +37 -0
  41. package/cjs/resources/V2/MoneyManagement/Adjustments.js +17 -0
  42. package/cjs/resources/V2/MoneyManagement/FinancialAccounts.js +29 -0
  43. package/cjs/resources/V2/MoneyManagement/FinancialAddresses.js +21 -0
  44. package/cjs/resources/V2/MoneyManagement/InboundTransfers.js +21 -0
  45. package/cjs/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +16 -0
  46. package/cjs/resources/V2/MoneyManagement/OutboundPayments.js +25 -0
  47. package/cjs/resources/V2/MoneyManagement/OutboundSetupIntents.js +29 -0
  48. package/cjs/resources/V2/MoneyManagement/OutboundTransfers.js +25 -0
  49. package/cjs/resources/V2/MoneyManagement/PayoutMethods.js +25 -0
  50. package/cjs/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +12 -0
  51. package/cjs/resources/V2/MoneyManagement/ReceivedCredits.js +17 -0
  52. package/cjs/resources/V2/MoneyManagement/ReceivedDebits.js +17 -0
  53. package/cjs/resources/V2/MoneyManagement/TransactionEntries.js +17 -0
  54. package/cjs/resources/V2/MoneyManagement/Transactions.js +17 -0
  55. package/cjs/resources/V2/TestHelpers/FinancialAddresses.js +16 -0
  56. package/cjs/resources.js +98 -4
  57. package/cjs/stripe.core.js +5 -1
  58. package/esm/Error.js +100 -0
  59. package/esm/StripeEventNotificationHandler.js +114 -0
  60. package/esm/apiVersion.js +1 -2
  61. package/esm/resources/AccountNotices.js +18 -0
  62. package/esm/resources/Billing/Analytics/MeterUsage.js +9 -0
  63. package/esm/resources/Capital/FinancingOffers.js +18 -0
  64. package/esm/resources/Capital/FinancingSummary.js +9 -0
  65. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  66. package/esm/resources/ExternalAccounts.js +20 -0
  67. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  68. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  69. package/esm/resources/FxQuotes.js +12 -0
  70. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  71. package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
  72. package/esm/resources/Issuing/FraudLiabilityDebits.js +14 -0
  73. package/esm/resources/Mandates.js +5 -0
  74. package/esm/resources/Margins.js +19 -0
  75. package/esm/resources/Orders.js +21 -0
  76. package/esm/resources/PaymentIntents.js +8 -0
  77. package/esm/resources/Privacy/RedactionJobs.js +39 -0
  78. package/esm/resources/Quotes.js +32 -0
  79. package/esm/resources/Reserve/Holds.js +11 -0
  80. package/esm/resources/Reserve/Plans.js +6 -0
  81. package/esm/resources/Reserve/Releases.js +14 -0
  82. package/esm/resources/SubscriptionSchedules.js +4 -0
  83. package/esm/resources/Subscriptions.js +4 -0
  84. package/esm/resources/Tax/Forms.js +17 -0
  85. package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
  86. package/esm/resources/V2/Billing/BillSettings/Versions.js +14 -0
  87. package/esm/resources/V2/Billing/BillSettings.js +24 -0
  88. package/esm/resources/V2/Billing/Cadences.js +20 -0
  89. package/esm/resources/V2/Billing/CollectionSettings/Versions.js +14 -0
  90. package/esm/resources/V2/Billing/CollectionSettings.js +27 -0
  91. package/esm/resources/V2/Billing/Profiles.js +16 -0
  92. package/esm/resources/V2/Core/Vault/GbBankAccounts.js +30 -0
  93. package/esm/resources/V2/Core/Vault/UsBankAccounts.js +34 -0
  94. package/esm/resources/V2/MoneyManagement/Adjustments.js +14 -0
  95. package/esm/resources/V2/MoneyManagement/FinancialAccounts.js +26 -0
  96. package/esm/resources/V2/MoneyManagement/FinancialAddresses.js +18 -0
  97. package/esm/resources/V2/MoneyManagement/InboundTransfers.js +18 -0
  98. package/esm/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +13 -0
  99. package/esm/resources/V2/MoneyManagement/OutboundPayments.js +22 -0
  100. package/esm/resources/V2/MoneyManagement/OutboundSetupIntents.js +26 -0
  101. package/esm/resources/V2/MoneyManagement/OutboundTransfers.js +22 -0
  102. package/esm/resources/V2/MoneyManagement/PayoutMethods.js +22 -0
  103. package/esm/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +9 -0
  104. package/esm/resources/V2/MoneyManagement/ReceivedCredits.js +14 -0
  105. package/esm/resources/V2/MoneyManagement/ReceivedDebits.js +14 -0
  106. package/esm/resources/V2/MoneyManagement/TransactionEntries.js +14 -0
  107. package/esm/resources/V2/MoneyManagement/Transactions.js +14 -0
  108. package/esm/resources/V2/TestHelpers/FinancialAddresses.js +13 -0
  109. package/esm/resources.js +89 -0
  110. package/esm/stripe.core.js +5 -1
  111. package/package.json +1 -1
  112. package/types/AccountLinksResource.d.ts +5 -1
  113. package/types/AccountNotices.d.ts +113 -0
  114. package/types/AccountNoticesResource.d.ts +98 -0
  115. package/types/AccountSessions.d.ts +45 -0
  116. package/types/AccountSessionsResource.d.ts +264 -0
  117. package/types/Accounts.d.ts +225 -1
  118. package/types/AccountsResource.d.ts +562 -0
  119. package/types/BankAccounts.d.ts +2 -0
  120. package/types/Billing/AlertTriggereds.d.ts +1 -1
  121. package/types/Billing/Analytics/MeterUsage.d.ts +31 -0
  122. package/types/Billing/Analytics/MeterUsageResource.d.ts +689 -0
  123. package/types/Billing/Analytics/MeterUsageRows.d.ts +51 -0
  124. package/types/Capabilities.d.ts +2 -0
  125. package/types/Capital/FinancingOffers.d.ts +188 -0
  126. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  127. package/types/Capital/FinancingSummary.d.ts +109 -0
  128. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  129. package/types/Capital/FinancingTransactions.d.ts +135 -0
  130. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  131. package/types/Cards.d.ts +5 -0
  132. package/types/Charges.d.ts +152 -0
  133. package/types/ChargesResource.d.ts +3855 -75
  134. package/types/Checkout/Sessions.d.ts +279 -2
  135. package/types/Checkout/SessionsResource.d.ts +362 -2
  136. package/types/ConfirmationTokens.d.ts +103 -0
  137. package/types/Coupons.d.ts +35 -0
  138. package/types/CouponsResource.d.ts +23 -0
  139. package/types/CreditNoteLineItems.d.ts +17 -0
  140. package/types/CustomerSessions.d.ts +41 -0
  141. package/types/CustomerSessionsResource.d.ts +41 -0
  142. package/types/CustomersResource.d.ts +7 -0
  143. package/types/Disputes.d.ts +40 -0
  144. package/types/DisputesResource.d.ts +11 -0
  145. package/types/Errors.d.ts +85 -0
  146. package/types/EventTypes.d.ts +630 -0
  147. package/types/Events.d.ts +96 -0
  148. package/types/ExternalAccountsResource.d.ts +304 -0
  149. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  150. package/types/FinancialConnections/Accounts.d.ts +34 -1
  151. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  152. package/types/FinancialConnections/Institutions.d.ts +98 -0
  153. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  154. package/types/FinancialConnections/Sessions.d.ts +49 -1
  155. package/types/FinancialConnections/SessionsResource.d.ts +38 -1
  156. package/types/FxQuotes.d.ts +155 -0
  157. package/types/FxQuotesResource.d.ts +130 -0
  158. package/types/InvoiceItems.d.ts +5 -0
  159. package/types/InvoiceItemsResource.d.ts +98 -0
  160. package/types/InvoiceLineItems.d.ts +45 -1
  161. package/types/Invoices.d.ts +198 -4
  162. package/types/InvoicesResource.d.ts +1606 -3
  163. package/types/Issuing/CardholdersResource.d.ts +2 -1
  164. package/types/Issuing/CreditUnderwritingRecords.d.ts +451 -0
  165. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1032 -0
  166. package/types/Issuing/DisputeSettlementDetails.d.ts +85 -0
  167. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
  168. package/types/Issuing/FraudLiabilityDebits.d.ts +52 -0
  169. package/types/Issuing/FraudLiabilityDebitsResource.d.ts +52 -0
  170. package/types/Issuing/Settlements.d.ts +113 -0
  171. package/types/Issuing/Transactions.d.ts +5 -0
  172. package/types/Issuing/TransactionsResource.d.ts +5 -0
  173. package/types/LineItems.d.ts +45 -1
  174. package/types/Mandates.d.ts +69 -1
  175. package/types/MandatesResource.d.ts +31 -0
  176. package/types/Margins.d.ts +56 -0
  177. package/types/MarginsResource.d.ts +114 -0
  178. package/types/Orders.d.ts +1163 -0
  179. package/types/OrdersResource.d.ts +5505 -0
  180. package/types/PaymentAttemptRecords.d.ts +117 -0
  181. package/types/PaymentIntents.d.ts +683 -3
  182. package/types/PaymentIntentsResource.d.ts +19095 -6508
  183. package/types/PaymentLinks.d.ts +5 -0
  184. package/types/PaymentLinksResource.d.ts +10 -0
  185. package/types/PaymentMethodConfigurations.d.ts +180 -0
  186. package/types/PaymentMethodConfigurationsResource.d.ts +250 -0
  187. package/types/PaymentMethods.d.ts +108 -0
  188. package/types/PaymentMethodsResource.d.ts +110 -0
  189. package/types/PaymentRecords.d.ts +117 -0
  190. package/types/Persons.d.ts +2 -0
  191. package/types/Prices.d.ts +22 -0
  192. package/types/PricesResource.d.ts +22 -0
  193. package/types/Privacy/RedactionJobValidationErrors.d.ts +60 -0
  194. package/types/Privacy/RedactionJobs.d.ts +111 -0
  195. package/types/Privacy/RedactionJobsResource.d.ts +230 -0
  196. package/types/QuoteLines.d.ts +634 -0
  197. package/types/QuotePreviewInvoices.d.ts +1821 -0
  198. package/types/QuotePreviewSubscriptionSchedules.d.ts +908 -0
  199. package/types/Quotes.d.ts +589 -1
  200. package/types/QuotesResource.d.ts +2567 -237
  201. package/types/Refunds.d.ts +14 -0
  202. package/types/Reserve/Holds.d.ts +104 -0
  203. package/types/Reserve/HoldsResource.d.ts +76 -0
  204. package/types/Reserve/Plans.d.ts +103 -0
  205. package/types/Reserve/PlansResource.d.ts +29 -0
  206. package/types/Reserve/Releases.d.ts +105 -0
  207. package/types/Reserve/ReleasesResource.d.ts +60 -0
  208. package/types/SetupAttempts.d.ts +42 -1
  209. package/types/SetupIntents.d.ts +138 -2
  210. package/types/SetupIntentsResource.d.ts +629 -3
  211. package/types/Sources.d.ts +29 -0
  212. package/types/SubscriptionItems.d.ts +26 -0
  213. package/types/SubscriptionItemsResource.d.ts +109 -0
  214. package/types/SubscriptionSchedules.d.ts +200 -0
  215. package/types/SubscriptionSchedulesResource.d.ts +1230 -12
  216. package/types/Subscriptions.d.ts +257 -1
  217. package/types/SubscriptionsResource.d.ts +726 -2
  218. package/types/Tax/Forms.d.ts +220 -0
  219. package/types/Tax/FormsResource.d.ts +107 -0
  220. package/types/Terminal/Configurations.d.ts +9 -0
  221. package/types/Terminal/ConfigurationsResource.d.ts +28 -0
  222. package/types/Terminal/ReaderCollectedData.d.ts +51 -0
  223. package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
  224. package/types/Terminal/Readers.d.ts +20 -0
  225. package/types/TestHelpers/ConfirmationTokensResource.d.ts +103 -0
  226. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  227. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  228. package/types/Transfers.d.ts +5 -0
  229. package/types/TransfersResource.d.ts +5 -0
  230. package/types/Treasury/FinancialAccountFeatures.d.ts +7 -0
  231. package/types/Treasury/FinancialAccounts.d.ts +5 -0
  232. package/types/Treasury/FinancialAccountsResource.d.ts +37 -0
  233. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  234. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  235. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  236. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  237. package/types/V2/Billing/BillSettingVersions.d.ts +97 -0
  238. package/types/V2/Billing/BillSettings/VersionsResource.d.ts +58 -0
  239. package/types/V2/Billing/BillSettings.d.ts +120 -0
  240. package/types/V2/Billing/BillSettingsResource.d.ts +241 -0
  241. package/types/V2/Billing/Cadences.d.ts +690 -0
  242. package/types/V2/Billing/CadencesResource.d.ts +487 -0
  243. package/types/V2/Billing/CollectionSettingVersions.d.ts +318 -0
  244. package/types/V2/Billing/CollectionSettings/VersionsResource.d.ts +62 -0
  245. package/types/V2/Billing/CollectionSettings.d.ts +341 -0
  246. package/types/V2/Billing/CollectionSettingsResource.d.ts +683 -0
  247. package/types/V2/Billing/Profiles.d.ts +70 -0
  248. package/types/V2/Billing/ProfilesResource.d.ts +150 -0
  249. package/types/V2/Core/AccountLinks.d.ts +10 -2
  250. package/types/V2/Core/AccountLinksResource.d.ts +10 -2
  251. package/types/V2/Core/AccountTokensResource.d.ts +12 -0
  252. package/types/V2/Core/Accounts.d.ts +999 -84
  253. package/types/V2/Core/AccountsResource.d.ts +523 -2
  254. package/types/V2/Core/EventTypes.d.ts +1564 -9
  255. package/types/V2/Core/Vault/GbBankAccounts.d.ts +160 -0
  256. package/types/V2/Core/Vault/GbBankAccountsResource.d.ts +194 -0
  257. package/types/V2/Core/Vault/UsBankAccounts.d.ts +121 -0
  258. package/types/V2/Core/Vault/UsBankAccountsResource.d.ts +198 -0
  259. package/types/V2/EventMisc.d.ts +37 -0
  260. package/types/V2/FinancialAddressCreditSimulations.d.ts +27 -0
  261. package/types/V2/FinancialAddressGeneratedMicrodeposits.d.ts +46 -0
  262. package/types/V2/MoneyManagement/Adjustments.d.ts +122 -0
  263. package/types/V2/MoneyManagement/AdjustmentsResource.d.ts +83 -0
  264. package/types/V2/MoneyManagement/FinancialAccounts.d.ts +186 -0
  265. package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +172 -0
  266. package/types/V2/MoneyManagement/FinancialAddresses.d.ts +175 -0
  267. package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +109 -0
  268. package/types/V2/MoneyManagement/InboundTransfers.d.ts +250 -0
  269. package/types/V2/MoneyManagement/InboundTransfersResource.d.ts +156 -0
  270. package/types/V2/MoneyManagement/OutboundPaymentQuotes.d.ts +222 -0
  271. package/types/V2/MoneyManagement/OutboundPaymentQuotesResource.d.ts +127 -0
  272. package/types/V2/MoneyManagement/OutboundPayments.d.ts +318 -0
  273. package/types/V2/MoneyManagement/OutboundPaymentsResource.d.ts +254 -0
  274. package/types/V2/MoneyManagement/OutboundSetupIntents.d.ts +97 -0
  275. package/types/V2/MoneyManagement/OutboundSetupIntentsResource.d.ts +298 -0
  276. package/types/V2/MoneyManagement/OutboundTransfers.d.ts +291 -0
  277. package/types/V2/MoneyManagement/OutboundTransfersResource.d.ts +220 -0
  278. package/types/V2/MoneyManagement/PayoutMethods.d.ts +165 -0
  279. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpec.d.ts +93 -0
  280. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecResource.d.ts +41 -0
  281. package/types/V2/MoneyManagement/PayoutMethodsResource.d.ts +115 -0
  282. package/types/V2/MoneyManagement/ReceivedCredits.d.ts +323 -0
  283. package/types/V2/MoneyManagement/ReceivedCreditsResource.d.ts +78 -0
  284. package/types/V2/MoneyManagement/ReceivedDebits.d.ts +188 -0
  285. package/types/V2/MoneyManagement/ReceivedDebitsResource.d.ts +48 -0
  286. package/types/V2/MoneyManagement/TransactionEntries.d.ts +200 -0
  287. package/types/V2/MoneyManagement/TransactionEntriesResource.d.ts +82 -0
  288. package/types/V2/MoneyManagement/Transactions.d.ts +227 -0
  289. package/types/V2/MoneyManagement/TransactionsResource.d.ts +83 -0
  290. package/types/V2/TestHelpers/FinancialAddressesResource.d.ts +80 -0
  291. package/types/WebhookEndpointsResource.d.ts +76 -0
  292. package/types/apiVersion.d.ts +1 -2
  293. package/types/index.d.ts +160 -0
  294. package/types/lib.d.ts +10 -0
  295. package/types/test/typescriptTest.ts +27 -0
package/types/Quotes.d.ts CHANGED
@@ -17,6 +17,11 @@ 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
+
20
25
  /**
21
26
  * Total before any discounts or taxes are applied.
22
27
  */
@@ -122,6 +127,11 @@ declare module 'stripe' {
122
127
  */
123
128
  line_items?: ApiList<Stripe.LineItem>;
124
129
 
130
+ /**
131
+ * 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.
132
+ */
133
+ lines?: Array<string> | null;
134
+
125
135
  /**
126
136
  * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
127
137
  */
@@ -147,6 +157,11 @@ declare module 'stripe' {
147
157
  */
148
158
  status: Quote.Status;
149
159
 
160
+ /**
161
+ * Details on when and why a quote has been marked as stale or canceled.
162
+ */
163
+ status_details?: Quote.StatusDetails | null;
164
+
150
165
  status_transitions: Quote.StatusTransitions;
151
166
 
152
167
  /**
@@ -156,11 +171,23 @@ declare module 'stripe' {
156
171
 
157
172
  subscription_data: Quote.SubscriptionData;
158
173
 
174
+ /**
175
+ * List representing overrides for `subscription_data` configurations for specific subscription schedules.
176
+ */
177
+ subscription_data_overrides?: Array<
178
+ Quote.SubscriptionDataOverride
179
+ > | null;
180
+
159
181
  /**
160
182
  * The subscription schedule that was created or updated from this quote.
161
183
  */
162
184
  subscription_schedule: string | Stripe.SubscriptionSchedule | null;
163
185
 
186
+ /**
187
+ * The subscription schedules that were created or updated from this quote.
188
+ */
189
+ subscription_schedules?: Array<Quote.SubscriptionSchedule> | null;
190
+
164
191
  /**
165
192
  * ID of the test clock this quote belongs to.
166
193
  */
@@ -220,15 +247,62 @@ declare module 'stripe' {
220
247
  type CollectionMethod = 'charge_automatically' | 'send_invoice';
221
248
 
222
249
  interface Computed {
250
+ /**
251
+ * Details of the most recent reestimate of the quote's preview schedules and upcoming invoices, including the status of Stripe's calculation.
252
+ */
253
+ last_reestimation_details?: Computed.LastReestimationDetails | null;
254
+
223
255
  /**
224
256
  * 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.
225
257
  */
226
258
  recurring: Computed.Recurring | null;
227
259
 
260
+ /**
261
+ * The time at which the quote's estimated schedules and upcoming invoices were generated.
262
+ */
263
+ updated_at?: number | null;
264
+
228
265
  upfront: Computed.Upfront;
229
266
  }
230
267
 
231
268
  namespace Computed {
269
+ interface LastReestimationDetails {
270
+ /**
271
+ * When `status` is `failed`, provides details about the quote reestimation failure.
272
+ */
273
+ failed: LastReestimationDetails.Failed | null;
274
+
275
+ /**
276
+ * Latest status of the reestimation.
277
+ */
278
+ status: LastReestimationDetails.Status;
279
+ }
280
+
281
+ namespace LastReestimationDetails {
282
+ interface Failed {
283
+ /**
284
+ * 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.
285
+ */
286
+ failure_code: string | null;
287
+
288
+ /**
289
+ * 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".
290
+ */
291
+ message: string | null;
292
+
293
+ /**
294
+ * The reason the reestimation failed.
295
+ */
296
+ reason: Failed.Reason;
297
+ }
298
+
299
+ namespace Failed {
300
+ type Reason = 'automation_failure' | 'internal_error';
301
+ }
302
+
303
+ type Status = 'failed' | 'in_progress' | 'succeeded';
304
+ }
305
+
232
306
  interface Recurring {
233
307
  /**
234
308
  * Total before any discounts or taxes are applied.
@@ -504,7 +578,153 @@ declare module 'stripe' {
504
578
  }
505
579
  }
506
580
 
507
- type Status = 'accepted' | 'canceled' | 'draft' | 'open';
581
+ type Status =
582
+ | 'accepted'
583
+ | 'accepting'
584
+ | 'canceled'
585
+ | 'draft'
586
+ | 'open'
587
+ | 'stale';
588
+
589
+ interface StatusDetails {
590
+ canceled?: StatusDetails.Canceled;
591
+
592
+ stale?: StatusDetails.Stale;
593
+ }
594
+
595
+ namespace StatusDetails {
596
+ interface Canceled {
597
+ /**
598
+ * The reason this quote was marked as canceled.
599
+ */
600
+ reason: Canceled.Reason | null;
601
+
602
+ /**
603
+ * Time at which the quote was marked as canceled. Measured in seconds since the Unix epoch.
604
+ */
605
+ transitioned_at: number | null;
606
+ }
607
+
608
+ namespace Canceled {
609
+ type Reason =
610
+ | 'canceled'
611
+ | 'quote_accepted'
612
+ | 'quote_expired'
613
+ | 'quote_superseded'
614
+ | 'subscription_canceled';
615
+ }
616
+
617
+ interface Stale {
618
+ /**
619
+ * Time at which the quote expires. Measured in seconds since the Unix epoch.
620
+ */
621
+ expires_at: number | null;
622
+
623
+ /**
624
+ * The most recent reason this quote was marked as stale.
625
+ */
626
+ last_reason: Stale.LastReason | null;
627
+
628
+ /**
629
+ * Time at which the stale reason was updated. Measured in seconds since the Unix epoch.
630
+ */
631
+ last_updated_at: number | null;
632
+
633
+ /**
634
+ * Time at which the quote was marked as stale. Measured in seconds since the Unix epoch.
635
+ */
636
+ transitioned_at: number | null;
637
+ }
638
+
639
+ namespace Stale {
640
+ interface LastReason {
641
+ /**
642
+ * The ID of the line that is invalid if the stale reason type is `line_invalid`.
643
+ */
644
+ line_invalid?: string;
645
+
646
+ /**
647
+ * The IDs of the lines that are invalid if the stale reason type is `lines_invalid`.
648
+ */
649
+ lines_invalid?: Array<LastReason.LinesInvalid>;
650
+
651
+ /**
652
+ * The user supplied mark stale reason.
653
+ */
654
+ marked_stale?: string | null;
655
+
656
+ /**
657
+ * The ID of the subscription that was canceled.
658
+ */
659
+ subscription_canceled?: string;
660
+
661
+ subscription_changed?: LastReason.SubscriptionChanged;
662
+
663
+ /**
664
+ * The ID of the subscription that was expired.
665
+ */
666
+ subscription_expired?: string;
667
+
668
+ /**
669
+ * The ID of the subscription schedule that was canceled.
670
+ */
671
+ subscription_schedule_canceled?: string;
672
+
673
+ subscription_schedule_changed?: LastReason.SubscriptionScheduleChanged;
674
+
675
+ /**
676
+ * The ID of the subscription schedule that was released.
677
+ */
678
+ subscription_schedule_released?: string;
679
+
680
+ /**
681
+ * The reason the quote was marked as stale.
682
+ */
683
+ type: LastReason.Type | null;
684
+ }
685
+
686
+ namespace LastReason {
687
+ interface LinesInvalid {
688
+ /**
689
+ * The timestamp at which the lines were marked as invalid.
690
+ */
691
+ invalid_at: number;
692
+
693
+ /**
694
+ * The list of lines that became invalid at the given timestamp.
695
+ */
696
+ lines: Array<string>;
697
+ }
698
+
699
+ interface SubscriptionChanged {
700
+ /**
701
+ * The subscription's state before the quote was marked as stale.
702
+ */
703
+ previous_subscription: Stripe.Subscription | null;
704
+ }
705
+
706
+ interface SubscriptionScheduleChanged {
707
+ /**
708
+ * The subscription schedule's state before the quote was marked as stale.
709
+ */
710
+ previous_subscription_schedule: Stripe.SubscriptionSchedule | null;
711
+ }
712
+
713
+ type Type =
714
+ | 'accept_failed_validations'
715
+ | 'bill_on_acceptance_invalid'
716
+ | 'line_invalid'
717
+ | 'lines_invalid'
718
+ | 'marked_stale'
719
+ | 'subscription_canceled'
720
+ | 'subscription_changed'
721
+ | 'subscription_expired'
722
+ | 'subscription_schedule_canceled'
723
+ | 'subscription_schedule_changed'
724
+ | 'subscription_schedule_released';
725
+ }
726
+ }
727
+ }
508
728
 
509
729
  interface StatusTransitions {
510
730
  /**
@@ -524,6 +744,21 @@ declare module 'stripe' {
524
744
  }
525
745
 
526
746
  interface SubscriptionData {
747
+ /**
748
+ * Describes the period to bill for upon accepting the quote.
749
+ */
750
+ bill_on_acceptance?: SubscriptionData.BillOnAcceptance | null;
751
+
752
+ /**
753
+ * 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.
754
+ */
755
+ billing_behavior?: SubscriptionData.BillingBehavior;
756
+
757
+ /**
758
+ * Whether the subscription will always start a new billing period when the quote is accepted.
759
+ */
760
+ billing_cycle_anchor?: 'reset' | null;
761
+
527
762
  /**
528
763
  * The billing mode of the quote.
529
764
  */
@@ -539,11 +774,31 @@ declare module 'stripe' {
539
774
  */
540
775
  effective_date: number | null;
541
776
 
777
+ /**
778
+ * Behavior of the subscription schedule and underlying subscription when it ends.
779
+ */
780
+ end_behavior?: SubscriptionData.EndBehavior | null;
781
+
782
+ /**
783
+ * The id of the subscription that will be updated when the quote is accepted.
784
+ */
785
+ from_subscription?: string | Stripe.Subscription | null;
786
+
542
787
  /**
543
788
  * Set of [key-value pairs](https://docs.stripe.com/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.
544
789
  */
545
790
  metadata: Stripe.Metadata | null;
546
791
 
792
+ /**
793
+ * If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
794
+ */
795
+ prebilling?: SubscriptionData.Prebilling | null;
796
+
797
+ /**
798
+ * Determines how to handle [prorations](https://docs.stripe.com/subscriptions/billing-cycle#prorations) when the quote is accepted.
799
+ */
800
+ proration_behavior?: SubscriptionData.ProrationBehavior;
801
+
547
802
  /**
548
803
  * Integer representing the number of trial period days before the customer is charged for the first time.
549
804
  */
@@ -551,6 +806,8 @@ declare module 'stripe' {
551
806
  }
552
807
 
553
808
  namespace SubscriptionData {
809
+ type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
810
+
554
811
  interface BillingMode {
555
812
  flexible?: BillingMode.Flexible;
556
813
 
@@ -574,6 +831,337 @@ declare module 'stripe' {
574
831
 
575
832
  type Type = 'classic' | 'flexible';
576
833
  }
834
+
835
+ interface BillOnAcceptance {
836
+ /**
837
+ * The start of the period to bill from when the Quote is accepted.
838
+ */
839
+ bill_from: BillOnAcceptance.BillFrom | null;
840
+
841
+ /**
842
+ * The end of the period to bill until when the Quote is accepted.
843
+ */
844
+ bill_until: BillOnAcceptance.BillUntil | null;
845
+ }
846
+
847
+ namespace BillOnAcceptance {
848
+ interface BillFrom {
849
+ /**
850
+ * The materialized time.
851
+ */
852
+ computed: number | null;
853
+
854
+ /**
855
+ * The timestamp the given line starts at.
856
+ */
857
+ line_starts_at: BillFrom.LineStartsAt | null;
858
+
859
+ /**
860
+ * A precise Unix timestamp.
861
+ */
862
+ timestamp: number | null;
863
+
864
+ /**
865
+ * The type of method to specify the `bill_from` time.
866
+ */
867
+ type: BillFrom.Type;
868
+ }
869
+
870
+ namespace BillFrom {
871
+ interface LineStartsAt {
872
+ /**
873
+ * Unique identifier for the object.
874
+ */
875
+ id: string;
876
+ }
877
+
878
+ type Type =
879
+ | 'line_starts_at'
880
+ | 'now'
881
+ | 'pause_collection_start'
882
+ | 'quote_acceptance_date'
883
+ | 'timestamp';
884
+ }
885
+
886
+ interface BillUntil {
887
+ /**
888
+ * The materialized time.
889
+ */
890
+ computed: number | null;
891
+
892
+ /**
893
+ * Time span for the quote line starting from the `starts_at` date.
894
+ */
895
+ duration: BillUntil.Duration | null;
896
+
897
+ /**
898
+ * The timestamp the given line ends at.
899
+ */
900
+ line_ends_at: BillUntil.LineEndsAt | null;
901
+
902
+ /**
903
+ * A precise Unix timestamp.
904
+ */
905
+ timestamp: number | null;
906
+
907
+ /**
908
+ * The type of method to specify the `bill_until` time.
909
+ */
910
+ type: BillUntil.Type;
911
+ }
912
+
913
+ namespace BillUntil {
914
+ interface Duration {
915
+ /**
916
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
917
+ */
918
+ interval: Duration.Interval;
919
+
920
+ /**
921
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
922
+ */
923
+ interval_count: number;
924
+ }
925
+
926
+ namespace Duration {
927
+ type Interval = 'day' | 'month' | 'week' | 'year';
928
+ }
929
+
930
+ interface LineEndsAt {
931
+ /**
932
+ * Unique identifier for the object.
933
+ */
934
+ id: string;
935
+ }
936
+
937
+ type Type =
938
+ | 'duration'
939
+ | 'line_ends_at'
940
+ | 'schedule_end'
941
+ | 'timestamp'
942
+ | 'upcoming_invoice';
943
+ }
944
+ }
945
+
946
+ type EndBehavior = 'cancel' | 'release';
947
+
948
+ interface Prebilling {
949
+ iterations: number;
950
+ }
951
+
952
+ type ProrationBehavior =
953
+ | 'always_invoice'
954
+ | 'create_prorations'
955
+ | 'none';
956
+ }
957
+
958
+ interface SubscriptionDataOverride {
959
+ applies_to: SubscriptionDataOverride.AppliesTo;
960
+
961
+ /**
962
+ * Describes the period to bill for upon accepting the quote.
963
+ */
964
+ bill_on_acceptance?: SubscriptionDataOverride.BillOnAcceptance | null;
965
+
966
+ /**
967
+ * 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.
968
+ */
969
+ billing_behavior?: SubscriptionDataOverride.BillingBehavior;
970
+
971
+ /**
972
+ * The customer who received this quote. A customer is required to finalize the quote. Once specified, you can't change it.
973
+ */
974
+ customer: string | null;
975
+
976
+ /**
977
+ * 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.
978
+ */
979
+ description: string | null;
980
+
981
+ /**
982
+ * Behavior of the subscription schedule and underlying subscription when it ends.
983
+ */
984
+ end_behavior?: SubscriptionDataOverride.EndBehavior | null;
985
+
986
+ /**
987
+ * Determines how to handle [prorations](https://docs.stripe.com/subscriptions/billing-cycle#prorations) when the quote is accepted.
988
+ */
989
+ proration_behavior?: SubscriptionDataOverride.ProrationBehavior | null;
990
+ }
991
+
992
+ namespace SubscriptionDataOverride {
993
+ interface AppliesTo {
994
+ /**
995
+ * 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.
996
+ */
997
+ new_reference: string | null;
998
+
999
+ /**
1000
+ * The ID of the schedule the line applies to.
1001
+ */
1002
+ subscription_schedule: string | null;
1003
+
1004
+ /**
1005
+ * Describes whether the quote line is affecting a new schedule or an existing schedule.
1006
+ */
1007
+ type: AppliesTo.Type;
1008
+ }
1009
+
1010
+ namespace AppliesTo {
1011
+ type Type = 'new_reference' | 'subscription_schedule';
1012
+ }
1013
+
1014
+ type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
1015
+
1016
+ interface BillOnAcceptance {
1017
+ /**
1018
+ * The start of the period to bill from when the Quote is accepted.
1019
+ */
1020
+ bill_from: BillOnAcceptance.BillFrom | null;
1021
+
1022
+ /**
1023
+ * The end of the period to bill until when the Quote is accepted.
1024
+ */
1025
+ bill_until: BillOnAcceptance.BillUntil | null;
1026
+ }
1027
+
1028
+ namespace BillOnAcceptance {
1029
+ interface BillFrom {
1030
+ /**
1031
+ * The materialized time.
1032
+ */
1033
+ computed: number | null;
1034
+
1035
+ /**
1036
+ * The timestamp the given line starts at.
1037
+ */
1038
+ line_starts_at: BillFrom.LineStartsAt | null;
1039
+
1040
+ /**
1041
+ * A precise Unix timestamp.
1042
+ */
1043
+ timestamp: number | null;
1044
+
1045
+ /**
1046
+ * The type of method to specify the `bill_from` time.
1047
+ */
1048
+ type: BillFrom.Type;
1049
+ }
1050
+
1051
+ namespace BillFrom {
1052
+ interface LineStartsAt {
1053
+ /**
1054
+ * Unique identifier for the object.
1055
+ */
1056
+ id: string;
1057
+ }
1058
+
1059
+ type Type =
1060
+ | 'line_starts_at'
1061
+ | 'now'
1062
+ | 'pause_collection_start'
1063
+ | 'quote_acceptance_date'
1064
+ | 'timestamp';
1065
+ }
1066
+
1067
+ interface BillUntil {
1068
+ /**
1069
+ * The materialized time.
1070
+ */
1071
+ computed: number | null;
1072
+
1073
+ /**
1074
+ * Time span for the quote line starting from the `starts_at` date.
1075
+ */
1076
+ duration: BillUntil.Duration | null;
1077
+
1078
+ /**
1079
+ * The timestamp the given line ends at.
1080
+ */
1081
+ line_ends_at: BillUntil.LineEndsAt | null;
1082
+
1083
+ /**
1084
+ * A precise Unix timestamp.
1085
+ */
1086
+ timestamp: number | null;
1087
+
1088
+ /**
1089
+ * The type of method to specify the `bill_until` time.
1090
+ */
1091
+ type: BillUntil.Type;
1092
+ }
1093
+
1094
+ namespace BillUntil {
1095
+ interface Duration {
1096
+ /**
1097
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1098
+ */
1099
+ interval: Duration.Interval;
1100
+
1101
+ /**
1102
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1103
+ */
1104
+ interval_count: number;
1105
+ }
1106
+
1107
+ namespace Duration {
1108
+ type Interval = 'day' | 'month' | 'week' | 'year';
1109
+ }
1110
+
1111
+ interface LineEndsAt {
1112
+ /**
1113
+ * Unique identifier for the object.
1114
+ */
1115
+ id: string;
1116
+ }
1117
+
1118
+ type Type =
1119
+ | 'duration'
1120
+ | 'line_ends_at'
1121
+ | 'schedule_end'
1122
+ | 'timestamp'
1123
+ | 'upcoming_invoice';
1124
+ }
1125
+ }
1126
+
1127
+ type EndBehavior = 'cancel' | 'release';
1128
+
1129
+ type ProrationBehavior =
1130
+ | 'always_invoice'
1131
+ | 'create_prorations'
1132
+ | 'none';
1133
+ }
1134
+
1135
+ interface SubscriptionSchedule {
1136
+ applies_to: SubscriptionSchedule.AppliesTo;
1137
+
1138
+ /**
1139
+ * The subscription schedule that was created or updated from this quote.
1140
+ */
1141
+ subscription_schedule: string;
1142
+ }
1143
+
1144
+ namespace SubscriptionSchedule {
1145
+ interface AppliesTo {
1146
+ /**
1147
+ * 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.
1148
+ */
1149
+ new_reference: string | null;
1150
+
1151
+ /**
1152
+ * The ID of the schedule the line applies to.
1153
+ */
1154
+ subscription_schedule: string | null;
1155
+
1156
+ /**
1157
+ * Describes whether the quote line is affecting a new schedule or an existing schedule.
1158
+ */
1159
+ type: AppliesTo.Type;
1160
+ }
1161
+
1162
+ namespace AppliesTo {
1163
+ type Type = 'new_reference' | 'subscription_schedule';
1164
+ }
577
1165
  }
578
1166
 
579
1167
  interface TotalDetails {