stripe 19.2.1 → 19.3.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 (433) hide show
  1. package/CHANGELOG.md +1686 -15
  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/RequestSender.js +1 -1
  7. package/cjs/apiVersion.js +2 -3
  8. package/cjs/resources/AccountNotices.js +21 -0
  9. package/cjs/resources/Billing/Analytics/MeterUsage.js +12 -0
  10. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  11. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  12. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  13. package/cjs/resources/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/Mandates.js +5 -0
  23. package/cjs/resources/Margins.js +22 -0
  24. package/cjs/resources/Orders.js +24 -0
  25. package/cjs/resources/PaymentIntents.js +8 -0
  26. package/cjs/resources/PaymentMethods.js +4 -0
  27. package/cjs/resources/Privacy/RedactionJobs.js +42 -0
  28. package/cjs/resources/Quotes.js +32 -0
  29. package/cjs/resources/SubscriptionSchedules.js +4 -0
  30. package/cjs/resources/Subscriptions.js +4 -0
  31. package/cjs/resources/Tax/Associations.js +9 -0
  32. package/cjs/resources/Tax/Forms.js +20 -0
  33. package/cjs/resources/Terminal/OnboardingLinks.js +12 -0
  34. package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
  35. package/cjs/resources/V2/Billing/BillSettings/Versions.js +17 -0
  36. package/cjs/resources/V2/Billing/BillSettings.js +27 -0
  37. package/cjs/resources/V2/Billing/Cadences.js +23 -0
  38. package/cjs/resources/V2/Billing/CollectionSettings/Versions.js +17 -0
  39. package/cjs/resources/V2/Billing/CollectionSettings.js +30 -0
  40. package/cjs/resources/V2/Billing/CustomPricingUnits.js +25 -0
  41. package/cjs/resources/V2/Billing/Intents/Actions.js +17 -0
  42. package/cjs/resources/V2/Billing/Intents.js +36 -0
  43. package/cjs/resources/V2/Billing/LicenseFeeSubscriptions.js +12 -0
  44. package/cjs/resources/V2/Billing/LicenseFees/Versions.js +17 -0
  45. package/cjs/resources/V2/Billing/LicenseFees.js +27 -0
  46. package/cjs/resources/V2/Billing/LicensedItems.js +25 -0
  47. package/cjs/resources/V2/Billing/MeteredItems.js +22 -0
  48. package/cjs/resources/V2/Billing/PricingPlanSubscriptions/Components.js +12 -0
  49. package/cjs/resources/V2/Billing/PricingPlanSubscriptions.js +26 -0
  50. package/cjs/resources/V2/Billing/PricingPlans/Components.js +29 -0
  51. package/cjs/resources/V2/Billing/PricingPlans/Versions.js +17 -0
  52. package/cjs/resources/V2/Billing/PricingPlans.js +29 -0
  53. package/cjs/resources/V2/Billing/Profiles.js +19 -0
  54. package/cjs/resources/V2/Billing/RateCardSubscriptions.js +29 -0
  55. package/cjs/resources/V2/Billing/RateCards/Rates.js +25 -0
  56. package/cjs/resources/V2/Billing/RateCards/Versions.js +17 -0
  57. package/cjs/resources/V2/Billing/RateCards.js +29 -0
  58. package/cjs/resources/V2/Billing/ServiceActions.js +20 -0
  59. package/cjs/resources/V2/Core/AccountLinks.js +9 -0
  60. package/cjs/resources/V2/Core/Accounts/Persons.js +29 -0
  61. package/cjs/resources/V2/Core/Accounts.js +25 -0
  62. package/cjs/resources/V2/Core/ClaimableSandboxes.js +16 -0
  63. package/cjs/resources/V2/Core/Vault/GbBankAccounts.js +33 -0
  64. package/cjs/resources/V2/Core/Vault/UsBankAccounts.js +37 -0
  65. package/cjs/resources/V2/MoneyManagement/Adjustments.js +17 -0
  66. package/cjs/resources/V2/MoneyManagement/FinancialAccounts.js +29 -0
  67. package/cjs/resources/V2/MoneyManagement/FinancialAddresses.js +21 -0
  68. package/cjs/resources/V2/MoneyManagement/InboundTransfers.js +21 -0
  69. package/cjs/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +16 -0
  70. package/cjs/resources/V2/MoneyManagement/OutboundPayments.js +25 -0
  71. package/cjs/resources/V2/MoneyManagement/OutboundSetupIntents.js +29 -0
  72. package/cjs/resources/V2/MoneyManagement/OutboundTransfers.js +25 -0
  73. package/cjs/resources/V2/MoneyManagement/PayoutMethods.js +25 -0
  74. package/cjs/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +12 -0
  75. package/cjs/resources/V2/MoneyManagement/ReceivedCredits.js +17 -0
  76. package/cjs/resources/V2/MoneyManagement/ReceivedDebits.js +17 -0
  77. package/cjs/resources/V2/MoneyManagement/RecipientVerifications.js +20 -0
  78. package/cjs/resources/V2/MoneyManagement/TransactionEntries.js +17 -0
  79. package/cjs/resources/V2/MoneyManagement/Transactions.js +17 -0
  80. package/cjs/resources/V2/Payments/OffSessionPayments.js +29 -0
  81. package/cjs/resources/V2/Tax/AutomaticRules.js +22 -0
  82. package/cjs/resources/V2/TestHelpers/FinancialAddresses.js +16 -0
  83. package/cjs/resources/V2/TestHelpers/MoneyManagement.js +12 -0
  84. package/cjs/resources.js +142 -8
  85. package/cjs/stripe.core.js +1 -1
  86. package/esm/Error.js +100 -0
  87. package/esm/RequestSender.js +1 -1
  88. package/esm/apiVersion.js +1 -2
  89. package/esm/resources/AccountNotices.js +18 -0
  90. package/esm/resources/Billing/Analytics/MeterUsage.js +9 -0
  91. package/esm/resources/Capital/FinancingOffers.js +18 -0
  92. package/esm/resources/Capital/FinancingSummary.js +9 -0
  93. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  94. package/esm/resources/DelegatedCheckout/RequestedSessions.js +25 -0
  95. package/esm/resources/ExternalAccounts.js +20 -0
  96. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  97. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  98. package/esm/resources/FxQuotes.js +12 -0
  99. package/esm/resources/Identity/BlocklistEntries.js +22 -0
  100. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  101. package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
  102. package/esm/resources/Issuing/FraudLiabilityDebits.js +14 -0
  103. package/esm/resources/Mandates.js +5 -0
  104. package/esm/resources/Margins.js +19 -0
  105. package/esm/resources/Orders.js +21 -0
  106. package/esm/resources/PaymentIntents.js +8 -0
  107. package/esm/resources/PaymentMethods.js +4 -0
  108. package/esm/resources/Privacy/RedactionJobs.js +39 -0
  109. package/esm/resources/Quotes.js +32 -0
  110. package/esm/resources/SubscriptionSchedules.js +4 -0
  111. package/esm/resources/Subscriptions.js +4 -0
  112. package/esm/resources/Tax/Associations.js +6 -0
  113. package/esm/resources/Tax/Forms.js +17 -0
  114. package/esm/resources/Terminal/OnboardingLinks.js +9 -0
  115. package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
  116. package/esm/resources/V2/Billing/BillSettings/Versions.js +14 -0
  117. package/esm/resources/V2/Billing/BillSettings.js +24 -0
  118. package/esm/resources/V2/Billing/Cadences.js +20 -0
  119. package/esm/resources/V2/Billing/CollectionSettings/Versions.js +14 -0
  120. package/esm/resources/V2/Billing/CollectionSettings.js +27 -0
  121. package/esm/resources/V2/Billing/CustomPricingUnits.js +22 -0
  122. package/esm/resources/V2/Billing/Intents/Actions.js +14 -0
  123. package/esm/resources/V2/Billing/Intents.js +33 -0
  124. package/esm/resources/V2/Billing/LicenseFeeSubscriptions.js +9 -0
  125. package/esm/resources/V2/Billing/LicenseFees/Versions.js +14 -0
  126. package/esm/resources/V2/Billing/LicenseFees.js +24 -0
  127. package/esm/resources/V2/Billing/LicensedItems.js +22 -0
  128. package/esm/resources/V2/Billing/MeteredItems.js +19 -0
  129. package/esm/resources/V2/Billing/PricingPlanSubscriptions/Components.js +9 -0
  130. package/esm/resources/V2/Billing/PricingPlanSubscriptions.js +23 -0
  131. package/esm/resources/V2/Billing/PricingPlans/Components.js +26 -0
  132. package/esm/resources/V2/Billing/PricingPlans/Versions.js +14 -0
  133. package/esm/resources/V2/Billing/PricingPlans.js +26 -0
  134. package/esm/resources/V2/Billing/Profiles.js +16 -0
  135. package/esm/resources/V2/Billing/RateCardSubscriptions.js +26 -0
  136. package/esm/resources/V2/Billing/RateCards/Rates.js +22 -0
  137. package/esm/resources/V2/Billing/RateCards/Versions.js +14 -0
  138. package/esm/resources/V2/Billing/RateCards.js +26 -0
  139. package/esm/resources/V2/Billing/ServiceActions.js +17 -0
  140. package/esm/resources/V2/Core/AccountLinks.js +6 -0
  141. package/esm/resources/V2/Core/Accounts/Persons.js +26 -0
  142. package/esm/resources/V2/Core/Accounts.js +22 -0
  143. package/esm/resources/V2/Core/ClaimableSandboxes.js +13 -0
  144. package/esm/resources/V2/Core/Vault/GbBankAccounts.js +30 -0
  145. package/esm/resources/V2/Core/Vault/UsBankAccounts.js +34 -0
  146. package/esm/resources/V2/MoneyManagement/Adjustments.js +14 -0
  147. package/esm/resources/V2/MoneyManagement/FinancialAccounts.js +26 -0
  148. package/esm/resources/V2/MoneyManagement/FinancialAddresses.js +18 -0
  149. package/esm/resources/V2/MoneyManagement/InboundTransfers.js +18 -0
  150. package/esm/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +13 -0
  151. package/esm/resources/V2/MoneyManagement/OutboundPayments.js +22 -0
  152. package/esm/resources/V2/MoneyManagement/OutboundSetupIntents.js +26 -0
  153. package/esm/resources/V2/MoneyManagement/OutboundTransfers.js +22 -0
  154. package/esm/resources/V2/MoneyManagement/PayoutMethods.js +22 -0
  155. package/esm/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +9 -0
  156. package/esm/resources/V2/MoneyManagement/ReceivedCredits.js +14 -0
  157. package/esm/resources/V2/MoneyManagement/ReceivedDebits.js +14 -0
  158. package/esm/resources/V2/MoneyManagement/RecipientVerifications.js +17 -0
  159. package/esm/resources/V2/MoneyManagement/TransactionEntries.js +14 -0
  160. package/esm/resources/V2/MoneyManagement/Transactions.js +14 -0
  161. package/esm/resources/V2/Payments/OffSessionPayments.js +26 -0
  162. package/esm/resources/V2/Tax/AutomaticRules.js +19 -0
  163. package/esm/resources/V2/TestHelpers/FinancialAddresses.js +13 -0
  164. package/esm/resources/V2/TestHelpers/MoneyManagement.js +9 -0
  165. package/esm/resources.js +129 -0
  166. package/esm/stripe.core.js +1 -1
  167. package/package.json +1 -1
  168. package/types/AccountLinksResource.d.ts +5 -1
  169. package/types/AccountNotices.d.ts +113 -0
  170. package/types/AccountNoticesResource.d.ts +98 -0
  171. package/types/AccountSessions.d.ts +45 -0
  172. package/types/AccountSessionsResource.d.ts +264 -0
  173. package/types/Accounts.d.ts +214 -1
  174. package/types/AccountsResource.d.ts +544 -0
  175. package/types/ApplicationFees.d.ts +6 -1
  176. package/types/Balance.d.ts +82 -0
  177. package/types/BalanceTransactions.d.ts +2 -1
  178. package/types/BankAccounts.d.ts +2 -0
  179. package/types/Billing/AlertTriggereds.d.ts +16 -1
  180. package/types/Billing/Alerts.d.ts +116 -1
  181. package/types/Billing/AlertsResource.d.ts +149 -2
  182. package/types/Billing/Analytics/MeterUsage.d.ts +31 -0
  183. package/types/Billing/Analytics/MeterUsageResource.d.ts +694 -0
  184. package/types/Billing/Analytics/MeterUsageRows.d.ts +58 -0
  185. package/types/Billing/CreditBalanceSummary.d.ts +123 -2
  186. package/types/Billing/CreditBalanceSummaryResource.d.ts +20 -3
  187. package/types/Billing/CreditBalanceTransactions.d.ts +118 -2
  188. package/types/Billing/CreditBalanceTransactionsResource.d.ts +12 -4
  189. package/types/Billing/CreditGrants.d.ts +76 -1
  190. package/types/Billing/CreditGrantsResource.d.ts +45 -4
  191. package/types/Billing/MeterEventSummaries.d.ts +7 -0
  192. package/types/Billing/Meters.d.ts +5 -0
  193. package/types/Billing/MetersResource.d.ts +17 -0
  194. package/types/BillingPortal/Sessions.d.ts +5 -0
  195. package/types/BillingPortal/SessionsResource.d.ts +12 -4
  196. package/types/Capabilities.d.ts +2 -0
  197. package/types/Capital/FinancingOffers.d.ts +188 -0
  198. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  199. package/types/Capital/FinancingSummary.d.ts +106 -0
  200. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  201. package/types/Capital/FinancingTransactions.d.ts +135 -0
  202. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  203. package/types/Cards.d.ts +19 -0
  204. package/types/CashBalances.d.ts +5 -0
  205. package/types/Charges.d.ts +185 -0
  206. package/types/ChargesResource.d.ts +1406 -0
  207. package/types/Checkout/Sessions.d.ts +427 -2
  208. package/types/Checkout/SessionsResource.d.ts +682 -2
  209. package/types/ConfirmationTokens.d.ts +139 -0
  210. package/types/Coupons.d.ts +33 -0
  211. package/types/CouponsResource.d.ts +21 -0
  212. package/types/CreditNoteLineItems.d.ts +17 -0
  213. package/types/CreditNotes.d.ts +5 -0
  214. package/types/CreditNotesResource.d.ts +5 -0
  215. package/types/CustomerBalanceTransactions.d.ts +2 -0
  216. package/types/CustomerCashBalanceTransactions.d.ts +2 -0
  217. package/types/CustomerSessions.d.ts +46 -0
  218. package/types/CustomerSessionsResource.d.ts +47 -1
  219. package/types/Customers.d.ts +2 -0
  220. package/types/CustomersResource.d.ts +8 -0
  221. package/types/DelegatedCheckout/RequestedSessions.d.ts +360 -0
  222. package/types/DelegatedCheckout/RequestedSessionsResource.d.ts +593 -0
  223. package/types/Discounts.d.ts +10 -0
  224. package/types/Disputes.d.ts +40 -0
  225. package/types/DisputesResource.d.ts +11 -0
  226. package/types/Errors.d.ts +85 -0
  227. package/types/EventTypes.d.ts +630 -0
  228. package/types/Events.d.ts +95 -0
  229. package/types/ExternalAccountsResource.d.ts +304 -0
  230. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  231. package/types/FinancialConnections/Accounts.d.ts +36 -1
  232. package/types/FinancialConnections/AccountsResource.d.ts +40 -3
  233. package/types/FinancialConnections/Institutions.d.ts +98 -0
  234. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  235. package/types/FinancialConnections/Sessions.d.ts +51 -1
  236. package/types/FinancialConnections/SessionsResource.d.ts +43 -1
  237. package/types/FxQuotes.d.ts +155 -0
  238. package/types/FxQuotesResource.d.ts +130 -0
  239. package/types/Identity/BlocklistEntries.d.ts +78 -0
  240. package/types/Identity/BlocklistEntriesResource.d.ts +146 -0
  241. package/types/Identity/VerificationReports.d.ts +10 -0
  242. package/types/Identity/VerificationReportsResource.d.ts +5 -0
  243. package/types/Identity/VerificationSessions.d.ts +5 -0
  244. package/types/Identity/VerificationSessionsResource.d.ts +7 -0
  245. package/types/InvoiceItems.d.ts +114 -2
  246. package/types/InvoiceItemsResource.d.ts +117 -6
  247. package/types/InvoiceLineItems.d.ts +158 -3
  248. package/types/InvoicePayments.d.ts +1 -1
  249. package/types/Invoices.d.ts +203 -4
  250. package/types/InvoicesResource.d.ts +1625 -2
  251. package/types/Issuing/CardholdersResource.d.ts +2 -1
  252. package/types/Issuing/CreditUnderwritingRecords.d.ts +451 -0
  253. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1032 -0
  254. package/types/Issuing/DisputeSettlementDetails.d.ts +85 -0
  255. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
  256. package/types/Issuing/FraudLiabilityDebits.d.ts +52 -0
  257. package/types/Issuing/FraudLiabilityDebitsResource.d.ts +52 -0
  258. package/types/Issuing/Settlements.d.ts +113 -0
  259. package/types/Issuing/Transactions.d.ts +5 -0
  260. package/types/Issuing/TransactionsResource.d.ts +5 -0
  261. package/types/LineItems.d.ts +49 -0
  262. package/types/Mandates.d.ts +135 -1
  263. package/types/MandatesResource.d.ts +31 -0
  264. package/types/Margins.d.ts +56 -0
  265. package/types/MarginsResource.d.ts +114 -0
  266. package/types/Orders.d.ts +1163 -0
  267. package/types/OrdersResource.d.ts +3139 -0
  268. package/types/PaymentAttemptRecords.d.ts +141 -0
  269. package/types/PaymentIntentAmountDetailsLineItems.d.ts +7 -13
  270. package/types/PaymentIntents.d.ts +807 -20
  271. package/types/PaymentIntentsResource.d.ts +9765 -4959
  272. package/types/PaymentLinks.d.ts +6 -0
  273. package/types/PaymentLinksResource.d.ts +12 -0
  274. package/types/PaymentMethodBalances.d.ts +63 -0
  275. package/types/PaymentMethodConfigurations.d.ts +216 -0
  276. package/types/PaymentMethodConfigurationsResource.d.ts +300 -0
  277. package/types/PaymentMethods.d.ts +144 -0
  278. package/types/PaymentMethodsResource.d.ts +187 -2
  279. package/types/PaymentRecords.d.ts +141 -0
  280. package/types/Persons.d.ts +2 -0
  281. package/types/Prices.d.ts +22 -0
  282. package/types/PricesResource.d.ts +22 -0
  283. package/types/Privacy/RedactionJobValidationErrors.d.ts +60 -0
  284. package/types/Privacy/RedactionJobs.d.ts +111 -0
  285. package/types/Privacy/RedactionJobsResource.d.ts +230 -0
  286. package/types/PromotionCodes.d.ts +5 -0
  287. package/types/PromotionCodesResource.d.ts +10 -0
  288. package/types/QuoteLines.d.ts +634 -0
  289. package/types/QuotePreviewInvoices.d.ts +1771 -0
  290. package/types/QuotePreviewSubscriptionSchedules.d.ts +908 -0
  291. package/types/Quotes.d.ts +594 -1
  292. package/types/QuotesResource.d.ts +2588 -243
  293. package/types/Refunds.d.ts +14 -0
  294. package/types/SetupAttempts.d.ts +51 -1
  295. package/types/SetupIntents.d.ts +239 -2
  296. package/types/SetupIntentsResource.d.ts +1044 -4
  297. package/types/Sources.d.ts +29 -0
  298. package/types/SubscriptionItems.d.ts +26 -0
  299. package/types/SubscriptionItemsResource.d.ts +109 -0
  300. package/types/SubscriptionSchedules.d.ts +205 -0
  301. package/types/SubscriptionSchedulesResource.d.ts +1233 -5
  302. package/types/Subscriptions.d.ts +262 -1
  303. package/types/SubscriptionsResource.d.ts +745 -8
  304. package/types/Tax/Associations.d.ts +82 -0
  305. package/types/Tax/AssociationsResource.d.ts +29 -0
  306. package/types/Tax/Forms.d.ts +220 -0
  307. package/types/Tax/FormsResource.d.ts +107 -0
  308. package/types/TaxIds.d.ts +10 -0
  309. package/types/TaxIdsResource.d.ts +10 -0
  310. package/types/Terminal/Configurations.d.ts +9 -0
  311. package/types/Terminal/ConfigurationsResource.d.ts +28 -0
  312. package/types/Terminal/OnboardingLinks.d.ts +57 -0
  313. package/types/Terminal/OnboardingLinksResource.d.ts +62 -0
  314. package/types/Terminal/ReaderCollectedData.d.ts +51 -0
  315. package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
  316. package/types/Terminal/Readers.d.ts +20 -0
  317. package/types/TestHelpers/ConfirmationTokensResource.d.ts +126 -0
  318. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  319. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  320. package/types/Transfers.d.ts +9 -0
  321. package/types/TransfersResource.d.ts +7 -0
  322. package/types/Treasury/FinancialAccountFeatures.d.ts +7 -0
  323. package/types/Treasury/FinancialAccounts.d.ts +5 -0
  324. package/types/Treasury/FinancialAccountsResource.d.ts +37 -0
  325. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  326. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  327. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  328. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  329. package/types/V2/Billing/BillSettingVersions.d.ts +97 -0
  330. package/types/V2/Billing/BillSettings/VersionsResource.d.ts +58 -0
  331. package/types/V2/Billing/BillSettings.d.ts +120 -0
  332. package/types/V2/Billing/BillSettingsResource.d.ts +241 -0
  333. package/types/V2/Billing/Cadences.d.ts +731 -0
  334. package/types/V2/Billing/CadencesResource.d.ts +516 -0
  335. package/types/V2/Billing/CollectionSettingVersions.d.ts +314 -0
  336. package/types/V2/Billing/CollectionSettings/VersionsResource.d.ts +62 -0
  337. package/types/V2/Billing/CollectionSettings.d.ts +337 -0
  338. package/types/V2/Billing/CollectionSettingsResource.d.ts +675 -0
  339. package/types/V2/Billing/CustomPricingUnits.d.ts +56 -0
  340. package/types/V2/Billing/CustomPricingUnitsResource.d.ts +122 -0
  341. package/types/V2/Billing/IntentActions.d.ts +459 -0
  342. package/types/V2/Billing/Intents/ActionsResource.d.ts +58 -0
  343. package/types/V2/Billing/Intents.d.ts +117 -0
  344. package/types/V2/Billing/IntentsResource.d.ts +575 -0
  345. package/types/V2/Billing/LicenseFeeSubscriptions.d.ts +64 -0
  346. package/types/V2/Billing/LicenseFeeSubscriptionsResource.d.ts +28 -0
  347. package/types/V2/Billing/LicenseFeeVersions.d.ts +106 -0
  348. package/types/V2/Billing/LicenseFees/VersionsResource.d.ts +58 -0
  349. package/types/V2/Billing/LicenseFees.d.ts +164 -0
  350. package/types/V2/Billing/LicenseFeesResource.d.ts +290 -0
  351. package/types/V2/Billing/LicensedItems.d.ts +73 -0
  352. package/types/V2/Billing/LicensedItemsResource.d.ts +157 -0
  353. package/types/V2/Billing/MeteredItems.d.ts +101 -0
  354. package/types/V2/Billing/MeteredItemsResource.d.ts +189 -0
  355. package/types/V2/Billing/PricingPlanComponents.d.ts +109 -0
  356. package/types/V2/Billing/PricingPlanSubscriptionComponents.d.ts +57 -0
  357. package/types/V2/Billing/PricingPlanSubscriptions/ComponentsResource.d.ts +40 -0
  358. package/types/V2/Billing/PricingPlanSubscriptions.d.ts +144 -0
  359. package/types/V2/Billing/PricingPlanSubscriptionsResource.d.ts +120 -0
  360. package/types/V2/Billing/PricingPlanVersions.d.ts +49 -0
  361. package/types/V2/Billing/PricingPlans/ComponentsResource.d.ts +197 -0
  362. package/types/V2/Billing/PricingPlans/VersionsResource.d.ts +58 -0
  363. package/types/V2/Billing/PricingPlans.d.ts +84 -0
  364. package/types/V2/Billing/PricingPlansResource.d.ts +151 -0
  365. package/types/V2/Billing/Profiles.d.ts +70 -0
  366. package/types/V2/Billing/ProfilesResource.d.ts +150 -0
  367. package/types/V2/Billing/RateCardRates.d.ts +144 -0
  368. package/types/V2/Billing/RateCardSubscriptions.d.ts +144 -0
  369. package/types/V2/Billing/RateCardSubscriptionsResource.d.ts +157 -0
  370. package/types/V2/Billing/RateCardVersions.d.ts +39 -0
  371. package/types/V2/Billing/RateCards/RatesResource.d.ts +203 -0
  372. package/types/V2/Billing/RateCards/VersionsResource.d.ts +58 -0
  373. package/types/V2/Billing/RateCards.d.ts +98 -0
  374. package/types/V2/Billing/RateCardsResource.d.ts +162 -0
  375. package/types/V2/Billing/ServiceActions.d.ts +274 -0
  376. package/types/V2/Billing/ServiceActionsResource.d.ts +370 -0
  377. package/types/V2/Core/AccountLinks.d.ts +168 -0
  378. package/types/V2/Core/AccountLinksResource.d.ts +152 -0
  379. package/types/V2/Core/AccountPersons.d.ts +615 -0
  380. package/types/V2/Core/Accounts/PersonsResource.d.ts +1153 -0
  381. package/types/V2/Core/Accounts.d.ts +7478 -0
  382. package/types/V2/Core/AccountsResource.d.ts +6723 -0
  383. package/types/V2/Core/ClaimableSandboxes.d.ts +132 -0
  384. package/types/V2/Core/ClaimableSandboxesResource.d.ts +74 -0
  385. package/types/V2/Core/EventTypes.d.ts +8589 -10
  386. package/types/V2/Core/Events.d.ts +12 -0
  387. package/types/V2/Core/Vault/GbBankAccounts.d.ts +160 -0
  388. package/types/V2/Core/Vault/GbBankAccountsResource.d.ts +194 -0
  389. package/types/V2/Core/Vault/UsBankAccounts.d.ts +116 -0
  390. package/types/V2/Core/Vault/UsBankAccountsResource.d.ts +198 -0
  391. package/types/V2/FinancialAddressCreditSimulations.d.ts +27 -0
  392. package/types/V2/FinancialAddressGeneratedMicrodeposits.d.ts +32 -0
  393. package/types/V2/MoneyManagement/Adjustments.d.ts +110 -0
  394. package/types/V2/MoneyManagement/AdjustmentsResource.d.ts +83 -0
  395. package/types/V2/MoneyManagement/FinancialAccounts.d.ts +148 -0
  396. package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +172 -0
  397. package/types/V2/MoneyManagement/FinancialAddresses.d.ts +178 -0
  398. package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +126 -0
  399. package/types/V2/MoneyManagement/InboundTransfers.d.ts +206 -0
  400. package/types/V2/MoneyManagement/InboundTransfersResource.d.ts +144 -0
  401. package/types/V2/MoneyManagement/OutboundPaymentQuotes.d.ts +170 -0
  402. package/types/V2/MoneyManagement/OutboundPaymentQuotesResource.d.ts +115 -0
  403. package/types/V2/MoneyManagement/OutboundPayments.d.ts +283 -0
  404. package/types/V2/MoneyManagement/OutboundPaymentsResource.d.ts +247 -0
  405. package/types/V2/MoneyManagement/OutboundSetupIntents.d.ts +97 -0
  406. package/types/V2/MoneyManagement/OutboundSetupIntentsResource.d.ts +330 -0
  407. package/types/V2/MoneyManagement/OutboundTransfers.d.ts +256 -0
  408. package/types/V2/MoneyManagement/OutboundTransfersResource.d.ts +213 -0
  409. package/types/V2/MoneyManagement/PayoutMethods.d.ts +201 -0
  410. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpec.d.ts +93 -0
  411. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecResource.d.ts +41 -0
  412. package/types/V2/MoneyManagement/PayoutMethodsResource.d.ts +113 -0
  413. package/types/V2/MoneyManagement/ReceivedCredits.d.ts +307 -0
  414. package/types/V2/MoneyManagement/ReceivedCreditsResource.d.ts +78 -0
  415. package/types/V2/MoneyManagement/ReceivedDebits.d.ts +186 -0
  416. package/types/V2/MoneyManagement/ReceivedDebitsResource.d.ts +48 -0
  417. package/types/V2/MoneyManagement/RecipientVerifications.d.ts +112 -0
  418. package/types/V2/MoneyManagement/RecipientVerificationsResource.d.ts +77 -0
  419. package/types/V2/MoneyManagement/TransactionEntries.d.ts +162 -0
  420. package/types/V2/MoneyManagement/TransactionEntriesResource.d.ts +82 -0
  421. package/types/V2/MoneyManagement/Transactions.d.ts +177 -0
  422. package/types/V2/MoneyManagement/TransactionsResource.d.ts +83 -0
  423. package/types/V2/Payments/OffSessionPayments.d.ts +326 -0
  424. package/types/V2/Payments/OffSessionPaymentsResource.d.ts +401 -0
  425. package/types/V2/Tax/AutomaticRules.d.ts +53 -0
  426. package/types/V2/Tax/AutomaticRulesResource.d.ts +102 -0
  427. package/types/V2/TestHelpers/FinancialAddressesResource.d.ts +73 -0
  428. package/types/V2/TestHelpers/MoneyManagementResource.d.ts +49 -0
  429. package/types/WebhookEndpointsResource.d.ts +74 -0
  430. package/types/Webhooks.d.ts +2 -0
  431. package/types/apiVersion.d.ts +1 -2
  432. package/types/index.d.ts +222 -0
  433. package/types/lib.d.ts +10 -0
@@ -3,6 +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
+
6
11
  /**
7
12
  * Controls how prorations and invoices for subscriptions are calculated and orchestrated.
8
13
  */
@@ -13,6 +18,11 @@ declare module 'stripe' {
13
18
  */
14
19
  customer?: string;
15
20
 
21
+ /**
22
+ * The identifier of the account to create the subscription schedule for.
23
+ */
24
+ customer_account?: string;
25
+
16
26
  /**
17
27
  * Object representing the subscription schedule's default settings.
18
28
  */
@@ -43,6 +53,11 @@ declare module 'stripe' {
43
53
  */
44
54
  phases?: Array<SubscriptionScheduleCreateParams.Phase>;
45
55
 
56
+ /**
57
+ * If specified, the invoicing for the given billing cycle iterations will be processed now.
58
+ */
59
+ prebilling?: SubscriptionScheduleCreateParams.Prebilling;
60
+
46
61
  /**
47
62
  * 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
63
  */
@@ -50,6 +65,8 @@ declare module 'stripe' {
50
65
  }
51
66
 
52
67
  namespace SubscriptionScheduleCreateParams {
68
+ type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
69
+
53
70
  interface BillingMode {
54
71
  /**
55
72
  * Configure behavior for flexible billing mode.
@@ -314,6 +331,11 @@ declare module 'stripe' {
314
331
  */
315
332
  on_behalf_of?: string;
316
333
 
334
+ /**
335
+ * 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).
336
+ */
337
+ pause_collection?: Phase.PauseCollection;
338
+
317
339
  /**
318
340
  * 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
341
  */
@@ -329,10 +351,20 @@ declare module 'stripe' {
329
351
  */
330
352
  trial?: boolean;
331
353
 
354
+ /**
355
+ * Specify trial behavior when crossing phase boundaries
356
+ */
357
+ trial_continuation?: Phase.TrialContinuation;
358
+
332
359
  /**
333
360
  * 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
361
  */
335
362
  trial_end?: number;
363
+
364
+ /**
365
+ * Settings related to subscription trials.
366
+ */
367
+ trial_settings?: Phase.TrialSettings;
336
368
  }
337
369
 
338
370
  namespace Phase {
@@ -385,12 +417,56 @@ declare module 'stripe' {
385
417
  */
386
418
  discount?: string;
387
419
 
420
+ /**
421
+ * Details to determine how long the discount should be applied for.
422
+ */
423
+ discount_end?: Discount.DiscountEnd;
424
+
388
425
  /**
389
426
  * ID of the promotion code to create a new discount for.
390
427
  */
391
428
  promotion_code?: string;
392
429
  }
393
430
 
431
+ namespace Discount {
432
+ interface DiscountEnd {
433
+ /**
434
+ * Time span for the redeemed discount.
435
+ */
436
+ duration?: DiscountEnd.Duration;
437
+
438
+ /**
439
+ * A precise Unix timestamp for the discount to end. Must be in the future.
440
+ */
441
+ timestamp?: number;
442
+
443
+ /**
444
+ * The type of calculation made to determine when the discount ends.
445
+ */
446
+ type: DiscountEnd.Type;
447
+ }
448
+
449
+ namespace DiscountEnd {
450
+ interface Duration {
451
+ /**
452
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
453
+ */
454
+ interval: Duration.Interval;
455
+
456
+ /**
457
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
458
+ */
459
+ interval_count: number;
460
+ }
461
+
462
+ namespace Duration {
463
+ type Interval = 'day' | 'month' | 'week' | 'year';
464
+ }
465
+
466
+ type Type = 'duration' | 'timestamp';
467
+ }
468
+ }
469
+
394
470
  interface Period {
395
471
  /**
396
472
  * End of the invoice item period.
@@ -526,12 +602,56 @@ declare module 'stripe' {
526
602
  */
527
603
  discount?: string;
528
604
 
605
+ /**
606
+ * Details to determine how long the discount should be applied for.
607
+ */
608
+ discount_end?: Discount.DiscountEnd;
609
+
529
610
  /**
530
611
  * ID of the promotion code to create a new discount for.
531
612
  */
532
613
  promotion_code?: string;
533
614
  }
534
615
 
616
+ namespace Discount {
617
+ interface DiscountEnd {
618
+ /**
619
+ * Time span for the redeemed discount.
620
+ */
621
+ duration?: DiscountEnd.Duration;
622
+
623
+ /**
624
+ * A precise Unix timestamp for the discount to end. Must be in the future.
625
+ */
626
+ timestamp?: number;
627
+
628
+ /**
629
+ * The type of calculation made to determine when the discount ends.
630
+ */
631
+ type: DiscountEnd.Type;
632
+ }
633
+
634
+ namespace DiscountEnd {
635
+ interface Duration {
636
+ /**
637
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
638
+ */
639
+ interval: Duration.Interval;
640
+
641
+ /**
642
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
643
+ */
644
+ interval_count: number;
645
+ }
646
+
647
+ namespace Duration {
648
+ type Interval = 'day' | 'month' | 'week' | 'year';
649
+ }
650
+
651
+ type Type = 'duration' | 'timestamp';
652
+ }
653
+ }
654
+
535
655
  interface Duration {
536
656
  /**
537
657
  * Specifies phase duration. Either `day`, `week`, `month` or `year`.
@@ -623,6 +743,11 @@ declare module 'stripe' {
623
743
  * 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
744
  */
625
745
  tax_rates?: Stripe.Emptyable<Array<string>>;
746
+
747
+ /**
748
+ * Options that configure the trial on the subscription item.
749
+ */
750
+ trial?: Item.Trial;
626
751
  }
627
752
 
628
753
  namespace Item {
@@ -644,12 +769,56 @@ declare module 'stripe' {
644
769
  */
645
770
  discount?: string;
646
771
 
772
+ /**
773
+ * Details to determine how long the discount should be applied for.
774
+ */
775
+ discount_end?: Discount.DiscountEnd;
776
+
647
777
  /**
648
778
  * ID of the promotion code to create a new discount for.
649
779
  */
650
780
  promotion_code?: string;
651
781
  }
652
782
 
783
+ namespace Discount {
784
+ interface DiscountEnd {
785
+ /**
786
+ * Time span for the redeemed discount.
787
+ */
788
+ duration?: DiscountEnd.Duration;
789
+
790
+ /**
791
+ * A precise Unix timestamp for the discount to end. Must be in the future.
792
+ */
793
+ timestamp?: number;
794
+
795
+ /**
796
+ * The type of calculation made to determine when the discount ends.
797
+ */
798
+ type: DiscountEnd.Type;
799
+ }
800
+
801
+ namespace DiscountEnd {
802
+ interface Duration {
803
+ /**
804
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
805
+ */
806
+ interval: Duration.Interval;
807
+
808
+ /**
809
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
810
+ */
811
+ interval_count: number;
812
+ }
813
+
814
+ namespace Duration {
815
+ type Interval = 'day' | 'month' | 'week' | 'year';
816
+ }
817
+
818
+ type Type = 'duration' | 'timestamp';
819
+ }
820
+ }
821
+
653
822
  interface PriceData {
654
823
  /**
655
824
  * 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 +870,33 @@ declare module 'stripe' {
701
870
 
702
871
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
703
872
  }
873
+
874
+ interface Trial {
875
+ /**
876
+ * 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.
877
+ */
878
+ converts_to?: Array<string>;
879
+
880
+ /**
881
+ * Determines the type of trial for this item.
882
+ */
883
+ type: Trial.Type;
884
+ }
885
+
886
+ namespace Trial {
887
+ type Type = 'free' | 'paid';
888
+ }
889
+ }
890
+
891
+ interface PauseCollection {
892
+ /**
893
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
894
+ */
895
+ behavior: PauseCollection.Behavior;
896
+ }
897
+
898
+ namespace PauseCollection {
899
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
704
900
  }
705
901
 
706
902
  type ProrationBehavior =
@@ -719,6 +915,44 @@ declare module 'stripe' {
719
915
  */
720
916
  destination: string;
721
917
  }
918
+
919
+ type TrialContinuation = 'continue' | 'none';
920
+
921
+ interface TrialSettings {
922
+ /**
923
+ * Defines how the subscription should behave when a trial ends.
924
+ */
925
+ end_behavior?: TrialSettings.EndBehavior;
926
+ }
927
+
928
+ namespace TrialSettings {
929
+ interface EndBehavior {
930
+ /**
931
+ * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
932
+ */
933
+ prorate_up_front?: EndBehavior.ProrateUpFront;
934
+ }
935
+
936
+ namespace EndBehavior {
937
+ type ProrateUpFront = 'defer' | 'include';
938
+ }
939
+ }
940
+ }
941
+
942
+ interface Prebilling {
943
+ /**
944
+ * This is used to determine the number of billing cycles to prebill.
945
+ */
946
+ iterations: number;
947
+
948
+ /**
949
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
950
+ */
951
+ update_behavior?: Prebilling.UpdateBehavior;
952
+ }
953
+
954
+ namespace Prebilling {
955
+ type UpdateBehavior = 'prebill' | 'reset';
722
956
  }
723
957
  }
724
958
 
@@ -730,6 +964,11 @@ declare module 'stripe' {
730
964
  }
731
965
 
732
966
  interface SubscriptionScheduleUpdateParams {
967
+ /**
968
+ * 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.
969
+ */
970
+ billing_behavior?: SubscriptionScheduleUpdateParams.BillingBehavior;
971
+
733
972
  /**
734
973
  * Object representing the subscription schedule's default settings.
735
974
  */
@@ -755,6 +994,11 @@ declare module 'stripe' {
755
994
  */
756
995
  phases?: Array<SubscriptionScheduleUpdateParams.Phase>;
757
996
 
997
+ /**
998
+ * If specified, the invoicing for the given billing cycle iterations will be processed now.
999
+ */
1000
+ prebilling?: SubscriptionScheduleUpdateParams.Prebilling;
1001
+
758
1002
  /**
759
1003
  * 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
1004
  */
@@ -762,6 +1006,8 @@ declare module 'stripe' {
762
1006
  }
763
1007
 
764
1008
  namespace SubscriptionScheduleUpdateParams {
1009
+ type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
1010
+
765
1011
  interface DefaultSettings {
766
1012
  /**
767
1013
  * 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).
@@ -999,6 +1245,11 @@ declare module 'stripe' {
999
1245
  */
1000
1246
  on_behalf_of?: string;
1001
1247
 
1248
+ /**
1249
+ * 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).
1250
+ */
1251
+ pause_collection?: Phase.PauseCollection;
1252
+
1002
1253
  /**
1003
1254
  * 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
1255
  */
@@ -1019,10 +1270,20 @@ declare module 'stripe' {
1019
1270
  */
1020
1271
  trial?: boolean;
1021
1272
 
1273
+ /**
1274
+ * Specify trial behavior when crossing phase boundaries
1275
+ */
1276
+ trial_continuation?: Phase.TrialContinuation;
1277
+
1022
1278
  /**
1023
1279
  * 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
1280
  */
1025
1281
  trial_end?: number | 'now';
1282
+
1283
+ /**
1284
+ * Settings related to subscription trials.
1285
+ */
1286
+ trial_settings?: Phase.TrialSettings;
1026
1287
  }
1027
1288
 
1028
1289
  namespace Phase {
@@ -1075,12 +1336,56 @@ declare module 'stripe' {
1075
1336
  */
1076
1337
  discount?: string;
1077
1338
 
1339
+ /**
1340
+ * Details to determine how long the discount should be applied for.
1341
+ */
1342
+ discount_end?: Discount.DiscountEnd;
1343
+
1078
1344
  /**
1079
1345
  * ID of the promotion code to create a new discount for.
1080
1346
  */
1081
1347
  promotion_code?: string;
1082
1348
  }
1083
1349
 
1350
+ namespace Discount {
1351
+ interface DiscountEnd {
1352
+ /**
1353
+ * Time span for the redeemed discount.
1354
+ */
1355
+ duration?: DiscountEnd.Duration;
1356
+
1357
+ /**
1358
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1359
+ */
1360
+ timestamp?: number;
1361
+
1362
+ /**
1363
+ * The type of calculation made to determine when the discount ends.
1364
+ */
1365
+ type: DiscountEnd.Type;
1366
+ }
1367
+
1368
+ namespace DiscountEnd {
1369
+ interface Duration {
1370
+ /**
1371
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1372
+ */
1373
+ interval: Duration.Interval;
1374
+
1375
+ /**
1376
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1377
+ */
1378
+ interval_count: number;
1379
+ }
1380
+
1381
+ namespace Duration {
1382
+ type Interval = 'day' | 'month' | 'week' | 'year';
1383
+ }
1384
+
1385
+ type Type = 'duration' | 'timestamp';
1386
+ }
1387
+ }
1388
+
1084
1389
  interface Period {
1085
1390
  /**
1086
1391
  * End of the invoice item period.
@@ -1216,12 +1521,56 @@ declare module 'stripe' {
1216
1521
  */
1217
1522
  discount?: string;
1218
1523
 
1524
+ /**
1525
+ * Details to determine how long the discount should be applied for.
1526
+ */
1527
+ discount_end?: Discount.DiscountEnd;
1528
+
1219
1529
  /**
1220
1530
  * ID of the promotion code to create a new discount for.
1221
1531
  */
1222
1532
  promotion_code?: string;
1223
1533
  }
1224
1534
 
1535
+ namespace Discount {
1536
+ interface DiscountEnd {
1537
+ /**
1538
+ * Time span for the redeemed discount.
1539
+ */
1540
+ duration?: DiscountEnd.Duration;
1541
+
1542
+ /**
1543
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1544
+ */
1545
+ timestamp?: number;
1546
+
1547
+ /**
1548
+ * The type of calculation made to determine when the discount ends.
1549
+ */
1550
+ type: DiscountEnd.Type;
1551
+ }
1552
+
1553
+ namespace DiscountEnd {
1554
+ interface Duration {
1555
+ /**
1556
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1557
+ */
1558
+ interval: Duration.Interval;
1559
+
1560
+ /**
1561
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1562
+ */
1563
+ interval_count: number;
1564
+ }
1565
+
1566
+ namespace Duration {
1567
+ type Interval = 'day' | 'month' | 'week' | 'year';
1568
+ }
1569
+
1570
+ type Type = 'duration' | 'timestamp';
1571
+ }
1572
+ }
1573
+
1225
1574
  interface Duration {
1226
1575
  /**
1227
1576
  * Specifies phase duration. Either `day`, `week`, `month` or `year`.
@@ -1313,6 +1662,11 @@ declare module 'stripe' {
1313
1662
  * 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
1663
  */
1315
1664
  tax_rates?: Stripe.Emptyable<Array<string>>;
1665
+
1666
+ /**
1667
+ * Options that configure the trial on the subscription item.
1668
+ */
1669
+ trial?: Item.Trial;
1316
1670
  }
1317
1671
 
1318
1672
  namespace Item {
@@ -1334,12 +1688,56 @@ declare module 'stripe' {
1334
1688
  */
1335
1689
  discount?: string;
1336
1690
 
1691
+ /**
1692
+ * Details to determine how long the discount should be applied for.
1693
+ */
1694
+ discount_end?: Discount.DiscountEnd;
1695
+
1337
1696
  /**
1338
1697
  * ID of the promotion code to create a new discount for.
1339
1698
  */
1340
1699
  promotion_code?: string;
1341
1700
  }
1342
1701
 
1702
+ namespace Discount {
1703
+ interface DiscountEnd {
1704
+ /**
1705
+ * Time span for the redeemed discount.
1706
+ */
1707
+ duration?: DiscountEnd.Duration;
1708
+
1709
+ /**
1710
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1711
+ */
1712
+ timestamp?: number;
1713
+
1714
+ /**
1715
+ * The type of calculation made to determine when the discount ends.
1716
+ */
1717
+ type: DiscountEnd.Type;
1718
+ }
1719
+
1720
+ namespace DiscountEnd {
1721
+ interface Duration {
1722
+ /**
1723
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1724
+ */
1725
+ interval: Duration.Interval;
1726
+
1727
+ /**
1728
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1729
+ */
1730
+ interval_count: number;
1731
+ }
1732
+
1733
+ namespace Duration {
1734
+ type Interval = 'day' | 'month' | 'week' | 'year';
1735
+ }
1736
+
1737
+ type Type = 'duration' | 'timestamp';
1738
+ }
1739
+ }
1740
+
1343
1741
  interface PriceData {
1344
1742
  /**
1345
1743
  * 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 +1789,33 @@ declare module 'stripe' {
1391
1789
 
1392
1790
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
1393
1791
  }
1792
+
1793
+ interface Trial {
1794
+ /**
1795
+ * 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.
1796
+ */
1797
+ converts_to?: Array<string>;
1798
+
1799
+ /**
1800
+ * Determines the type of trial for this item.
1801
+ */
1802
+ type: Trial.Type;
1803
+ }
1804
+
1805
+ namespace Trial {
1806
+ type Type = 'free' | 'paid';
1807
+ }
1808
+ }
1809
+
1810
+ interface PauseCollection {
1811
+ /**
1812
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1813
+ */
1814
+ behavior: PauseCollection.Behavior;
1815
+ }
1816
+
1817
+ namespace PauseCollection {
1818
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
1394
1819
  }
1395
1820
 
1396
1821
  type ProrationBehavior =
@@ -1409,6 +1834,44 @@ declare module 'stripe' {
1409
1834
  */
1410
1835
  destination: string;
1411
1836
  }
1837
+
1838
+ type TrialContinuation = 'continue' | 'none';
1839
+
1840
+ interface TrialSettings {
1841
+ /**
1842
+ * Defines how the subscription should behave when a trial ends.
1843
+ */
1844
+ end_behavior?: TrialSettings.EndBehavior;
1845
+ }
1846
+
1847
+ namespace TrialSettings {
1848
+ interface EndBehavior {
1849
+ /**
1850
+ * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1851
+ */
1852
+ prorate_up_front?: EndBehavior.ProrateUpFront;
1853
+ }
1854
+
1855
+ namespace EndBehavior {
1856
+ type ProrateUpFront = 'defer' | 'include';
1857
+ }
1858
+ }
1859
+ }
1860
+
1861
+ interface Prebilling {
1862
+ /**
1863
+ * This is used to determine the number of billing cycles to prebill.
1864
+ */
1865
+ iterations: number;
1866
+
1867
+ /**
1868
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1869
+ */
1870
+ update_behavior?: Prebilling.UpdateBehavior;
1871
+ }
1872
+
1873
+ namespace Prebilling {
1874
+ type UpdateBehavior = 'prebill' | 'reset';
1412
1875
  }
1413
1876
 
1414
1877
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
@@ -1435,6 +1898,11 @@ declare module 'stripe' {
1435
1898
  */
1436
1899
  customer?: string;
1437
1900
 
1901
+ /**
1902
+ * Only return subscription schedules for the given account.
1903
+ */
1904
+ customer_account?: string;
1905
+
1438
1906
  /**
1439
1907
  * Specifies which fields in the response should be expanded.
1440
1908
  */
@@ -1451,21 +1919,768 @@ declare module 'stripe' {
1451
1919
  scheduled?: boolean;
1452
1920
  }
1453
1921
 
1454
- interface SubscriptionScheduleCancelParams {
1922
+ interface SubscriptionScheduleAmendParams {
1923
+ /**
1924
+ * Changes to apply to the phases of the subscription schedule, in the order provided.
1925
+ */
1926
+ amendments?: Array<SubscriptionScheduleAmendParams.Amendment>;
1927
+
1455
1928
  /**
1456
1929
  * Specifies which fields in the response should be expanded.
1457
1930
  */
1458
1931
  expand?: Array<string>;
1459
1932
 
1460
1933
  /**
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`.
1934
+ * Provide any time periods to bill in advance.
1462
1935
  */
1463
- invoice_now?: boolean;
1936
+ prebilling?: Stripe.Emptyable<
1937
+ Array<SubscriptionScheduleAmendParams.Prebilling>
1938
+ >;
1464
1939
 
1465
1940
  /**
1466
- * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`.
1941
+ * In cases where the amendment changes the currently active phase,
1942
+ * specifies if and how to prorate at the time of the request.
1467
1943
  */
1468
- prorate?: boolean;
1944
+ proration_behavior?: SubscriptionScheduleAmendParams.ProrationBehavior;
1945
+
1946
+ /**
1947
+ * Changes to apply to the subscription schedule.
1948
+ */
1949
+ schedule_settings?: SubscriptionScheduleAmendParams.ScheduleSettings;
1950
+ }
1951
+
1952
+ namespace SubscriptionScheduleAmendParams {
1953
+ interface Amendment {
1954
+ /**
1955
+ * 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.
1956
+ */
1957
+ amendment_end?: Amendment.AmendmentEnd;
1958
+
1959
+ /**
1960
+ * Details to identify the earliest timestamp where the proposed change should take effect.
1961
+ */
1962
+ amendment_start: Amendment.AmendmentStart;
1963
+
1964
+ /**
1965
+ * 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.
1966
+ */
1967
+ billing_cycle_anchor?: Amendment.BillingCycleAnchor;
1968
+
1969
+ /**
1970
+ * Changes to the coupons being redeemed or discounts being applied during the amendment time span.
1971
+ */
1972
+ discount_actions?: Array<Amendment.DiscountAction>;
1973
+
1974
+ /**
1975
+ * Changes to the subscription items during the amendment time span.
1976
+ */
1977
+ item_actions?: Array<Amendment.ItemAction>;
1978
+
1979
+ /**
1980
+ * Instructions for how to modify phase metadata
1981
+ */
1982
+ metadata_actions?: Array<Amendment.MetadataAction>;
1983
+
1984
+ /**
1985
+ * 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`.
1986
+ */
1987
+ proration_behavior?: Amendment.ProrationBehavior;
1988
+
1989
+ /**
1990
+ * Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
1991
+ */
1992
+ set_pause_collection?: Amendment.SetPauseCollection;
1993
+
1994
+ /**
1995
+ * Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
1996
+ */
1997
+ set_schedule_end?: Amendment.SetScheduleEnd;
1998
+
1999
+ /**
2000
+ * Settings related to subscription trials.
2001
+ */
2002
+ trial_settings?: Amendment.TrialSettings;
2003
+ }
2004
+
2005
+ namespace Amendment {
2006
+ interface AmendmentEnd {
2007
+ /**
2008
+ * Use the `end` time of a given discount.
2009
+ */
2010
+ discount_end?: AmendmentEnd.DiscountEnd;
2011
+
2012
+ /**
2013
+ * Time span for the amendment starting from the `amendment_start`.
2014
+ */
2015
+ duration?: AmendmentEnd.Duration;
2016
+
2017
+ /**
2018
+ * A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
2019
+ */
2020
+ timestamp?: number;
2021
+
2022
+ /**
2023
+ * Select one of three ways to pass the `amendment_end`.
2024
+ */
2025
+ type: AmendmentEnd.Type;
2026
+ }
2027
+
2028
+ namespace AmendmentEnd {
2029
+ interface DiscountEnd {
2030
+ /**
2031
+ * The ID of a specific discount.
2032
+ */
2033
+ discount: string;
2034
+ }
2035
+
2036
+ interface Duration {
2037
+ /**
2038
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2039
+ */
2040
+ interval: Duration.Interval;
2041
+
2042
+ /**
2043
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2044
+ */
2045
+ interval_count: number;
2046
+ }
2047
+
2048
+ namespace Duration {
2049
+ type Interval = 'day' | 'month' | 'week' | 'year';
2050
+ }
2051
+
2052
+ type Type =
2053
+ | 'discount_end'
2054
+ | 'duration'
2055
+ | 'schedule_end'
2056
+ | 'timestamp'
2057
+ | 'trial_end'
2058
+ | 'trial_start'
2059
+ | 'upcoming_invoice';
2060
+ }
2061
+
2062
+ interface AmendmentStart {
2063
+ /**
2064
+ * Details of another amendment in the same array, immediately after which this amendment should begin.
2065
+ */
2066
+ amendment_end?: AmendmentStart.AmendmentEnd;
2067
+
2068
+ /**
2069
+ * Use the `end` time of a given discount.
2070
+ */
2071
+ discount_end?: AmendmentStart.DiscountEnd;
2072
+
2073
+ /**
2074
+ * A precise Unix timestamp for the amendment to start.
2075
+ */
2076
+ timestamp?: number;
2077
+
2078
+ /**
2079
+ * Select one of three ways to pass the `amendment_start`.
2080
+ */
2081
+ type: AmendmentStart.Type;
2082
+ }
2083
+
2084
+ namespace AmendmentStart {
2085
+ interface AmendmentEnd {
2086
+ /**
2087
+ * 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.
2088
+ */
2089
+ index: number;
2090
+ }
2091
+
2092
+ interface DiscountEnd {
2093
+ /**
2094
+ * The ID of a specific discount.
2095
+ */
2096
+ discount: string;
2097
+ }
2098
+
2099
+ type Type =
2100
+ | 'amendment_end'
2101
+ | 'discount_end'
2102
+ | 'now'
2103
+ | 'schedule_end'
2104
+ | 'timestamp'
2105
+ | 'trial_end'
2106
+ | 'trial_start'
2107
+ | 'upcoming_invoice';
2108
+ }
2109
+
2110
+ type BillingCycleAnchor = 'amendment_start' | 'automatic';
2111
+
2112
+ interface DiscountAction {
2113
+ /**
2114
+ * Details of the discount to add.
2115
+ */
2116
+ add?: DiscountAction.Add;
2117
+
2118
+ /**
2119
+ * Details of the discount to remove.
2120
+ */
2121
+ remove?: DiscountAction.Remove;
2122
+
2123
+ /**
2124
+ * Details of the discount to replace the existing discounts with.
2125
+ */
2126
+ set?: DiscountAction.Set;
2127
+
2128
+ /**
2129
+ * Determines the type of discount action.
2130
+ */
2131
+ type: DiscountAction.Type;
2132
+ }
2133
+
2134
+ namespace DiscountAction {
2135
+ interface Add {
2136
+ /**
2137
+ * The coupon code to redeem.
2138
+ */
2139
+ coupon?: string;
2140
+
2141
+ /**
2142
+ * An ID of an existing discount for a coupon that was already redeemed.
2143
+ */
2144
+ discount?: string;
2145
+
2146
+ /**
2147
+ * Details to determine how long the discount should be applied for.
2148
+ */
2149
+ discount_end?: Add.DiscountEnd;
2150
+
2151
+ /**
2152
+ * 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.
2153
+ */
2154
+ index?: number;
2155
+
2156
+ /**
2157
+ * The promotion code to redeem.
2158
+ */
2159
+ promotion_code?: string;
2160
+ }
2161
+
2162
+ namespace Add {
2163
+ interface DiscountEnd {
2164
+ /**
2165
+ * The type of calculation made to determine when the discount ends.
2166
+ */
2167
+ type: 'amendment_end';
2168
+ }
2169
+ }
2170
+
2171
+ interface Remove {
2172
+ /**
2173
+ * The coupon code to remove from the `discounts` array.
2174
+ */
2175
+ coupon?: string;
2176
+
2177
+ /**
2178
+ * The ID of a discount to remove from the `discounts` array.
2179
+ */
2180
+ discount?: string;
2181
+
2182
+ /**
2183
+ * The ID of a promotion code to remove from the `discounts` array.
2184
+ */
2185
+ promotion_code?: string;
2186
+ }
2187
+
2188
+ interface Set {
2189
+ /**
2190
+ * The coupon code to replace the `discounts` array with.
2191
+ */
2192
+ coupon?: string;
2193
+
2194
+ /**
2195
+ * An ID of an existing discount to replace the `discounts` array with.
2196
+ */
2197
+ discount?: string;
2198
+
2199
+ /**
2200
+ * An ID of an existing promotion code to replace the `discounts` array with.
2201
+ */
2202
+ promotion_code?: string;
2203
+ }
2204
+
2205
+ type Type = 'add' | 'remove' | 'set';
2206
+ }
2207
+
2208
+ interface ItemAction {
2209
+ /**
2210
+ * 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.
2211
+ */
2212
+ add?: ItemAction.Add;
2213
+
2214
+ /**
2215
+ * Details of the subscription item to remove.
2216
+ */
2217
+ remove?: ItemAction.Remove;
2218
+
2219
+ /**
2220
+ * 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.
2221
+ */
2222
+ set?: ItemAction.Set;
2223
+
2224
+ /**
2225
+ * Determines the type of item action.
2226
+ */
2227
+ type: ItemAction.Type;
2228
+ }
2229
+
2230
+ namespace ItemAction {
2231
+ interface Add {
2232
+ /**
2233
+ * The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
2234
+ */
2235
+ discounts?: Array<Add.Discount>;
2236
+
2237
+ /**
2238
+ * 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`.
2239
+ */
2240
+ metadata?: Stripe.MetadataParam;
2241
+
2242
+ /**
2243
+ * The ID of the price object.
2244
+ */
2245
+ price: string;
2246
+
2247
+ /**
2248
+ * Quantity for this item.
2249
+ */
2250
+ quantity?: number;
2251
+
2252
+ /**
2253
+ * 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`.
2254
+ */
2255
+ tax_rates?: Array<string>;
2256
+
2257
+ /**
2258
+ * Options that configure the trial on the subscription item.
2259
+ */
2260
+ trial?: Add.Trial;
2261
+ }
2262
+
2263
+ namespace Add {
2264
+ interface Discount {
2265
+ /**
2266
+ * ID of the coupon to create a new discount for.
2267
+ */
2268
+ coupon?: string;
2269
+
2270
+ /**
2271
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
2272
+ */
2273
+ discount?: string;
2274
+
2275
+ /**
2276
+ * Details to determine how long the discount should be applied for.
2277
+ */
2278
+ discount_end?: Discount.DiscountEnd;
2279
+
2280
+ /**
2281
+ * ID of the promotion code to create a new discount for.
2282
+ */
2283
+ promotion_code?: string;
2284
+ }
2285
+
2286
+ namespace Discount {
2287
+ interface DiscountEnd {
2288
+ /**
2289
+ * Time span for the redeemed discount.
2290
+ */
2291
+ duration?: DiscountEnd.Duration;
2292
+
2293
+ /**
2294
+ * A precise Unix timestamp for the discount to end. Must be in the future.
2295
+ */
2296
+ timestamp?: number;
2297
+
2298
+ /**
2299
+ * The type of calculation made to determine when the discount ends.
2300
+ */
2301
+ type: DiscountEnd.Type;
2302
+ }
2303
+
2304
+ namespace DiscountEnd {
2305
+ interface Duration {
2306
+ /**
2307
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2308
+ */
2309
+ interval: Duration.Interval;
2310
+
2311
+ /**
2312
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2313
+ */
2314
+ interval_count: number;
2315
+ }
2316
+
2317
+ namespace Duration {
2318
+ type Interval = 'day' | 'month' | 'week' | 'year';
2319
+ }
2320
+
2321
+ type Type = 'duration' | 'timestamp';
2322
+ }
2323
+ }
2324
+
2325
+ interface Trial {
2326
+ /**
2327
+ * 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.
2328
+ */
2329
+ converts_to?: Array<string>;
2330
+
2331
+ /**
2332
+ * Determines the type of trial for this item.
2333
+ */
2334
+ type: Trial.Type;
2335
+ }
2336
+
2337
+ namespace Trial {
2338
+ type Type = 'free' | 'paid';
2339
+ }
2340
+ }
2341
+
2342
+ interface Remove {
2343
+ /**
2344
+ * ID of a price to remove.
2345
+ */
2346
+ price: string;
2347
+ }
2348
+
2349
+ interface Set {
2350
+ /**
2351
+ * 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`.
2352
+ */
2353
+ discounts?: Array<Set.Discount>;
2354
+
2355
+ /**
2356
+ * 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`.
2357
+ */
2358
+ metadata?: Stripe.MetadataParam;
2359
+
2360
+ /**
2361
+ * The ID of the price object.
2362
+ */
2363
+ price: string;
2364
+
2365
+ /**
2366
+ * 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`.
2367
+ */
2368
+ quantity?: number;
2369
+
2370
+ /**
2371
+ * 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`.
2372
+ */
2373
+ tax_rates?: Array<string>;
2374
+
2375
+ /**
2376
+ * 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`.
2377
+ */
2378
+ trial?: Set.Trial;
2379
+ }
2380
+
2381
+ namespace Set {
2382
+ interface Discount {
2383
+ /**
2384
+ * ID of the coupon to create a new discount for.
2385
+ */
2386
+ coupon?: string;
2387
+
2388
+ /**
2389
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
2390
+ */
2391
+ discount?: string;
2392
+
2393
+ /**
2394
+ * Details to determine how long the discount should be applied for.
2395
+ */
2396
+ discount_end?: Discount.DiscountEnd;
2397
+
2398
+ /**
2399
+ * ID of the promotion code to create a new discount for.
2400
+ */
2401
+ promotion_code?: string;
2402
+ }
2403
+
2404
+ namespace Discount {
2405
+ interface DiscountEnd {
2406
+ /**
2407
+ * Time span for the redeemed discount.
2408
+ */
2409
+ duration?: DiscountEnd.Duration;
2410
+
2411
+ /**
2412
+ * A precise Unix timestamp for the discount to end. Must be in the future.
2413
+ */
2414
+ timestamp?: number;
2415
+
2416
+ /**
2417
+ * The type of calculation made to determine when the discount ends.
2418
+ */
2419
+ type: DiscountEnd.Type;
2420
+ }
2421
+
2422
+ namespace DiscountEnd {
2423
+ interface Duration {
2424
+ /**
2425
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2426
+ */
2427
+ interval: Duration.Interval;
2428
+
2429
+ /**
2430
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2431
+ */
2432
+ interval_count: number;
2433
+ }
2434
+
2435
+ namespace Duration {
2436
+ type Interval = 'day' | 'month' | 'week' | 'year';
2437
+ }
2438
+
2439
+ type Type = 'duration' | 'timestamp';
2440
+ }
2441
+ }
2442
+
2443
+ interface Trial {
2444
+ /**
2445
+ * 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.
2446
+ */
2447
+ converts_to?: Array<string>;
2448
+
2449
+ /**
2450
+ * Determines the type of trial for this item.
2451
+ */
2452
+ type: Trial.Type;
2453
+ }
2454
+
2455
+ namespace Trial {
2456
+ type Type = 'free' | 'paid';
2457
+ }
2458
+ }
2459
+
2460
+ type Type = 'add' | 'remove' | 'set';
2461
+ }
2462
+
2463
+ interface MetadataAction {
2464
+ /**
2465
+ * Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
2466
+ */
2467
+ add?: {
2468
+ [key: string]: string;
2469
+ };
2470
+
2471
+ /**
2472
+ * Keys to remove from schedule phase metadata.
2473
+ */
2474
+ remove?: Array<string>;
2475
+
2476
+ /**
2477
+ * Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
2478
+ */
2479
+ set?: Stripe.Emptyable<{
2480
+ [key: string]: string;
2481
+ }>;
2482
+
2483
+ /**
2484
+ * Select one of three ways to update phase-level `metadata` on subscription schedules.
2485
+ */
2486
+ type: MetadataAction.Type;
2487
+ }
2488
+
2489
+ namespace MetadataAction {
2490
+ type Type = 'add' | 'remove' | 'set';
2491
+ }
2492
+
2493
+ type ProrationBehavior =
2494
+ | 'always_invoice'
2495
+ | 'create_prorations'
2496
+ | 'none';
2497
+
2498
+ interface SetPauseCollection {
2499
+ /**
2500
+ * Details of the pause_collection behavior to apply to the amendment.
2501
+ */
2502
+ set?: SetPauseCollection.Set;
2503
+
2504
+ /**
2505
+ * Determines the type of the pause_collection amendment.
2506
+ */
2507
+ type: SetPauseCollection.Type;
2508
+ }
2509
+
2510
+ namespace SetPauseCollection {
2511
+ interface Set {
2512
+ /**
2513
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2514
+ */
2515
+ behavior: Set.Behavior;
2516
+ }
2517
+
2518
+ namespace Set {
2519
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
2520
+ }
2521
+
2522
+ type Type = 'remove' | 'set';
2523
+ }
2524
+
2525
+ type SetScheduleEnd = 'amendment_end' | 'amendment_start';
2526
+
2527
+ interface TrialSettings {
2528
+ /**
2529
+ * Defines how the subscription should behave when a trial ends.
2530
+ */
2531
+ end_behavior?: TrialSettings.EndBehavior;
2532
+ }
2533
+
2534
+ namespace TrialSettings {
2535
+ interface EndBehavior {
2536
+ /**
2537
+ * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2538
+ */
2539
+ prorate_up_front?: EndBehavior.ProrateUpFront;
2540
+ }
2541
+
2542
+ namespace EndBehavior {
2543
+ type ProrateUpFront = 'defer' | 'include';
2544
+ }
2545
+ }
2546
+ }
2547
+
2548
+ interface Prebilling {
2549
+ /**
2550
+ * The beginning of the prebilled time period. The default value is `now`.
2551
+ */
2552
+ bill_from?: Prebilling.BillFrom;
2553
+
2554
+ /**
2555
+ * The end of the prebilled time period.
2556
+ */
2557
+ bill_until?: Prebilling.BillUntil;
2558
+
2559
+ /**
2560
+ * When the prebilling invoice should be created. The default value is `now`.
2561
+ */
2562
+ invoice_at?: 'now';
2563
+
2564
+ /**
2565
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2566
+ */
2567
+ update_behavior?: Prebilling.UpdateBehavior;
2568
+ }
2569
+
2570
+ namespace Prebilling {
2571
+ interface BillFrom {
2572
+ /**
2573
+ * Start the prebilled period when a specified amendment begins.
2574
+ */
2575
+ amendment_start?: BillFrom.AmendmentStart;
2576
+
2577
+ /**
2578
+ * Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2579
+ */
2580
+ timestamp?: number;
2581
+
2582
+ /**
2583
+ * Select one of several ways to pass the `bill_from` value.
2584
+ */
2585
+ type: BillFrom.Type;
2586
+ }
2587
+
2588
+ namespace BillFrom {
2589
+ interface AmendmentStart {
2590
+ /**
2591
+ * 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.
2592
+ */
2593
+ index: number;
2594
+ }
2595
+
2596
+ type Type = 'amendment_start' | 'now' | 'timestamp';
2597
+ }
2598
+
2599
+ interface BillUntil {
2600
+ /**
2601
+ * End the prebilled period when a specified amendment ends.
2602
+ */
2603
+ amendment_end?: BillUntil.AmendmentEnd;
2604
+
2605
+ /**
2606
+ * Time span for prebilling, starting from `bill_from`.
2607
+ */
2608
+ duration?: BillUntil.Duration;
2609
+
2610
+ /**
2611
+ * End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2612
+ */
2613
+ timestamp?: number;
2614
+
2615
+ /**
2616
+ * Select one of several ways to pass the `bill_until` value.
2617
+ */
2618
+ type: BillUntil.Type;
2619
+ }
2620
+
2621
+ namespace BillUntil {
2622
+ interface AmendmentEnd {
2623
+ /**
2624
+ * 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.
2625
+ */
2626
+ index: number;
2627
+ }
2628
+
2629
+ interface Duration {
2630
+ /**
2631
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2632
+ */
2633
+ interval: Duration.Interval;
2634
+
2635
+ /**
2636
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2637
+ */
2638
+ interval_count: number;
2639
+ }
2640
+
2641
+ namespace Duration {
2642
+ type Interval = 'day' | 'month' | 'week' | 'year';
2643
+ }
2644
+
2645
+ type Type =
2646
+ | 'amendment_end'
2647
+ | 'duration'
2648
+ | 'schedule_end'
2649
+ | 'timestamp';
2650
+ }
2651
+
2652
+ type UpdateBehavior = 'prebill' | 'reset';
2653
+ }
2654
+
2655
+ type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
2656
+
2657
+ interface ScheduleSettings {
2658
+ /**
2659
+ * Behavior of the subscription schedule and underlying subscription when it ends.
2660
+ */
2661
+ end_behavior?: ScheduleSettings.EndBehavior;
2662
+ }
2663
+
2664
+ namespace ScheduleSettings {
2665
+ type EndBehavior = 'cancel' | 'release';
2666
+ }
2667
+ }
2668
+
2669
+ interface SubscriptionScheduleCancelParams {
2670
+ /**
2671
+ * Specifies which fields in the response should be expanded.
2672
+ */
2673
+ expand?: Array<string>;
2674
+
2675
+ /**
2676
+ * 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`.
2677
+ */
2678
+ invoice_now?: boolean;
2679
+
2680
+ /**
2681
+ * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`.
2682
+ */
2683
+ prorate?: boolean;
1469
2684
  }
1470
2685
 
1471
2686
  interface SubscriptionScheduleReleaseParams {
@@ -1525,6 +2740,19 @@ declare module 'stripe' {
1525
2740
  options?: RequestOptions
1526
2741
  ): ApiListPromise<Stripe.SubscriptionSchedule>;
1527
2742
 
2743
+ /**
2744
+ * Amends an existing subscription schedule.
2745
+ */
2746
+ amend(
2747
+ id: string,
2748
+ params?: SubscriptionScheduleAmendParams,
2749
+ options?: RequestOptions
2750
+ ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2751
+ amend(
2752
+ id: string,
2753
+ options?: RequestOptions
2754
+ ): Promise<Stripe.Response<Stripe.SubscriptionSchedule>>;
2755
+
1528
2756
  /**
1529
2757
  * 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.
1530
2758
  */