stripe 18.2.0-beta.1 → 18.2.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 (333) hide show
  1. package/CHANGELOG.md +183 -1211
  2. package/OPENAPI_VERSION +1 -1
  3. package/README.md +11 -12
  4. package/VERSION +1 -1
  5. package/cjs/Error.js +1 -91
  6. package/cjs/RequestSender.js +3 -3
  7. package/cjs/StripeResource.js +1 -1
  8. package/cjs/apiVersion.js +1 -1
  9. package/cjs/resources/FinancialConnections/Accounts.js +0 -5
  10. package/cjs/resources/{PaymentAttemptRecords.js → InvoicePayments.js} +4 -4
  11. package/cjs/resources/PaymentIntents.js +0 -13
  12. package/cjs/resources/Quotes.js +0 -32
  13. package/cjs/resources/SubscriptionSchedules.js +0 -4
  14. package/cjs/resources/Terminal/Readers.js +0 -8
  15. package/cjs/resources.js +18 -108
  16. package/cjs/stripe.core.js +1 -1
  17. package/cjs/utils.js +5 -0
  18. package/esm/Error.js +0 -79
  19. package/esm/RequestSender.js +3 -3
  20. package/esm/StripeResource.js +1 -1
  21. package/esm/apiVersion.js +1 -1
  22. package/esm/resources/FinancialConnections/Accounts.js +0 -5
  23. package/esm/resources/{PaymentAttemptRecords.js → InvoicePayments.js} +3 -3
  24. package/esm/resources/PaymentIntents.js +0 -13
  25. package/esm/resources/Quotes.js +0 -32
  26. package/esm/resources/SubscriptionSchedules.js +0 -4
  27. package/esm/resources/Terminal/Readers.js +0 -8
  28. package/esm/resources.js +1 -84
  29. package/esm/stripe.core.js +1 -1
  30. package/esm/utils.js +5 -0
  31. package/package.json +1 -1
  32. package/types/AccountLinksResource.d.ts +1 -5
  33. package/types/AccountSessions.d.ts +52 -32
  34. package/types/AccountSessionsResource.d.ts +23 -246
  35. package/types/Accounts.d.ts +19 -223
  36. package/types/AccountsResource.d.ts +61 -581
  37. package/types/Balance.d.ts +83 -1
  38. package/types/BalanceResource.d.ts +1 -1
  39. package/types/BalanceTransactions.d.ts +10 -0
  40. package/types/BankAccounts.d.ts +3 -3
  41. package/types/Billing/Alerts.d.ts +1 -1
  42. package/types/Billing/AlertsResource.d.ts +2 -2
  43. package/types/Billing/CreditBalanceSummary.d.ts +0 -5
  44. package/types/Billing/CreditBalanceSummaryResource.d.ts +3 -8
  45. package/types/Billing/CreditBalanceTransactionsResource.d.ts +4 -12
  46. package/types/Billing/CreditGrants.d.ts +0 -5
  47. package/types/Billing/CreditGrantsResource.d.ts +1 -11
  48. package/types/BillingPortal/Sessions.d.ts +1 -6
  49. package/types/BillingPortal/SessionsResource.d.ts +4 -12
  50. package/types/Capabilities.d.ts +1 -1
  51. package/types/Cards.d.ts +2 -7
  52. package/types/CashBalances.d.ts +0 -5
  53. package/types/Charges.d.ts +20 -166
  54. package/types/ChargesResource.d.ts +4 -1318
  55. package/types/Checkout/Sessions.d.ts +120 -418
  56. package/types/Checkout/SessionsResource.d.ts +118 -448
  57. package/types/ConfirmationTokens.d.ts +4 -129
  58. package/types/CountrySpecs.d.ts +1 -1
  59. package/types/Coupons.d.ts +0 -33
  60. package/types/CouponsResource.d.ts +0 -21
  61. package/types/CreditNoteLineItems.d.ts +0 -17
  62. package/types/CreditNotes.d.ts +11 -10
  63. package/types/CreditNotesResource.d.ts +7 -13
  64. package/types/CustomerBalanceTransactions.d.ts +0 -2
  65. package/types/CustomerCashBalanceTransactions.d.ts +0 -2
  66. package/types/CustomerSessions.d.ts +3 -8
  67. package/types/CustomerSessionsResource.d.ts +1 -6
  68. package/types/Customers.d.ts +0 -2
  69. package/types/CustomersResource.d.ts +7 -15
  70. package/types/Discounts.d.ts +0 -10
  71. package/types/Disputes.d.ts +1 -1
  72. package/types/DisputesResource.d.ts +1 -1
  73. package/types/Errors.d.ts +2 -69
  74. package/types/EventTypes.d.ts +17 -698
  75. package/types/Events.d.ts +4 -99
  76. package/types/Files.d.ts +1 -1
  77. package/types/FilesResource.d.ts +1 -1
  78. package/types/FinancialConnections/Accounts.d.ts +1 -31
  79. package/types/FinancialConnections/AccountsResource.d.ts +3 -40
  80. package/types/FinancialConnections/Sessions.d.ts +1 -51
  81. package/types/FinancialConnections/SessionsResource.d.ts +1 -43
  82. package/types/Identity/VerificationReports.d.ts +17 -0
  83. package/types/Identity/VerificationSessions.d.ts +19 -7
  84. package/types/Identity/VerificationSessionsResource.d.ts +5 -12
  85. package/types/InvoiceItems.d.ts +1 -11
  86. package/types/InvoiceItemsResource.d.ts +6 -117
  87. package/types/InvoiceLineItems.d.ts +2 -46
  88. package/types/InvoicePayments.d.ts +9 -7
  89. package/types/InvoicePaymentsResource.d.ts +74 -0
  90. package/types/Invoices.d.ts +10 -142
  91. package/types/InvoicesResource.d.ts +66 -1469
  92. package/types/Issuing/AuthorizationsResource.d.ts +4 -4
  93. package/types/Issuing/CardholdersResource.d.ts +1 -2
  94. package/types/Issuing/CardsResource.d.ts +3 -0
  95. package/types/Issuing/DisputesResource.d.ts +2 -2
  96. package/types/Issuing/Transactions.d.ts +0 -5
  97. package/types/Issuing/TransactionsResource.d.ts +0 -5
  98. package/types/LineItems.d.ts +2 -51
  99. package/types/Mandates.d.ts +0 -77
  100. package/types/PaymentIntents.d.ts +145 -856
  101. package/types/PaymentIntentsResource.d.ts +4307 -8780
  102. package/types/PaymentLinks.d.ts +0 -6
  103. package/types/PaymentLinksResource.d.ts +0 -12
  104. package/types/PaymentMethodConfigurations.d.ts +70 -70
  105. package/types/PaymentMethodConfigurationsResource.d.ts +164 -164
  106. package/types/PaymentMethodDomainsResource.d.ts +1 -1
  107. package/types/PaymentMethods.d.ts +4 -129
  108. package/types/PaymentMethodsResource.d.ts +10 -175
  109. package/types/Payouts.d.ts +2 -7
  110. package/types/PayoutsResource.d.ts +2 -7
  111. package/types/Persons.d.ts +10 -10
  112. package/types/PlansResource.d.ts +1 -1
  113. package/types/Prices.d.ts +0 -22
  114. package/types/PricesResource.d.ts +2 -24
  115. package/types/Products.d.ts +0 -39
  116. package/types/ProductsResource.d.ts +1 -37
  117. package/types/PromotionCodes.d.ts +0 -5
  118. package/types/PromotionCodesResource.d.ts +1 -11
  119. package/types/Quotes.d.ts +7 -609
  120. package/types/QuotesResource.d.ts +224 -2578
  121. package/types/Radar/EarlyFraudWarningsResource.d.ts +1 -1
  122. package/types/Refunds.d.ts +6 -15
  123. package/types/Reviews.d.ts +1 -1
  124. package/types/SetupAttempts.d.ts +2 -50
  125. package/types/SetupIntents.d.ts +4 -122
  126. package/types/SetupIntentsResource.d.ts +6 -733
  127. package/types/Sources.d.ts +0 -29
  128. package/types/SourcesResource.d.ts +1 -1
  129. package/types/SubscriptionItems.d.ts +8 -17
  130. package/types/SubscriptionItemsResource.d.ts +28 -109
  131. package/types/SubscriptionSchedules.d.ts +47 -213
  132. package/types/SubscriptionSchedulesResource.d.ts +104 -1243
  133. package/types/Subscriptions.d.ts +16 -102
  134. package/types/SubscriptionsResource.d.ts +80 -407
  135. package/types/Tax/CalculationLineItems.d.ts +5 -0
  136. package/types/Tax/CalculationsResource.d.ts +5 -0
  137. package/types/Tax/RegistrationsResource.d.ts +1 -1
  138. package/types/TaxIds.d.ts +0 -10
  139. package/types/TaxIdsResource.d.ts +0 -10
  140. package/types/TaxRates.d.ts +2 -2
  141. package/types/Terminal/LocationsResource.d.ts +1 -1
  142. package/types/Terminal/Readers.d.ts +7 -89
  143. package/types/Terminal/ReadersResource.d.ts +6 -82
  144. package/types/TestHelpers/ConfirmationTokensResource.d.ts +0 -126
  145. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +0 -26
  146. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +0 -26
  147. package/types/Tokens.d.ts +3 -3
  148. package/types/TokensResource.d.ts +8 -8
  149. package/types/TransferReversals.d.ts +1 -1
  150. package/types/Transfers.d.ts +0 -5
  151. package/types/TransfersResource.d.ts +2 -7
  152. package/types/Treasury/FinancialAccountFeatures.d.ts +0 -7
  153. package/types/Treasury/FinancialAccounts.d.ts +0 -5
  154. package/types/Treasury/FinancialAccountsResource.d.ts +0 -37
  155. package/types/Treasury/OutboundTransfers.d.ts +0 -26
  156. package/types/Treasury/OutboundTransfersResource.d.ts +0 -26
  157. package/types/Treasury/ReceivedCredits.d.ts +2 -28
  158. package/types/Treasury/ReceivedDebits.d.ts +0 -31
  159. package/types/V2/EventTypes.d.ts +1 -812
  160. package/types/WebhookEndpointsResource.d.ts +4 -83
  161. package/types/index.d.ts +5 -145
  162. package/types/lib.d.ts +1 -11
  163. package/types/test/typescriptTest.ts +3 -3
  164. package/cjs/resources/AccountNotices.js +0 -21
  165. package/cjs/resources/BalanceSettings.js +0 -10
  166. package/cjs/resources/Capital/FinancingOffers.js +0 -21
  167. package/cjs/resources/Capital/FinancingSummary.js +0 -12
  168. package/cjs/resources/Capital/FinancingTransactions.js +0 -17
  169. package/cjs/resources/ExternalAccounts.js +0 -23
  170. package/cjs/resources/FinancialConnections/Institutions.js +0 -17
  171. package/cjs/resources/FxQuotes.js +0 -15
  172. package/cjs/resources/GiftCards/Cards.js +0 -23
  173. package/cjs/resources/GiftCards/Transactions.js +0 -33
  174. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +0 -33
  175. package/cjs/resources/Issuing/DisputeSettlementDetails.js +0 -17
  176. package/cjs/resources/Issuing/FraudLiabilityDebits.js +0 -17
  177. package/cjs/resources/Margins.js +0 -22
  178. package/cjs/resources/Orders.js +0 -24
  179. package/cjs/resources/PaymentRecords.js +0 -29
  180. package/cjs/resources/Privacy/RedactionJobs.js +0 -42
  181. package/cjs/resources/Tax/Associations.js +0 -9
  182. package/cjs/resources/Tax/Forms.js +0 -20
  183. package/cjs/resources/Terminal/ReaderCollectedData.js +0 -12
  184. package/cjs/resources/V2/Core/AccountLinks.js +0 -9
  185. package/cjs/resources/V2/Core/Accounts/Persons.js +0 -29
  186. package/cjs/resources/V2/Core/Accounts.js +0 -25
  187. package/cjs/resources/V2/Core/Vault/GbBankAccounts.js +0 -28
  188. package/cjs/resources/V2/Core/Vault/UsBankAccounts.js +0 -24
  189. package/cjs/resources/V2/MoneyManagement/Adjustments.js +0 -17
  190. package/cjs/resources/V2/MoneyManagement/FinancialAccounts.js +0 -17
  191. package/cjs/resources/V2/MoneyManagement/FinancialAddresses.js +0 -21
  192. package/cjs/resources/V2/MoneyManagement/InboundTransfers.js +0 -21
  193. package/cjs/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +0 -16
  194. package/cjs/resources/V2/MoneyManagement/OutboundPayments.js +0 -25
  195. package/cjs/resources/V2/MoneyManagement/OutboundSetupIntents.js +0 -29
  196. package/cjs/resources/V2/MoneyManagement/OutboundTransfers.js +0 -25
  197. package/cjs/resources/V2/MoneyManagement/PayoutMethods.js +0 -25
  198. package/cjs/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +0 -12
  199. package/cjs/resources/V2/MoneyManagement/ReceivedCredits.js +0 -17
  200. package/cjs/resources/V2/MoneyManagement/ReceivedDebits.js +0 -17
  201. package/cjs/resources/V2/MoneyManagement/TransactionEntries.js +0 -17
  202. package/cjs/resources/V2/MoneyManagement/Transactions.js +0 -17
  203. package/cjs/resources/V2/TestHelpers/FinancialAddresses.js +0 -16
  204. package/esm/resources/AccountNotices.js +0 -18
  205. package/esm/resources/BalanceSettings.js +0 -7
  206. package/esm/resources/Capital/FinancingOffers.js +0 -18
  207. package/esm/resources/Capital/FinancingSummary.js +0 -9
  208. package/esm/resources/Capital/FinancingTransactions.js +0 -14
  209. package/esm/resources/ExternalAccounts.js +0 -20
  210. package/esm/resources/FinancialConnections/Institutions.js +0 -14
  211. package/esm/resources/FxQuotes.js +0 -12
  212. package/esm/resources/GiftCards/Cards.js +0 -20
  213. package/esm/resources/GiftCards/Transactions.js +0 -30
  214. package/esm/resources/Issuing/CreditUnderwritingRecords.js +0 -30
  215. package/esm/resources/Issuing/DisputeSettlementDetails.js +0 -14
  216. package/esm/resources/Issuing/FraudLiabilityDebits.js +0 -14
  217. package/esm/resources/Margins.js +0 -19
  218. package/esm/resources/Orders.js +0 -21
  219. package/esm/resources/PaymentRecords.js +0 -26
  220. package/esm/resources/Privacy/RedactionJobs.js +0 -39
  221. package/esm/resources/Tax/Associations.js +0 -6
  222. package/esm/resources/Tax/Forms.js +0 -17
  223. package/esm/resources/Terminal/ReaderCollectedData.js +0 -9
  224. package/esm/resources/V2/Core/AccountLinks.js +0 -6
  225. package/esm/resources/V2/Core/Accounts/Persons.js +0 -26
  226. package/esm/resources/V2/Core/Accounts.js +0 -22
  227. package/esm/resources/V2/Core/Vault/GbBankAccounts.js +0 -25
  228. package/esm/resources/V2/Core/Vault/UsBankAccounts.js +0 -21
  229. package/esm/resources/V2/MoneyManagement/Adjustments.js +0 -14
  230. package/esm/resources/V2/MoneyManagement/FinancialAccounts.js +0 -14
  231. package/esm/resources/V2/MoneyManagement/FinancialAddresses.js +0 -18
  232. package/esm/resources/V2/MoneyManagement/InboundTransfers.js +0 -18
  233. package/esm/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +0 -13
  234. package/esm/resources/V2/MoneyManagement/OutboundPayments.js +0 -22
  235. package/esm/resources/V2/MoneyManagement/OutboundSetupIntents.js +0 -26
  236. package/esm/resources/V2/MoneyManagement/OutboundTransfers.js +0 -22
  237. package/esm/resources/V2/MoneyManagement/PayoutMethods.js +0 -22
  238. package/esm/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +0 -9
  239. package/esm/resources/V2/MoneyManagement/ReceivedCredits.js +0 -14
  240. package/esm/resources/V2/MoneyManagement/ReceivedDebits.js +0 -14
  241. package/esm/resources/V2/MoneyManagement/TransactionEntries.js +0 -14
  242. package/esm/resources/V2/MoneyManagement/Transactions.js +0 -14
  243. package/esm/resources/V2/TestHelpers/FinancialAddresses.js +0 -13
  244. package/types/AccountNotices.d.ts +0 -113
  245. package/types/AccountNoticesResource.d.ts +0 -98
  246. package/types/BalanceSettings.d.ts +0 -89
  247. package/types/BalanceSettingsResource.d.ts +0 -108
  248. package/types/Billing/MeterErrorReports.d.ts +0 -106
  249. package/types/Capital/FinancingOffers.d.ts +0 -188
  250. package/types/Capital/FinancingOffersResource.d.ts +0 -97
  251. package/types/Capital/FinancingSummary.d.ts +0 -106
  252. package/types/Capital/FinancingSummaryResource.d.ts +0 -27
  253. package/types/Capital/FinancingTransactions.d.ts +0 -135
  254. package/types/Capital/FinancingTransactionsResource.d.ts +0 -68
  255. package/types/ExternalAccountsResource.d.ts +0 -304
  256. package/types/FinancialConnections/AccountInferredBalances.d.ts +0 -38
  257. package/types/FinancialConnections/Institutions.d.ts +0 -93
  258. package/types/FinancialConnections/InstitutionsResource.d.ts +0 -47
  259. package/types/FxQuotes.d.ts +0 -153
  260. package/types/FxQuotesResource.d.ts +0 -130
  261. package/types/GiftCards/Cards.d.ts +0 -118
  262. package/types/GiftCards/CardsResource.d.ts +0 -159
  263. package/types/GiftCards/Transactions.d.ts +0 -129
  264. package/types/GiftCards/TransactionsResource.d.ts +0 -201
  265. package/types/Issuing/CreditUnderwritingRecords.d.ts +0 -451
  266. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +0 -1032
  267. package/types/Issuing/DisputeSettlementDetails.d.ts +0 -85
  268. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +0 -52
  269. package/types/Issuing/FraudLiabilityDebits.d.ts +0 -52
  270. package/types/Issuing/FraudLiabilityDebitsResource.d.ts +0 -52
  271. package/types/Issuing/Settlements.d.ts +0 -113
  272. package/types/Margins.d.ts +0 -56
  273. package/types/MarginsResource.d.ts +0 -114
  274. package/types/Orders.d.ts +0 -1199
  275. package/types/OrdersResource.d.ts +0 -3001
  276. package/types/PaymentAttemptRecords.d.ts +0 -2112
  277. package/types/PaymentAttemptRecordsResource.d.ts +0 -47
  278. package/types/PaymentIntentAmountDetailsLineItems.d.ts +0 -110
  279. package/types/PaymentRecords.d.ts +0 -2105
  280. package/types/PaymentRecordsResource.d.ts +0 -455
  281. package/types/Privacy/RedactionJobValidationErrors.d.ts +0 -30
  282. package/types/Privacy/RedactionJobs.d.ts +0 -65
  283. package/types/Privacy/RedactionJobsResource.d.ts +0 -218
  284. package/types/QuoteLines.d.ts +0 -634
  285. package/types/QuotePreviewInvoices.d.ts +0 -1697
  286. package/types/QuotePreviewSubscriptionSchedules.d.ts +0 -785
  287. package/types/Tax/Associations.d.ts +0 -126
  288. package/types/Tax/AssociationsResource.d.ts +0 -29
  289. package/types/Tax/Forms.d.ts +0 -220
  290. package/types/Tax/FormsResource.d.ts +0 -107
  291. package/types/Terminal/ReaderCollectedData.d.ts +0 -51
  292. package/types/Terminal/ReaderCollectedDataResource.d.ts +0 -29
  293. package/types/V2/Core/AccountLinks.d.ts +0 -106
  294. package/types/V2/Core/AccountLinksResource.d.ts +0 -90
  295. package/types/V2/Core/Accounts/PersonsResource.d.ts +0 -3770
  296. package/types/V2/Core/Accounts.d.ts +0 -8169
  297. package/types/V2/Core/AccountsResource.d.ts +0 -10203
  298. package/types/V2/Core/Persons.d.ts +0 -1867
  299. package/types/V2/Core/Vault/GbBankAccounts.d.ts +0 -160
  300. package/types/V2/Core/Vault/GbBankAccountsResource.d.ts +0 -172
  301. package/types/V2/Core/Vault/UsBankAccounts.d.ts +0 -70
  302. package/types/V2/Core/Vault/UsBankAccountsResource.d.ts +0 -123
  303. package/types/V2/FinancialAddressCreditSimulations.d.ts +0 -27
  304. package/types/V2/FinancialAddressGeneratedMicrodeposits.d.ts +0 -32
  305. package/types/V2/MoneyManagement/Adjustments.d.ts +0 -110
  306. package/types/V2/MoneyManagement/AdjustmentsResource.d.ts +0 -83
  307. package/types/V2/MoneyManagement/FinancialAccounts.d.ts +0 -546
  308. package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +0 -52
  309. package/types/V2/MoneyManagement/FinancialAddresses.d.ts +0 -314
  310. package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +0 -288
  311. package/types/V2/MoneyManagement/InboundTransfers.d.ts +0 -206
  312. package/types/V2/MoneyManagement/InboundTransfersResource.d.ts +0 -144
  313. package/types/V2/MoneyManagement/OutboundPaymentQuotes.d.ts +0 -168
  314. package/types/V2/MoneyManagement/OutboundPaymentQuotesResource.d.ts +0 -115
  315. package/types/V2/MoneyManagement/OutboundPayments.d.ts +0 -278
  316. package/types/V2/MoneyManagement/OutboundPaymentsResource.d.ts +0 -242
  317. package/types/V2/MoneyManagement/OutboundSetupIntents.d.ts +0 -97
  318. package/types/V2/MoneyManagement/OutboundSetupIntentsResource.d.ts +0 -296
  319. package/types/V2/MoneyManagement/OutboundTransfers.d.ts +0 -251
  320. package/types/V2/MoneyManagement/OutboundTransfersResource.d.ts +0 -207
  321. package/types/V2/MoneyManagement/PayoutMethods.d.ts +0 -151
  322. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecResource.d.ts +0 -41
  323. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecs.d.ts +0 -87
  324. package/types/V2/MoneyManagement/PayoutMethodsResource.d.ts +0 -113
  325. package/types/V2/MoneyManagement/ReceivedCredits.d.ts +0 -285
  326. package/types/V2/MoneyManagement/ReceivedCreditsResource.d.ts +0 -78
  327. package/types/V2/MoneyManagement/ReceivedDebits.d.ts +0 -224
  328. package/types/V2/MoneyManagement/ReceivedDebitsResource.d.ts +0 -48
  329. package/types/V2/MoneyManagement/TransactionEntries.d.ts +0 -155
  330. package/types/V2/MoneyManagement/TransactionEntriesResource.d.ts +0 -82
  331. package/types/V2/MoneyManagement/Transactions.d.ts +0 -170
  332. package/types/V2/MoneyManagement/TransactionsResource.d.ts +0 -83
  333. package/types/V2/TestHelpers/FinancialAddressesResource.d.ts +0 -66
@@ -3,26 +3,11 @@
3
3
  declare module 'stripe' {
4
4
  namespace Stripe {
5
5
  interface SubscriptionScheduleCreateParams {
6
- /**
7
- * 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.
8
- */
9
- billing_behavior?: SubscriptionScheduleCreateParams.BillingBehavior;
10
-
11
- /**
12
- * Configure billing_mode to opt in improved credit proration behavior.When the schedule creates a subscription, the subscription's `billing_mode` will be set to the same value as the schedule's `billing_mode`.
13
- */
14
- billing_mode?: SubscriptionScheduleCreateParams.BillingMode;
15
-
16
6
  /**
17
7
  * The identifier of the customer to create the subscription schedule for.
18
8
  */
19
9
  customer?: string;
20
10
 
21
- /**
22
- * The identifier of the account to create the subscription schedule for.
23
- */
24
- customer_account?: string;
25
-
26
11
  /**
27
12
  * Object representing the subscription schedule's default settings.
28
13
  */
@@ -53,11 +38,6 @@ declare module 'stripe' {
53
38
  */
54
39
  phases?: Array<SubscriptionScheduleCreateParams.Phase>;
55
40
 
56
- /**
57
- * If specified, the invoicing for the given billing cycle iterations will be processed now.
58
- */
59
- prebilling?: SubscriptionScheduleCreateParams.Prebilling;
60
-
61
41
  /**
62
42
  * When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on.
63
43
  */
@@ -65,10 +45,6 @@ declare module 'stripe' {
65
45
  }
66
46
 
67
47
  namespace SubscriptionScheduleCreateParams {
68
- type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
69
-
70
- type BillingMode = 'classic' | 'flexible';
71
-
72
48
  interface DefaultSettings {
73
49
  /**
74
50
  * 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. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
@@ -85,6 +61,13 @@ declare module 'stripe' {
85
61
  */
86
62
  billing_cycle_anchor?: DefaultSettings.BillingCycleAnchor;
87
63
 
64
+ /**
65
+ * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
66
+ */
67
+ billing_thresholds?: Stripe.Emptyable<
68
+ DefaultSettings.BillingThresholds
69
+ >;
70
+
88
71
  /**
89
72
  * 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.
90
73
  */
@@ -149,6 +132,18 @@ declare module 'stripe' {
149
132
 
150
133
  type BillingCycleAnchor = 'automatic' | 'phase_start';
151
134
 
135
+ interface BillingThresholds {
136
+ /**
137
+ * Monetary threshold that triggers the subscription to advance to a new billing period
138
+ */
139
+ amount_gte?: number;
140
+
141
+ /**
142
+ * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
143
+ */
144
+ reset_billing_cycle_anchor?: boolean;
145
+ }
146
+
152
147
  type CollectionMethod = 'charge_automatically' | 'send_invoice';
153
148
 
154
149
  interface InvoiceSettings {
@@ -222,6 +217,11 @@ declare module 'stripe' {
222
217
  */
223
218
  billing_cycle_anchor?: Phase.BillingCycleAnchor;
224
219
 
220
+ /**
221
+ * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
222
+ */
223
+ billing_thresholds?: Stripe.Emptyable<Phase.BillingThresholds>;
224
+
225
225
  /**
226
226
  * 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.
227
227
  */
@@ -283,12 +283,7 @@ declare module 'stripe' {
283
283
  on_behalf_of?: string;
284
284
 
285
285
  /**
286
- * If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
287
- */
288
- pause_collection?: Phase.PauseCollection;
289
-
290
- /**
291
- * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
286
+ * Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
292
287
  */
293
288
  proration_behavior?: Phase.ProrationBehavior;
294
289
 
@@ -302,20 +297,10 @@ declare module 'stripe' {
302
297
  */
303
298
  trial?: boolean;
304
299
 
305
- /**
306
- * Specify trial behavior when crossing phase boundaries
307
- */
308
- trial_continuation?: Phase.TrialContinuation;
309
-
310
300
  /**
311
301
  * 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`
312
302
  */
313
303
  trial_end?: number;
314
-
315
- /**
316
- * Settings related to subscription trials.
317
- */
318
- trial_settings?: Phase.TrialSettings;
319
304
  }
320
305
 
321
306
  namespace Phase {
@@ -358,56 +343,12 @@ declare module 'stripe' {
358
343
  */
359
344
  discount?: string;
360
345
 
361
- /**
362
- * Details to determine how long the discount should be applied for.
363
- */
364
- discount_end?: Discount.DiscountEnd;
365
-
366
346
  /**
367
347
  * ID of the promotion code to create a new discount for.
368
348
  */
369
349
  promotion_code?: string;
370
350
  }
371
351
 
372
- namespace Discount {
373
- interface DiscountEnd {
374
- /**
375
- * Time span for the redeemed discount.
376
- */
377
- duration?: DiscountEnd.Duration;
378
-
379
- /**
380
- * A precise Unix timestamp for the discount to end. Must be in the future.
381
- */
382
- timestamp?: number;
383
-
384
- /**
385
- * The type of calculation made to determine when the discount ends.
386
- */
387
- type: DiscountEnd.Type;
388
- }
389
-
390
- namespace DiscountEnd {
391
- interface Duration {
392
- /**
393
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
394
- */
395
- interval: Duration.Interval;
396
-
397
- /**
398
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
399
- */
400
- interval_count: number;
401
- }
402
-
403
- namespace Duration {
404
- type Interval = 'day' | 'month' | 'week' | 'year';
405
- }
406
-
407
- type Type = 'duration' | 'timestamp';
408
- }
409
- }
410
-
411
352
  interface PriceData {
412
353
  /**
413
354
  * 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).
@@ -472,6 +413,18 @@ declare module 'stripe' {
472
413
 
473
414
  type BillingCycleAnchor = 'automatic' | 'phase_start';
474
415
 
416
+ interface BillingThresholds {
417
+ /**
418
+ * Monetary threshold that triggers the subscription to advance to a new billing period
419
+ */
420
+ amount_gte?: number;
421
+
422
+ /**
423
+ * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
424
+ */
425
+ reset_billing_cycle_anchor?: boolean;
426
+ }
427
+
475
428
  type CollectionMethod = 'charge_automatically' | 'send_invoice';
476
429
 
477
430
  interface Discount {
@@ -485,56 +438,12 @@ declare module 'stripe' {
485
438
  */
486
439
  discount?: string;
487
440
 
488
- /**
489
- * Details to determine how long the discount should be applied for.
490
- */
491
- discount_end?: Discount.DiscountEnd;
492
-
493
441
  /**
494
442
  * ID of the promotion code to create a new discount for.
495
443
  */
496
444
  promotion_code?: string;
497
445
  }
498
446
 
499
- namespace Discount {
500
- interface DiscountEnd {
501
- /**
502
- * Time span for the redeemed discount.
503
- */
504
- duration?: DiscountEnd.Duration;
505
-
506
- /**
507
- * A precise Unix timestamp for the discount to end. Must be in the future.
508
- */
509
- timestamp?: number;
510
-
511
- /**
512
- * The type of calculation made to determine when the discount ends.
513
- */
514
- type: DiscountEnd.Type;
515
- }
516
-
517
- namespace DiscountEnd {
518
- interface Duration {
519
- /**
520
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
521
- */
522
- interval: Duration.Interval;
523
-
524
- /**
525
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
526
- */
527
- interval_count: number;
528
- }
529
-
530
- namespace Duration {
531
- type Interval = 'day' | 'month' | 'week' | 'year';
532
- }
533
-
534
- type Type = 'duration' | 'timestamp';
535
- }
536
- }
537
-
538
447
  interface InvoiceSettings {
539
448
  /**
540
449
  * The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
@@ -571,6 +480,11 @@ declare module 'stripe' {
571
480
  }
572
481
 
573
482
  interface Item {
483
+ /**
484
+ * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
485
+ */
486
+ billing_thresholds?: Stripe.Emptyable<Item.BillingThresholds>;
487
+
574
488
  /**
575
489
  * The coupons to redeem into discounts for the subscription item.
576
490
  */
@@ -605,14 +519,16 @@ declare module 'stripe' {
605
519
  * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
606
520
  */
607
521
  tax_rates?: Stripe.Emptyable<Array<string>>;
608
-
609
- /**
610
- * Options that configure the trial on the subscription item.
611
- */
612
- trial?: Item.Trial;
613
522
  }
614
523
 
615
524
  namespace Item {
525
+ interface BillingThresholds {
526
+ /**
527
+ * Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
528
+ */
529
+ usage_gte: number;
530
+ }
531
+
616
532
  interface Discount {
617
533
  /**
618
534
  * ID of the coupon to create a new discount for.
@@ -624,56 +540,12 @@ declare module 'stripe' {
624
540
  */
625
541
  discount?: string;
626
542
 
627
- /**
628
- * Details to determine how long the discount should be applied for.
629
- */
630
- discount_end?: Discount.DiscountEnd;
631
-
632
543
  /**
633
544
  * ID of the promotion code to create a new discount for.
634
545
  */
635
546
  promotion_code?: string;
636
547
  }
637
548
 
638
- namespace Discount {
639
- interface DiscountEnd {
640
- /**
641
- * Time span for the redeemed discount.
642
- */
643
- duration?: DiscountEnd.Duration;
644
-
645
- /**
646
- * A precise Unix timestamp for the discount to end. Must be in the future.
647
- */
648
- timestamp?: number;
649
-
650
- /**
651
- * The type of calculation made to determine when the discount ends.
652
- */
653
- type: DiscountEnd.Type;
654
- }
655
-
656
- namespace DiscountEnd {
657
- interface Duration {
658
- /**
659
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
660
- */
661
- interval: Duration.Interval;
662
-
663
- /**
664
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
665
- */
666
- interval_count: number;
667
- }
668
-
669
- namespace Duration {
670
- type Interval = 'day' | 'month' | 'week' | 'year';
671
- }
672
-
673
- type Type = 'duration' | 'timestamp';
674
- }
675
- }
676
-
677
549
  interface PriceData {
678
550
  /**
679
551
  * 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).
@@ -725,33 +597,6 @@ declare module 'stripe' {
725
597
 
726
598
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
727
599
  }
728
-
729
- interface Trial {
730
- /**
731
- * 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.
732
- */
733
- converts_to?: Array<string>;
734
-
735
- /**
736
- * Determines the type of trial for this item.
737
- */
738
- type: Trial.Type;
739
- }
740
-
741
- namespace Trial {
742
- type Type = 'free' | 'paid';
743
- }
744
- }
745
-
746
- interface PauseCollection {
747
- /**
748
- * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
749
- */
750
- behavior: PauseCollection.Behavior;
751
- }
752
-
753
- namespace PauseCollection {
754
- type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
755
600
  }
756
601
 
757
602
  type ProrationBehavior =
@@ -770,44 +615,6 @@ declare module 'stripe' {
770
615
  */
771
616
  destination: string;
772
617
  }
773
-
774
- type TrialContinuation = 'continue' | 'none';
775
-
776
- interface TrialSettings {
777
- /**
778
- * Defines how the subscription should behave when a trial ends.
779
- */
780
- end_behavior?: TrialSettings.EndBehavior;
781
- }
782
-
783
- namespace TrialSettings {
784
- interface EndBehavior {
785
- /**
786
- * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
787
- */
788
- prorate_up_front?: EndBehavior.ProrateUpFront;
789
- }
790
-
791
- namespace EndBehavior {
792
- type ProrateUpFront = 'defer' | 'include';
793
- }
794
- }
795
- }
796
-
797
- interface Prebilling {
798
- /**
799
- * This is used to determine the number of billing cycles to prebill.
800
- */
801
- iterations: number;
802
-
803
- /**
804
- * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
805
- */
806
- update_behavior?: Prebilling.UpdateBehavior;
807
- }
808
-
809
- namespace Prebilling {
810
- type UpdateBehavior = 'prebill' | 'reset';
811
618
  }
812
619
  }
813
620
 
@@ -819,11 +626,6 @@ declare module 'stripe' {
819
626
  }
820
627
 
821
628
  interface SubscriptionScheduleUpdateParams {
822
- /**
823
- * 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.
824
- */
825
- billing_behavior?: SubscriptionScheduleUpdateParams.BillingBehavior;
826
-
827
629
  /**
828
630
  * Object representing the subscription schedule's default settings.
829
631
  */
@@ -850,19 +652,12 @@ declare module 'stripe' {
850
652
  phases?: Array<SubscriptionScheduleUpdateParams.Phase>;
851
653
 
852
654
  /**
853
- * If specified, the invoicing for the given billing cycle iterations will be processed now.
854
- */
855
- prebilling?: SubscriptionScheduleUpdateParams.Prebilling;
856
-
857
- /**
858
- * If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
655
+ * If the update changes the billing configuration (item price, quantity, etc.) of the current phase, indicates how prorations from this change should be handled. The default value is `create_prorations`.
859
656
  */
860
657
  proration_behavior?: SubscriptionScheduleUpdateParams.ProrationBehavior;
861
658
  }
862
659
 
863
660
  namespace SubscriptionScheduleUpdateParams {
864
- type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
865
-
866
661
  interface DefaultSettings {
867
662
  /**
868
663
  * 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. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
@@ -879,6 +674,13 @@ declare module 'stripe' {
879
674
  */
880
675
  billing_cycle_anchor?: DefaultSettings.BillingCycleAnchor;
881
676
 
677
+ /**
678
+ * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
679
+ */
680
+ billing_thresholds?: Stripe.Emptyable<
681
+ DefaultSettings.BillingThresholds
682
+ >;
683
+
882
684
  /**
883
685
  * 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.
884
686
  */
@@ -943,6 +745,18 @@ declare module 'stripe' {
943
745
 
944
746
  type BillingCycleAnchor = 'automatic' | 'phase_start';
945
747
 
748
+ interface BillingThresholds {
749
+ /**
750
+ * Monetary threshold that triggers the subscription to advance to a new billing period
751
+ */
752
+ amount_gte?: number;
753
+
754
+ /**
755
+ * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
756
+ */
757
+ reset_billing_cycle_anchor?: boolean;
758
+ }
759
+
946
760
  type CollectionMethod = 'charge_automatically' | 'send_invoice';
947
761
 
948
762
  interface InvoiceSettings {
@@ -1016,6 +830,11 @@ declare module 'stripe' {
1016
830
  */
1017
831
  billing_cycle_anchor?: Phase.BillingCycleAnchor;
1018
832
 
833
+ /**
834
+ * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
835
+ */
836
+ billing_thresholds?: Stripe.Emptyable<Phase.BillingThresholds>;
837
+
1019
838
  /**
1020
839
  * 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.
1021
840
  */
@@ -1077,12 +896,7 @@ declare module 'stripe' {
1077
896
  on_behalf_of?: string;
1078
897
 
1079
898
  /**
1080
- * If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
1081
- */
1082
- pause_collection?: Phase.PauseCollection;
1083
-
1084
- /**
1085
- * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
899
+ * Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
1086
900
  */
1087
901
  proration_behavior?: Phase.ProrationBehavior;
1088
902
 
@@ -1101,20 +915,10 @@ declare module 'stripe' {
1101
915
  */
1102
916
  trial?: boolean;
1103
917
 
1104
- /**
1105
- * Specify trial behavior when crossing phase boundaries
1106
- */
1107
- trial_continuation?: Phase.TrialContinuation;
1108
-
1109
918
  /**
1110
919
  * 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`
1111
920
  */
1112
921
  trial_end?: number | 'now';
1113
-
1114
- /**
1115
- * Settings related to subscription trials.
1116
- */
1117
- trial_settings?: Phase.TrialSettings;
1118
922
  }
1119
923
 
1120
924
  namespace Phase {
@@ -1157,56 +961,12 @@ declare module 'stripe' {
1157
961
  */
1158
962
  discount?: string;
1159
963
 
1160
- /**
1161
- * Details to determine how long the discount should be applied for.
1162
- */
1163
- discount_end?: Discount.DiscountEnd;
1164
-
1165
964
  /**
1166
965
  * ID of the promotion code to create a new discount for.
1167
966
  */
1168
967
  promotion_code?: string;
1169
968
  }
1170
969
 
1171
- namespace Discount {
1172
- interface DiscountEnd {
1173
- /**
1174
- * Time span for the redeemed discount.
1175
- */
1176
- duration?: DiscountEnd.Duration;
1177
-
1178
- /**
1179
- * A precise Unix timestamp for the discount to end. Must be in the future.
1180
- */
1181
- timestamp?: number;
1182
-
1183
- /**
1184
- * The type of calculation made to determine when the discount ends.
1185
- */
1186
- type: DiscountEnd.Type;
1187
- }
1188
-
1189
- namespace DiscountEnd {
1190
- interface Duration {
1191
- /**
1192
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1193
- */
1194
- interval: Duration.Interval;
1195
-
1196
- /**
1197
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1198
- */
1199
- interval_count: number;
1200
- }
1201
-
1202
- namespace Duration {
1203
- type Interval = 'day' | 'month' | 'week' | 'year';
1204
- }
1205
-
1206
- type Type = 'duration' | 'timestamp';
1207
- }
1208
- }
1209
-
1210
970
  interface PriceData {
1211
971
  /**
1212
972
  * 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).
@@ -1271,6 +1031,18 @@ declare module 'stripe' {
1271
1031
 
1272
1032
  type BillingCycleAnchor = 'automatic' | 'phase_start';
1273
1033
 
1034
+ interface BillingThresholds {
1035
+ /**
1036
+ * Monetary threshold that triggers the subscription to advance to a new billing period
1037
+ */
1038
+ amount_gte?: number;
1039
+
1040
+ /**
1041
+ * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
1042
+ */
1043
+ reset_billing_cycle_anchor?: boolean;
1044
+ }
1045
+
1274
1046
  type CollectionMethod = 'charge_automatically' | 'send_invoice';
1275
1047
 
1276
1048
  interface Discount {
@@ -1284,56 +1056,12 @@ declare module 'stripe' {
1284
1056
  */
1285
1057
  discount?: string;
1286
1058
 
1287
- /**
1288
- * Details to determine how long the discount should be applied for.
1289
- */
1290
- discount_end?: Discount.DiscountEnd;
1291
-
1292
1059
  /**
1293
1060
  * ID of the promotion code to create a new discount for.
1294
1061
  */
1295
1062
  promotion_code?: string;
1296
1063
  }
1297
1064
 
1298
- namespace Discount {
1299
- interface DiscountEnd {
1300
- /**
1301
- * Time span for the redeemed discount.
1302
- */
1303
- duration?: DiscountEnd.Duration;
1304
-
1305
- /**
1306
- * A precise Unix timestamp for the discount to end. Must be in the future.
1307
- */
1308
- timestamp?: number;
1309
-
1310
- /**
1311
- * The type of calculation made to determine when the discount ends.
1312
- */
1313
- type: DiscountEnd.Type;
1314
- }
1315
-
1316
- namespace DiscountEnd {
1317
- interface Duration {
1318
- /**
1319
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1320
- */
1321
- interval: Duration.Interval;
1322
-
1323
- /**
1324
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1325
- */
1326
- interval_count: number;
1327
- }
1328
-
1329
- namespace Duration {
1330
- type Interval = 'day' | 'month' | 'week' | 'year';
1331
- }
1332
-
1333
- type Type = 'duration' | 'timestamp';
1334
- }
1335
- }
1336
-
1337
1065
  interface InvoiceSettings {
1338
1066
  /**
1339
1067
  * The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
@@ -1370,6 +1098,11 @@ declare module 'stripe' {
1370
1098
  }
1371
1099
 
1372
1100
  interface Item {
1101
+ /**
1102
+ * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
1103
+ */
1104
+ billing_thresholds?: Stripe.Emptyable<Item.BillingThresholds>;
1105
+
1373
1106
  /**
1374
1107
  * The coupons to redeem into discounts for the subscription item.
1375
1108
  */
@@ -1404,14 +1137,16 @@ declare module 'stripe' {
1404
1137
  * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
1405
1138
  */
1406
1139
  tax_rates?: Stripe.Emptyable<Array<string>>;
1407
-
1408
- /**
1409
- * Options that configure the trial on the subscription item.
1410
- */
1411
- trial?: Item.Trial;
1412
1140
  }
1413
1141
 
1414
1142
  namespace Item {
1143
+ interface BillingThresholds {
1144
+ /**
1145
+ * Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
1146
+ */
1147
+ usage_gte: number;
1148
+ }
1149
+
1415
1150
  interface Discount {
1416
1151
  /**
1417
1152
  * ID of the coupon to create a new discount for.
@@ -1423,61 +1158,17 @@ declare module 'stripe' {
1423
1158
  */
1424
1159
  discount?: string;
1425
1160
 
1426
- /**
1427
- * Details to determine how long the discount should be applied for.
1428
- */
1429
- discount_end?: Discount.DiscountEnd;
1430
-
1431
1161
  /**
1432
1162
  * ID of the promotion code to create a new discount for.
1433
1163
  */
1434
1164
  promotion_code?: string;
1435
1165
  }
1436
1166
 
1437
- namespace Discount {
1438
- interface DiscountEnd {
1439
- /**
1440
- * Time span for the redeemed discount.
1441
- */
1442
- duration?: DiscountEnd.Duration;
1443
-
1444
- /**
1445
- * A precise Unix timestamp for the discount to end. Must be in the future.
1446
- */
1447
- timestamp?: number;
1448
-
1449
- /**
1450
- * The type of calculation made to determine when the discount ends.
1451
- */
1452
- type: DiscountEnd.Type;
1453
- }
1454
-
1455
- namespace DiscountEnd {
1456
- interface Duration {
1457
- /**
1458
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1459
- */
1460
- interval: Duration.Interval;
1461
-
1462
- /**
1463
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1464
- */
1465
- interval_count: number;
1466
- }
1467
-
1468
- namespace Duration {
1469
- type Interval = 'day' | 'month' | 'week' | 'year';
1470
- }
1471
-
1472
- type Type = 'duration' | 'timestamp';
1473
- }
1474
- }
1475
-
1476
- interface PriceData {
1477
- /**
1478
- * 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).
1479
- */
1480
- currency: string;
1167
+ interface PriceData {
1168
+ /**
1169
+ * 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).
1170
+ */
1171
+ currency: string;
1481
1172
 
1482
1173
  /**
1483
1174
  * The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
@@ -1524,33 +1215,6 @@ declare module 'stripe' {
1524
1215
 
1525
1216
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
1526
1217
  }
1527
-
1528
- interface Trial {
1529
- /**
1530
- * 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.
1531
- */
1532
- converts_to?: Array<string>;
1533
-
1534
- /**
1535
- * Determines the type of trial for this item.
1536
- */
1537
- type: Trial.Type;
1538
- }
1539
-
1540
- namespace Trial {
1541
- type Type = 'free' | 'paid';
1542
- }
1543
- }
1544
-
1545
- interface PauseCollection {
1546
- /**
1547
- * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1548
- */
1549
- behavior: PauseCollection.Behavior;
1550
- }
1551
-
1552
- namespace PauseCollection {
1553
- type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
1554
1218
  }
1555
1219
 
1556
1220
  type ProrationBehavior =
@@ -1569,44 +1233,6 @@ declare module 'stripe' {
1569
1233
  */
1570
1234
  destination: string;
1571
1235
  }
1572
-
1573
- type TrialContinuation = 'continue' | 'none';
1574
-
1575
- interface TrialSettings {
1576
- /**
1577
- * Defines how the subscription should behave when a trial ends.
1578
- */
1579
- end_behavior?: TrialSettings.EndBehavior;
1580
- }
1581
-
1582
- namespace TrialSettings {
1583
- interface EndBehavior {
1584
- /**
1585
- * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1586
- */
1587
- prorate_up_front?: EndBehavior.ProrateUpFront;
1588
- }
1589
-
1590
- namespace EndBehavior {
1591
- type ProrateUpFront = 'defer' | 'include';
1592
- }
1593
- }
1594
- }
1595
-
1596
- interface Prebilling {
1597
- /**
1598
- * This is used to determine the number of billing cycles to prebill.
1599
- */
1600
- iterations: number;
1601
-
1602
- /**
1603
- * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1604
- */
1605
- update_behavior?: Prebilling.UpdateBehavior;
1606
- }
1607
-
1608
- namespace Prebilling {
1609
- type UpdateBehavior = 'prebill' | 'reset';
1610
1236
  }
1611
1237
 
1612
1238
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
@@ -1633,11 +1259,6 @@ declare module 'stripe' {
1633
1259
  */
1634
1260
  customer?: string;
1635
1261
 
1636
- /**
1637
- * Only return subscription schedules for the given account.
1638
- */
1639
- customer_account?: string;
1640
-
1641
1262
  /**
1642
1263
  * Specifies which fields in the response should be expanded.
1643
1264
  */
@@ -1654,753 +1275,6 @@ declare module 'stripe' {
1654
1275
  scheduled?: boolean;
1655
1276
  }
1656
1277
 
1657
- interface SubscriptionScheduleAmendParams {
1658
- /**
1659
- * Changes to apply to the phases of the subscription schedule, in the order provided.
1660
- */
1661
- amendments?: Array<SubscriptionScheduleAmendParams.Amendment>;
1662
-
1663
- /**
1664
- * Specifies which fields in the response should be expanded.
1665
- */
1666
- expand?: Array<string>;
1667
-
1668
- /**
1669
- * Provide any time periods to bill in advance.
1670
- */
1671
- prebilling?: Stripe.Emptyable<
1672
- Array<SubscriptionScheduleAmendParams.Prebilling>
1673
- >;
1674
-
1675
- /**
1676
- * In cases where the amendment changes the currently active phase,
1677
- * specifies if and how to prorate at the time of the request.
1678
- */
1679
- proration_behavior?: SubscriptionScheduleAmendParams.ProrationBehavior;
1680
-
1681
- /**
1682
- * Changes to apply to the subscription schedule.
1683
- */
1684
- schedule_settings?: SubscriptionScheduleAmendParams.ScheduleSettings;
1685
- }
1686
-
1687
- namespace SubscriptionScheduleAmendParams {
1688
- interface Amendment {
1689
- /**
1690
- * Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.
1691
- */
1692
- amendment_end?: Amendment.AmendmentEnd;
1693
-
1694
- /**
1695
- * Details to identify the earliest timestamp where the proposed change should take effect.
1696
- */
1697
- amendment_start: Amendment.AmendmentStart;
1698
-
1699
- /**
1700
- * For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment.
1701
- */
1702
- billing_cycle_anchor?: Amendment.BillingCycleAnchor;
1703
-
1704
- /**
1705
- * Changes to the coupons being redeemed or discounts being applied during the amendment time span.
1706
- */
1707
- discount_actions?: Array<Amendment.DiscountAction>;
1708
-
1709
- /**
1710
- * Changes to the subscription items during the amendment time span.
1711
- */
1712
- item_actions?: Array<Amendment.ItemAction>;
1713
-
1714
- /**
1715
- * Instructions for how to modify phase metadata
1716
- */
1717
- metadata_actions?: Array<Amendment.MetadataAction>;
1718
-
1719
- /**
1720
- * Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.
1721
- */
1722
- proration_behavior?: Amendment.ProrationBehavior;
1723
-
1724
- /**
1725
- * Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
1726
- */
1727
- set_pause_collection?: Amendment.SetPauseCollection;
1728
-
1729
- /**
1730
- * Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
1731
- */
1732
- set_schedule_end?: Amendment.SetScheduleEnd;
1733
-
1734
- /**
1735
- * Settings related to subscription trials.
1736
- */
1737
- trial_settings?: Amendment.TrialSettings;
1738
- }
1739
-
1740
- namespace Amendment {
1741
- interface AmendmentEnd {
1742
- /**
1743
- * Use the `end` time of a given discount.
1744
- */
1745
- discount_end?: AmendmentEnd.DiscountEnd;
1746
-
1747
- /**
1748
- * Time span for the amendment starting from the `amendment_start`.
1749
- */
1750
- duration?: AmendmentEnd.Duration;
1751
-
1752
- /**
1753
- * A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
1754
- */
1755
- timestamp?: number;
1756
-
1757
- /**
1758
- * Select one of three ways to pass the `amendment_end`.
1759
- */
1760
- type: AmendmentEnd.Type;
1761
- }
1762
-
1763
- namespace AmendmentEnd {
1764
- interface DiscountEnd {
1765
- /**
1766
- * The ID of a specific discount.
1767
- */
1768
- discount: string;
1769
- }
1770
-
1771
- interface Duration {
1772
- /**
1773
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1774
- */
1775
- interval: Duration.Interval;
1776
-
1777
- /**
1778
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1779
- */
1780
- interval_count: number;
1781
- }
1782
-
1783
- namespace Duration {
1784
- type Interval = 'day' | 'month' | 'week' | 'year';
1785
- }
1786
-
1787
- type Type =
1788
- | 'discount_end'
1789
- | 'duration'
1790
- | 'schedule_end'
1791
- | 'timestamp'
1792
- | 'trial_end'
1793
- | 'trial_start'
1794
- | 'upcoming_invoice';
1795
- }
1796
-
1797
- interface AmendmentStart {
1798
- /**
1799
- * Details of another amendment in the same array, immediately after which this amendment should begin.
1800
- */
1801
- amendment_end?: AmendmentStart.AmendmentEnd;
1802
-
1803
- /**
1804
- * Use the `end` time of a given discount.
1805
- */
1806
- discount_end?: AmendmentStart.DiscountEnd;
1807
-
1808
- /**
1809
- * A precise Unix timestamp for the amendment to start.
1810
- */
1811
- timestamp?: number;
1812
-
1813
- /**
1814
- * Select one of three ways to pass the `amendment_start`.
1815
- */
1816
- type: AmendmentStart.Type;
1817
- }
1818
-
1819
- namespace AmendmentStart {
1820
- interface AmendmentEnd {
1821
- /**
1822
- * The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.
1823
- */
1824
- index: number;
1825
- }
1826
-
1827
- interface DiscountEnd {
1828
- /**
1829
- * The ID of a specific discount.
1830
- */
1831
- discount: string;
1832
- }
1833
-
1834
- type Type =
1835
- | 'amendment_end'
1836
- | 'discount_end'
1837
- | 'now'
1838
- | 'schedule_end'
1839
- | 'timestamp'
1840
- | 'trial_end'
1841
- | 'trial_start'
1842
- | 'upcoming_invoice';
1843
- }
1844
-
1845
- type BillingCycleAnchor = 'amendment_start' | 'automatic';
1846
-
1847
- interface DiscountAction {
1848
- /**
1849
- * Details of the discount to add.
1850
- */
1851
- add?: DiscountAction.Add;
1852
-
1853
- /**
1854
- * Details of the discount to remove.
1855
- */
1856
- remove?: DiscountAction.Remove;
1857
-
1858
- /**
1859
- * Details of the discount to replace the existing discounts with.
1860
- */
1861
- set?: DiscountAction.Set;
1862
-
1863
- /**
1864
- * Determines the type of discount action.
1865
- */
1866
- type: DiscountAction.Type;
1867
- }
1868
-
1869
- namespace DiscountAction {
1870
- interface Add {
1871
- /**
1872
- * The coupon code to redeem.
1873
- */
1874
- coupon?: string;
1875
-
1876
- /**
1877
- * An ID of an existing discount for a coupon that was already redeemed.
1878
- */
1879
- discount?: string;
1880
-
1881
- /**
1882
- * Details to determine how long the discount should be applied for.
1883
- */
1884
- discount_end?: Add.DiscountEnd;
1885
-
1886
- /**
1887
- * 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.
1888
- */
1889
- index?: number;
1890
-
1891
- /**
1892
- * The promotion code to redeem.
1893
- */
1894
- promotion_code?: string;
1895
- }
1896
-
1897
- namespace Add {
1898
- interface DiscountEnd {
1899
- /**
1900
- * The type of calculation made to determine when the discount ends.
1901
- */
1902
- type: 'amendment_end';
1903
- }
1904
- }
1905
-
1906
- interface Remove {
1907
- /**
1908
- * The coupon code to remove from the `discounts` array.
1909
- */
1910
- coupon?: string;
1911
-
1912
- /**
1913
- * The ID of a discount to remove from the `discounts` array.
1914
- */
1915
- discount?: string;
1916
-
1917
- /**
1918
- * The ID of a promotion code to remove from the `discounts` array.
1919
- */
1920
- promotion_code?: string;
1921
- }
1922
-
1923
- interface Set {
1924
- /**
1925
- * The coupon code to replace the `discounts` array with.
1926
- */
1927
- coupon?: string;
1928
-
1929
- /**
1930
- * An ID of an existing discount to replace the `discounts` array with.
1931
- */
1932
- discount?: string;
1933
-
1934
- /**
1935
- * An ID of an existing promotion code to replace the `discounts` array with.
1936
- */
1937
- promotion_code?: string;
1938
- }
1939
-
1940
- type Type = 'add' | 'remove' | 'set';
1941
- }
1942
-
1943
- interface ItemAction {
1944
- /**
1945
- * Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.
1946
- */
1947
- add?: ItemAction.Add;
1948
-
1949
- /**
1950
- * Details of the subscription item to remove.
1951
- */
1952
- remove?: ItemAction.Remove;
1953
-
1954
- /**
1955
- * Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.
1956
- */
1957
- set?: ItemAction.Set;
1958
-
1959
- /**
1960
- * Determines the type of item action.
1961
- */
1962
- type: ItemAction.Type;
1963
- }
1964
-
1965
- namespace ItemAction {
1966
- interface Add {
1967
- /**
1968
- * The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
1969
- */
1970
- discounts?: Array<Add.Discount>;
1971
-
1972
- /**
1973
- * 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`.
1974
- */
1975
- metadata?: Stripe.MetadataParam;
1976
-
1977
- /**
1978
- * The ID of the price object.
1979
- */
1980
- price: string;
1981
-
1982
- /**
1983
- * Quantity for this item.
1984
- */
1985
- quantity?: number;
1986
-
1987
- /**
1988
- * 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`.
1989
- */
1990
- tax_rates?: Array<string>;
1991
-
1992
- /**
1993
- * Options that configure the trial on the subscription item.
1994
- */
1995
- trial?: Add.Trial;
1996
- }
1997
-
1998
- namespace Add {
1999
- interface Discount {
2000
- /**
2001
- * ID of the coupon to create a new discount for.
2002
- */
2003
- coupon?: string;
2004
-
2005
- /**
2006
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
2007
- */
2008
- discount?: string;
2009
-
2010
- /**
2011
- * Details to determine how long the discount should be applied for.
2012
- */
2013
- discount_end?: Discount.DiscountEnd;
2014
-
2015
- /**
2016
- * ID of the promotion code to create a new discount for.
2017
- */
2018
- promotion_code?: string;
2019
- }
2020
-
2021
- namespace Discount {
2022
- interface DiscountEnd {
2023
- /**
2024
- * Time span for the redeemed discount.
2025
- */
2026
- duration?: DiscountEnd.Duration;
2027
-
2028
- /**
2029
- * A precise Unix timestamp for the discount to end. Must be in the future.
2030
- */
2031
- timestamp?: number;
2032
-
2033
- /**
2034
- * The type of calculation made to determine when the discount ends.
2035
- */
2036
- type: DiscountEnd.Type;
2037
- }
2038
-
2039
- namespace DiscountEnd {
2040
- interface Duration {
2041
- /**
2042
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2043
- */
2044
- interval: Duration.Interval;
2045
-
2046
- /**
2047
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2048
- */
2049
- interval_count: number;
2050
- }
2051
-
2052
- namespace Duration {
2053
- type Interval = 'day' | 'month' | 'week' | 'year';
2054
- }
2055
-
2056
- type Type = 'duration' | 'timestamp';
2057
- }
2058
- }
2059
-
2060
- interface Trial {
2061
- /**
2062
- * 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.
2063
- */
2064
- converts_to?: Array<string>;
2065
-
2066
- /**
2067
- * Determines the type of trial for this item.
2068
- */
2069
- type: Trial.Type;
2070
- }
2071
-
2072
- namespace Trial {
2073
- type Type = 'free' | 'paid';
2074
- }
2075
- }
2076
-
2077
- interface Remove {
2078
- /**
2079
- * ID of a price to remove.
2080
- */
2081
- price: string;
2082
- }
2083
-
2084
- interface Set {
2085
- /**
2086
- * 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`.
2087
- */
2088
- discounts?: Array<Set.Discount>;
2089
-
2090
- /**
2091
- * 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`.
2092
- */
2093
- metadata?: Stripe.MetadataParam;
2094
-
2095
- /**
2096
- * The ID of the price object.
2097
- */
2098
- price: string;
2099
-
2100
- /**
2101
- * 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`.
2102
- */
2103
- quantity?: number;
2104
-
2105
- /**
2106
- * 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`.
2107
- */
2108
- tax_rates?: Array<string>;
2109
-
2110
- /**
2111
- * 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`.
2112
- */
2113
- trial?: Set.Trial;
2114
- }
2115
-
2116
- namespace Set {
2117
- interface Discount {
2118
- /**
2119
- * ID of the coupon to create a new discount for.
2120
- */
2121
- coupon?: string;
2122
-
2123
- /**
2124
- * ID of an existing discount on the object (or one of its ancestors) to reuse.
2125
- */
2126
- discount?: string;
2127
-
2128
- /**
2129
- * Details to determine how long the discount should be applied for.
2130
- */
2131
- discount_end?: Discount.DiscountEnd;
2132
-
2133
- /**
2134
- * ID of the promotion code to create a new discount for.
2135
- */
2136
- promotion_code?: string;
2137
- }
2138
-
2139
- namespace Discount {
2140
- interface DiscountEnd {
2141
- /**
2142
- * Time span for the redeemed discount.
2143
- */
2144
- duration?: DiscountEnd.Duration;
2145
-
2146
- /**
2147
- * A precise Unix timestamp for the discount to end. Must be in the future.
2148
- */
2149
- timestamp?: number;
2150
-
2151
- /**
2152
- * The type of calculation made to determine when the discount ends.
2153
- */
2154
- type: DiscountEnd.Type;
2155
- }
2156
-
2157
- namespace DiscountEnd {
2158
- interface Duration {
2159
- /**
2160
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2161
- */
2162
- interval: Duration.Interval;
2163
-
2164
- /**
2165
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2166
- */
2167
- interval_count: number;
2168
- }
2169
-
2170
- namespace Duration {
2171
- type Interval = 'day' | 'month' | 'week' | 'year';
2172
- }
2173
-
2174
- type Type = 'duration' | 'timestamp';
2175
- }
2176
- }
2177
-
2178
- interface Trial {
2179
- /**
2180
- * 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.
2181
- */
2182
- converts_to?: Array<string>;
2183
-
2184
- /**
2185
- * Determines the type of trial for this item.
2186
- */
2187
- type: Trial.Type;
2188
- }
2189
-
2190
- namespace Trial {
2191
- type Type = 'free' | 'paid';
2192
- }
2193
- }
2194
-
2195
- type Type = 'add' | 'remove' | 'set';
2196
- }
2197
-
2198
- interface MetadataAction {
2199
- /**
2200
- * Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
2201
- */
2202
- add?: {
2203
- [key: string]: string;
2204
- };
2205
-
2206
- /**
2207
- * Keys to remove from schedule phase metadata.
2208
- */
2209
- remove?: Array<string>;
2210
-
2211
- /**
2212
- * Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
2213
- */
2214
- set?: Stripe.Emptyable<{
2215
- [key: string]: string;
2216
- }>;
2217
-
2218
- /**
2219
- * Select one of three ways to update phase-level `metadata` on subscription schedules.
2220
- */
2221
- type: MetadataAction.Type;
2222
- }
2223
-
2224
- namespace MetadataAction {
2225
- type Type = 'add' | 'remove' | 'set';
2226
- }
2227
-
2228
- type ProrationBehavior =
2229
- | 'always_invoice'
2230
- | 'create_prorations'
2231
- | 'none';
2232
-
2233
- interface SetPauseCollection {
2234
- /**
2235
- * Details of the pause_collection behavior to apply to the amendment.
2236
- */
2237
- set?: SetPauseCollection.Set;
2238
-
2239
- /**
2240
- * Determines the type of the pause_collection amendment.
2241
- */
2242
- type: SetPauseCollection.Type;
2243
- }
2244
-
2245
- namespace SetPauseCollection {
2246
- interface Set {
2247
- /**
2248
- * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2249
- */
2250
- behavior: Set.Behavior;
2251
- }
2252
-
2253
- namespace Set {
2254
- type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
2255
- }
2256
-
2257
- type Type = 'remove' | 'set';
2258
- }
2259
-
2260
- type SetScheduleEnd = 'amendment_end' | 'amendment_start';
2261
-
2262
- interface TrialSettings {
2263
- /**
2264
- * Defines how the subscription should behave when a trial ends.
2265
- */
2266
- end_behavior?: TrialSettings.EndBehavior;
2267
- }
2268
-
2269
- namespace TrialSettings {
2270
- interface EndBehavior {
2271
- /**
2272
- * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2273
- */
2274
- prorate_up_front?: EndBehavior.ProrateUpFront;
2275
- }
2276
-
2277
- namespace EndBehavior {
2278
- type ProrateUpFront = 'defer' | 'include';
2279
- }
2280
- }
2281
- }
2282
-
2283
- interface Prebilling {
2284
- /**
2285
- * The beginning of the prebilled time period. The default value is `now`.
2286
- */
2287
- bill_from?: Prebilling.BillFrom;
2288
-
2289
- /**
2290
- * The end of the prebilled time period.
2291
- */
2292
- bill_until?: Prebilling.BillUntil;
2293
-
2294
- /**
2295
- * When the prebilling invoice should be created. The default value is `now`.
2296
- */
2297
- invoice_at?: 'now';
2298
-
2299
- /**
2300
- * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2301
- */
2302
- update_behavior?: Prebilling.UpdateBehavior;
2303
- }
2304
-
2305
- namespace Prebilling {
2306
- interface BillFrom {
2307
- /**
2308
- * Start the prebilled period when a specified amendment begins.
2309
- */
2310
- amendment_start?: BillFrom.AmendmentStart;
2311
-
2312
- /**
2313
- * Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2314
- */
2315
- timestamp?: number;
2316
-
2317
- /**
2318
- * Select one of several ways to pass the `bill_from` value.
2319
- */
2320
- type: BillFrom.Type;
2321
- }
2322
-
2323
- namespace BillFrom {
2324
- interface AmendmentStart {
2325
- /**
2326
- * The position of the amendment in the `amendments` array with which prebilling should begin. Indexes start from 0 and must be less than the total number of supplied amendments.
2327
- */
2328
- index: number;
2329
- }
2330
-
2331
- type Type = 'amendment_start' | 'now' | 'timestamp';
2332
- }
2333
-
2334
- interface BillUntil {
2335
- /**
2336
- * End the prebilled period when a specified amendment ends.
2337
- */
2338
- amendment_end?: BillUntil.AmendmentEnd;
2339
-
2340
- /**
2341
- * Time span for prebilling, starting from `bill_from`.
2342
- */
2343
- duration?: BillUntil.Duration;
2344
-
2345
- /**
2346
- * End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2347
- */
2348
- timestamp?: number;
2349
-
2350
- /**
2351
- * Select one of several ways to pass the `bill_until` value.
2352
- */
2353
- type: BillUntil.Type;
2354
- }
2355
-
2356
- namespace BillUntil {
2357
- interface AmendmentEnd {
2358
- /**
2359
- * The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments.
2360
- */
2361
- index: number;
2362
- }
2363
-
2364
- interface Duration {
2365
- /**
2366
- * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2367
- */
2368
- interval: Duration.Interval;
2369
-
2370
- /**
2371
- * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2372
- */
2373
- interval_count: number;
2374
- }
2375
-
2376
- namespace Duration {
2377
- type Interval = 'day' | 'month' | 'week' | 'year';
2378
- }
2379
-
2380
- type Type =
2381
- | 'amendment_end'
2382
- | 'duration'
2383
- | 'schedule_end'
2384
- | 'timestamp';
2385
- }
2386
-
2387
- type UpdateBehavior = 'prebill' | 'reset';
2388
- }
2389
-
2390
- type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
2391
-
2392
- interface ScheduleSettings {
2393
- /**
2394
- * Behavior of the subscription schedule and underlying subscription when it ends.
2395
- */
2396
- end_behavior?: ScheduleSettings.EndBehavior;
2397
- }
2398
-
2399
- namespace ScheduleSettings {
2400
- type EndBehavior = 'cancel' | 'release';
2401
- }
2402
- }
2403
-
2404
1278
  interface SubscriptionScheduleCancelParams {
2405
1279
  /**
2406
1280
  * Specifies which fields in the response should be expanded.
@@ -2475,19 +1349,6 @@ declare module 'stripe' {
2475
1349
  options?: RequestOptions
2476
1350
  ): ApiListPromise<Stripe.SubscriptionSchedule>;
2477
1351
 
2478
- /**
2479
- * Amends an existing subscription schedule.
2480
- */
2481
- amend(
2482
- id: string,
2483
- params?: SubscriptionScheduleAmendParams,
2484
- options?: RequestOptions
2485
- ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2486
- amend(
2487
- id: string,
2488
- options?: RequestOptions
2489
- ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2490
-
2491
1352
  /**
2492
1353
  * Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
2493
1354
  */