stripe 18.3.0 → 18.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/CHANGELOG.md +1279 -48
  2. package/README.md +1 -0
  3. package/VERSION +1 -1
  4. package/cjs/Error.js +91 -1
  5. package/cjs/apiVersion.js +2 -3
  6. package/cjs/resources/AccountNotices.js +21 -0
  7. package/cjs/resources/BalanceSettings.js +10 -0
  8. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  9. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  10. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  11. package/cjs/resources/ExternalAccounts.js +23 -0
  12. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  13. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  14. package/cjs/resources/FxQuotes.js +15 -0
  15. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  16. package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
  17. package/cjs/resources/Issuing/FraudLiabilityDebits.js +17 -0
  18. package/cjs/resources/Margins.js +22 -0
  19. package/cjs/resources/Orders.js +24 -0
  20. package/cjs/resources/{InvoicePayments.js → PaymentAttemptRecords.js} +4 -4
  21. package/cjs/resources/PaymentIntents.js +13 -0
  22. package/cjs/resources/PaymentRecords.js +29 -0
  23. package/cjs/resources/Privacy/RedactionJobs.js +42 -0
  24. package/cjs/resources/Quotes.js +32 -0
  25. package/cjs/resources/SubscriptionSchedules.js +4 -0
  26. package/cjs/resources/Tax/Associations.js +9 -0
  27. package/cjs/resources/Tax/Forms.js +20 -0
  28. package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
  29. package/cjs/resources/V2/Core/AccountLinks.js +9 -0
  30. package/cjs/resources/V2/Core/Accounts/Persons.js +29 -0
  31. package/cjs/resources/V2/Core/Accounts.js +25 -0
  32. package/cjs/resources/V2/Core/Vault/GbBankAccounts.js +28 -0
  33. package/cjs/resources/V2/Core/Vault/UsBankAccounts.js +24 -0
  34. package/cjs/resources/V2/MoneyManagement/Adjustments.js +17 -0
  35. package/cjs/resources/V2/MoneyManagement/FinancialAccounts.js +17 -0
  36. package/cjs/resources/V2/MoneyManagement/FinancialAddresses.js +21 -0
  37. package/cjs/resources/V2/MoneyManagement/InboundTransfers.js +21 -0
  38. package/cjs/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +16 -0
  39. package/cjs/resources/V2/MoneyManagement/OutboundPayments.js +25 -0
  40. package/cjs/resources/V2/MoneyManagement/OutboundSetupIntents.js +29 -0
  41. package/cjs/resources/V2/MoneyManagement/OutboundTransfers.js +25 -0
  42. package/cjs/resources/V2/MoneyManagement/PayoutMethods.js +25 -0
  43. package/cjs/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +12 -0
  44. package/cjs/resources/V2/MoneyManagement/ReceivedCredits.js +17 -0
  45. package/cjs/resources/V2/MoneyManagement/ReceivedDebits.js +17 -0
  46. package/cjs/resources/V2/MoneyManagement/TransactionEntries.js +17 -0
  47. package/cjs/resources/V2/MoneyManagement/Transactions.js +17 -0
  48. package/cjs/resources/V2/Payments/OffSessionPayments.js +25 -0
  49. package/cjs/resources/V2/TestHelpers/FinancialAddresses.js +16 -0
  50. package/cjs/resources.js +98 -10
  51. package/cjs/stripe.core.js +1 -1
  52. package/esm/Error.js +79 -0
  53. package/esm/apiVersion.js +1 -2
  54. package/esm/resources/AccountNotices.js +18 -0
  55. package/esm/resources/BalanceSettings.js +7 -0
  56. package/esm/resources/Capital/FinancingOffers.js +18 -0
  57. package/esm/resources/Capital/FinancingSummary.js +9 -0
  58. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  59. package/esm/resources/ExternalAccounts.js +20 -0
  60. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  61. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  62. package/esm/resources/FxQuotes.js +12 -0
  63. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  64. package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
  65. package/esm/resources/Issuing/FraudLiabilityDebits.js +14 -0
  66. package/esm/resources/Margins.js +19 -0
  67. package/esm/resources/Orders.js +21 -0
  68. package/esm/resources/{InvoicePayments.js → PaymentAttemptRecords.js} +3 -3
  69. package/esm/resources/PaymentIntents.js +13 -0
  70. package/esm/resources/PaymentRecords.js +26 -0
  71. package/esm/resources/Privacy/RedactionJobs.js +39 -0
  72. package/esm/resources/Quotes.js +32 -0
  73. package/esm/resources/SubscriptionSchedules.js +4 -0
  74. package/esm/resources/Tax/Associations.js +6 -0
  75. package/esm/resources/Tax/Forms.js +17 -0
  76. package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
  77. package/esm/resources/V2/Core/AccountLinks.js +6 -0
  78. package/esm/resources/V2/Core/Accounts/Persons.js +26 -0
  79. package/esm/resources/V2/Core/Accounts.js +22 -0
  80. package/esm/resources/V2/Core/Vault/GbBankAccounts.js +25 -0
  81. package/esm/resources/V2/Core/Vault/UsBankAccounts.js +21 -0
  82. package/esm/resources/V2/MoneyManagement/Adjustments.js +14 -0
  83. package/esm/resources/V2/MoneyManagement/FinancialAccounts.js +14 -0
  84. package/esm/resources/V2/MoneyManagement/FinancialAddresses.js +18 -0
  85. package/esm/resources/V2/MoneyManagement/InboundTransfers.js +18 -0
  86. package/esm/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +13 -0
  87. package/esm/resources/V2/MoneyManagement/OutboundPayments.js +22 -0
  88. package/esm/resources/V2/MoneyManagement/OutboundSetupIntents.js +26 -0
  89. package/esm/resources/V2/MoneyManagement/OutboundTransfers.js +22 -0
  90. package/esm/resources/V2/MoneyManagement/PayoutMethods.js +22 -0
  91. package/esm/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +9 -0
  92. package/esm/resources/V2/MoneyManagement/ReceivedCredits.js +14 -0
  93. package/esm/resources/V2/MoneyManagement/ReceivedDebits.js +14 -0
  94. package/esm/resources/V2/MoneyManagement/TransactionEntries.js +14 -0
  95. package/esm/resources/V2/MoneyManagement/Transactions.js +14 -0
  96. package/esm/resources/V2/Payments/OffSessionPayments.js +22 -0
  97. package/esm/resources/V2/TestHelpers/FinancialAddresses.js +13 -0
  98. package/esm/resources.js +82 -1
  99. package/esm/stripe.core.js +1 -1
  100. package/package.json +1 -1
  101. package/types/AccountLinksResource.d.ts +5 -1
  102. package/types/AccountNotices.d.ts +113 -0
  103. package/types/AccountNoticesResource.d.ts +98 -0
  104. package/types/AccountSessions.d.ts +45 -0
  105. package/types/AccountSessionsResource.d.ts +264 -0
  106. package/types/Accounts.d.ts +212 -1
  107. package/types/AccountsResource.d.ts +544 -0
  108. package/types/BalanceSettings.d.ts +89 -0
  109. package/types/BalanceSettingsResource.d.ts +108 -0
  110. package/types/Billing/CreditBalanceSummary.d.ts +5 -0
  111. package/types/Billing/CreditBalanceSummaryResource.d.ts +8 -3
  112. package/types/Billing/CreditBalanceTransactionsResource.d.ts +12 -4
  113. package/types/Billing/CreditGrants.d.ts +5 -0
  114. package/types/Billing/CreditGrantsResource.d.ts +11 -1
  115. package/types/BillingPortal/Sessions.d.ts +5 -0
  116. package/types/BillingPortal/SessionsResource.d.ts +12 -4
  117. package/types/Capital/FinancingOffers.d.ts +188 -0
  118. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  119. package/types/Capital/FinancingSummary.d.ts +106 -0
  120. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  121. package/types/Capital/FinancingTransactions.d.ts +135 -0
  122. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  123. package/types/Cards.d.ts +5 -0
  124. package/types/CashBalances.d.ts +5 -0
  125. package/types/Charges.d.ts +166 -0
  126. package/types/ChargesResource.d.ts +1406 -0
  127. package/types/Checkout/Sessions.d.ts +314 -1
  128. package/types/Checkout/SessionsResource.d.ts +333 -1
  129. package/types/ConfirmationTokens.d.ts +125 -0
  130. package/types/Coupons.d.ts +33 -0
  131. package/types/CouponsResource.d.ts +21 -0
  132. package/types/CreditNoteLineItems.d.ts +17 -0
  133. package/types/CreditNotes.d.ts +5 -0
  134. package/types/CreditNotesResource.d.ts +5 -0
  135. package/types/CustomerBalanceTransactions.d.ts +2 -0
  136. package/types/CustomerCashBalanceTransactions.d.ts +2 -0
  137. package/types/CustomerSessions.d.ts +5 -0
  138. package/types/CustomerSessionsResource.d.ts +6 -1
  139. package/types/Customers.d.ts +2 -0
  140. package/types/CustomersResource.d.ts +8 -0
  141. package/types/Discounts.d.ts +10 -0
  142. package/types/Disputes.d.ts +7 -0
  143. package/types/Errors.d.ts +69 -2
  144. package/types/EventTypes.d.ts +664 -0
  145. package/types/Events.d.ts +97 -0
  146. package/types/ExternalAccountsResource.d.ts +304 -0
  147. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  148. package/types/FinancialConnections/Accounts.d.ts +36 -1
  149. package/types/FinancialConnections/AccountsResource.d.ts +40 -3
  150. package/types/FinancialConnections/Institutions.d.ts +98 -0
  151. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  152. package/types/FinancialConnections/Sessions.d.ts +51 -1
  153. package/types/FinancialConnections/SessionsResource.d.ts +43 -1
  154. package/types/FxQuotes.d.ts +153 -0
  155. package/types/FxQuotesResource.d.ts +130 -0
  156. package/types/Identity/VerificationSessions.d.ts +5 -0
  157. package/types/Identity/VerificationSessionsResource.d.ts +7 -0
  158. package/types/InvoiceItems.d.ts +10 -0
  159. package/types/InvoiceItemsResource.d.ts +117 -6
  160. package/types/InvoiceLineItems.d.ts +45 -1
  161. package/types/InvoicePayments.d.ts +5 -0
  162. package/types/Invoices.d.ts +133 -3
  163. package/types/InvoicesResource.d.ts +1447 -16
  164. package/types/Issuing/CardholdersResource.d.ts +2 -1
  165. package/types/Issuing/CreditUnderwritingRecords.d.ts +451 -0
  166. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1032 -0
  167. package/types/Issuing/DisputeSettlementDetails.d.ts +85 -0
  168. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
  169. package/types/Issuing/FraudLiabilityDebits.d.ts +52 -0
  170. package/types/Issuing/FraudLiabilityDebitsResource.d.ts +52 -0
  171. package/types/Issuing/Settlements.d.ts +113 -0
  172. package/types/Issuing/Transactions.d.ts +5 -0
  173. package/types/Issuing/TransactionsResource.d.ts +5 -0
  174. package/types/LineItems.d.ts +49 -0
  175. package/types/Mandates.d.ts +77 -0
  176. package/types/Margins.d.ts +56 -0
  177. package/types/MarginsResource.d.ts +114 -0
  178. package/types/Orders.d.ts +1163 -0
  179. package/types/OrdersResource.d.ts +3139 -0
  180. package/types/PaymentAttemptRecords.d.ts +2161 -0
  181. package/types/PaymentAttemptRecordsResource.d.ts +47 -0
  182. package/types/PaymentIntentAmountDetailsLineItems.d.ts +116 -0
  183. package/types/PaymentIntents.d.ts +768 -2
  184. package/types/PaymentIntentsResource.d.ts +8808 -4088
  185. package/types/PaymentLinks.d.ts +6 -0
  186. package/types/PaymentLinksResource.d.ts +12 -0
  187. package/types/PaymentMethodConfigurations.d.ts +180 -0
  188. package/types/PaymentMethodConfigurationsResource.d.ts +250 -0
  189. package/types/PaymentMethods.d.ts +125 -0
  190. package/types/PaymentMethodsResource.d.ts +167 -2
  191. package/types/PaymentRecords.d.ts +2154 -0
  192. package/types/PaymentRecordsResource.d.ts +455 -0
  193. package/types/Payouts.d.ts +5 -0
  194. package/types/PayoutsResource.d.ts +5 -0
  195. package/types/Prices.d.ts +22 -0
  196. package/types/PricesResource.d.ts +22 -0
  197. package/types/Privacy/RedactionJobValidationErrors.d.ts +60 -0
  198. package/types/Privacy/RedactionJobs.d.ts +111 -0
  199. package/types/Privacy/RedactionJobsResource.d.ts +230 -0
  200. package/types/PromotionCodes.d.ts +5 -0
  201. package/types/PromotionCodesResource.d.ts +10 -0
  202. package/types/QuoteLines.d.ts +634 -0
  203. package/types/QuotePreviewInvoices.d.ts +1696 -0
  204. package/types/QuotePreviewSubscriptionSchedules.d.ts +845 -0
  205. package/types/Quotes.d.ts +594 -1
  206. package/types/QuotesResource.d.ts +2577 -232
  207. package/types/Refunds.d.ts +14 -0
  208. package/types/SetupAttempts.d.ts +47 -1
  209. package/types/SetupIntents.d.ts +118 -2
  210. package/types/SetupIntentsResource.d.ts +730 -3
  211. package/types/Sources.d.ts +29 -0
  212. package/types/SubscriptionItems.d.ts +21 -0
  213. package/types/SubscriptionItemsResource.d.ts +109 -0
  214. package/types/SubscriptionSchedules.d.ts +205 -0
  215. package/types/SubscriptionSchedulesResource.d.ts +1237 -9
  216. package/types/Subscriptions.d.ts +97 -1
  217. package/types/SubscriptionsResource.d.ts +396 -10
  218. package/types/Tax/Associations.d.ts +82 -0
  219. package/types/Tax/AssociationsResource.d.ts +29 -0
  220. package/types/Tax/Forms.d.ts +220 -0
  221. package/types/Tax/FormsResource.d.ts +107 -0
  222. package/types/TaxIds.d.ts +10 -0
  223. package/types/TaxIdsResource.d.ts +10 -0
  224. package/types/Terminal/ReaderCollectedData.d.ts +51 -0
  225. package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
  226. package/types/Terminal/Readers.d.ts +20 -0
  227. package/types/TestHelpers/ConfirmationTokensResource.d.ts +126 -0
  228. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  229. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  230. package/types/Transfers.d.ts +5 -0
  231. package/types/TransfersResource.d.ts +5 -0
  232. package/types/Treasury/FinancialAccountFeatures.d.ts +7 -0
  233. package/types/Treasury/FinancialAccounts.d.ts +5 -0
  234. package/types/Treasury/FinancialAccountsResource.d.ts +37 -0
  235. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  236. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  237. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  238. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  239. package/types/V2/Core/AccountLinks.d.ts +106 -0
  240. package/types/V2/Core/AccountLinksResource.d.ts +90 -0
  241. package/types/V2/Core/Accounts/PersonsResource.d.ts +3780 -0
  242. package/types/V2/Core/Accounts.d.ts +8248 -0
  243. package/types/V2/Core/AccountsResource.d.ts +10257 -0
  244. package/types/V2/Core/Persons.d.ts +1872 -0
  245. package/types/V2/Core/Vault/GbBankAccounts.d.ts +160 -0
  246. package/types/V2/Core/Vault/GbBankAccountsResource.d.ts +172 -0
  247. package/types/V2/Core/Vault/UsBankAccounts.d.ts +70 -0
  248. package/types/V2/Core/Vault/UsBankAccountsResource.d.ts +123 -0
  249. package/types/V2/EventTypes.d.ts +907 -5
  250. package/types/V2/FinancialAddressCreditSimulations.d.ts +27 -0
  251. package/types/V2/FinancialAddressGeneratedMicrodeposits.d.ts +32 -0
  252. package/types/V2/MoneyManagement/Adjustments.d.ts +110 -0
  253. package/types/V2/MoneyManagement/AdjustmentsResource.d.ts +83 -0
  254. package/types/V2/MoneyManagement/FinancialAccounts.d.ts +550 -0
  255. package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +52 -0
  256. package/types/V2/MoneyManagement/FinancialAddresses.d.ts +314 -0
  257. package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +289 -0
  258. package/types/V2/MoneyManagement/InboundTransfers.d.ts +206 -0
  259. package/types/V2/MoneyManagement/InboundTransfersResource.d.ts +144 -0
  260. package/types/V2/MoneyManagement/OutboundPaymentQuotes.d.ts +168 -0
  261. package/types/V2/MoneyManagement/OutboundPaymentQuotesResource.d.ts +115 -0
  262. package/types/V2/MoneyManagement/OutboundPayments.d.ts +278 -0
  263. package/types/V2/MoneyManagement/OutboundPaymentsResource.d.ts +242 -0
  264. package/types/V2/MoneyManagement/OutboundSetupIntents.d.ts +97 -0
  265. package/types/V2/MoneyManagement/OutboundSetupIntentsResource.d.ts +296 -0
  266. package/types/V2/MoneyManagement/OutboundTransfers.d.ts +251 -0
  267. package/types/V2/MoneyManagement/OutboundTransfersResource.d.ts +208 -0
  268. package/types/V2/MoneyManagement/PayoutMethods.d.ts +151 -0
  269. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecResource.d.ts +41 -0
  270. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecs.d.ts +87 -0
  271. package/types/V2/MoneyManagement/PayoutMethodsResource.d.ts +113 -0
  272. package/types/V2/MoneyManagement/ReceivedCredits.d.ts +262 -0
  273. package/types/V2/MoneyManagement/ReceivedCreditsResource.d.ts +78 -0
  274. package/types/V2/MoneyManagement/ReceivedDebits.d.ts +176 -0
  275. package/types/V2/MoneyManagement/ReceivedDebitsResource.d.ts +48 -0
  276. package/types/V2/MoneyManagement/TransactionEntries.d.ts +155 -0
  277. package/types/V2/MoneyManagement/TransactionEntriesResource.d.ts +82 -0
  278. package/types/V2/MoneyManagement/Transactions.d.ts +170 -0
  279. package/types/V2/MoneyManagement/TransactionsResource.d.ts +83 -0
  280. package/types/V2/Payments/OffSessionPayments.d.ts +162 -0
  281. package/types/V2/Payments/OffSessionPaymentsResource.d.ts +159 -0
  282. package/types/V2/TestHelpers/FinancialAddressesResource.d.ts +66 -0
  283. package/types/WebhookEndpointsResource.d.ts +78 -0
  284. package/types/index.d.ts +138 -2
  285. package/types/lib.d.ts +11 -1
  286. package/types/test/typescriptTest.ts +3 -3
  287. package/types/InvoicePaymentsResource.d.ts +0 -74
@@ -8,6 +8,11 @@ declare module 'stripe' {
8
8
  */
9
9
  account_tax_ids?: Stripe.Emptyable<Array<string>>;
10
10
 
11
+ /**
12
+ * List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
13
+ */
14
+ amounts_due?: Stripe.Emptyable<Array<InvoiceCreateParams.AmountsDue>>;
15
+
11
16
  /**
12
17
  * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
13
18
  */
@@ -48,11 +53,21 @@ declare module 'stripe' {
48
53
  */
49
54
  customer?: string;
50
55
 
56
+ /**
57
+ * The ID of the account who will be billed.
58
+ */
59
+ customer_account?: string;
60
+
51
61
  /**
52
62
  * The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
53
63
  */
54
64
  days_until_due?: number;
55
65
 
66
+ /**
67
+ * The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
68
+ */
69
+ default_margins?: Array<string>;
70
+
56
71
  /**
57
72
  * ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
58
73
  */
@@ -165,6 +180,28 @@ declare module 'stripe' {
165
180
  }
166
181
 
167
182
  namespace InvoiceCreateParams {
183
+ interface AmountsDue {
184
+ /**
185
+ * The amount in cents (or local equivalent).
186
+ */
187
+ amount: number;
188
+
189
+ /**
190
+ * Number of days from when invoice is finalized until the payment is due.
191
+ */
192
+ days_until_due?: number;
193
+
194
+ /**
195
+ * An arbitrary string attached to the object. Often useful for displaying to users.
196
+ */
197
+ description: string;
198
+
199
+ /**
200
+ * Date on which a payment plan's payment is due.
201
+ */
202
+ due_date?: number;
203
+ }
204
+
168
205
  interface AutomaticTax {
169
206
  /**
170
207
  * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
@@ -220,12 +257,56 @@ declare module 'stripe' {
220
257
  */
221
258
  discount?: string;
222
259
 
260
+ /**
261
+ * Details to determine how long the discount should be applied for.
262
+ */
263
+ discount_end?: Discount.DiscountEnd;
264
+
223
265
  /**
224
266
  * ID of the promotion code to create a new discount for.
225
267
  */
226
268
  promotion_code?: string;
227
269
  }
228
270
 
271
+ namespace Discount {
272
+ interface DiscountEnd {
273
+ /**
274
+ * Time span for the redeemed discount.
275
+ */
276
+ duration?: DiscountEnd.Duration;
277
+
278
+ /**
279
+ * A precise Unix timestamp for the discount to end. Must be in the future.
280
+ */
281
+ timestamp?: number;
282
+
283
+ /**
284
+ * The type of calculation made to determine when the discount ends.
285
+ */
286
+ type: DiscountEnd.Type;
287
+ }
288
+
289
+ namespace DiscountEnd {
290
+ interface Duration {
291
+ /**
292
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
293
+ */
294
+ interval: Duration.Interval;
295
+
296
+ /**
297
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
298
+ */
299
+ interval_count: number;
300
+ }
301
+
302
+ namespace Duration {
303
+ type Interval = 'day' | 'month' | 'week' | 'year';
304
+ }
305
+
306
+ type Type = 'duration' | 'timestamp';
307
+ }
308
+ }
309
+
229
310
  interface FromInvoice {
230
311
  /**
231
312
  * The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted
@@ -297,6 +378,13 @@ declare module 'stripe' {
297
378
  PaymentMethodOptions.CustomerBalance
298
379
  >;
299
380
 
381
+ /**
382
+ * If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent.
383
+ */
384
+ id_bank_transfer?: Stripe.Emptyable<
385
+ PaymentMethodOptions.IdBankTransfer
386
+ >;
387
+
300
388
  /**
301
389
  * If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent.
302
390
  */
@@ -444,6 +532,8 @@ declare module 'stripe' {
444
532
  }
445
533
  }
446
534
 
535
+ interface IdBankTransfer {}
536
+
447
537
  interface Konbini {}
448
538
 
449
539
  interface SepaDebit {}
@@ -484,6 +574,11 @@ declare module 'stripe' {
484
574
  * The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
485
575
  */
486
576
  account_subcategories?: Array<Filters.AccountSubcategory>;
577
+
578
+ /**
579
+ * ID of the institution to use to filter for selectable accounts.
580
+ */
581
+ institution?: string;
487
582
  }
488
583
 
489
584
  namespace Filters {
@@ -496,7 +591,11 @@ declare module 'stripe' {
496
591
  | 'payment_method'
497
592
  | 'transactions';
498
593
 
499
- type Prefetch = 'balances' | 'ownership' | 'transactions';
594
+ type Prefetch =
595
+ | 'balances'
596
+ | 'inferred_balances'
597
+ | 'ownership'
598
+ | 'transactions';
500
599
  }
501
600
 
502
601
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -516,11 +615,13 @@ declare module 'stripe' {
516
615
  | 'card'
517
616
  | 'cashapp'
518
617
  | 'crypto'
618
+ | 'custom'
519
619
  | 'customer_balance'
520
620
  | 'eps'
521
621
  | 'fpx'
522
622
  | 'giropay'
523
623
  | 'grabpay'
624
+ | 'id_bank_transfer'
524
625
  | 'ideal'
525
626
  | 'jp_credit_transfer'
526
627
  | 'kakao_pay'
@@ -540,6 +641,7 @@ declare module 'stripe' {
540
641
  | 'sepa_credit_transfer'
541
642
  | 'sepa_debit'
542
643
  | 'sofort'
644
+ | 'stripe_balance'
543
645
  | 'swish'
544
646
  | 'us_bank_account'
545
647
  | 'wechat_pay';
@@ -767,6 +869,11 @@ declare module 'stripe' {
767
869
  */
768
870
  account_tax_ids?: Stripe.Emptyable<Array<string>>;
769
871
 
872
+ /**
873
+ * List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
874
+ */
875
+ amounts_due?: Stripe.Emptyable<Array<InvoiceUpdateParams.AmountsDue>>;
876
+
770
877
  /**
771
878
  * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
772
879
  */
@@ -802,6 +909,11 @@ declare module 'stripe' {
802
909
  */
803
910
  days_until_due?: number;
804
911
 
912
+ /**
913
+ * The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
914
+ */
915
+ default_margins?: Stripe.Emptyable<Array<string>>;
916
+
805
917
  /**
806
918
  * ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
807
919
  */
@@ -899,6 +1011,28 @@ declare module 'stripe' {
899
1011
  }
900
1012
 
901
1013
  namespace InvoiceUpdateParams {
1014
+ interface AmountsDue {
1015
+ /**
1016
+ * The amount in cents (or local equivalent).
1017
+ */
1018
+ amount: number;
1019
+
1020
+ /**
1021
+ * Number of days from when invoice is finalized until the payment is due.
1022
+ */
1023
+ days_until_due?: number;
1024
+
1025
+ /**
1026
+ * An arbitrary string attached to the object. Often useful for displaying to users.
1027
+ */
1028
+ description: string;
1029
+
1030
+ /**
1031
+ * Date on which a payment plan's payment is due.
1032
+ */
1033
+ due_date?: number;
1034
+ }
1035
+
902
1036
  interface AutomaticTax {
903
1037
  /**
904
1038
  * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
@@ -954,12 +1088,56 @@ declare module 'stripe' {
954
1088
  */
955
1089
  discount?: string;
956
1090
 
1091
+ /**
1092
+ * Details to determine how long the discount should be applied for.
1093
+ */
1094
+ discount_end?: Discount.DiscountEnd;
1095
+
957
1096
  /**
958
1097
  * ID of the promotion code to create a new discount for.
959
1098
  */
960
1099
  promotion_code?: string;
961
1100
  }
962
1101
 
1102
+ namespace Discount {
1103
+ interface DiscountEnd {
1104
+ /**
1105
+ * Time span for the redeemed discount.
1106
+ */
1107
+ duration?: DiscountEnd.Duration;
1108
+
1109
+ /**
1110
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1111
+ */
1112
+ timestamp?: number;
1113
+
1114
+ /**
1115
+ * The type of calculation made to determine when the discount ends.
1116
+ */
1117
+ type: DiscountEnd.Type;
1118
+ }
1119
+
1120
+ namespace DiscountEnd {
1121
+ interface Duration {
1122
+ /**
1123
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1124
+ */
1125
+ interval: Duration.Interval;
1126
+
1127
+ /**
1128
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1129
+ */
1130
+ interval_count: number;
1131
+ }
1132
+
1133
+ namespace Duration {
1134
+ type Interval = 'day' | 'month' | 'week' | 'year';
1135
+ }
1136
+
1137
+ type Type = 'duration' | 'timestamp';
1138
+ }
1139
+ }
1140
+
963
1141
  interface Issuer {
964
1142
  /**
965
1143
  * The connected account being referenced when `type` is `account`.
@@ -1019,6 +1197,13 @@ declare module 'stripe' {
1019
1197
  PaymentMethodOptions.CustomerBalance
1020
1198
  >;
1021
1199
 
1200
+ /**
1201
+ * If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent.
1202
+ */
1203
+ id_bank_transfer?: Stripe.Emptyable<
1204
+ PaymentMethodOptions.IdBankTransfer
1205
+ >;
1206
+
1022
1207
  /**
1023
1208
  * If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent.
1024
1209
  */
@@ -1166,6 +1351,8 @@ declare module 'stripe' {
1166
1351
  }
1167
1352
  }
1168
1353
 
1354
+ interface IdBankTransfer {}
1355
+
1169
1356
  interface Konbini {}
1170
1357
 
1171
1358
  interface SepaDebit {}
@@ -1206,6 +1393,11 @@ declare module 'stripe' {
1206
1393
  * The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1207
1394
  */
1208
1395
  account_subcategories?: Array<Filters.AccountSubcategory>;
1396
+
1397
+ /**
1398
+ * ID of the institution to use to filter for selectable accounts.
1399
+ */
1400
+ institution?: string;
1209
1401
  }
1210
1402
 
1211
1403
  namespace Filters {
@@ -1218,7 +1410,11 @@ declare module 'stripe' {
1218
1410
  | 'payment_method'
1219
1411
  | 'transactions';
1220
1412
 
1221
- type Prefetch = 'balances' | 'ownership' | 'transactions';
1413
+ type Prefetch =
1414
+ | 'balances'
1415
+ | 'inferred_balances'
1416
+ | 'ownership'
1417
+ | 'transactions';
1222
1418
  }
1223
1419
 
1224
1420
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -1238,11 +1434,13 @@ declare module 'stripe' {
1238
1434
  | 'card'
1239
1435
  | 'cashapp'
1240
1436
  | 'crypto'
1437
+ | 'custom'
1241
1438
  | 'customer_balance'
1242
1439
  | 'eps'
1243
1440
  | 'fpx'
1244
1441
  | 'giropay'
1245
1442
  | 'grabpay'
1443
+ | 'id_bank_transfer'
1246
1444
  | 'ideal'
1247
1445
  | 'jp_credit_transfer'
1248
1446
  | 'kakao_pay'
@@ -1262,6 +1460,7 @@ declare module 'stripe' {
1262
1460
  | 'sepa_credit_transfer'
1263
1461
  | 'sepa_debit'
1264
1462
  | 'sofort'
1463
+ | 'stripe_balance'
1265
1464
  | 'swish'
1266
1465
  | 'us_bank_account'
1267
1466
  | 'wechat_pay';
@@ -1490,6 +1689,11 @@ declare module 'stripe' {
1490
1689
  */
1491
1690
  customer?: string;
1492
1691
 
1692
+ /**
1693
+ * Only return invoices for the account specified by this account ID.
1694
+ */
1695
+ customer_account?: string;
1696
+
1493
1697
  due_date?: Stripe.RangeQueryParam | number;
1494
1698
 
1495
1699
  /**
@@ -1562,6 +1766,11 @@ declare module 'stripe' {
1562
1766
  */
1563
1767
  invoice_item?: string;
1564
1768
 
1769
+ /**
1770
+ * The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
1771
+ */
1772
+ margins?: Stripe.Emptyable<Array<string>>;
1773
+
1565
1774
  /**
1566
1775
  * 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`.
1567
1776
  */
@@ -1610,12 +1819,56 @@ declare module 'stripe' {
1610
1819
  */
1611
1820
  discount?: string;
1612
1821
 
1822
+ /**
1823
+ * Details to determine how long the discount should be applied for.
1824
+ */
1825
+ discount_end?: Discount.DiscountEnd;
1826
+
1613
1827
  /**
1614
1828
  * ID of the promotion code to create a new discount for.
1615
1829
  */
1616
1830
  promotion_code?: string;
1617
1831
  }
1618
1832
 
1833
+ namespace Discount {
1834
+ interface DiscountEnd {
1835
+ /**
1836
+ * Time span for the redeemed discount.
1837
+ */
1838
+ duration?: DiscountEnd.Duration;
1839
+
1840
+ /**
1841
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1842
+ */
1843
+ timestamp?: number;
1844
+
1845
+ /**
1846
+ * The type of calculation made to determine when the discount ends.
1847
+ */
1848
+ type: DiscountEnd.Type;
1849
+ }
1850
+
1851
+ namespace DiscountEnd {
1852
+ interface Duration {
1853
+ /**
1854
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1855
+ */
1856
+ interval: Duration.Interval;
1857
+
1858
+ /**
1859
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1860
+ */
1861
+ interval_count: number;
1862
+ }
1863
+
1864
+ namespace Duration {
1865
+ type Interval = 'day' | 'month' | 'week' | 'year';
1866
+ }
1867
+
1868
+ type Type = 'duration' | 'timestamp';
1869
+ }
1870
+ }
1871
+
1619
1872
  interface Period {
1620
1873
  /**
1621
1874
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.
@@ -1817,6 +2070,11 @@ declare module 'stripe' {
1817
2070
  }
1818
2071
 
1819
2072
  interface InvoiceAttachPaymentParams {
2073
+ /**
2074
+ * The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount.
2075
+ */
2076
+ amount_requested?: number;
2077
+
1820
2078
  /**
1821
2079
  * Specifies which fields in the response should be expanded.
1822
2080
  */
@@ -1826,6 +2084,50 @@ declare module 'stripe' {
1826
2084
  * The ID of the PaymentIntent to attach to the invoice.
1827
2085
  */
1828
2086
  payment_intent?: string;
2087
+
2088
+ /**
2089
+ * The ID of the PaymentRecord to attach to the invoice.
2090
+ */
2091
+ payment_record?: string;
2092
+
2093
+ /**
2094
+ * The PaymentRecord data for attaching an out of band payment to the invoice.
2095
+ */
2096
+ payment_record_data?: InvoiceAttachPaymentParams.PaymentRecordData;
2097
+ }
2098
+
2099
+ namespace InvoiceAttachPaymentParams {
2100
+ interface PaymentRecordData {
2101
+ /**
2102
+ * The amount that was paid out of band.
2103
+ */
2104
+ amount: number;
2105
+
2106
+ /**
2107
+ * The currency that was paid out of band.
2108
+ */
2109
+ currency: string;
2110
+
2111
+ /**
2112
+ * 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`.
2113
+ */
2114
+ metadata?: Stripe.Emptyable<Stripe.MetadataParam>;
2115
+
2116
+ /**
2117
+ * The type of money movement for this out of band payment record.
2118
+ */
2119
+ money_movement_type: string;
2120
+
2121
+ /**
2122
+ * The timestamp when this out of band payment was paid.
2123
+ */
2124
+ paid_at?: number;
2125
+
2126
+ /**
2127
+ * The reference for this out of band payment record.
2128
+ */
2129
+ payment_reference?: string;
2130
+ }
1829
2131
  }
1830
2132
 
1831
2133
  interface InvoiceCreatePreviewParams {
@@ -1844,6 +2146,11 @@ declare module 'stripe' {
1844
2146
  */
1845
2147
  customer?: string;
1846
2148
 
2149
+ /**
2150
+ * The identifier of the account whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_account`, `customer_details`, `subscription`, or `schedule` must be set.
2151
+ */
2152
+ customer_account?: string;
2153
+
1847
2154
  /**
1848
2155
  * Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
1849
2156
  */
@@ -2123,12 +2430,56 @@ declare module 'stripe' {
2123
2430
  */
2124
2431
  discount?: string;
2125
2432
 
2433
+ /**
2434
+ * Details to determine how long the discount should be applied for.
2435
+ */
2436
+ discount_end?: Discount.DiscountEnd;
2437
+
2126
2438
  /**
2127
2439
  * ID of the promotion code to create a new discount for.
2128
2440
  */
2129
2441
  promotion_code?: string;
2130
2442
  }
2131
2443
 
2444
+ namespace Discount {
2445
+ interface DiscountEnd {
2446
+ /**
2447
+ * Time span for the redeemed discount.
2448
+ */
2449
+ duration?: DiscountEnd.Duration;
2450
+
2451
+ /**
2452
+ * A precise Unix timestamp for the discount to end. Must be in the future.
2453
+ */
2454
+ timestamp?: number;
2455
+
2456
+ /**
2457
+ * The type of calculation made to determine when the discount ends.
2458
+ */
2459
+ type: DiscountEnd.Type;
2460
+ }
2461
+
2462
+ namespace DiscountEnd {
2463
+ interface Duration {
2464
+ /**
2465
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2466
+ */
2467
+ interval: Duration.Interval;
2468
+
2469
+ /**
2470
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2471
+ */
2472
+ interval_count: number;
2473
+ }
2474
+
2475
+ namespace Duration {
2476
+ type Interval = 'day' | 'month' | 'week' | 'year';
2477
+ }
2478
+
2479
+ type Type = 'duration' | 'timestamp';
2480
+ }
2481
+ }
2482
+
2132
2483
  interface InvoiceItem {
2133
2484
  /**
2134
2485
  * The integer amount in cents (or local equivalent) of previewed invoice item.
@@ -2223,12 +2574,56 @@ declare module 'stripe' {
2223
2574
  */
2224
2575
  discount?: string;
2225
2576
 
2577
+ /**
2578
+ * Details to determine how long the discount should be applied for.
2579
+ */
2580
+ discount_end?: Discount.DiscountEnd;
2581
+
2226
2582
  /**
2227
2583
  * ID of the promotion code to create a new discount for.
2228
2584
  */
2229
2585
  promotion_code?: string;
2230
2586
  }
2231
2587
 
2588
+ namespace Discount {
2589
+ interface DiscountEnd {
2590
+ /**
2591
+ * Time span for the redeemed discount.
2592
+ */
2593
+ duration?: DiscountEnd.Duration;
2594
+
2595
+ /**
2596
+ * A precise Unix timestamp for the discount to end. Must be in the future.
2597
+ */
2598
+ timestamp?: number;
2599
+
2600
+ /**
2601
+ * The type of calculation made to determine when the discount ends.
2602
+ */
2603
+ type: DiscountEnd.Type;
2604
+ }
2605
+
2606
+ namespace DiscountEnd {
2607
+ interface Duration {
2608
+ /**
2609
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2610
+ */
2611
+ interval: Duration.Interval;
2612
+
2613
+ /**
2614
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2615
+ */
2616
+ interval_count: number;
2617
+ }
2618
+
2619
+ namespace Duration {
2620
+ type Interval = 'day' | 'month' | 'week' | 'year';
2621
+ }
2622
+
2623
+ type Type = 'duration' | 'timestamp';
2624
+ }
2625
+ }
2626
+
2232
2627
  interface Period {
2233
2628
  /**
2234
2629
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.
@@ -2294,6 +2689,16 @@ declare module 'stripe' {
2294
2689
  type PreviewMode = 'next' | 'recurring';
2295
2690
 
2296
2691
  interface ScheduleDetails {
2692
+ /**
2693
+ * Changes to apply to the phases of the subscription schedule, in the order provided.
2694
+ */
2695
+ amendments?: Array<ScheduleDetails.Amendment>;
2696
+
2697
+ /**
2698
+ * 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.
2699
+ */
2700
+ billing_behavior?: ScheduleDetails.BillingBehavior;
2701
+
2297
2702
  /**
2298
2703
  * Controls how prorations and invoices for subscriptions are calculated and orchestrated.
2299
2704
  */
@@ -2309,6 +2714,11 @@ declare module 'stripe' {
2309
2714
  */
2310
2715
  phases?: Array<ScheduleDetails.Phase>;
2311
2716
 
2717
+ /**
2718
+ * Provide any time periods to bill in advance.
2719
+ */
2720
+ prebilling?: Stripe.Emptyable<Array<ScheduleDetails.Prebilling>>;
2721
+
2312
2722
  /**
2313
2723
  * In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
2314
2724
  */
@@ -2316,21 +2726,618 @@ declare module 'stripe' {
2316
2726
  }
2317
2727
 
2318
2728
  namespace ScheduleDetails {
2319
- interface BillingMode {
2320
- type: BillingMode.Type;
2321
- }
2322
-
2323
- namespace BillingMode {
2324
- type Type = 'classic' | 'flexible';
2325
- }
2326
-
2327
- type EndBehavior = 'cancel' | 'release';
2328
-
2329
- interface Phase {
2729
+ interface Amendment {
2330
2730
  /**
2331
- * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
2731
+ * 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.
2332
2732
  */
2333
- add_invoice_items?: Array<Phase.AddInvoiceItem>;
2733
+ amendment_end?: Amendment.AmendmentEnd;
2734
+
2735
+ /**
2736
+ * Details to identify the earliest timestamp where the proposed change should take effect.
2737
+ */
2738
+ amendment_start: Amendment.AmendmentStart;
2739
+
2740
+ /**
2741
+ * 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.
2742
+ */
2743
+ billing_cycle_anchor?: Amendment.BillingCycleAnchor;
2744
+
2745
+ /**
2746
+ * Changes to the coupons being redeemed or discounts being applied during the amendment time span.
2747
+ */
2748
+ discount_actions?: Array<Amendment.DiscountAction>;
2749
+
2750
+ /**
2751
+ * Changes to the subscription items during the amendment time span.
2752
+ */
2753
+ item_actions?: Array<Amendment.ItemAction>;
2754
+
2755
+ /**
2756
+ * Instructions for how to modify phase metadata
2757
+ */
2758
+ metadata_actions?: Array<Amendment.MetadataAction>;
2759
+
2760
+ /**
2761
+ * 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`.
2762
+ */
2763
+ proration_behavior?: Amendment.ProrationBehavior;
2764
+
2765
+ /**
2766
+ * Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
2767
+ */
2768
+ set_pause_collection?: Amendment.SetPauseCollection;
2769
+
2770
+ /**
2771
+ * Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
2772
+ */
2773
+ set_schedule_end?: Amendment.SetScheduleEnd;
2774
+
2775
+ /**
2776
+ * Settings related to subscription trials.
2777
+ */
2778
+ trial_settings?: Amendment.TrialSettings;
2779
+ }
2780
+
2781
+ namespace Amendment {
2782
+ interface AmendmentEnd {
2783
+ /**
2784
+ * Use the `end` time of a given discount.
2785
+ */
2786
+ discount_end?: AmendmentEnd.DiscountEnd;
2787
+
2788
+ /**
2789
+ * Time span for the amendment starting from the `amendment_start`.
2790
+ */
2791
+ duration?: AmendmentEnd.Duration;
2792
+
2793
+ /**
2794
+ * A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
2795
+ */
2796
+ timestamp?: number;
2797
+
2798
+ /**
2799
+ * Select one of three ways to pass the `amendment_end`.
2800
+ */
2801
+ type: AmendmentEnd.Type;
2802
+ }
2803
+
2804
+ namespace AmendmentEnd {
2805
+ interface DiscountEnd {
2806
+ /**
2807
+ * The ID of a specific discount.
2808
+ */
2809
+ discount: string;
2810
+ }
2811
+
2812
+ interface Duration {
2813
+ /**
2814
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2815
+ */
2816
+ interval: Duration.Interval;
2817
+
2818
+ /**
2819
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2820
+ */
2821
+ interval_count: number;
2822
+ }
2823
+
2824
+ namespace Duration {
2825
+ type Interval = 'day' | 'month' | 'week' | 'year';
2826
+ }
2827
+
2828
+ type Type =
2829
+ | 'discount_end'
2830
+ | 'duration'
2831
+ | 'schedule_end'
2832
+ | 'timestamp'
2833
+ | 'trial_end'
2834
+ | 'trial_start'
2835
+ | 'upcoming_invoice';
2836
+ }
2837
+
2838
+ interface AmendmentStart {
2839
+ /**
2840
+ * Details of another amendment in the same array, immediately after which this amendment should begin.
2841
+ */
2842
+ amendment_end?: AmendmentStart.AmendmentEnd;
2843
+
2844
+ /**
2845
+ * Use the `end` time of a given discount.
2846
+ */
2847
+ discount_end?: AmendmentStart.DiscountEnd;
2848
+
2849
+ /**
2850
+ * A precise Unix timestamp for the amendment to start.
2851
+ */
2852
+ timestamp?: number;
2853
+
2854
+ /**
2855
+ * Select one of three ways to pass the `amendment_start`.
2856
+ */
2857
+ type: AmendmentStart.Type;
2858
+ }
2859
+
2860
+ namespace AmendmentStart {
2861
+ interface AmendmentEnd {
2862
+ /**
2863
+ * 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.
2864
+ */
2865
+ index: number;
2866
+ }
2867
+
2868
+ interface DiscountEnd {
2869
+ /**
2870
+ * The ID of a specific discount.
2871
+ */
2872
+ discount: string;
2873
+ }
2874
+
2875
+ type Type =
2876
+ | 'amendment_end'
2877
+ | 'discount_end'
2878
+ | 'now'
2879
+ | 'schedule_end'
2880
+ | 'timestamp'
2881
+ | 'trial_end'
2882
+ | 'trial_start'
2883
+ | 'upcoming_invoice';
2884
+ }
2885
+
2886
+ type BillingCycleAnchor = 'amendment_start' | 'automatic';
2887
+
2888
+ interface DiscountAction {
2889
+ /**
2890
+ * Details of the discount to add.
2891
+ */
2892
+ add?: DiscountAction.Add;
2893
+
2894
+ /**
2895
+ * Details of the discount to remove.
2896
+ */
2897
+ remove?: DiscountAction.Remove;
2898
+
2899
+ /**
2900
+ * Details of the discount to replace the existing discounts with.
2901
+ */
2902
+ set?: DiscountAction.Set;
2903
+
2904
+ /**
2905
+ * Determines the type of discount action.
2906
+ */
2907
+ type: DiscountAction.Type;
2908
+ }
2909
+
2910
+ namespace DiscountAction {
2911
+ interface Add {
2912
+ /**
2913
+ * The coupon code to redeem.
2914
+ */
2915
+ coupon?: string;
2916
+
2917
+ /**
2918
+ * An ID of an existing discount for a coupon that was already redeemed.
2919
+ */
2920
+ discount?: string;
2921
+
2922
+ /**
2923
+ * Details to determine how long the discount should be applied for.
2924
+ */
2925
+ discount_end?: Add.DiscountEnd;
2926
+
2927
+ /**
2928
+ * 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.
2929
+ */
2930
+ index?: number;
2931
+
2932
+ /**
2933
+ * The promotion code to redeem.
2934
+ */
2935
+ promotion_code?: string;
2936
+ }
2937
+
2938
+ namespace Add {
2939
+ interface DiscountEnd {
2940
+ /**
2941
+ * The type of calculation made to determine when the discount ends.
2942
+ */
2943
+ type: 'amendment_end';
2944
+ }
2945
+ }
2946
+
2947
+ interface Remove {
2948
+ /**
2949
+ * The coupon code to remove from the `discounts` array.
2950
+ */
2951
+ coupon?: string;
2952
+
2953
+ /**
2954
+ * The ID of a discount to remove from the `discounts` array.
2955
+ */
2956
+ discount?: string;
2957
+
2958
+ /**
2959
+ * The ID of a promotion code to remove from the `discounts` array.
2960
+ */
2961
+ promotion_code?: string;
2962
+ }
2963
+
2964
+ interface Set {
2965
+ /**
2966
+ * The coupon code to replace the `discounts` array with.
2967
+ */
2968
+ coupon?: string;
2969
+
2970
+ /**
2971
+ * An ID of an existing discount to replace the `discounts` array with.
2972
+ */
2973
+ discount?: string;
2974
+
2975
+ /**
2976
+ * An ID of an existing promotion code to replace the `discounts` array with.
2977
+ */
2978
+ promotion_code?: string;
2979
+ }
2980
+
2981
+ type Type = 'add' | 'remove' | 'set';
2982
+ }
2983
+
2984
+ interface ItemAction {
2985
+ /**
2986
+ * 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.
2987
+ */
2988
+ add?: ItemAction.Add;
2989
+
2990
+ /**
2991
+ * Details of the subscription item to remove.
2992
+ */
2993
+ remove?: ItemAction.Remove;
2994
+
2995
+ /**
2996
+ * 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.
2997
+ */
2998
+ set?: ItemAction.Set;
2999
+
3000
+ /**
3001
+ * Determines the type of item action.
3002
+ */
3003
+ type: ItemAction.Type;
3004
+ }
3005
+
3006
+ namespace ItemAction {
3007
+ interface Add {
3008
+ /**
3009
+ * The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
3010
+ */
3011
+ discounts?: Array<Add.Discount>;
3012
+
3013
+ /**
3014
+ * 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`.
3015
+ */
3016
+ metadata?: Stripe.MetadataParam;
3017
+
3018
+ /**
3019
+ * The ID of the price object.
3020
+ */
3021
+ price: string;
3022
+
3023
+ /**
3024
+ * Quantity for this item.
3025
+ */
3026
+ quantity?: number;
3027
+
3028
+ /**
3029
+ * 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`.
3030
+ */
3031
+ tax_rates?: Array<string>;
3032
+
3033
+ /**
3034
+ * Options that configure the trial on the subscription item.
3035
+ */
3036
+ trial?: Add.Trial;
3037
+ }
3038
+
3039
+ namespace Add {
3040
+ interface Discount {
3041
+ /**
3042
+ * ID of the coupon to create a new discount for.
3043
+ */
3044
+ coupon?: string;
3045
+
3046
+ /**
3047
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
3048
+ */
3049
+ discount?: string;
3050
+
3051
+ /**
3052
+ * Details to determine how long the discount should be applied for.
3053
+ */
3054
+ discount_end?: Discount.DiscountEnd;
3055
+
3056
+ /**
3057
+ * ID of the promotion code to create a new discount for.
3058
+ */
3059
+ promotion_code?: string;
3060
+ }
3061
+
3062
+ namespace Discount {
3063
+ interface DiscountEnd {
3064
+ /**
3065
+ * Time span for the redeemed discount.
3066
+ */
3067
+ duration?: DiscountEnd.Duration;
3068
+
3069
+ /**
3070
+ * A precise Unix timestamp for the discount to end. Must be in the future.
3071
+ */
3072
+ timestamp?: number;
3073
+
3074
+ /**
3075
+ * The type of calculation made to determine when the discount ends.
3076
+ */
3077
+ type: DiscountEnd.Type;
3078
+ }
3079
+
3080
+ namespace DiscountEnd {
3081
+ interface Duration {
3082
+ /**
3083
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3084
+ */
3085
+ interval: Duration.Interval;
3086
+
3087
+ /**
3088
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3089
+ */
3090
+ interval_count: number;
3091
+ }
3092
+
3093
+ namespace Duration {
3094
+ type Interval = 'day' | 'month' | 'week' | 'year';
3095
+ }
3096
+
3097
+ type Type = 'duration' | 'timestamp';
3098
+ }
3099
+ }
3100
+
3101
+ interface Trial {
3102
+ /**
3103
+ * 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.
3104
+ */
3105
+ converts_to?: Array<string>;
3106
+
3107
+ /**
3108
+ * Determines the type of trial for this item.
3109
+ */
3110
+ type: Trial.Type;
3111
+ }
3112
+
3113
+ namespace Trial {
3114
+ type Type = 'free' | 'paid';
3115
+ }
3116
+ }
3117
+
3118
+ interface Remove {
3119
+ /**
3120
+ * ID of a price to remove.
3121
+ */
3122
+ price: string;
3123
+ }
3124
+
3125
+ interface Set {
3126
+ /**
3127
+ * 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`.
3128
+ */
3129
+ discounts?: Array<Set.Discount>;
3130
+
3131
+ /**
3132
+ * 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`.
3133
+ */
3134
+ metadata?: Stripe.MetadataParam;
3135
+
3136
+ /**
3137
+ * The ID of the price object.
3138
+ */
3139
+ price: string;
3140
+
3141
+ /**
3142
+ * 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`.
3143
+ */
3144
+ quantity?: number;
3145
+
3146
+ /**
3147
+ * 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`.
3148
+ */
3149
+ tax_rates?: Array<string>;
3150
+
3151
+ /**
3152
+ * 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`.
3153
+ */
3154
+ trial?: Set.Trial;
3155
+ }
3156
+
3157
+ namespace Set {
3158
+ interface Discount {
3159
+ /**
3160
+ * ID of the coupon to create a new discount for.
3161
+ */
3162
+ coupon?: string;
3163
+
3164
+ /**
3165
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
3166
+ */
3167
+ discount?: string;
3168
+
3169
+ /**
3170
+ * Details to determine how long the discount should be applied for.
3171
+ */
3172
+ discount_end?: Discount.DiscountEnd;
3173
+
3174
+ /**
3175
+ * ID of the promotion code to create a new discount for.
3176
+ */
3177
+ promotion_code?: string;
3178
+ }
3179
+
3180
+ namespace Discount {
3181
+ interface DiscountEnd {
3182
+ /**
3183
+ * Time span for the redeemed discount.
3184
+ */
3185
+ duration?: DiscountEnd.Duration;
3186
+
3187
+ /**
3188
+ * A precise Unix timestamp for the discount to end. Must be in the future.
3189
+ */
3190
+ timestamp?: number;
3191
+
3192
+ /**
3193
+ * The type of calculation made to determine when the discount ends.
3194
+ */
3195
+ type: DiscountEnd.Type;
3196
+ }
3197
+
3198
+ namespace DiscountEnd {
3199
+ interface Duration {
3200
+ /**
3201
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3202
+ */
3203
+ interval: Duration.Interval;
3204
+
3205
+ /**
3206
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3207
+ */
3208
+ interval_count: number;
3209
+ }
3210
+
3211
+ namespace Duration {
3212
+ type Interval = 'day' | 'month' | 'week' | 'year';
3213
+ }
3214
+
3215
+ type Type = 'duration' | 'timestamp';
3216
+ }
3217
+ }
3218
+
3219
+ interface Trial {
3220
+ /**
3221
+ * 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.
3222
+ */
3223
+ converts_to?: Array<string>;
3224
+
3225
+ /**
3226
+ * Determines the type of trial for this item.
3227
+ */
3228
+ type: Trial.Type;
3229
+ }
3230
+
3231
+ namespace Trial {
3232
+ type Type = 'free' | 'paid';
3233
+ }
3234
+ }
3235
+
3236
+ type Type = 'add' | 'remove' | 'set';
3237
+ }
3238
+
3239
+ interface MetadataAction {
3240
+ /**
3241
+ * Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
3242
+ */
3243
+ add?: {
3244
+ [key: string]: string;
3245
+ };
3246
+
3247
+ /**
3248
+ * Keys to remove from schedule phase metadata.
3249
+ */
3250
+ remove?: Array<string>;
3251
+
3252
+ /**
3253
+ * Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
3254
+ */
3255
+ set?: Stripe.Emptyable<{
3256
+ [key: string]: string;
3257
+ }>;
3258
+
3259
+ /**
3260
+ * Select one of three ways to update phase-level `metadata` on subscription schedules.
3261
+ */
3262
+ type: MetadataAction.Type;
3263
+ }
3264
+
3265
+ namespace MetadataAction {
3266
+ type Type = 'add' | 'remove' | 'set';
3267
+ }
3268
+
3269
+ type ProrationBehavior =
3270
+ | 'always_invoice'
3271
+ | 'create_prorations'
3272
+ | 'none';
3273
+
3274
+ interface SetPauseCollection {
3275
+ /**
3276
+ * Details of the pause_collection behavior to apply to the amendment.
3277
+ */
3278
+ set?: SetPauseCollection.Set;
3279
+
3280
+ /**
3281
+ * Determines the type of the pause_collection amendment.
3282
+ */
3283
+ type: SetPauseCollection.Type;
3284
+ }
3285
+
3286
+ namespace SetPauseCollection {
3287
+ interface Set {
3288
+ /**
3289
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3290
+ */
3291
+ behavior: Set.Behavior;
3292
+ }
3293
+
3294
+ namespace Set {
3295
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
3296
+ }
3297
+
3298
+ type Type = 'remove' | 'set';
3299
+ }
3300
+
3301
+ type SetScheduleEnd = 'amendment_end' | 'amendment_start';
3302
+
3303
+ interface TrialSettings {
3304
+ /**
3305
+ * Defines how the subscription should behave when a trial ends.
3306
+ */
3307
+ end_behavior?: TrialSettings.EndBehavior;
3308
+ }
3309
+
3310
+ namespace TrialSettings {
3311
+ interface EndBehavior {
3312
+ /**
3313
+ * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3314
+ */
3315
+ prorate_up_front?: EndBehavior.ProrateUpFront;
3316
+ }
3317
+
3318
+ namespace EndBehavior {
3319
+ type ProrateUpFront = 'defer' | 'include';
3320
+ }
3321
+ }
3322
+ }
3323
+
3324
+ type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
3325
+
3326
+ interface BillingMode {
3327
+ type: BillingMode.Type;
3328
+ }
3329
+
3330
+ namespace BillingMode {
3331
+ type Type = 'classic' | 'flexible';
3332
+ }
3333
+
3334
+ type EndBehavior = 'cancel' | 'release';
3335
+
3336
+ interface Phase {
3337
+ /**
3338
+ * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
3339
+ */
3340
+ add_invoice_items?: Array<Phase.AddInvoiceItem>;
2334
3341
 
2335
3342
  /**
2336
3343
  * 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).
@@ -2412,6 +3419,11 @@ declare module 'stripe' {
2412
3419
  */
2413
3420
  on_behalf_of?: string;
2414
3421
 
3422
+ /**
3423
+ * 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).
3424
+ */
3425
+ pause_collection?: Phase.PauseCollection;
3426
+
2415
3427
  /**
2416
3428
  * 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.
2417
3429
  */
@@ -2432,10 +3444,20 @@ declare module 'stripe' {
2432
3444
  */
2433
3445
  trial?: boolean;
2434
3446
 
3447
+ /**
3448
+ * Specify trial behavior when crossing phase boundaries
3449
+ */
3450
+ trial_continuation?: Phase.TrialContinuation;
3451
+
2435
3452
  /**
2436
3453
  * 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`
2437
3454
  */
2438
3455
  trial_end?: number | 'now';
3456
+
3457
+ /**
3458
+ * Settings related to subscription trials.
3459
+ */
3460
+ trial_settings?: Phase.TrialSettings;
2439
3461
  }
2440
3462
 
2441
3463
  namespace Phase {
@@ -2478,12 +3500,56 @@ declare module 'stripe' {
2478
3500
  */
2479
3501
  discount?: string;
2480
3502
 
3503
+ /**
3504
+ * Details to determine how long the discount should be applied for.
3505
+ */
3506
+ discount_end?: Discount.DiscountEnd;
3507
+
2481
3508
  /**
2482
3509
  * ID of the promotion code to create a new discount for.
2483
3510
  */
2484
3511
  promotion_code?: string;
2485
3512
  }
2486
3513
 
3514
+ namespace Discount {
3515
+ interface DiscountEnd {
3516
+ /**
3517
+ * Time span for the redeemed discount.
3518
+ */
3519
+ duration?: DiscountEnd.Duration;
3520
+
3521
+ /**
3522
+ * A precise Unix timestamp for the discount to end. Must be in the future.
3523
+ */
3524
+ timestamp?: number;
3525
+
3526
+ /**
3527
+ * The type of calculation made to determine when the discount ends.
3528
+ */
3529
+ type: DiscountEnd.Type;
3530
+ }
3531
+
3532
+ namespace DiscountEnd {
3533
+ interface Duration {
3534
+ /**
3535
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3536
+ */
3537
+ interval: Duration.Interval;
3538
+
3539
+ /**
3540
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3541
+ */
3542
+ interval_count: number;
3543
+ }
3544
+
3545
+ namespace Duration {
3546
+ type Interval = 'day' | 'month' | 'week' | 'year';
3547
+ }
3548
+
3549
+ type Type = 'duration' | 'timestamp';
3550
+ }
3551
+ }
3552
+
2487
3553
  interface PriceData {
2488
3554
  /**
2489
3555
  * 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).
@@ -2573,12 +3639,56 @@ declare module 'stripe' {
2573
3639
  */
2574
3640
  discount?: string;
2575
3641
 
3642
+ /**
3643
+ * Details to determine how long the discount should be applied for.
3644
+ */
3645
+ discount_end?: Discount.DiscountEnd;
3646
+
2576
3647
  /**
2577
3648
  * ID of the promotion code to create a new discount for.
2578
3649
  */
2579
3650
  promotion_code?: string;
2580
3651
  }
2581
3652
 
3653
+ namespace Discount {
3654
+ interface DiscountEnd {
3655
+ /**
3656
+ * Time span for the redeemed discount.
3657
+ */
3658
+ duration?: DiscountEnd.Duration;
3659
+
3660
+ /**
3661
+ * A precise Unix timestamp for the discount to end. Must be in the future.
3662
+ */
3663
+ timestamp?: number;
3664
+
3665
+ /**
3666
+ * The type of calculation made to determine when the discount ends.
3667
+ */
3668
+ type: DiscountEnd.Type;
3669
+ }
3670
+
3671
+ namespace DiscountEnd {
3672
+ interface Duration {
3673
+ /**
3674
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3675
+ */
3676
+ interval: Duration.Interval;
3677
+
3678
+ /**
3679
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3680
+ */
3681
+ interval_count: number;
3682
+ }
3683
+
3684
+ namespace Duration {
3685
+ type Interval = 'day' | 'month' | 'week' | 'year';
3686
+ }
3687
+
3688
+ type Type = 'duration' | 'timestamp';
3689
+ }
3690
+ }
3691
+
2582
3692
  interface InvoiceSettings {
2583
3693
  /**
2584
3694
  * 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.
@@ -2654,6 +3764,11 @@ declare module 'stripe' {
2654
3764
  * 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.
2655
3765
  */
2656
3766
  tax_rates?: Stripe.Emptyable<Array<string>>;
3767
+
3768
+ /**
3769
+ * Options that configure the trial on the subscription item.
3770
+ */
3771
+ trial?: Item.Trial;
2657
3772
  }
2658
3773
 
2659
3774
  namespace Item {
@@ -2675,12 +3790,56 @@ declare module 'stripe' {
2675
3790
  */
2676
3791
  discount?: string;
2677
3792
 
3793
+ /**
3794
+ * Details to determine how long the discount should be applied for.
3795
+ */
3796
+ discount_end?: Discount.DiscountEnd;
3797
+
2678
3798
  /**
2679
3799
  * ID of the promotion code to create a new discount for.
2680
3800
  */
2681
3801
  promotion_code?: string;
2682
3802
  }
2683
3803
 
3804
+ namespace Discount {
3805
+ interface DiscountEnd {
3806
+ /**
3807
+ * Time span for the redeemed discount.
3808
+ */
3809
+ duration?: DiscountEnd.Duration;
3810
+
3811
+ /**
3812
+ * A precise Unix timestamp for the discount to end. Must be in the future.
3813
+ */
3814
+ timestamp?: number;
3815
+
3816
+ /**
3817
+ * The type of calculation made to determine when the discount ends.
3818
+ */
3819
+ type: DiscountEnd.Type;
3820
+ }
3821
+
3822
+ namespace DiscountEnd {
3823
+ interface Duration {
3824
+ /**
3825
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3826
+ */
3827
+ interval: Duration.Interval;
3828
+
3829
+ /**
3830
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3831
+ */
3832
+ interval_count: number;
3833
+ }
3834
+
3835
+ namespace Duration {
3836
+ type Interval = 'day' | 'month' | 'week' | 'year';
3837
+ }
3838
+
3839
+ type Type = 'duration' | 'timestamp';
3840
+ }
3841
+ }
3842
+
2684
3843
  interface PriceData {
2685
3844
  /**
2686
3845
  * 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).
@@ -2732,6 +3891,33 @@ declare module 'stripe' {
2732
3891
 
2733
3892
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
2734
3893
  }
3894
+
3895
+ interface Trial {
3896
+ /**
3897
+ * 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.
3898
+ */
3899
+ converts_to?: Array<string>;
3900
+
3901
+ /**
3902
+ * Determines the type of trial for this item.
3903
+ */
3904
+ type: Trial.Type;
3905
+ }
3906
+
3907
+ namespace Trial {
3908
+ type Type = 'free' | 'paid';
3909
+ }
3910
+ }
3911
+
3912
+ interface PauseCollection {
3913
+ /**
3914
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3915
+ */
3916
+ behavior: PauseCollection.Behavior;
3917
+ }
3918
+
3919
+ namespace PauseCollection {
3920
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
2735
3921
  }
2736
3922
 
2737
3923
  type ProrationBehavior =
@@ -2750,6 +3936,95 @@ declare module 'stripe' {
2750
3936
  */
2751
3937
  destination: string;
2752
3938
  }
3939
+
3940
+ type TrialContinuation = 'continue' | 'none';
3941
+
3942
+ interface TrialSettings {
3943
+ /**
3944
+ * Defines how the subscription should behave when a trial ends.
3945
+ */
3946
+ end_behavior?: TrialSettings.EndBehavior;
3947
+ }
3948
+
3949
+ namespace TrialSettings {
3950
+ interface EndBehavior {
3951
+ /**
3952
+ * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3953
+ */
3954
+ prorate_up_front?: EndBehavior.ProrateUpFront;
3955
+ }
3956
+
3957
+ namespace EndBehavior {
3958
+ type ProrateUpFront = 'defer' | 'include';
3959
+ }
3960
+ }
3961
+ }
3962
+
3963
+ interface Prebilling {
3964
+ /**
3965
+ * The end of the prebilled time period.
3966
+ */
3967
+ bill_until?: Prebilling.BillUntil;
3968
+
3969
+ /**
3970
+ * This is used to determine the number of billing cycles to prebill.
3971
+ */
3972
+ iterations?: number;
3973
+ }
3974
+
3975
+ namespace Prebilling {
3976
+ interface BillUntil {
3977
+ /**
3978
+ * End the prebilled period when a specified amendment ends.
3979
+ */
3980
+ amendment_end?: BillUntil.AmendmentEnd;
3981
+
3982
+ /**
3983
+ * Time span for prebilling, starting from `bill_from`.
3984
+ */
3985
+ duration?: BillUntil.Duration;
3986
+
3987
+ /**
3988
+ * End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
3989
+ */
3990
+ timestamp?: number;
3991
+
3992
+ /**
3993
+ * Select one of several ways to pass the `bill_until` value.
3994
+ */
3995
+ type: BillUntil.Type;
3996
+ }
3997
+
3998
+ namespace BillUntil {
3999
+ interface AmendmentEnd {
4000
+ /**
4001
+ * 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.
4002
+ */
4003
+ index: number;
4004
+ }
4005
+
4006
+ interface Duration {
4007
+ /**
4008
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
4009
+ */
4010
+ interval: Duration.Interval;
4011
+
4012
+ /**
4013
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
4014
+ */
4015
+ interval_count: number;
4016
+ }
4017
+
4018
+ namespace Duration {
4019
+ type Interval = 'day' | 'month' | 'week' | 'year';
4020
+ }
4021
+
4022
+ type Type =
4023
+ | 'amendment_end'
4024
+ | 'duration'
4025
+ | 'schedule_end'
4026
+ | 'timestamp';
4027
+ }
2753
4028
  }
2754
4029
 
2755
4030
  type ProrationBehavior =
@@ -2772,7 +4047,7 @@ declare module 'stripe' {
2772
4047
  /**
2773
4048
  * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
2774
4049
  */
2775
- cancel_at?: Stripe.Emptyable<number>;
4050
+ cancel_at?: Stripe.Emptyable<number | SubscriptionDetails.CancelAt>;
2776
4051
 
2777
4052
  /**
2778
4053
  * Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
@@ -2794,6 +4069,11 @@ declare module 'stripe' {
2794
4069
  */
2795
4070
  items?: Array<SubscriptionDetails.Item>;
2796
4071
 
4072
+ /**
4073
+ * The pre-billing to apply to the subscription as a preview.
4074
+ */
4075
+ prebilling?: SubscriptionDetails.Prebilling;
4076
+
2797
4077
  /**
2798
4078
  * Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
2799
4079
  */
@@ -2831,6 +4111,8 @@ declare module 'stripe' {
2831
4111
  type Type = 'classic' | 'flexible';
2832
4112
  }
2833
4113
 
4114
+ type CancelAt = 'max_period_end' | 'min_period_end';
4115
+
2834
4116
  interface Item {
2835
4117
  /**
2836
4118
  * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
@@ -2907,12 +4189,56 @@ declare module 'stripe' {
2907
4189
  */
2908
4190
  discount?: string;
2909
4191
 
4192
+ /**
4193
+ * Details to determine how long the discount should be applied for.
4194
+ */
4195
+ discount_end?: Discount.DiscountEnd;
4196
+
2910
4197
  /**
2911
4198
  * ID of the promotion code to create a new discount for.
2912
4199
  */
2913
4200
  promotion_code?: string;
2914
4201
  }
2915
4202
 
4203
+ namespace Discount {
4204
+ interface DiscountEnd {
4205
+ /**
4206
+ * Time span for the redeemed discount.
4207
+ */
4208
+ duration?: DiscountEnd.Duration;
4209
+
4210
+ /**
4211
+ * A precise Unix timestamp for the discount to end. Must be in the future.
4212
+ */
4213
+ timestamp?: number;
4214
+
4215
+ /**
4216
+ * The type of calculation made to determine when the discount ends.
4217
+ */
4218
+ type: DiscountEnd.Type;
4219
+ }
4220
+
4221
+ namespace DiscountEnd {
4222
+ interface Duration {
4223
+ /**
4224
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
4225
+ */
4226
+ interval: Duration.Interval;
4227
+
4228
+ /**
4229
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
4230
+ */
4231
+ interval_count: number;
4232
+ }
4233
+
4234
+ namespace Duration {
4235
+ type Interval = 'day' | 'month' | 'week' | 'year';
4236
+ }
4237
+
4238
+ type Type = 'duration' | 'timestamp';
4239
+ }
4240
+ }
4241
+
2916
4242
  interface PriceData {
2917
4243
  /**
2918
4244
  * 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).
@@ -2966,6 +4292,13 @@ declare module 'stripe' {
2966
4292
  }
2967
4293
  }
2968
4294
 
4295
+ interface Prebilling {
4296
+ /**
4297
+ * This is used to determine the number of billing cycles to prebill.
4298
+ */
4299
+ iterations: number;
4300
+ }
4301
+
2969
4302
  type ProrationBehavior =
2970
4303
  | 'always_invoice'
2971
4304
  | 'create_prorations'
@@ -3150,6 +4483,11 @@ declare module 'stripe' {
3150
4483
  */
3151
4484
  id: string;
3152
4485
 
4486
+ /**
4487
+ * The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
4488
+ */
4489
+ margins?: Stripe.Emptyable<Array<string>>;
4490
+
3153
4491
  /**
3154
4492
  * 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`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
3155
4493
  */
@@ -3198,12 +4536,56 @@ declare module 'stripe' {
3198
4536
  */
3199
4537
  discount?: string;
3200
4538
 
4539
+ /**
4540
+ * Details to determine how long the discount should be applied for.
4541
+ */
4542
+ discount_end?: Discount.DiscountEnd;
4543
+
3201
4544
  /**
3202
4545
  * ID of the promotion code to create a new discount for.
3203
4546
  */
3204
4547
  promotion_code?: string;
3205
4548
  }
3206
4549
 
4550
+ namespace Discount {
4551
+ interface DiscountEnd {
4552
+ /**
4553
+ * Time span for the redeemed discount.
4554
+ */
4555
+ duration?: DiscountEnd.Duration;
4556
+
4557
+ /**
4558
+ * A precise Unix timestamp for the discount to end. Must be in the future.
4559
+ */
4560
+ timestamp?: number;
4561
+
4562
+ /**
4563
+ * The type of calculation made to determine when the discount ends.
4564
+ */
4565
+ type: DiscountEnd.Type;
4566
+ }
4567
+
4568
+ namespace DiscountEnd {
4569
+ interface Duration {
4570
+ /**
4571
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
4572
+ */
4573
+ interval: Duration.Interval;
4574
+
4575
+ /**
4576
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
4577
+ */
4578
+ interval_count: number;
4579
+ }
4580
+
4581
+ namespace Duration {
4582
+ type Interval = 'day' | 'month' | 'week' | 'year';
4583
+ }
4584
+
4585
+ type Type = 'duration' | 'timestamp';
4586
+ }
4587
+ }
4588
+
3207
4589
  interface Period {
3208
4590
  /**
3209
4591
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.
@@ -3430,6 +4812,11 @@ declare module 'stripe' {
3430
4812
  */
3431
4813
  expand?: Array<string>;
3432
4814
 
4815
+ /**
4816
+ * The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
4817
+ */
4818
+ margins?: Stripe.Emptyable<Array<string>>;
4819
+
3433
4820
  /**
3434
4821
  * 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`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
3435
4822
  */
@@ -3480,12 +4867,56 @@ declare module 'stripe' {
3480
4867
  */
3481
4868
  discount?: string;
3482
4869
 
4870
+ /**
4871
+ * Details to determine how long the discount should be applied for.
4872
+ */
4873
+ discount_end?: Discount.DiscountEnd;
4874
+
3483
4875
  /**
3484
4876
  * ID of the promotion code to create a new discount for.
3485
4877
  */
3486
4878
  promotion_code?: string;
3487
4879
  }
3488
4880
 
4881
+ namespace Discount {
4882
+ interface DiscountEnd {
4883
+ /**
4884
+ * Time span for the redeemed discount.
4885
+ */
4886
+ duration?: DiscountEnd.Duration;
4887
+
4888
+ /**
4889
+ * A precise Unix timestamp for the discount to end. Must be in the future.
4890
+ */
4891
+ timestamp?: number;
4892
+
4893
+ /**
4894
+ * The type of calculation made to determine when the discount ends.
4895
+ */
4896
+ type: DiscountEnd.Type;
4897
+ }
4898
+
4899
+ namespace DiscountEnd {
4900
+ interface Duration {
4901
+ /**
4902
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
4903
+ */
4904
+ interval: Duration.Interval;
4905
+
4906
+ /**
4907
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
4908
+ */
4909
+ interval_count: number;
4910
+ }
4911
+
4912
+ namespace Duration {
4913
+ type Interval = 'day' | 'month' | 'week' | 'year';
4914
+ }
4915
+
4916
+ type Type = 'duration' | 'timestamp';
4917
+ }
4918
+ }
4919
+
3489
4920
  interface Period {
3490
4921
  /**
3491
4922
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.