stripe 20.0.0 → 20.1.0-alpha.2

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 (454) hide show
  1. package/CHANGELOG.md +1902 -12
  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/apiVersion.js +2 -3
  7. package/cjs/resources/AccountNotices.js +21 -0
  8. package/cjs/resources/BalanceTransfers.js +9 -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/DelegatedCheckout/RequestedSessions.js +28 -0
  14. package/cjs/resources/ExternalAccounts.js +23 -0
  15. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  16. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  17. package/cjs/resources/FxQuotes.js +15 -0
  18. package/cjs/resources/Identity/BlocklistEntries.js +25 -0
  19. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  20. package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
  21. package/cjs/resources/Issuing/FraudLiabilityDebits.js +17 -0
  22. package/cjs/resources/Issuing/Programs.js +22 -0
  23. package/cjs/resources/Mandates.js +5 -0
  24. package/cjs/resources/Margins.js +22 -0
  25. package/cjs/resources/Orders.js +24 -0
  26. package/cjs/resources/PaymentIntents.js +8 -0
  27. package/cjs/resources/PaymentMethods.js +4 -0
  28. package/cjs/resources/Privacy/RedactionJobs.js +42 -0
  29. package/cjs/resources/Quotes.js +32 -0
  30. package/cjs/resources/Radar/AccountEvaluations.js +20 -0
  31. package/cjs/resources/SubscriptionSchedules.js +4 -0
  32. package/cjs/resources/Subscriptions.js +4 -0
  33. package/cjs/resources/Tax/Forms.js +20 -0
  34. package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
  35. package/cjs/resources/TestHelpers/Capital/FinancingOffers.js +16 -0
  36. package/cjs/resources/V2/Billing/BillSettings/Versions.js +17 -0
  37. package/cjs/resources/V2/Billing/BillSettings.js +27 -0
  38. package/cjs/resources/V2/Billing/Cadences.js +23 -0
  39. package/cjs/resources/V2/Billing/CollectionSettings/Versions.js +17 -0
  40. package/cjs/resources/V2/Billing/CollectionSettings.js +30 -0
  41. package/cjs/resources/V2/Billing/CustomPricingUnits.js +25 -0
  42. package/cjs/resources/V2/Billing/Intents/Actions.js +17 -0
  43. package/cjs/resources/V2/Billing/Intents.js +36 -0
  44. package/cjs/resources/V2/Billing/LicenseFeeSubscriptions.js +12 -0
  45. package/cjs/resources/V2/Billing/LicenseFees/Versions.js +17 -0
  46. package/cjs/resources/V2/Billing/LicenseFees.js +27 -0
  47. package/cjs/resources/V2/Billing/LicensedItems.js +25 -0
  48. package/cjs/resources/V2/Billing/MeteredItems.js +22 -0
  49. package/cjs/resources/V2/Billing/PricingPlanSubscriptions/Components.js +12 -0
  50. package/cjs/resources/V2/Billing/PricingPlanSubscriptions.js +26 -0
  51. package/cjs/resources/V2/Billing/PricingPlans/Components.js +29 -0
  52. package/cjs/resources/V2/Billing/PricingPlans/Versions.js +17 -0
  53. package/cjs/resources/V2/Billing/PricingPlans.js +29 -0
  54. package/cjs/resources/V2/Billing/Profiles.js +19 -0
  55. package/cjs/resources/V2/Billing/RateCardSubscriptions.js +29 -0
  56. package/cjs/resources/V2/Billing/RateCards/Rates.js +25 -0
  57. package/cjs/resources/V2/Billing/RateCards/Versions.js +17 -0
  58. package/cjs/resources/V2/Billing/RateCards.js +29 -0
  59. package/cjs/resources/V2/Billing/ServiceActions.js +20 -0
  60. package/cjs/resources/V2/Core/AccountLinks.js +9 -0
  61. package/cjs/resources/V2/Core/AccountTokens.js +13 -0
  62. package/cjs/resources/V2/Core/Accounts/PersonTokens.js +16 -0
  63. package/cjs/resources/V2/Core/Accounts/Persons.js +29 -0
  64. package/cjs/resources/V2/Core/Accounts.js +27 -0
  65. package/cjs/resources/V2/Core/ClaimableSandboxes.js +16 -0
  66. package/cjs/resources/V2/Core/Vault/GbBankAccounts.js +33 -0
  67. package/cjs/resources/V2/Core/Vault/UsBankAccounts.js +37 -0
  68. package/cjs/resources/V2/MoneyManagement/Adjustments.js +17 -0
  69. package/cjs/resources/V2/MoneyManagement/CurrencyConversions.js +21 -0
  70. package/cjs/resources/V2/MoneyManagement/FinancialAccounts.js +29 -0
  71. package/cjs/resources/V2/MoneyManagement/FinancialAddresses.js +21 -0
  72. package/cjs/resources/V2/MoneyManagement/InboundTransfers.js +21 -0
  73. package/cjs/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +16 -0
  74. package/cjs/resources/V2/MoneyManagement/OutboundPayments.js +25 -0
  75. package/cjs/resources/V2/MoneyManagement/OutboundSetupIntents.js +29 -0
  76. package/cjs/resources/V2/MoneyManagement/OutboundTransfers.js +25 -0
  77. package/cjs/resources/V2/MoneyManagement/PayoutMethods.js +25 -0
  78. package/cjs/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +12 -0
  79. package/cjs/resources/V2/MoneyManagement/ReceivedCredits.js +17 -0
  80. package/cjs/resources/V2/MoneyManagement/ReceivedDebits.js +17 -0
  81. package/cjs/resources/V2/MoneyManagement/RecipientVerifications.js +20 -0
  82. package/cjs/resources/V2/MoneyManagement/TransactionEntries.js +17 -0
  83. package/cjs/resources/V2/MoneyManagement/Transactions.js +17 -0
  84. package/cjs/resources/V2/Payments/OffSessionPayments.js +29 -0
  85. package/cjs/resources/V2/Reporting/ReportRuns.js +13 -0
  86. package/cjs/resources/V2/Reporting/Reports.js +12 -0
  87. package/cjs/resources/V2/TestHelpers/FinancialAddresses.js +16 -0
  88. package/cjs/resources/V2/TestHelpers/MoneyManagement.js +12 -0
  89. package/cjs/resources.js +156 -8
  90. package/cjs/stripe.core.js +1 -1
  91. package/esm/Error.js +100 -0
  92. package/esm/apiVersion.js +1 -2
  93. package/esm/resources/AccountNotices.js +18 -0
  94. package/esm/resources/BalanceTransfers.js +6 -0
  95. package/esm/resources/Billing/Analytics/MeterUsage.js +9 -0
  96. package/esm/resources/Capital/FinancingOffers.js +18 -0
  97. package/esm/resources/Capital/FinancingSummary.js +9 -0
  98. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  99. package/esm/resources/DelegatedCheckout/RequestedSessions.js +25 -0
  100. package/esm/resources/ExternalAccounts.js +20 -0
  101. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  102. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  103. package/esm/resources/FxQuotes.js +12 -0
  104. package/esm/resources/Identity/BlocklistEntries.js +22 -0
  105. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  106. package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
  107. package/esm/resources/Issuing/FraudLiabilityDebits.js +14 -0
  108. package/esm/resources/Issuing/Programs.js +19 -0
  109. package/esm/resources/Mandates.js +5 -0
  110. package/esm/resources/Margins.js +19 -0
  111. package/esm/resources/Orders.js +21 -0
  112. package/esm/resources/PaymentIntents.js +8 -0
  113. package/esm/resources/PaymentMethods.js +4 -0
  114. package/esm/resources/Privacy/RedactionJobs.js +39 -0
  115. package/esm/resources/Quotes.js +32 -0
  116. package/esm/resources/Radar/AccountEvaluations.js +17 -0
  117. package/esm/resources/SubscriptionSchedules.js +4 -0
  118. package/esm/resources/Subscriptions.js +4 -0
  119. package/esm/resources/Tax/Forms.js +17 -0
  120. package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
  121. package/esm/resources/TestHelpers/Capital/FinancingOffers.js +13 -0
  122. package/esm/resources/V2/Billing/BillSettings/Versions.js +14 -0
  123. package/esm/resources/V2/Billing/BillSettings.js +24 -0
  124. package/esm/resources/V2/Billing/Cadences.js +20 -0
  125. package/esm/resources/V2/Billing/CollectionSettings/Versions.js +14 -0
  126. package/esm/resources/V2/Billing/CollectionSettings.js +27 -0
  127. package/esm/resources/V2/Billing/CustomPricingUnits.js +22 -0
  128. package/esm/resources/V2/Billing/Intents/Actions.js +14 -0
  129. package/esm/resources/V2/Billing/Intents.js +33 -0
  130. package/esm/resources/V2/Billing/LicenseFeeSubscriptions.js +9 -0
  131. package/esm/resources/V2/Billing/LicenseFees/Versions.js +14 -0
  132. package/esm/resources/V2/Billing/LicenseFees.js +24 -0
  133. package/esm/resources/V2/Billing/LicensedItems.js +22 -0
  134. package/esm/resources/V2/Billing/MeteredItems.js +19 -0
  135. package/esm/resources/V2/Billing/PricingPlanSubscriptions/Components.js +9 -0
  136. package/esm/resources/V2/Billing/PricingPlanSubscriptions.js +23 -0
  137. package/esm/resources/V2/Billing/PricingPlans/Components.js +26 -0
  138. package/esm/resources/V2/Billing/PricingPlans/Versions.js +14 -0
  139. package/esm/resources/V2/Billing/PricingPlans.js +26 -0
  140. package/esm/resources/V2/Billing/Profiles.js +16 -0
  141. package/esm/resources/V2/Billing/RateCardSubscriptions.js +26 -0
  142. package/esm/resources/V2/Billing/RateCards/Rates.js +22 -0
  143. package/esm/resources/V2/Billing/RateCards/Versions.js +14 -0
  144. package/esm/resources/V2/Billing/RateCards.js +26 -0
  145. package/esm/resources/V2/Billing/ServiceActions.js +17 -0
  146. package/esm/resources/V2/Core/AccountLinks.js +6 -0
  147. package/esm/resources/V2/Core/AccountTokens.js +10 -0
  148. package/esm/resources/V2/Core/Accounts/PersonTokens.js +13 -0
  149. package/esm/resources/V2/Core/Accounts/Persons.js +26 -0
  150. package/esm/resources/V2/Core/Accounts.js +24 -0
  151. package/esm/resources/V2/Core/ClaimableSandboxes.js +13 -0
  152. package/esm/resources/V2/Core/Vault/GbBankAccounts.js +30 -0
  153. package/esm/resources/V2/Core/Vault/UsBankAccounts.js +34 -0
  154. package/esm/resources/V2/MoneyManagement/Adjustments.js +14 -0
  155. package/esm/resources/V2/MoneyManagement/CurrencyConversions.js +18 -0
  156. package/esm/resources/V2/MoneyManagement/FinancialAccounts.js +26 -0
  157. package/esm/resources/V2/MoneyManagement/FinancialAddresses.js +18 -0
  158. package/esm/resources/V2/MoneyManagement/InboundTransfers.js +18 -0
  159. package/esm/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +13 -0
  160. package/esm/resources/V2/MoneyManagement/OutboundPayments.js +22 -0
  161. package/esm/resources/V2/MoneyManagement/OutboundSetupIntents.js +26 -0
  162. package/esm/resources/V2/MoneyManagement/OutboundTransfers.js +22 -0
  163. package/esm/resources/V2/MoneyManagement/PayoutMethods.js +22 -0
  164. package/esm/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +9 -0
  165. package/esm/resources/V2/MoneyManagement/ReceivedCredits.js +14 -0
  166. package/esm/resources/V2/MoneyManagement/ReceivedDebits.js +14 -0
  167. package/esm/resources/V2/MoneyManagement/RecipientVerifications.js +17 -0
  168. package/esm/resources/V2/MoneyManagement/TransactionEntries.js +14 -0
  169. package/esm/resources/V2/MoneyManagement/Transactions.js +14 -0
  170. package/esm/resources/V2/Payments/OffSessionPayments.js +26 -0
  171. package/esm/resources/V2/Reporting/ReportRuns.js +10 -0
  172. package/esm/resources/V2/Reporting/Reports.js +9 -0
  173. package/esm/resources/V2/TestHelpers/FinancialAddresses.js +13 -0
  174. package/esm/resources/V2/TestHelpers/MoneyManagement.js +9 -0
  175. package/esm/resources.js +142 -0
  176. package/esm/stripe.core.js +1 -1
  177. package/package.json +1 -1
  178. package/types/AccountLinksResource.d.ts +5 -1
  179. package/types/AccountNotices.d.ts +113 -0
  180. package/types/AccountNoticesResource.d.ts +98 -0
  181. package/types/AccountSessions.d.ts +45 -0
  182. package/types/AccountSessionsResource.d.ts +264 -0
  183. package/types/Accounts.d.ts +232 -1
  184. package/types/AccountsResource.d.ts +674 -0
  185. package/types/ApplicationFees.d.ts +6 -1
  186. package/types/Balance.d.ts +82 -0
  187. package/types/BalanceTransactions.d.ts +2 -1
  188. package/types/BalanceTransfers.d.ts +122 -0
  189. package/types/BalanceTransfersResource.d.ts +87 -0
  190. package/types/BankAccounts.d.ts +2 -0
  191. package/types/Billing/AlertTriggereds.d.ts +16 -1
  192. package/types/Billing/Alerts.d.ts +116 -1
  193. package/types/Billing/AlertsResource.d.ts +149 -2
  194. package/types/Billing/Analytics/MeterUsage.d.ts +31 -0
  195. package/types/Billing/Analytics/MeterUsageResource.d.ts +694 -0
  196. package/types/Billing/Analytics/MeterUsageRows.d.ts +58 -0
  197. package/types/Billing/CreditBalanceSummary.d.ts +123 -2
  198. package/types/Billing/CreditBalanceSummaryResource.d.ts +20 -3
  199. package/types/Billing/CreditBalanceTransactions.d.ts +118 -2
  200. package/types/Billing/CreditBalanceTransactionsResource.d.ts +12 -4
  201. package/types/Billing/CreditGrants.d.ts +76 -1
  202. package/types/Billing/CreditGrantsResource.d.ts +45 -4
  203. package/types/Billing/MeterEventSummaries.d.ts +7 -0
  204. package/types/Billing/Meters.d.ts +5 -0
  205. package/types/Billing/MetersResource.d.ts +17 -0
  206. package/types/BillingPortal/Sessions.d.ts +5 -0
  207. package/types/BillingPortal/SessionsResource.d.ts +12 -4
  208. package/types/Capabilities.d.ts +2 -0
  209. package/types/Capital/FinancingOffers.d.ts +188 -0
  210. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  211. package/types/Capital/FinancingSummary.d.ts +106 -0
  212. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  213. package/types/Capital/FinancingTransactions.d.ts +135 -0
  214. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  215. package/types/Cards.d.ts +19 -0
  216. package/types/CashBalances.d.ts +5 -0
  217. package/types/Charges.d.ts +190 -0
  218. package/types/ChargesResource.d.ts +3855 -75
  219. package/types/Checkout/Sessions.d.ts +427 -2
  220. package/types/Checkout/SessionsResource.d.ts +682 -2
  221. package/types/ConfirmationTokens.d.ts +139 -0
  222. package/types/Coupons.d.ts +35 -0
  223. package/types/CouponsResource.d.ts +23 -0
  224. package/types/CreditNoteLineItems.d.ts +17 -0
  225. package/types/CreditNotes.d.ts +5 -0
  226. package/types/CreditNotesResource.d.ts +5 -0
  227. package/types/CustomerBalanceTransactions.d.ts +2 -0
  228. package/types/CustomerCashBalanceTransactions.d.ts +2 -0
  229. package/types/CustomerSessions.d.ts +46 -0
  230. package/types/CustomerSessionsResource.d.ts +47 -1
  231. package/types/Customers.d.ts +2 -0
  232. package/types/CustomersResource.d.ts +8 -0
  233. package/types/DelegatedCheckout/RequestedSessions.d.ts +419 -0
  234. package/types/DelegatedCheckout/RequestedSessionsResource.d.ts +599 -0
  235. package/types/Discounts.d.ts +20 -0
  236. package/types/Disputes.d.ts +40 -0
  237. package/types/DisputesResource.d.ts +11 -0
  238. package/types/Errors.d.ts +85 -0
  239. package/types/EventTypes.d.ts +630 -0
  240. package/types/Events.d.ts +96 -0
  241. package/types/ExternalAccountsResource.d.ts +304 -0
  242. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  243. package/types/FinancialConnections/Accounts.d.ts +36 -1
  244. package/types/FinancialConnections/AccountsResource.d.ts +40 -3
  245. package/types/FinancialConnections/Institutions.d.ts +98 -0
  246. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  247. package/types/FinancialConnections/Sessions.d.ts +51 -1
  248. package/types/FinancialConnections/SessionsResource.d.ts +43 -1
  249. package/types/FxQuotes.d.ts +155 -0
  250. package/types/FxQuotesResource.d.ts +130 -0
  251. package/types/Identity/BlocklistEntries.d.ts +78 -0
  252. package/types/Identity/BlocklistEntriesResource.d.ts +146 -0
  253. package/types/Identity/VerificationReports.d.ts +10 -0
  254. package/types/Identity/VerificationReportsResource.d.ts +5 -0
  255. package/types/Identity/VerificationSessions.d.ts +5 -0
  256. package/types/Identity/VerificationSessionsResource.d.ts +7 -0
  257. package/types/InvoiceItems.d.ts +127 -2
  258. package/types/InvoiceItemsResource.d.ts +117 -6
  259. package/types/InvoiceLineItems.d.ts +171 -3
  260. package/types/Invoices.d.ts +216 -4
  261. package/types/InvoicesResource.d.ts +1787 -10
  262. package/types/Issuing/CardholdersResource.d.ts +2 -1
  263. package/types/Issuing/CreditUnderwritingRecords.d.ts +451 -0
  264. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1032 -0
  265. package/types/Issuing/DisputeSettlementDetails.d.ts +85 -0
  266. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
  267. package/types/Issuing/FraudLiabilityDebits.d.ts +52 -0
  268. package/types/Issuing/FraudLiabilityDebitsResource.d.ts +52 -0
  269. package/types/Issuing/Programs.d.ts +42 -0
  270. package/types/Issuing/ProgramsResource.d.ts +96 -0
  271. package/types/Issuing/Settlements.d.ts +113 -0
  272. package/types/Issuing/Transactions.d.ts +5 -0
  273. package/types/Issuing/TransactionsResource.d.ts +5 -0
  274. package/types/LineItems.d.ts +49 -0
  275. package/types/Mandates.d.ts +135 -1
  276. package/types/MandatesResource.d.ts +31 -0
  277. package/types/Margins.d.ts +56 -0
  278. package/types/MarginsResource.d.ts +114 -0
  279. package/types/Orders.d.ts +1163 -0
  280. package/types/OrdersResource.d.ts +5505 -0
  281. package/types/PaymentAttemptRecords.d.ts +141 -0
  282. package/types/PaymentIntents.d.ts +779 -3
  283. package/types/PaymentIntentsResource.d.ts +19573 -6528
  284. package/types/PaymentLinks.d.ts +6 -0
  285. package/types/PaymentLinksResource.d.ts +12 -0
  286. package/types/PaymentMethodBalances.d.ts +63 -0
  287. package/types/PaymentMethodConfigurations.d.ts +216 -0
  288. package/types/PaymentMethodConfigurationsResource.d.ts +300 -0
  289. package/types/PaymentMethods.d.ts +144 -0
  290. package/types/PaymentMethodsResource.d.ts +199 -2
  291. package/types/PaymentRecords.d.ts +141 -0
  292. package/types/Persons.d.ts +30 -0
  293. package/types/Prices.d.ts +22 -0
  294. package/types/PricesResource.d.ts +22 -0
  295. package/types/Privacy/RedactionJobValidationErrors.d.ts +60 -0
  296. package/types/Privacy/RedactionJobs.d.ts +111 -0
  297. package/types/Privacy/RedactionJobsResource.d.ts +230 -0
  298. package/types/PromotionCodes.d.ts +5 -0
  299. package/types/PromotionCodesResource.d.ts +10 -0
  300. package/types/QuoteLines.d.ts +651 -0
  301. package/types/QuotePreviewInvoices.d.ts +1784 -0
  302. package/types/QuotePreviewSubscriptionSchedules.d.ts +1034 -0
  303. package/types/Quotes.d.ts +876 -1
  304. package/types/QuotesResource.d.ts +3255 -292
  305. package/types/Radar/AccountEvaluations.d.ts +88 -0
  306. package/types/Radar/AccountEvaluationsResource.d.ts +148 -0
  307. package/types/Refunds.d.ts +14 -0
  308. package/types/SetupAttempts.d.ts +51 -1
  309. package/types/SetupIntents.d.ts +239 -2
  310. package/types/SetupIntentsResource.d.ts +1044 -4
  311. package/types/Sources.d.ts +29 -0
  312. package/types/SubscriptionItems.d.ts +39 -0
  313. package/types/SubscriptionItemsResource.d.ts +143 -0
  314. package/types/SubscriptionSchedules.d.ts +329 -0
  315. package/types/SubscriptionSchedulesResource.d.ts +1525 -59
  316. package/types/Subscriptions.d.ts +284 -1
  317. package/types/SubscriptionsResource.d.ts +779 -8
  318. package/types/Tax/Forms.d.ts +220 -0
  319. package/types/Tax/FormsResource.d.ts +107 -0
  320. package/types/TaxIds.d.ts +10 -0
  321. package/types/TaxIdsResource.d.ts +10 -0
  322. package/types/Terminal/Configurations.d.ts +9 -0
  323. package/types/Terminal/ConfigurationsResource.d.ts +28 -0
  324. package/types/Terminal/ReaderCollectedData.d.ts +51 -0
  325. package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
  326. package/types/Terminal/Readers.d.ts +20 -0
  327. package/types/TestHelpers/Capital/FinancingOffersResource.d.ts +130 -0
  328. package/types/TestHelpers/ConfirmationTokensResource.d.ts +126 -0
  329. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  330. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  331. package/types/TokensResource.d.ts +44 -0
  332. package/types/Transfers.d.ts +9 -0
  333. package/types/TransfersResource.d.ts +7 -0
  334. package/types/TransitBalances.d.ts +40 -0
  335. package/types/Treasury/FinancialAccountFeatures.d.ts +7 -0
  336. package/types/Treasury/FinancialAccounts.d.ts +5 -0
  337. package/types/Treasury/FinancialAccountsResource.d.ts +37 -0
  338. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  339. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  340. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  341. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  342. package/types/V2/Billing/BillSettingVersions.d.ts +97 -0
  343. package/types/V2/Billing/BillSettings/VersionsResource.d.ts +58 -0
  344. package/types/V2/Billing/BillSettings.d.ts +120 -0
  345. package/types/V2/Billing/BillSettingsResource.d.ts +241 -0
  346. package/types/V2/Billing/Cadences.d.ts +735 -0
  347. package/types/V2/Billing/CadencesResource.d.ts +516 -0
  348. package/types/V2/Billing/CollectionSettingVersions.d.ts +318 -0
  349. package/types/V2/Billing/CollectionSettings/VersionsResource.d.ts +62 -0
  350. package/types/V2/Billing/CollectionSettings.d.ts +341 -0
  351. package/types/V2/Billing/CollectionSettingsResource.d.ts +683 -0
  352. package/types/V2/Billing/CustomPricingUnits.d.ts +56 -0
  353. package/types/V2/Billing/CustomPricingUnitsResource.d.ts +122 -0
  354. package/types/V2/Billing/IntentActions.d.ts +459 -0
  355. package/types/V2/Billing/Intents/ActionsResource.d.ts +58 -0
  356. package/types/V2/Billing/Intents.d.ts +117 -0
  357. package/types/V2/Billing/IntentsResource.d.ts +575 -0
  358. package/types/V2/Billing/LicenseFeeSubscriptions.d.ts +64 -0
  359. package/types/V2/Billing/LicenseFeeSubscriptionsResource.d.ts +28 -0
  360. package/types/V2/Billing/LicenseFeeVersions.d.ts +106 -0
  361. package/types/V2/Billing/LicenseFees/VersionsResource.d.ts +58 -0
  362. package/types/V2/Billing/LicenseFees.d.ts +164 -0
  363. package/types/V2/Billing/LicenseFeesResource.d.ts +290 -0
  364. package/types/V2/Billing/LicensedItems.d.ts +73 -0
  365. package/types/V2/Billing/LicensedItemsResource.d.ts +157 -0
  366. package/types/V2/Billing/MeteredItems.d.ts +101 -0
  367. package/types/V2/Billing/MeteredItemsResource.d.ts +189 -0
  368. package/types/V2/Billing/PricingPlanComponents.d.ts +109 -0
  369. package/types/V2/Billing/PricingPlanSubscriptionComponents.d.ts +57 -0
  370. package/types/V2/Billing/PricingPlanSubscriptions/ComponentsResource.d.ts +40 -0
  371. package/types/V2/Billing/PricingPlanSubscriptions.d.ts +144 -0
  372. package/types/V2/Billing/PricingPlanSubscriptionsResource.d.ts +120 -0
  373. package/types/V2/Billing/PricingPlanVersions.d.ts +49 -0
  374. package/types/V2/Billing/PricingPlans/ComponentsResource.d.ts +197 -0
  375. package/types/V2/Billing/PricingPlans/VersionsResource.d.ts +58 -0
  376. package/types/V2/Billing/PricingPlans.d.ts +84 -0
  377. package/types/V2/Billing/PricingPlansResource.d.ts +151 -0
  378. package/types/V2/Billing/Profiles.d.ts +70 -0
  379. package/types/V2/Billing/ProfilesResource.d.ts +150 -0
  380. package/types/V2/Billing/RateCardRates.d.ts +144 -0
  381. package/types/V2/Billing/RateCardSubscriptions.d.ts +144 -0
  382. package/types/V2/Billing/RateCardSubscriptionsResource.d.ts +157 -0
  383. package/types/V2/Billing/RateCardVersions.d.ts +39 -0
  384. package/types/V2/Billing/RateCards/RatesResource.d.ts +203 -0
  385. package/types/V2/Billing/RateCards/VersionsResource.d.ts +58 -0
  386. package/types/V2/Billing/RateCards.d.ts +98 -0
  387. package/types/V2/Billing/RateCardsResource.d.ts +162 -0
  388. package/types/V2/Billing/ServiceActions.d.ts +298 -0
  389. package/types/V2/Billing/ServiceActionsResource.d.ts +394 -0
  390. package/types/V2/Core/AccountLinks.d.ts +168 -0
  391. package/types/V2/Core/AccountLinksResource.d.ts +152 -0
  392. package/types/V2/Core/AccountPersonTokens.d.ts +44 -0
  393. package/types/V2/Core/AccountPersons.d.ts +616 -0
  394. package/types/V2/Core/AccountTokens.d.ts +44 -0
  395. package/types/V2/Core/AccountTokensResource.d.ts +1315 -0
  396. package/types/V2/Core/Accounts/PersonTokensResource.d.ts +509 -0
  397. package/types/V2/Core/Accounts/PersonsResource.d.ts +1165 -0
  398. package/types/V2/Core/Accounts.d.ts +8018 -0
  399. package/types/V2/Core/AccountsResource.d.ts +6997 -0
  400. package/types/V2/Core/ClaimableSandboxes.d.ts +132 -0
  401. package/types/V2/Core/ClaimableSandboxesResource.d.ts +74 -0
  402. package/types/V2/Core/EventTypes.d.ts +4715 -9
  403. package/types/V2/Core/Events.d.ts +9 -0
  404. package/types/V2/Core/Vault/GbBankAccounts.d.ts +160 -0
  405. package/types/V2/Core/Vault/GbBankAccountsResource.d.ts +194 -0
  406. package/types/V2/Core/Vault/UsBankAccounts.d.ts +116 -0
  407. package/types/V2/Core/Vault/UsBankAccountsResource.d.ts +198 -0
  408. package/types/V2/FinancialAddressCreditSimulations.d.ts +27 -0
  409. package/types/V2/FinancialAddressGeneratedMicrodeposits.d.ts +46 -0
  410. package/types/V2/MoneyManagement/Adjustments.d.ts +122 -0
  411. package/types/V2/MoneyManagement/AdjustmentsResource.d.ts +83 -0
  412. package/types/V2/MoneyManagement/CurrencyConversions.d.ts +98 -0
  413. package/types/V2/MoneyManagement/CurrencyConversionsResource.d.ts +141 -0
  414. package/types/V2/MoneyManagement/FinancialAccounts.d.ts +186 -0
  415. package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +172 -0
  416. package/types/V2/MoneyManagement/FinancialAddresses.d.ts +178 -0
  417. package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +126 -0
  418. package/types/V2/MoneyManagement/InboundTransfers.d.ts +250 -0
  419. package/types/V2/MoneyManagement/InboundTransfersResource.d.ts +156 -0
  420. package/types/V2/MoneyManagement/OutboundPaymentQuotes.d.ts +222 -0
  421. package/types/V2/MoneyManagement/OutboundPaymentQuotesResource.d.ts +127 -0
  422. package/types/V2/MoneyManagement/OutboundPayments.d.ts +323 -0
  423. package/types/V2/MoneyManagement/OutboundPaymentsResource.d.ts +259 -0
  424. package/types/V2/MoneyManagement/OutboundSetupIntents.d.ts +97 -0
  425. package/types/V2/MoneyManagement/OutboundSetupIntentsResource.d.ts +330 -0
  426. package/types/V2/MoneyManagement/OutboundTransfers.d.ts +296 -0
  427. package/types/V2/MoneyManagement/OutboundTransfersResource.d.ts +225 -0
  428. package/types/V2/MoneyManagement/PayoutMethods.d.ts +201 -0
  429. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpec.d.ts +93 -0
  430. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecResource.d.ts +41 -0
  431. package/types/V2/MoneyManagement/PayoutMethodsResource.d.ts +113 -0
  432. package/types/V2/MoneyManagement/ReceivedCredits.d.ts +331 -0
  433. package/types/V2/MoneyManagement/ReceivedCreditsResource.d.ts +78 -0
  434. package/types/V2/MoneyManagement/ReceivedDebits.d.ts +210 -0
  435. package/types/V2/MoneyManagement/ReceivedDebitsResource.d.ts +48 -0
  436. package/types/V2/MoneyManagement/RecipientVerifications.d.ts +112 -0
  437. package/types/V2/MoneyManagement/RecipientVerificationsResource.d.ts +77 -0
  438. package/types/V2/MoneyManagement/TransactionEntries.d.ts +200 -0
  439. package/types/V2/MoneyManagement/TransactionEntriesResource.d.ts +82 -0
  440. package/types/V2/MoneyManagement/Transactions.d.ts +227 -0
  441. package/types/V2/MoneyManagement/TransactionsResource.d.ts +83 -0
  442. package/types/V2/Payments/OffSessionPayments.d.ts +249 -0
  443. package/types/V2/Payments/OffSessionPaymentsResource.d.ts +306 -0
  444. package/types/V2/Reporting/ReportRuns.d.ts +154 -0
  445. package/types/V2/Reporting/ReportRunsResource.d.ts +75 -0
  446. package/types/V2/Reporting/Reports.d.ts +120 -0
  447. package/types/V2/Reporting/ReportsResource.d.ts +30 -0
  448. package/types/V2/TestHelpers/FinancialAddressesResource.d.ts +85 -0
  449. package/types/V2/TestHelpers/MoneyManagementResource.d.ts +49 -0
  450. package/types/WebhookEndpointsResource.d.ts +76 -0
  451. package/types/Webhooks.d.ts +2 -0
  452. package/types/apiVersion.d.ts +1 -2
  453. package/types/index.d.ts +241 -0
  454. package/types/lib.d.ts +10 -0
@@ -3,16 +3,33 @@
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
+
6
11
  /**
7
12
  * Controls how prorations and invoices for subscriptions are calculated and orchestrated.
8
13
  */
9
14
  billing_mode?: SubscriptionScheduleCreateParams.BillingMode;
10
15
 
16
+ /**
17
+ * Sets the billing schedules for the subscription schedule.
18
+ */
19
+ billing_schedules?: Array<
20
+ SubscriptionScheduleCreateParams.BillingSchedule
21
+ >;
22
+
11
23
  /**
12
24
  * The identifier of the customer to create the subscription schedule for.
13
25
  */
14
26
  customer?: string;
15
27
 
28
+ /**
29
+ * The identifier of the account to create the subscription schedule for.
30
+ */
31
+ customer_account?: string;
32
+
16
33
  /**
17
34
  * Object representing the subscription schedule's default settings.
18
35
  */
@@ -43,6 +60,11 @@ declare module 'stripe' {
43
60
  */
44
61
  phases?: Array<SubscriptionScheduleCreateParams.Phase>;
45
62
 
63
+ /**
64
+ * If specified, the invoicing for the given billing cycle iterations will be processed now.
65
+ */
66
+ prebilling?: SubscriptionScheduleCreateParams.Prebilling;
67
+
46
68
  /**
47
69
  * 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.
48
70
  */
@@ -50,6 +72,8 @@ declare module 'stripe' {
50
72
  }
51
73
 
52
74
  namespace SubscriptionScheduleCreateParams {
75
+ type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
76
+
53
77
  interface BillingMode {
54
78
  /**
55
79
  * Configure behavior for flexible billing mode.
@@ -77,6 +101,74 @@ declare module 'stripe' {
77
101
  type Type = 'classic' | 'flexible';
78
102
  }
79
103
 
104
+ interface BillingSchedule {
105
+ /**
106
+ * Configure billing schedule differently for individual subscription items.
107
+ */
108
+ applies_to?: Array<BillingSchedule.AppliesTo>;
109
+
110
+ /**
111
+ * The end date for the billing schedule.
112
+ */
113
+ bill_until: BillingSchedule.BillUntil;
114
+
115
+ /**
116
+ * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and up to 200 characters. If not provided, a unique key will be generated.
117
+ */
118
+ key?: string;
119
+ }
120
+
121
+ namespace BillingSchedule {
122
+ interface AppliesTo {
123
+ /**
124
+ * The ID of the price object.
125
+ */
126
+ price?: string;
127
+
128
+ /**
129
+ * Controls which subscription items the billing schedule applies to.
130
+ */
131
+ type: 'price';
132
+ }
133
+
134
+ interface BillUntil {
135
+ /**
136
+ * Specifies the billing period.
137
+ */
138
+ duration?: BillUntil.Duration;
139
+
140
+ /**
141
+ * The end date of the billing schedule.
142
+ */
143
+ timestamp?: number;
144
+
145
+ /**
146
+ * Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`.
147
+ */
148
+ type: BillUntil.Type;
149
+ }
150
+
151
+ namespace BillUntil {
152
+ interface Duration {
153
+ /**
154
+ * Specifies billing duration. Either `day`, `week`, `month` or `year`.
155
+ */
156
+ interval: Duration.Interval;
157
+
158
+ /**
159
+ * The multiplier applied to the interval.
160
+ */
161
+ interval_count?: number;
162
+ }
163
+
164
+ namespace Duration {
165
+ type Interval = 'day' | 'month' | 'week' | 'year';
166
+ }
167
+
168
+ type Type = 'duration' | 'timestamp';
169
+ }
170
+ }
171
+
80
172
  interface DefaultSettings {
81
173
  /**
82
174
  * 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).
@@ -129,6 +221,11 @@ declare module 'stripe' {
129
221
  * The data with which to automatically create a Transfer for each of the associated subscription's invoices.
130
222
  */
131
223
  transfer_data?: Stripe.Emptyable<DefaultSettings.TransferData>;
224
+
225
+ /**
226
+ * Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.
227
+ */
228
+ phase_effective_at?: DefaultSettings.PhaseEffectiveAt;
132
229
  }
133
230
 
134
231
  namespace DefaultSettings {
@@ -213,6 +310,8 @@ declare module 'stripe' {
213
310
  }
214
311
  }
215
312
 
313
+ type PhaseEffectiveAt = 'billing_period_start' | 'phase_start';
314
+
216
315
  interface TransferData {
217
316
  /**
218
317
  * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
@@ -314,6 +413,11 @@ declare module 'stripe' {
314
413
  */
315
414
  on_behalf_of?: string;
316
415
 
416
+ /**
417
+ * 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).
418
+ */
419
+ pause_collection?: Phase.PauseCollection;
420
+
317
421
  /**
318
422
  * 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.
319
423
  */
@@ -329,10 +433,25 @@ declare module 'stripe' {
329
433
  */
330
434
  trial?: boolean;
331
435
 
436
+ /**
437
+ * Specify trial behavior when crossing phase boundaries
438
+ */
439
+ trial_continuation?: Phase.TrialContinuation;
440
+
332
441
  /**
333
442
  * 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`
334
443
  */
335
444
  trial_end?: number;
445
+
446
+ /**
447
+ * Settings related to subscription trials.
448
+ */
449
+ trial_settings?: Phase.TrialSettings;
450
+
451
+ /**
452
+ * Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.
453
+ */
454
+ effective_at?: Phase.EffectiveAt;
336
455
  }
337
456
 
338
457
  namespace Phase {
@@ -385,12 +504,56 @@ declare module 'stripe' {
385
504
  */
386
505
  discount?: string;
387
506
 
507
+ /**
508
+ * Details to determine how long the discount should be applied for.
509
+ */
510
+ discount_end?: Discount.DiscountEnd;
511
+
388
512
  /**
389
513
  * ID of the promotion code to create a new discount for.
390
514
  */
391
515
  promotion_code?: string;
392
516
  }
393
517
 
518
+ namespace Discount {
519
+ interface DiscountEnd {
520
+ /**
521
+ * Time span for the redeemed discount.
522
+ */
523
+ duration?: DiscountEnd.Duration;
524
+
525
+ /**
526
+ * A precise Unix timestamp for the discount to end. Must be in the future.
527
+ */
528
+ timestamp?: number;
529
+
530
+ /**
531
+ * The type of calculation made to determine when the discount ends.
532
+ */
533
+ type: DiscountEnd.Type;
534
+ }
535
+
536
+ namespace DiscountEnd {
537
+ interface Duration {
538
+ /**
539
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
540
+ */
541
+ interval: Duration.Interval;
542
+
543
+ /**
544
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
545
+ */
546
+ interval_count: number;
547
+ }
548
+
549
+ namespace Duration {
550
+ type Interval = 'day' | 'month' | 'week' | 'year';
551
+ }
552
+
553
+ type Type = 'duration' | 'timestamp';
554
+ }
555
+ }
556
+
394
557
  interface Period {
395
558
  /**
396
559
  * End of the invoice item period.
@@ -526,12 +689,56 @@ declare module 'stripe' {
526
689
  */
527
690
  discount?: string;
528
691
 
692
+ /**
693
+ * Details to determine how long the discount should be applied for.
694
+ */
695
+ discount_end?: Discount.DiscountEnd;
696
+
529
697
  /**
530
698
  * ID of the promotion code to create a new discount for.
531
699
  */
532
700
  promotion_code?: string;
533
701
  }
534
702
 
703
+ namespace Discount {
704
+ interface DiscountEnd {
705
+ /**
706
+ * Time span for the redeemed discount.
707
+ */
708
+ duration?: DiscountEnd.Duration;
709
+
710
+ /**
711
+ * A precise Unix timestamp for the discount to end. Must be in the future.
712
+ */
713
+ timestamp?: number;
714
+
715
+ /**
716
+ * The type of calculation made to determine when the discount ends.
717
+ */
718
+ type: DiscountEnd.Type;
719
+ }
720
+
721
+ namespace DiscountEnd {
722
+ interface Duration {
723
+ /**
724
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
725
+ */
726
+ interval: Duration.Interval;
727
+
728
+ /**
729
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
730
+ */
731
+ interval_count: number;
732
+ }
733
+
734
+ namespace Duration {
735
+ type Interval = 'day' | 'month' | 'week' | 'year';
736
+ }
737
+
738
+ type Type = 'duration' | 'timestamp';
739
+ }
740
+ }
741
+
535
742
  interface Duration {
536
743
  /**
537
744
  * Specifies phase duration. Either `day`, `week`, `month` or `year`.
@@ -548,6 +755,8 @@ declare module 'stripe' {
548
755
  type Interval = 'day' | 'month' | 'week' | 'year';
549
756
  }
550
757
 
758
+ type EffectiveAt = 'billing_period_start' | 'phase_start';
759
+
551
760
  interface InvoiceSettings {
552
761
  /**
553
762
  * 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.
@@ -623,6 +832,16 @@ declare module 'stripe' {
623
832
  * 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.
624
833
  */
625
834
  tax_rates?: Stripe.Emptyable<Array<string>>;
835
+
836
+ /**
837
+ * Options that configure the trial on the subscription item.
838
+ */
839
+ trial?: Item.Trial;
840
+
841
+ /**
842
+ * The ID of the trial offer to apply to the configuration item.
843
+ */
844
+ trial_offer?: string;
626
845
  }
627
846
 
628
847
  namespace Item {
@@ -644,12 +863,56 @@ declare module 'stripe' {
644
863
  */
645
864
  discount?: string;
646
865
 
866
+ /**
867
+ * Details to determine how long the discount should be applied for.
868
+ */
869
+ discount_end?: Discount.DiscountEnd;
870
+
647
871
  /**
648
872
  * ID of the promotion code to create a new discount for.
649
873
  */
650
874
  promotion_code?: string;
651
875
  }
652
876
 
877
+ namespace Discount {
878
+ interface DiscountEnd {
879
+ /**
880
+ * Time span for the redeemed discount.
881
+ */
882
+ duration?: DiscountEnd.Duration;
883
+
884
+ /**
885
+ * A precise Unix timestamp for the discount to end. Must be in the future.
886
+ */
887
+ timestamp?: number;
888
+
889
+ /**
890
+ * The type of calculation made to determine when the discount ends.
891
+ */
892
+ type: DiscountEnd.Type;
893
+ }
894
+
895
+ namespace DiscountEnd {
896
+ interface Duration {
897
+ /**
898
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
899
+ */
900
+ interval: Duration.Interval;
901
+
902
+ /**
903
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
904
+ */
905
+ interval_count: number;
906
+ }
907
+
908
+ namespace Duration {
909
+ type Interval = 'day' | 'month' | 'week' | 'year';
910
+ }
911
+
912
+ type Type = 'duration' | 'timestamp';
913
+ }
914
+ }
915
+
653
916
  interface PriceData {
654
917
  /**
655
918
  * 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).
@@ -701,6 +964,33 @@ declare module 'stripe' {
701
964
 
702
965
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
703
966
  }
967
+
968
+ interface Trial {
969
+ /**
970
+ * 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.
971
+ */
972
+ converts_to?: Array<string>;
973
+
974
+ /**
975
+ * Determines the type of trial for this item.
976
+ */
977
+ type: Trial.Type;
978
+ }
979
+
980
+ namespace Trial {
981
+ type Type = 'free' | 'paid';
982
+ }
983
+ }
984
+
985
+ interface PauseCollection {
986
+ /**
987
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
988
+ */
989
+ behavior: PauseCollection.Behavior;
990
+ }
991
+
992
+ namespace PauseCollection {
993
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
704
994
  }
705
995
 
706
996
  type ProrationBehavior =
@@ -719,6 +1009,44 @@ declare module 'stripe' {
719
1009
  */
720
1010
  destination: string;
721
1011
  }
1012
+
1013
+ type TrialContinuation = 'continue' | 'none';
1014
+
1015
+ interface TrialSettings {
1016
+ /**
1017
+ * Defines how the subscription should behave when a trial ends.
1018
+ */
1019
+ end_behavior?: TrialSettings.EndBehavior;
1020
+ }
1021
+
1022
+ namespace TrialSettings {
1023
+ interface EndBehavior {
1024
+ /**
1025
+ * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1026
+ */
1027
+ prorate_up_front?: EndBehavior.ProrateUpFront;
1028
+ }
1029
+
1030
+ namespace EndBehavior {
1031
+ type ProrateUpFront = 'defer' | 'include';
1032
+ }
1033
+ }
1034
+ }
1035
+
1036
+ interface Prebilling {
1037
+ /**
1038
+ * This is used to determine the number of billing cycles to prebill.
1039
+ */
1040
+ iterations: number;
1041
+
1042
+ /**
1043
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1044
+ */
1045
+ update_behavior?: Prebilling.UpdateBehavior;
1046
+ }
1047
+
1048
+ namespace Prebilling {
1049
+ type UpdateBehavior = 'prebill' | 'reset';
722
1050
  }
723
1051
  }
724
1052
 
@@ -730,6 +1058,18 @@ declare module 'stripe' {
730
1058
  }
731
1059
 
732
1060
  interface SubscriptionScheduleUpdateParams {
1061
+ /**
1062
+ * 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.
1063
+ */
1064
+ billing_behavior?: SubscriptionScheduleUpdateParams.BillingBehavior;
1065
+
1066
+ /**
1067
+ * Sets the billing schedules for the subscription schedule.
1068
+ */
1069
+ billing_schedules?: Stripe.Emptyable<
1070
+ Array<SubscriptionScheduleUpdateParams.BillingSchedule>
1071
+ >;
1072
+
733
1073
  /**
734
1074
  * Object representing the subscription schedule's default settings.
735
1075
  */
@@ -755,6 +1095,11 @@ declare module 'stripe' {
755
1095
  */
756
1096
  phases?: Array<SubscriptionScheduleUpdateParams.Phase>;
757
1097
 
1098
+ /**
1099
+ * If specified, the invoicing for the given billing cycle iterations will be processed now.
1100
+ */
1101
+ prebilling?: SubscriptionScheduleUpdateParams.Prebilling;
1102
+
758
1103
  /**
759
1104
  * 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`.
760
1105
  */
@@ -762,6 +1107,76 @@ declare module 'stripe' {
762
1107
  }
763
1108
 
764
1109
  namespace SubscriptionScheduleUpdateParams {
1110
+ type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
1111
+
1112
+ interface BillingSchedule {
1113
+ /**
1114
+ * Configure billing schedule differently for individual subscription items.
1115
+ */
1116
+ applies_to?: Array<BillingSchedule.AppliesTo>;
1117
+
1118
+ /**
1119
+ * The end date for the billing schedule.
1120
+ */
1121
+ bill_until?: BillingSchedule.BillUntil;
1122
+
1123
+ /**
1124
+ * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and up to 200 characters. If not provided, a unique key will be generated.
1125
+ */
1126
+ key?: string;
1127
+ }
1128
+
1129
+ namespace BillingSchedule {
1130
+ interface AppliesTo {
1131
+ /**
1132
+ * The ID of the price object.
1133
+ */
1134
+ price?: string;
1135
+
1136
+ /**
1137
+ * Controls which subscription items the billing schedule applies to.
1138
+ */
1139
+ type: 'price';
1140
+ }
1141
+
1142
+ interface BillUntil {
1143
+ /**
1144
+ * Specifies the billing period.
1145
+ */
1146
+ duration?: BillUntil.Duration;
1147
+
1148
+ /**
1149
+ * The end date of the billing schedule.
1150
+ */
1151
+ timestamp?: number;
1152
+
1153
+ /**
1154
+ * Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`.
1155
+ */
1156
+ type: BillUntil.Type;
1157
+ }
1158
+
1159
+ namespace BillUntil {
1160
+ interface Duration {
1161
+ /**
1162
+ * Specifies billing duration. Either `day`, `week`, `month` or `year`.
1163
+ */
1164
+ interval: Duration.Interval;
1165
+
1166
+ /**
1167
+ * The multiplier applied to the interval.
1168
+ */
1169
+ interval_count?: number;
1170
+ }
1171
+
1172
+ namespace Duration {
1173
+ type Interval = 'day' | 'month' | 'week' | 'year';
1174
+ }
1175
+
1176
+ type Type = 'duration' | 'timestamp';
1177
+ }
1178
+ }
1179
+
765
1180
  interface DefaultSettings {
766
1181
  /**
767
1182
  * 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).
@@ -814,6 +1229,11 @@ declare module 'stripe' {
814
1229
  * The data with which to automatically create a Transfer for each of the associated subscription's invoices.
815
1230
  */
816
1231
  transfer_data?: Stripe.Emptyable<DefaultSettings.TransferData>;
1232
+
1233
+ /**
1234
+ * Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.
1235
+ */
1236
+ phase_effective_at?: DefaultSettings.PhaseEffectiveAt;
817
1237
  }
818
1238
 
819
1239
  namespace DefaultSettings {
@@ -898,6 +1318,8 @@ declare module 'stripe' {
898
1318
  }
899
1319
  }
900
1320
 
1321
+ type PhaseEffectiveAt = 'billing_period_start' | 'phase_start';
1322
+
901
1323
  interface TransferData {
902
1324
  /**
903
1325
  * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
@@ -999,6 +1421,11 @@ declare module 'stripe' {
999
1421
  */
1000
1422
  on_behalf_of?: string;
1001
1423
 
1424
+ /**
1425
+ * 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).
1426
+ */
1427
+ pause_collection?: Phase.PauseCollection;
1428
+
1002
1429
  /**
1003
1430
  * 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.
1004
1431
  */
@@ -1019,10 +1446,25 @@ declare module 'stripe' {
1019
1446
  */
1020
1447
  trial?: boolean;
1021
1448
 
1449
+ /**
1450
+ * Specify trial behavior when crossing phase boundaries
1451
+ */
1452
+ trial_continuation?: Phase.TrialContinuation;
1453
+
1022
1454
  /**
1023
1455
  * 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`
1024
1456
  */
1025
1457
  trial_end?: number | 'now';
1458
+
1459
+ /**
1460
+ * Settings related to subscription trials.
1461
+ */
1462
+ trial_settings?: Phase.TrialSettings;
1463
+
1464
+ /**
1465
+ * Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.
1466
+ */
1467
+ effective_at?: Phase.EffectiveAt;
1026
1468
  }
1027
1469
 
1028
1470
  namespace Phase {
@@ -1075,17 +1517,61 @@ declare module 'stripe' {
1075
1517
  */
1076
1518
  discount?: string;
1077
1519
 
1520
+ /**
1521
+ * Details to determine how long the discount should be applied for.
1522
+ */
1523
+ discount_end?: Discount.DiscountEnd;
1524
+
1078
1525
  /**
1079
1526
  * ID of the promotion code to create a new discount for.
1080
1527
  */
1081
1528
  promotion_code?: string;
1082
1529
  }
1083
1530
 
1084
- interface Period {
1085
- /**
1086
- * End of the invoice item period.
1087
- */
1088
- end: Period.End;
1531
+ namespace Discount {
1532
+ interface DiscountEnd {
1533
+ /**
1534
+ * Time span for the redeemed discount.
1535
+ */
1536
+ duration?: DiscountEnd.Duration;
1537
+
1538
+ /**
1539
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1540
+ */
1541
+ timestamp?: number;
1542
+
1543
+ /**
1544
+ * The type of calculation made to determine when the discount ends.
1545
+ */
1546
+ type: DiscountEnd.Type;
1547
+ }
1548
+
1549
+ namespace DiscountEnd {
1550
+ interface Duration {
1551
+ /**
1552
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1553
+ */
1554
+ interval: Duration.Interval;
1555
+
1556
+ /**
1557
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1558
+ */
1559
+ interval_count: number;
1560
+ }
1561
+
1562
+ namespace Duration {
1563
+ type Interval = 'day' | 'month' | 'week' | 'year';
1564
+ }
1565
+
1566
+ type Type = 'duration' | 'timestamp';
1567
+ }
1568
+ }
1569
+
1570
+ interface Period {
1571
+ /**
1572
+ * End of the invoice item period.
1573
+ */
1574
+ end: Period.End;
1089
1575
 
1090
1576
  /**
1091
1577
  * Start of the invoice item period.
@@ -1216,12 +1702,56 @@ declare module 'stripe' {
1216
1702
  */
1217
1703
  discount?: string;
1218
1704
 
1705
+ /**
1706
+ * Details to determine how long the discount should be applied for.
1707
+ */
1708
+ discount_end?: Discount.DiscountEnd;
1709
+
1219
1710
  /**
1220
1711
  * ID of the promotion code to create a new discount for.
1221
1712
  */
1222
1713
  promotion_code?: string;
1223
1714
  }
1224
1715
 
1716
+ namespace Discount {
1717
+ interface DiscountEnd {
1718
+ /**
1719
+ * Time span for the redeemed discount.
1720
+ */
1721
+ duration?: DiscountEnd.Duration;
1722
+
1723
+ /**
1724
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1725
+ */
1726
+ timestamp?: number;
1727
+
1728
+ /**
1729
+ * The type of calculation made to determine when the discount ends.
1730
+ */
1731
+ type: DiscountEnd.Type;
1732
+ }
1733
+
1734
+ namespace DiscountEnd {
1735
+ interface Duration {
1736
+ /**
1737
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1738
+ */
1739
+ interval: Duration.Interval;
1740
+
1741
+ /**
1742
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1743
+ */
1744
+ interval_count: number;
1745
+ }
1746
+
1747
+ namespace Duration {
1748
+ type Interval = 'day' | 'month' | 'week' | 'year';
1749
+ }
1750
+
1751
+ type Type = 'duration' | 'timestamp';
1752
+ }
1753
+ }
1754
+
1225
1755
  interface Duration {
1226
1756
  /**
1227
1757
  * Specifies phase duration. Either `day`, `week`, `month` or `year`.
@@ -1238,6 +1768,8 @@ declare module 'stripe' {
1238
1768
  type Interval = 'day' | 'month' | 'week' | 'year';
1239
1769
  }
1240
1770
 
1771
+ type EffectiveAt = 'billing_period_start' | 'phase_start';
1772
+
1241
1773
  interface InvoiceSettings {
1242
1774
  /**
1243
1775
  * 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.
@@ -1313,6 +1845,16 @@ declare module 'stripe' {
1313
1845
  * 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.
1314
1846
  */
1315
1847
  tax_rates?: Stripe.Emptyable<Array<string>>;
1848
+
1849
+ /**
1850
+ * Options that configure the trial on the subscription item.
1851
+ */
1852
+ trial?: Item.Trial;
1853
+
1854
+ /**
1855
+ * The ID of the trial offer to apply to the configuration item.
1856
+ */
1857
+ trial_offer?: string;
1316
1858
  }
1317
1859
 
1318
1860
  namespace Item {
@@ -1334,12 +1876,56 @@ declare module 'stripe' {
1334
1876
  */
1335
1877
  discount?: string;
1336
1878
 
1879
+ /**
1880
+ * Details to determine how long the discount should be applied for.
1881
+ */
1882
+ discount_end?: Discount.DiscountEnd;
1883
+
1337
1884
  /**
1338
1885
  * ID of the promotion code to create a new discount for.
1339
1886
  */
1340
1887
  promotion_code?: string;
1341
1888
  }
1342
1889
 
1890
+ namespace Discount {
1891
+ interface DiscountEnd {
1892
+ /**
1893
+ * Time span for the redeemed discount.
1894
+ */
1895
+ duration?: DiscountEnd.Duration;
1896
+
1897
+ /**
1898
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1899
+ */
1900
+ timestamp?: number;
1901
+
1902
+ /**
1903
+ * The type of calculation made to determine when the discount ends.
1904
+ */
1905
+ type: DiscountEnd.Type;
1906
+ }
1907
+
1908
+ namespace DiscountEnd {
1909
+ interface Duration {
1910
+ /**
1911
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1912
+ */
1913
+ interval: Duration.Interval;
1914
+
1915
+ /**
1916
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1917
+ */
1918
+ interval_count: number;
1919
+ }
1920
+
1921
+ namespace Duration {
1922
+ type Interval = 'day' | 'month' | 'week' | 'year';
1923
+ }
1924
+
1925
+ type Type = 'duration' | 'timestamp';
1926
+ }
1927
+ }
1928
+
1343
1929
  interface PriceData {
1344
1930
  /**
1345
1931
  * 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).
@@ -1391,6 +1977,33 @@ declare module 'stripe' {
1391
1977
 
1392
1978
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
1393
1979
  }
1980
+
1981
+ interface Trial {
1982
+ /**
1983
+ * 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.
1984
+ */
1985
+ converts_to?: Array<string>;
1986
+
1987
+ /**
1988
+ * Determines the type of trial for this item.
1989
+ */
1990
+ type: Trial.Type;
1991
+ }
1992
+
1993
+ namespace Trial {
1994
+ type Type = 'free' | 'paid';
1995
+ }
1996
+ }
1997
+
1998
+ interface PauseCollection {
1999
+ /**
2000
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2001
+ */
2002
+ behavior: PauseCollection.Behavior;
2003
+ }
2004
+
2005
+ namespace PauseCollection {
2006
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
1394
2007
  }
1395
2008
 
1396
2009
  type ProrationBehavior =
@@ -1409,6 +2022,44 @@ declare module 'stripe' {
1409
2022
  */
1410
2023
  destination: string;
1411
2024
  }
2025
+
2026
+ type TrialContinuation = 'continue' | 'none';
2027
+
2028
+ interface TrialSettings {
2029
+ /**
2030
+ * Defines how the subscription should behave when a trial ends.
2031
+ */
2032
+ end_behavior?: TrialSettings.EndBehavior;
2033
+ }
2034
+
2035
+ namespace TrialSettings {
2036
+ interface EndBehavior {
2037
+ /**
2038
+ * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2039
+ */
2040
+ prorate_up_front?: EndBehavior.ProrateUpFront;
2041
+ }
2042
+
2043
+ namespace EndBehavior {
2044
+ type ProrateUpFront = 'defer' | 'include';
2045
+ }
2046
+ }
2047
+ }
2048
+
2049
+ interface Prebilling {
2050
+ /**
2051
+ * This is used to determine the number of billing cycles to prebill.
2052
+ */
2053
+ iterations: number;
2054
+
2055
+ /**
2056
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2057
+ */
2058
+ update_behavior?: Prebilling.UpdateBehavior;
2059
+ }
2060
+
2061
+ namespace Prebilling {
2062
+ type UpdateBehavior = 'prebill' | 'reset';
1412
2063
  }
1413
2064
 
1414
2065
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
@@ -1435,6 +2086,11 @@ declare module 'stripe' {
1435
2086
  */
1436
2087
  customer?: string;
1437
2088
 
2089
+ /**
2090
+ * Only return subscription schedules for the given account.
2091
+ */
2092
+ customer_account?: string;
2093
+
1438
2094
  /**
1439
2095
  * Specifies which fields in the response should be expanded.
1440
2096
  */
@@ -1451,79 +2107,889 @@ declare module 'stripe' {
1451
2107
  scheduled?: boolean;
1452
2108
  }
1453
2109
 
1454
- interface SubscriptionScheduleCancelParams {
2110
+ interface SubscriptionScheduleAmendParams {
1455
2111
  /**
1456
- * Specifies which fields in the response should be expanded.
2112
+ * Changes to apply to the phases of the subscription schedule, in the order provided.
1457
2113
  */
1458
- expand?: Array<string>;
2114
+ amendments?: Array<SubscriptionScheduleAmendParams.Amendment>;
1459
2115
 
1460
2116
  /**
1461
- * If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`.
2117
+ * Specifies which fields in the response should be expanded.
1462
2118
  */
1463
- invoice_now?: boolean;
2119
+ expand?: Array<string>;
1464
2120
 
1465
2121
  /**
1466
- * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`.
2122
+ * Provide any time periods to bill in advance.
1467
2123
  */
1468
- prorate?: boolean;
1469
- }
2124
+ prebilling?: Stripe.Emptyable<
2125
+ Array<SubscriptionScheduleAmendParams.Prebilling>
2126
+ >;
1470
2127
 
1471
- interface SubscriptionScheduleReleaseParams {
1472
2128
  /**
1473
- * Specifies which fields in the response should be expanded.
2129
+ * In cases where the amendment changes the currently active phase,
2130
+ * specifies if and how to prorate at the time of the request.
1474
2131
  */
1475
- expand?: Array<string>;
2132
+ proration_behavior?: SubscriptionScheduleAmendParams.ProrationBehavior;
1476
2133
 
1477
2134
  /**
1478
- * Keep any cancellation on the subscription that the schedule has set
2135
+ * Changes to apply to the subscription schedule.
1479
2136
  */
1480
- preserve_cancel_date?: boolean;
2137
+ schedule_settings?: SubscriptionScheduleAmendParams.ScheduleSettings;
1481
2138
  }
1482
2139
 
1483
- class SubscriptionSchedulesResource {
1484
- /**
1485
- * Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
1486
- */
1487
- create(
1488
- params?: SubscriptionScheduleCreateParams,
1489
- options?: RequestOptions
1490
- ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
1491
- create(
1492
- options?: RequestOptions
1493
- ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2140
+ namespace SubscriptionScheduleAmendParams {
2141
+ interface Amendment {
2142
+ /**
2143
+ * 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.
2144
+ */
2145
+ amendment_end?: Amendment.AmendmentEnd;
1494
2146
 
1495
- /**
1496
- * Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation.
1497
- */
1498
- retrieve(
1499
- id: string,
1500
- params?: SubscriptionScheduleRetrieveParams,
1501
- options?: RequestOptions
1502
- ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
1503
- retrieve(
1504
- id: string,
1505
- options?: RequestOptions
1506
- ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2147
+ /**
2148
+ * Details to identify the earliest timestamp where the proposed change should take effect.
2149
+ */
2150
+ amendment_start: Amendment.AmendmentStart;
1507
2151
 
1508
- /**
1509
- * Updates an existing subscription schedule.
1510
- */
1511
- update(
1512
- id: string,
1513
- params?: SubscriptionScheduleUpdateParams,
1514
- options?: RequestOptions
1515
- ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2152
+ /**
2153
+ * 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.
2154
+ */
2155
+ billing_cycle_anchor?: Amendment.BillingCycleAnchor;
1516
2156
 
1517
- /**
1518
- * Retrieves the list of your subscription schedules.
1519
- */
1520
- list(
1521
- params?: SubscriptionScheduleListParams,
1522
- options?: RequestOptions
1523
- ): ApiListPromise<Stripe.SubscriptionSchedule>;
1524
- list(
1525
- options?: RequestOptions
1526
- ): ApiListPromise<Stripe.SubscriptionSchedule>;
2157
+ /**
2158
+ * Changes to the coupons being redeemed or discounts being applied during the amendment time span.
2159
+ */
2160
+ discount_actions?: Array<Amendment.DiscountAction>;
2161
+
2162
+ /**
2163
+ * Changes to the subscription items during the amendment time span.
2164
+ */
2165
+ item_actions?: Array<Amendment.ItemAction>;
2166
+
2167
+ /**
2168
+ * Instructions for how to modify phase metadata
2169
+ */
2170
+ metadata_actions?: Array<Amendment.MetadataAction>;
2171
+
2172
+ /**
2173
+ * 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`.
2174
+ */
2175
+ proration_behavior?: Amendment.ProrationBehavior;
2176
+
2177
+ /**
2178
+ * Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
2179
+ */
2180
+ set_pause_collection?: Amendment.SetPauseCollection;
2181
+
2182
+ /**
2183
+ * Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
2184
+ */
2185
+ set_schedule_end?: Amendment.SetScheduleEnd;
2186
+
2187
+ /**
2188
+ * Settings related to subscription trials.
2189
+ */
2190
+ trial_settings?: Amendment.TrialSettings;
2191
+
2192
+ /**
2193
+ * Actions to apply to the billing schedules.
2194
+ */
2195
+ billing_schedules_actions?: Array<Amendment.BillingSchedulesAction>;
2196
+
2197
+ /**
2198
+ * Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.
2199
+ */
2200
+ effective_at?: Amendment.EffectiveAt;
2201
+ }
2202
+
2203
+ namespace Amendment {
2204
+ interface AmendmentEnd {
2205
+ /**
2206
+ * Use the `end` time of a given discount.
2207
+ */
2208
+ discount_end?: AmendmentEnd.DiscountEnd;
2209
+
2210
+ /**
2211
+ * Time span for the amendment starting from the `amendment_start`.
2212
+ */
2213
+ duration?: AmendmentEnd.Duration;
2214
+
2215
+ /**
2216
+ * A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
2217
+ */
2218
+ timestamp?: number;
2219
+
2220
+ /**
2221
+ * Select one of three ways to pass the `amendment_end`.
2222
+ */
2223
+ type: AmendmentEnd.Type;
2224
+ }
2225
+
2226
+ namespace AmendmentEnd {
2227
+ interface DiscountEnd {
2228
+ /**
2229
+ * The ID of a specific discount.
2230
+ */
2231
+ discount: string;
2232
+ }
2233
+
2234
+ interface Duration {
2235
+ /**
2236
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2237
+ */
2238
+ interval: Duration.Interval;
2239
+
2240
+ /**
2241
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2242
+ */
2243
+ interval_count: number;
2244
+ }
2245
+
2246
+ namespace Duration {
2247
+ type Interval = 'day' | 'month' | 'week' | 'year';
2248
+ }
2249
+
2250
+ type Type =
2251
+ | 'discount_end'
2252
+ | 'duration'
2253
+ | 'schedule_end'
2254
+ | 'timestamp'
2255
+ | 'trial_end'
2256
+ | 'trial_start'
2257
+ | 'upcoming_invoice';
2258
+ }
2259
+
2260
+ interface AmendmentStart {
2261
+ /**
2262
+ * Details of another amendment in the same array, immediately after which this amendment should begin.
2263
+ */
2264
+ amendment_end?: AmendmentStart.AmendmentEnd;
2265
+
2266
+ /**
2267
+ * Use the `end` time of a given discount.
2268
+ */
2269
+ discount_end?: AmendmentStart.DiscountEnd;
2270
+
2271
+ /**
2272
+ * A precise Unix timestamp for the amendment to start.
2273
+ */
2274
+ timestamp?: number;
2275
+
2276
+ /**
2277
+ * Select one of three ways to pass the `amendment_start`.
2278
+ */
2279
+ type: AmendmentStart.Type;
2280
+ }
2281
+
2282
+ namespace AmendmentStart {
2283
+ interface AmendmentEnd {
2284
+ /**
2285
+ * 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.
2286
+ */
2287
+ index: number;
2288
+ }
2289
+
2290
+ interface DiscountEnd {
2291
+ /**
2292
+ * The ID of a specific discount.
2293
+ */
2294
+ discount: string;
2295
+ }
2296
+
2297
+ type Type =
2298
+ | 'amendment_end'
2299
+ | 'discount_end'
2300
+ | 'now'
2301
+ | 'schedule_end'
2302
+ | 'timestamp'
2303
+ | 'trial_end'
2304
+ | 'trial_start'
2305
+ | 'upcoming_invoice';
2306
+ }
2307
+
2308
+ type BillingCycleAnchor = 'amendment_start' | 'automatic';
2309
+
2310
+ interface BillingSchedulesAction {
2311
+ /**
2312
+ * Specify which subscription items the billing schedule applies to.
2313
+ */
2314
+ applies_to?: Array<BillingSchedulesAction.AppliesTo>;
2315
+
2316
+ /**
2317
+ * Select the action.
2318
+ */
2319
+ type: BillingSchedulesAction.Type;
2320
+ }
2321
+
2322
+ namespace BillingSchedulesAction {
2323
+ interface AppliesTo {
2324
+ /**
2325
+ * The ID of the price object.
2326
+ */
2327
+ price?: string;
2328
+
2329
+ /**
2330
+ * Controls which subscription items the billing schedule applies to.
2331
+ */
2332
+ type: 'price';
2333
+ }
2334
+
2335
+ type Type = 'remove' | 'set';
2336
+ }
2337
+
2338
+ interface DiscountAction {
2339
+ /**
2340
+ * Details of the discount to add.
2341
+ */
2342
+ add?: DiscountAction.Add;
2343
+
2344
+ /**
2345
+ * Details of the discount to remove.
2346
+ */
2347
+ remove?: DiscountAction.Remove;
2348
+
2349
+ /**
2350
+ * Details of the discount to replace the existing discounts with.
2351
+ */
2352
+ set?: DiscountAction.Set;
2353
+
2354
+ /**
2355
+ * Determines the type of discount action.
2356
+ */
2357
+ type: DiscountAction.Type;
2358
+ }
2359
+
2360
+ namespace DiscountAction {
2361
+ interface Add {
2362
+ /**
2363
+ * The coupon code to redeem.
2364
+ */
2365
+ coupon?: string;
2366
+
2367
+ /**
2368
+ * An ID of an existing discount for a coupon that was already redeemed.
2369
+ */
2370
+ discount?: string;
2371
+
2372
+ /**
2373
+ * Details to determine how long the discount should be applied for.
2374
+ */
2375
+ discount_end?: Add.DiscountEnd;
2376
+
2377
+ /**
2378
+ * 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.
2379
+ */
2380
+ index?: number;
2381
+
2382
+ /**
2383
+ * The promotion code to redeem.
2384
+ */
2385
+ promotion_code?: string;
2386
+ }
2387
+
2388
+ namespace Add {
2389
+ interface DiscountEnd {
2390
+ /**
2391
+ * The type of calculation made to determine when the discount ends.
2392
+ */
2393
+ type: 'amendment_end';
2394
+ }
2395
+ }
2396
+
2397
+ interface Remove {
2398
+ /**
2399
+ * The coupon code to remove from the `discounts` array.
2400
+ */
2401
+ coupon?: string;
2402
+
2403
+ /**
2404
+ * The ID of a discount to remove from the `discounts` array.
2405
+ */
2406
+ discount?: string;
2407
+
2408
+ /**
2409
+ * The ID of a promotion code to remove from the `discounts` array.
2410
+ */
2411
+ promotion_code?: string;
2412
+ }
2413
+
2414
+ interface Set {
2415
+ /**
2416
+ * The coupon code to replace the `discounts` array with.
2417
+ */
2418
+ coupon?: string;
2419
+
2420
+ /**
2421
+ * An ID of an existing discount to replace the `discounts` array with.
2422
+ */
2423
+ discount?: string;
2424
+
2425
+ /**
2426
+ * An ID of an existing promotion code to replace the `discounts` array with.
2427
+ */
2428
+ promotion_code?: string;
2429
+ }
2430
+
2431
+ type Type = 'add' | 'remove' | 'set';
2432
+ }
2433
+
2434
+ type EffectiveAt = 'amendment_start' | 'billing_period_start';
2435
+
2436
+ interface ItemAction {
2437
+ /**
2438
+ * 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.
2439
+ */
2440
+ add?: ItemAction.Add;
2441
+
2442
+ /**
2443
+ * Details of the subscription item to remove.
2444
+ */
2445
+ remove?: ItemAction.Remove;
2446
+
2447
+ /**
2448
+ * 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.
2449
+ */
2450
+ set?: ItemAction.Set;
2451
+
2452
+ /**
2453
+ * Determines the type of item action.
2454
+ */
2455
+ type: ItemAction.Type;
2456
+ }
2457
+
2458
+ namespace ItemAction {
2459
+ interface Add {
2460
+ /**
2461
+ * The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
2462
+ */
2463
+ discounts?: Array<Add.Discount>;
2464
+
2465
+ /**
2466
+ * 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`.
2467
+ */
2468
+ metadata?: Stripe.MetadataParam;
2469
+
2470
+ /**
2471
+ * The ID of the price object.
2472
+ */
2473
+ price: string;
2474
+
2475
+ /**
2476
+ * Quantity for this item.
2477
+ */
2478
+ quantity?: number;
2479
+
2480
+ /**
2481
+ * 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`.
2482
+ */
2483
+ tax_rates?: Array<string>;
2484
+
2485
+ /**
2486
+ * Options that configure the trial on the subscription item.
2487
+ */
2488
+ trial?: Add.Trial;
2489
+
2490
+ /**
2491
+ * The ID of the trial offer to apply to the configuration item.
2492
+ */
2493
+ trial_offer?: string;
2494
+ }
2495
+
2496
+ namespace Add {
2497
+ interface Discount {
2498
+ /**
2499
+ * ID of the coupon to create a new discount for.
2500
+ */
2501
+ coupon?: string;
2502
+
2503
+ /**
2504
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
2505
+ */
2506
+ discount?: string;
2507
+
2508
+ /**
2509
+ * Details to determine how long the discount should be applied for.
2510
+ */
2511
+ discount_end?: Discount.DiscountEnd;
2512
+
2513
+ /**
2514
+ * ID of the promotion code to create a new discount for.
2515
+ */
2516
+ promotion_code?: string;
2517
+ }
2518
+
2519
+ namespace Discount {
2520
+ interface DiscountEnd {
2521
+ /**
2522
+ * Time span for the redeemed discount.
2523
+ */
2524
+ duration?: DiscountEnd.Duration;
2525
+
2526
+ /**
2527
+ * A precise Unix timestamp for the discount to end. Must be in the future.
2528
+ */
2529
+ timestamp?: number;
2530
+
2531
+ /**
2532
+ * The type of calculation made to determine when the discount ends.
2533
+ */
2534
+ type: DiscountEnd.Type;
2535
+ }
2536
+
2537
+ namespace DiscountEnd {
2538
+ interface Duration {
2539
+ /**
2540
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2541
+ */
2542
+ interval: Duration.Interval;
2543
+
2544
+ /**
2545
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2546
+ */
2547
+ interval_count: number;
2548
+ }
2549
+
2550
+ namespace Duration {
2551
+ type Interval = 'day' | 'month' | 'week' | 'year';
2552
+ }
2553
+
2554
+ type Type = 'duration' | 'timestamp';
2555
+ }
2556
+ }
2557
+
2558
+ interface Trial {
2559
+ /**
2560
+ * 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.
2561
+ */
2562
+ converts_to?: Array<string>;
2563
+
2564
+ /**
2565
+ * Determines the type of trial for this item.
2566
+ */
2567
+ type: Trial.Type;
2568
+ }
2569
+
2570
+ namespace Trial {
2571
+ type Type = 'free' | 'paid';
2572
+ }
2573
+ }
2574
+
2575
+ interface Remove {
2576
+ /**
2577
+ * ID of a price to remove.
2578
+ */
2579
+ price: string;
2580
+ }
2581
+
2582
+ interface Set {
2583
+ /**
2584
+ * 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`.
2585
+ */
2586
+ discounts?: Array<Set.Discount>;
2587
+
2588
+ /**
2589
+ * 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`.
2590
+ */
2591
+ metadata?: Stripe.MetadataParam;
2592
+
2593
+ /**
2594
+ * The ID of the price object.
2595
+ */
2596
+ price: string;
2597
+
2598
+ /**
2599
+ * 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`.
2600
+ */
2601
+ quantity?: number;
2602
+
2603
+ /**
2604
+ * 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`.
2605
+ */
2606
+ tax_rates?: Array<string>;
2607
+
2608
+ /**
2609
+ * 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`.
2610
+ */
2611
+ trial?: Set.Trial;
2612
+
2613
+ /**
2614
+ * The ID of the trial offer to apply to the configuration item.
2615
+ */
2616
+ trial_offer?: string;
2617
+ }
2618
+
2619
+ namespace Set {
2620
+ interface Discount {
2621
+ /**
2622
+ * ID of the coupon to create a new discount for.
2623
+ */
2624
+ coupon?: string;
2625
+
2626
+ /**
2627
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
2628
+ */
2629
+ discount?: string;
2630
+
2631
+ /**
2632
+ * Details to determine how long the discount should be applied for.
2633
+ */
2634
+ discount_end?: Discount.DiscountEnd;
2635
+
2636
+ /**
2637
+ * ID of the promotion code to create a new discount for.
2638
+ */
2639
+ promotion_code?: string;
2640
+ }
2641
+
2642
+ namespace Discount {
2643
+ interface DiscountEnd {
2644
+ /**
2645
+ * Time span for the redeemed discount.
2646
+ */
2647
+ duration?: DiscountEnd.Duration;
2648
+
2649
+ /**
2650
+ * A precise Unix timestamp for the discount to end. Must be in the future.
2651
+ */
2652
+ timestamp?: number;
2653
+
2654
+ /**
2655
+ * The type of calculation made to determine when the discount ends.
2656
+ */
2657
+ type: DiscountEnd.Type;
2658
+ }
2659
+
2660
+ namespace DiscountEnd {
2661
+ interface Duration {
2662
+ /**
2663
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2664
+ */
2665
+ interval: Duration.Interval;
2666
+
2667
+ /**
2668
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2669
+ */
2670
+ interval_count: number;
2671
+ }
2672
+
2673
+ namespace Duration {
2674
+ type Interval = 'day' | 'month' | 'week' | 'year';
2675
+ }
2676
+
2677
+ type Type = 'duration' | 'timestamp';
2678
+ }
2679
+ }
2680
+
2681
+ interface Trial {
2682
+ /**
2683
+ * 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.
2684
+ */
2685
+ converts_to?: Array<string>;
2686
+
2687
+ /**
2688
+ * Determines the type of trial for this item.
2689
+ */
2690
+ type: Trial.Type;
2691
+ }
2692
+
2693
+ namespace Trial {
2694
+ type Type = 'free' | 'paid';
2695
+ }
2696
+ }
2697
+
2698
+ type Type = 'add' | 'remove' | 'set';
2699
+ }
2700
+
2701
+ interface MetadataAction {
2702
+ /**
2703
+ * Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
2704
+ */
2705
+ add?: {
2706
+ [key: string]: string;
2707
+ };
2708
+
2709
+ /**
2710
+ * Keys to remove from schedule phase metadata.
2711
+ */
2712
+ remove?: Array<string>;
2713
+
2714
+ /**
2715
+ * Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
2716
+ */
2717
+ set?: Stripe.Emptyable<{
2718
+ [key: string]: string;
2719
+ }>;
2720
+
2721
+ /**
2722
+ * Select one of three ways to update phase-level `metadata` on subscription schedules.
2723
+ */
2724
+ type: MetadataAction.Type;
2725
+ }
2726
+
2727
+ namespace MetadataAction {
2728
+ type Type = 'add' | 'remove' | 'set';
2729
+ }
2730
+
2731
+ type ProrationBehavior =
2732
+ | 'always_invoice'
2733
+ | 'create_prorations'
2734
+ | 'none';
2735
+
2736
+ interface SetPauseCollection {
2737
+ /**
2738
+ * Details of the pause_collection behavior to apply to the amendment.
2739
+ */
2740
+ set?: SetPauseCollection.Set;
2741
+
2742
+ /**
2743
+ * Determines the type of the pause_collection amendment.
2744
+ */
2745
+ type: SetPauseCollection.Type;
2746
+ }
2747
+
2748
+ namespace SetPauseCollection {
2749
+ interface Set {
2750
+ /**
2751
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2752
+ */
2753
+ behavior: Set.Behavior;
2754
+ }
2755
+
2756
+ namespace Set {
2757
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
2758
+ }
2759
+
2760
+ type Type = 'remove' | 'set';
2761
+ }
2762
+
2763
+ type SetScheduleEnd = 'amendment_end' | 'amendment_start';
2764
+
2765
+ interface TrialSettings {
2766
+ /**
2767
+ * Defines how the subscription should behave when a trial ends.
2768
+ */
2769
+ end_behavior?: TrialSettings.EndBehavior;
2770
+ }
2771
+
2772
+ namespace TrialSettings {
2773
+ interface EndBehavior {
2774
+ /**
2775
+ * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2776
+ */
2777
+ prorate_up_front?: EndBehavior.ProrateUpFront;
2778
+ }
2779
+
2780
+ namespace EndBehavior {
2781
+ type ProrateUpFront = 'defer' | 'include';
2782
+ }
2783
+ }
2784
+ }
2785
+
2786
+ interface Prebilling {
2787
+ /**
2788
+ * The beginning of the prebilled time period. The default value is `now`.
2789
+ */
2790
+ bill_from?: Prebilling.BillFrom;
2791
+
2792
+ /**
2793
+ * The end of the prebilled time period.
2794
+ */
2795
+ bill_until?: Prebilling.BillUntil;
2796
+
2797
+ /**
2798
+ * When the prebilling invoice should be created. The default value is `now`.
2799
+ */
2800
+ invoice_at?: 'now';
2801
+
2802
+ /**
2803
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2804
+ */
2805
+ update_behavior?: Prebilling.UpdateBehavior;
2806
+ }
2807
+
2808
+ namespace Prebilling {
2809
+ interface BillFrom {
2810
+ /**
2811
+ * Start the prebilled period when a specified amendment begins.
2812
+ */
2813
+ amendment_start?: BillFrom.AmendmentStart;
2814
+
2815
+ /**
2816
+ * Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2817
+ */
2818
+ timestamp?: number;
2819
+
2820
+ /**
2821
+ * Select one of several ways to pass the `bill_from` value.
2822
+ */
2823
+ type: BillFrom.Type;
2824
+ }
2825
+
2826
+ namespace BillFrom {
2827
+ interface AmendmentStart {
2828
+ /**
2829
+ * 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.
2830
+ */
2831
+ index: number;
2832
+ }
2833
+
2834
+ type Type = 'amendment_start' | 'now' | 'timestamp';
2835
+ }
2836
+
2837
+ interface BillUntil {
2838
+ /**
2839
+ * End the prebilled period when a specified amendment ends.
2840
+ */
2841
+ amendment_end?: BillUntil.AmendmentEnd;
2842
+
2843
+ /**
2844
+ * Time span for prebilling, starting from `bill_from`.
2845
+ */
2846
+ duration?: BillUntil.Duration;
2847
+
2848
+ /**
2849
+ * End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2850
+ */
2851
+ timestamp?: number;
2852
+
2853
+ /**
2854
+ * Select one of several ways to pass the `bill_until` value.
2855
+ */
2856
+ type: BillUntil.Type;
2857
+ }
2858
+
2859
+ namespace BillUntil {
2860
+ interface AmendmentEnd {
2861
+ /**
2862
+ * 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.
2863
+ */
2864
+ index: number;
2865
+ }
2866
+
2867
+ interface Duration {
2868
+ /**
2869
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2870
+ */
2871
+ interval: Duration.Interval;
2872
+
2873
+ /**
2874
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2875
+ */
2876
+ interval_count: number;
2877
+ }
2878
+
2879
+ namespace Duration {
2880
+ type Interval = 'day' | 'month' | 'week' | 'year';
2881
+ }
2882
+
2883
+ type Type =
2884
+ | 'amendment_end'
2885
+ | 'duration'
2886
+ | 'schedule_end'
2887
+ | 'timestamp';
2888
+ }
2889
+
2890
+ type UpdateBehavior = 'prebill' | 'reset';
2891
+ }
2892
+
2893
+ type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
2894
+
2895
+ interface ScheduleSettings {
2896
+ /**
2897
+ * Behavior of the subscription schedule and underlying subscription when it ends.
2898
+ */
2899
+ end_behavior?: ScheduleSettings.EndBehavior;
2900
+ }
2901
+
2902
+ namespace ScheduleSettings {
2903
+ type EndBehavior = 'cancel' | 'release';
2904
+ }
2905
+ }
2906
+
2907
+ interface SubscriptionScheduleCancelParams {
2908
+ /**
2909
+ * Specifies which fields in the response should be expanded.
2910
+ */
2911
+ expand?: Array<string>;
2912
+
2913
+ /**
2914
+ * If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`.
2915
+ */
2916
+ invoice_now?: boolean;
2917
+
2918
+ /**
2919
+ * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`.
2920
+ */
2921
+ prorate?: boolean;
2922
+ }
2923
+
2924
+ interface SubscriptionScheduleReleaseParams {
2925
+ /**
2926
+ * Specifies which fields in the response should be expanded.
2927
+ */
2928
+ expand?: Array<string>;
2929
+
2930
+ /**
2931
+ * Keep any cancellation on the subscription that the schedule has set
2932
+ */
2933
+ preserve_cancel_date?: boolean;
2934
+ }
2935
+
2936
+ class SubscriptionSchedulesResource {
2937
+ /**
2938
+ * Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
2939
+ */
2940
+ create(
2941
+ params?: SubscriptionScheduleCreateParams,
2942
+ options?: RequestOptions
2943
+ ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2944
+ create(
2945
+ options?: RequestOptions
2946
+ ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2947
+
2948
+ /**
2949
+ * Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation.
2950
+ */
2951
+ retrieve(
2952
+ id: string,
2953
+ params?: SubscriptionScheduleRetrieveParams,
2954
+ options?: RequestOptions
2955
+ ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2956
+ retrieve(
2957
+ id: string,
2958
+ options?: RequestOptions
2959
+ ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2960
+
2961
+ /**
2962
+ * Updates an existing subscription schedule.
2963
+ */
2964
+ update(
2965
+ id: string,
2966
+ params?: SubscriptionScheduleUpdateParams,
2967
+ options?: RequestOptions
2968
+ ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2969
+
2970
+ /**
2971
+ * Retrieves the list of your subscription schedules.
2972
+ */
2973
+ list(
2974
+ params?: SubscriptionScheduleListParams,
2975
+ options?: RequestOptions
2976
+ ): ApiListPromise<Stripe.SubscriptionSchedule>;
2977
+ list(
2978
+ options?: RequestOptions
2979
+ ): ApiListPromise<Stripe.SubscriptionSchedule>;
2980
+
2981
+ /**
2982
+ * Amends an existing subscription schedule.
2983
+ */
2984
+ amend(
2985
+ id: string,
2986
+ params?: SubscriptionScheduleAmendParams,
2987
+ options?: RequestOptions
2988
+ ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2989
+ amend(
2990
+ id: string,
2991
+ options?: RequestOptions
2992
+ ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
1527
2993
 
1528
2994
  /**
1529
2995
  * 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.