stripe 18.2.1 → 18.3.0-beta.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 (293) hide show
  1. package/CHANGELOG.md +1243 -14
  2. package/README.md +1 -0
  3. package/VERSION +1 -1
  4. package/cjs/Error.js +91 -1
  5. package/cjs/RequestSender.js +1 -1
  6. package/cjs/apiVersion.js +1 -1
  7. package/cjs/resources/AccountNotices.js +21 -0
  8. package/cjs/resources/BalanceSettings.js +10 -0
  9. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  10. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  11. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  12. package/cjs/resources/ExternalAccounts.js +23 -0
  13. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  14. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  15. package/cjs/resources/FxQuotes.js +15 -0
  16. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  17. package/cjs/resources/Issuing/DisputeSettlementDetails.js +17 -0
  18. package/cjs/resources/Issuing/FraudLiabilityDebits.js +17 -0
  19. package/cjs/resources/Margins.js +22 -0
  20. package/cjs/resources/Orders.js +24 -0
  21. package/cjs/resources/{InvoicePayments.js → PaymentAttemptRecords.js} +4 -4
  22. package/cjs/resources/PaymentIntents.js +13 -0
  23. package/cjs/resources/PaymentRecords.js +29 -0
  24. package/cjs/resources/Privacy/RedactionJobs.js +42 -0
  25. package/cjs/resources/Quotes.js +32 -0
  26. package/cjs/resources/SubscriptionSchedules.js +4 -0
  27. package/cjs/resources/Subscriptions.js +4 -0
  28. package/cjs/resources/Tax/Associations.js +9 -0
  29. package/cjs/resources/Tax/Forms.js +20 -0
  30. package/cjs/resources/Terminal/ReaderCollectedData.js +12 -0
  31. package/cjs/resources/Terminal/Readers.js +8 -0
  32. package/cjs/resources/V2/Core/AccountLinks.js +9 -0
  33. package/cjs/resources/V2/Core/Accounts/Persons.js +29 -0
  34. package/cjs/resources/V2/Core/Accounts.js +25 -0
  35. package/cjs/resources/V2/Core/Vault/GbBankAccounts.js +28 -0
  36. package/cjs/resources/V2/Core/Vault/UsBankAccounts.js +24 -0
  37. package/cjs/resources/V2/MoneyManagement/Adjustments.js +17 -0
  38. package/cjs/resources/V2/MoneyManagement/FinancialAccounts.js +17 -0
  39. package/cjs/resources/V2/MoneyManagement/FinancialAddresses.js +21 -0
  40. package/cjs/resources/V2/MoneyManagement/InboundTransfers.js +21 -0
  41. package/cjs/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +16 -0
  42. package/cjs/resources/V2/MoneyManagement/OutboundPayments.js +25 -0
  43. package/cjs/resources/V2/MoneyManagement/OutboundSetupIntents.js +29 -0
  44. package/cjs/resources/V2/MoneyManagement/OutboundTransfers.js +25 -0
  45. package/cjs/resources/V2/MoneyManagement/PayoutMethods.js +25 -0
  46. package/cjs/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +12 -0
  47. package/cjs/resources/V2/MoneyManagement/ReceivedCredits.js +17 -0
  48. package/cjs/resources/V2/MoneyManagement/ReceivedDebits.js +17 -0
  49. package/cjs/resources/V2/MoneyManagement/TransactionEntries.js +17 -0
  50. package/cjs/resources/V2/MoneyManagement/Transactions.js +17 -0
  51. package/cjs/resources/V2/Payments/OffSessionPayments.js +25 -0
  52. package/cjs/resources/V2/TestHelpers/FinancialAddresses.js +16 -0
  53. package/cjs/resources.js +98 -10
  54. package/cjs/stripe.core.js +1 -1
  55. package/esm/Error.js +79 -0
  56. package/esm/RequestSender.js +1 -1
  57. package/esm/apiVersion.js +1 -1
  58. package/esm/resources/AccountNotices.js +18 -0
  59. package/esm/resources/BalanceSettings.js +7 -0
  60. package/esm/resources/Capital/FinancingOffers.js +18 -0
  61. package/esm/resources/Capital/FinancingSummary.js +9 -0
  62. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  63. package/esm/resources/ExternalAccounts.js +20 -0
  64. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  65. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  66. package/esm/resources/FxQuotes.js +12 -0
  67. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  68. package/esm/resources/Issuing/DisputeSettlementDetails.js +14 -0
  69. package/esm/resources/Issuing/FraudLiabilityDebits.js +14 -0
  70. package/esm/resources/Margins.js +19 -0
  71. package/esm/resources/Orders.js +21 -0
  72. package/esm/resources/{InvoicePayments.js → PaymentAttemptRecords.js} +3 -3
  73. package/esm/resources/PaymentIntents.js +13 -0
  74. package/esm/resources/PaymentRecords.js +26 -0
  75. package/esm/resources/Privacy/RedactionJobs.js +39 -0
  76. package/esm/resources/Quotes.js +32 -0
  77. package/esm/resources/SubscriptionSchedules.js +4 -0
  78. package/esm/resources/Subscriptions.js +4 -0
  79. package/esm/resources/Tax/Associations.js +6 -0
  80. package/esm/resources/Tax/Forms.js +17 -0
  81. package/esm/resources/Terminal/ReaderCollectedData.js +9 -0
  82. package/esm/resources/Terminal/Readers.js +8 -0
  83. package/esm/resources/V2/Core/AccountLinks.js +6 -0
  84. package/esm/resources/V2/Core/Accounts/Persons.js +26 -0
  85. package/esm/resources/V2/Core/Accounts.js +22 -0
  86. package/esm/resources/V2/Core/Vault/GbBankAccounts.js +25 -0
  87. package/esm/resources/V2/Core/Vault/UsBankAccounts.js +21 -0
  88. package/esm/resources/V2/MoneyManagement/Adjustments.js +14 -0
  89. package/esm/resources/V2/MoneyManagement/FinancialAccounts.js +14 -0
  90. package/esm/resources/V2/MoneyManagement/FinancialAddresses.js +18 -0
  91. package/esm/resources/V2/MoneyManagement/InboundTransfers.js +18 -0
  92. package/esm/resources/V2/MoneyManagement/OutboundPaymentQuotes.js +13 -0
  93. package/esm/resources/V2/MoneyManagement/OutboundPayments.js +22 -0
  94. package/esm/resources/V2/MoneyManagement/OutboundSetupIntents.js +26 -0
  95. package/esm/resources/V2/MoneyManagement/OutboundTransfers.js +22 -0
  96. package/esm/resources/V2/MoneyManagement/PayoutMethods.js +22 -0
  97. package/esm/resources/V2/MoneyManagement/PayoutMethodsBankAccountSpec.js +9 -0
  98. package/esm/resources/V2/MoneyManagement/ReceivedCredits.js +14 -0
  99. package/esm/resources/V2/MoneyManagement/ReceivedDebits.js +14 -0
  100. package/esm/resources/V2/MoneyManagement/TransactionEntries.js +14 -0
  101. package/esm/resources/V2/MoneyManagement/Transactions.js +14 -0
  102. package/esm/resources/V2/Payments/OffSessionPayments.js +22 -0
  103. package/esm/resources/V2/TestHelpers/FinancialAddresses.js +13 -0
  104. package/esm/resources.js +82 -1
  105. package/esm/stripe.core.js +1 -1
  106. package/package.json +1 -1
  107. package/types/AccountLinksResource.d.ts +5 -1
  108. package/types/AccountNotices.d.ts +113 -0
  109. package/types/AccountNoticesResource.d.ts +98 -0
  110. package/types/AccountSessions.d.ts +45 -0
  111. package/types/AccountSessionsResource.d.ts +264 -0
  112. package/types/Accounts.d.ts +212 -1
  113. package/types/AccountsResource.d.ts +544 -0
  114. package/types/BalanceSettings.d.ts +89 -0
  115. package/types/BalanceSettingsResource.d.ts +108 -0
  116. package/types/Billing/CreditBalanceSummary.d.ts +5 -0
  117. package/types/Billing/CreditBalanceSummaryResource.d.ts +8 -3
  118. package/types/Billing/CreditBalanceTransactionsResource.d.ts +12 -4
  119. package/types/Billing/CreditGrants.d.ts +5 -0
  120. package/types/Billing/CreditGrantsResource.d.ts +11 -1
  121. package/types/BillingPortal/Sessions.d.ts +5 -0
  122. package/types/BillingPortal/SessionsResource.d.ts +12 -4
  123. package/types/Capital/FinancingOffers.d.ts +188 -0
  124. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  125. package/types/Capital/FinancingSummary.d.ts +106 -0
  126. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  127. package/types/Capital/FinancingTransactions.d.ts +135 -0
  128. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  129. package/types/Cards.d.ts +5 -0
  130. package/types/CashBalances.d.ts +5 -0
  131. package/types/Charges.d.ts +166 -0
  132. package/types/ChargesResource.d.ts +1406 -0
  133. package/types/Checkout/Sessions.d.ts +314 -1
  134. package/types/Checkout/SessionsResource.d.ts +340 -1
  135. package/types/ConfirmationTokens.d.ts +125 -0
  136. package/types/Coupons.d.ts +33 -0
  137. package/types/CouponsResource.d.ts +21 -0
  138. package/types/CreditNoteLineItems.d.ts +17 -0
  139. package/types/CreditNotes.d.ts +5 -0
  140. package/types/CreditNotesResource.d.ts +5 -0
  141. package/types/CustomerBalanceTransactions.d.ts +2 -0
  142. package/types/CustomerCashBalanceTransactions.d.ts +2 -0
  143. package/types/CustomerSessions.d.ts +5 -0
  144. package/types/CustomerSessionsResource.d.ts +6 -1
  145. package/types/Customers.d.ts +2 -0
  146. package/types/CustomersResource.d.ts +8 -0
  147. package/types/Discounts.d.ts +10 -0
  148. package/types/Errors.d.ts +69 -2
  149. package/types/EventTypes.d.ts +681 -0
  150. package/types/Events.d.ts +98 -0
  151. package/types/ExternalAccountsResource.d.ts +304 -0
  152. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  153. package/types/FinancialConnections/Accounts.d.ts +36 -1
  154. package/types/FinancialConnections/AccountsResource.d.ts +40 -3
  155. package/types/FinancialConnections/Institutions.d.ts +98 -0
  156. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  157. package/types/FinancialConnections/Sessions.d.ts +51 -1
  158. package/types/FinancialConnections/SessionsResource.d.ts +43 -1
  159. package/types/FxQuotes.d.ts +153 -0
  160. package/types/FxQuotesResource.d.ts +130 -0
  161. package/types/Identity/VerificationSessions.d.ts +5 -0
  162. package/types/Identity/VerificationSessionsResource.d.ts +7 -0
  163. package/types/InvoiceItems.d.ts +10 -0
  164. package/types/InvoiceItemsResource.d.ts +117 -6
  165. package/types/InvoiceLineItems.d.ts +45 -1
  166. package/types/InvoicePayments.d.ts +5 -0
  167. package/types/Invoices.d.ts +133 -3
  168. package/types/InvoicesResource.d.ts +1458 -13
  169. package/types/Issuing/CardholdersResource.d.ts +2 -1
  170. package/types/Issuing/CreditUnderwritingRecords.d.ts +451 -0
  171. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1032 -0
  172. package/types/Issuing/DisputeSettlementDetails.d.ts +85 -0
  173. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +52 -0
  174. package/types/Issuing/FraudLiabilityDebits.d.ts +52 -0
  175. package/types/Issuing/FraudLiabilityDebitsResource.d.ts +52 -0
  176. package/types/Issuing/Settlements.d.ts +113 -0
  177. package/types/Issuing/Transactions.d.ts +5 -0
  178. package/types/Issuing/TransactionsResource.d.ts +5 -0
  179. package/types/LineItems.d.ts +49 -0
  180. package/types/Mandates.d.ts +77 -0
  181. package/types/Margins.d.ts +56 -0
  182. package/types/MarginsResource.d.ts +114 -0
  183. package/types/Orders.d.ts +1159 -0
  184. package/types/OrdersResource.d.ts +2967 -0
  185. package/types/PaymentAttemptRecords.d.ts +2132 -0
  186. package/types/PaymentAttemptRecordsResource.d.ts +47 -0
  187. package/types/PaymentIntentAmountDetailsLineItems.d.ts +116 -0
  188. package/types/PaymentIntents.d.ts +764 -2
  189. package/types/PaymentIntentsResource.d.ts +8819 -4111
  190. package/types/PaymentLinks.d.ts +6 -0
  191. package/types/PaymentLinksResource.d.ts +12 -0
  192. package/types/PaymentMethodConfigurations.d.ts +180 -0
  193. package/types/PaymentMethodConfigurationsResource.d.ts +250 -0
  194. package/types/PaymentMethods.d.ts +125 -0
  195. package/types/PaymentMethodsResource.d.ts +167 -2
  196. package/types/PaymentRecords.d.ts +2125 -0
  197. package/types/PaymentRecordsResource.d.ts +455 -0
  198. package/types/Payouts.d.ts +5 -0
  199. package/types/PayoutsResource.d.ts +5 -0
  200. package/types/Prices.d.ts +22 -0
  201. package/types/PricesResource.d.ts +22 -0
  202. package/types/Privacy/RedactionJobValidationErrors.d.ts +60 -0
  203. package/types/Privacy/RedactionJobs.d.ts +111 -0
  204. package/types/Privacy/RedactionJobsResource.d.ts +230 -0
  205. package/types/PromotionCodes.d.ts +5 -0
  206. package/types/PromotionCodesResource.d.ts +10 -0
  207. package/types/QuoteLines.d.ts +634 -0
  208. package/types/QuotePreviewInvoices.d.ts +1695 -0
  209. package/types/QuotePreviewSubscriptionSchedules.d.ts +831 -0
  210. package/types/Quotes.d.ts +603 -1
  211. package/types/QuotesResource.d.ts +2572 -218
  212. package/types/Refunds.d.ts +14 -0
  213. package/types/SetupAttempts.d.ts +47 -1
  214. package/types/SetupIntents.d.ts +118 -2
  215. package/types/SetupIntentsResource.d.ts +730 -3
  216. package/types/Sources.d.ts +29 -0
  217. package/types/SubscriptionItems.d.ts +30 -0
  218. package/types/SubscriptionItemsResource.d.ts +109 -0
  219. package/types/SubscriptionSchedules.d.ts +212 -0
  220. package/types/SubscriptionSchedulesResource.d.ts +1240 -5
  221. package/types/Subscriptions.d.ts +116 -1
  222. package/types/SubscriptionsResource.d.ts +424 -10
  223. package/types/Tax/Associations.d.ts +82 -0
  224. package/types/Tax/AssociationsResource.d.ts +29 -0
  225. package/types/Tax/Forms.d.ts +220 -0
  226. package/types/Tax/FormsResource.d.ts +107 -0
  227. package/types/TaxIds.d.ts +10 -0
  228. package/types/TaxIdsResource.d.ts +10 -0
  229. package/types/Terminal/ReaderCollectedData.d.ts +51 -0
  230. package/types/Terminal/ReaderCollectedDataResource.d.ts +29 -0
  231. package/types/Terminal/Readers.d.ts +102 -0
  232. package/types/Terminal/ReadersResource.d.ts +96 -0
  233. package/types/TestHelpers/ConfirmationTokensResource.d.ts +126 -0
  234. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  235. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  236. package/types/Transfers.d.ts +5 -0
  237. package/types/TransfersResource.d.ts +5 -0
  238. package/types/Treasury/FinancialAccountFeatures.d.ts +7 -0
  239. package/types/Treasury/FinancialAccounts.d.ts +5 -0
  240. package/types/Treasury/FinancialAccountsResource.d.ts +37 -0
  241. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  242. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  243. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  244. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  245. package/types/V2/Core/AccountLinks.d.ts +106 -0
  246. package/types/V2/Core/AccountLinksResource.d.ts +90 -0
  247. package/types/V2/Core/Accounts/PersonsResource.d.ts +3770 -0
  248. package/types/V2/Core/Accounts.d.ts +8169 -0
  249. package/types/V2/Core/AccountsResource.d.ts +10203 -0
  250. package/types/V2/Core/Persons.d.ts +1867 -0
  251. package/types/V2/Core/Vault/GbBankAccounts.d.ts +160 -0
  252. package/types/V2/Core/Vault/GbBankAccountsResource.d.ts +172 -0
  253. package/types/V2/Core/Vault/UsBankAccounts.d.ts +70 -0
  254. package/types/V2/Core/Vault/UsBankAccountsResource.d.ts +123 -0
  255. package/types/V2/EventTypes.d.ts +907 -5
  256. package/types/V2/FinancialAddressCreditSimulations.d.ts +27 -0
  257. package/types/V2/FinancialAddressGeneratedMicrodeposits.d.ts +32 -0
  258. package/types/V2/MoneyManagement/Adjustments.d.ts +110 -0
  259. package/types/V2/MoneyManagement/AdjustmentsResource.d.ts +83 -0
  260. package/types/V2/MoneyManagement/FinancialAccounts.d.ts +546 -0
  261. package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +52 -0
  262. package/types/V2/MoneyManagement/FinancialAddresses.d.ts +314 -0
  263. package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +288 -0
  264. package/types/V2/MoneyManagement/InboundTransfers.d.ts +206 -0
  265. package/types/V2/MoneyManagement/InboundTransfersResource.d.ts +144 -0
  266. package/types/V2/MoneyManagement/OutboundPaymentQuotes.d.ts +168 -0
  267. package/types/V2/MoneyManagement/OutboundPaymentQuotesResource.d.ts +115 -0
  268. package/types/V2/MoneyManagement/OutboundPayments.d.ts +278 -0
  269. package/types/V2/MoneyManagement/OutboundPaymentsResource.d.ts +242 -0
  270. package/types/V2/MoneyManagement/OutboundSetupIntents.d.ts +97 -0
  271. package/types/V2/MoneyManagement/OutboundSetupIntentsResource.d.ts +296 -0
  272. package/types/V2/MoneyManagement/OutboundTransfers.d.ts +251 -0
  273. package/types/V2/MoneyManagement/OutboundTransfersResource.d.ts +207 -0
  274. package/types/V2/MoneyManagement/PayoutMethods.d.ts +151 -0
  275. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecResource.d.ts +41 -0
  276. package/types/V2/MoneyManagement/PayoutMethodsBankAccountSpecs.d.ts +87 -0
  277. package/types/V2/MoneyManagement/PayoutMethodsResource.d.ts +113 -0
  278. package/types/V2/MoneyManagement/ReceivedCredits.d.ts +243 -0
  279. package/types/V2/MoneyManagement/ReceivedCreditsResource.d.ts +78 -0
  280. package/types/V2/MoneyManagement/ReceivedDebits.d.ts +176 -0
  281. package/types/V2/MoneyManagement/ReceivedDebitsResource.d.ts +48 -0
  282. package/types/V2/MoneyManagement/TransactionEntries.d.ts +155 -0
  283. package/types/V2/MoneyManagement/TransactionEntriesResource.d.ts +82 -0
  284. package/types/V2/MoneyManagement/Transactions.d.ts +170 -0
  285. package/types/V2/MoneyManagement/TransactionsResource.d.ts +83 -0
  286. package/types/V2/Payments/OffSessionPayments.d.ts +162 -0
  287. package/types/V2/Payments/OffSessionPaymentsResource.d.ts +159 -0
  288. package/types/V2/TestHelpers/FinancialAddressesResource.d.ts +66 -0
  289. package/types/WebhookEndpointsResource.d.ts +80 -0
  290. package/types/index.d.ts +141 -5
  291. package/types/lib.d.ts +11 -1
  292. package/types/test/typescriptTest.ts +3 -3
  293. 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
  */
@@ -440,6 +528,8 @@ declare module 'stripe' {
440
528
  }
441
529
  }
442
530
 
531
+ interface IdBankTransfer {}
532
+
443
533
  interface Konbini {}
444
534
 
445
535
  interface SepaDebit {}
@@ -480,6 +570,11 @@ declare module 'stripe' {
480
570
  * The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
481
571
  */
482
572
  account_subcategories?: Array<Filters.AccountSubcategory>;
573
+
574
+ /**
575
+ * ID of the institution to use to filter for selectable accounts.
576
+ */
577
+ institution?: string;
483
578
  }
484
579
 
485
580
  namespace Filters {
@@ -492,7 +587,11 @@ declare module 'stripe' {
492
587
  | 'payment_method'
493
588
  | 'transactions';
494
589
 
495
- type Prefetch = 'balances' | 'ownership' | 'transactions';
590
+ type Prefetch =
591
+ | 'balances'
592
+ | 'inferred_balances'
593
+ | 'ownership'
594
+ | 'transactions';
496
595
  }
497
596
 
498
597
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -511,11 +610,13 @@ declare module 'stripe' {
511
610
  | 'boleto'
512
611
  | 'card'
513
612
  | 'cashapp'
613
+ | 'custom'
514
614
  | 'customer_balance'
515
615
  | 'eps'
516
616
  | 'fpx'
517
617
  | 'giropay'
518
618
  | 'grabpay'
619
+ | 'id_bank_transfer'
519
620
  | 'ideal'
520
621
  | 'jp_credit_transfer'
521
622
  | 'kakao_pay'
@@ -535,6 +636,7 @@ declare module 'stripe' {
535
636
  | 'sepa_credit_transfer'
536
637
  | 'sepa_debit'
537
638
  | 'sofort'
639
+ | 'stripe_balance'
538
640
  | 'swish'
539
641
  | 'us_bank_account'
540
642
  | 'wechat_pay';
@@ -762,6 +864,11 @@ declare module 'stripe' {
762
864
  */
763
865
  account_tax_ids?: Stripe.Emptyable<Array<string>>;
764
866
 
867
+ /**
868
+ * List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
869
+ */
870
+ amounts_due?: Stripe.Emptyable<Array<InvoiceUpdateParams.AmountsDue>>;
871
+
765
872
  /**
766
873
  * 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).
767
874
  */
@@ -797,6 +904,11 @@ declare module 'stripe' {
797
904
  */
798
905
  days_until_due?: number;
799
906
 
907
+ /**
908
+ * The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
909
+ */
910
+ default_margins?: Stripe.Emptyable<Array<string>>;
911
+
800
912
  /**
801
913
  * 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.
802
914
  */
@@ -894,6 +1006,28 @@ declare module 'stripe' {
894
1006
  }
895
1007
 
896
1008
  namespace InvoiceUpdateParams {
1009
+ interface AmountsDue {
1010
+ /**
1011
+ * The amount in cents (or local equivalent).
1012
+ */
1013
+ amount: number;
1014
+
1015
+ /**
1016
+ * Number of days from when invoice is finalized until the payment is due.
1017
+ */
1018
+ days_until_due?: number;
1019
+
1020
+ /**
1021
+ * An arbitrary string attached to the object. Often useful for displaying to users.
1022
+ */
1023
+ description: string;
1024
+
1025
+ /**
1026
+ * Date on which a payment plan's payment is due.
1027
+ */
1028
+ due_date?: number;
1029
+ }
1030
+
897
1031
  interface AutomaticTax {
898
1032
  /**
899
1033
  * 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.
@@ -949,12 +1083,56 @@ declare module 'stripe' {
949
1083
  */
950
1084
  discount?: string;
951
1085
 
1086
+ /**
1087
+ * Details to determine how long the discount should be applied for.
1088
+ */
1089
+ discount_end?: Discount.DiscountEnd;
1090
+
952
1091
  /**
953
1092
  * ID of the promotion code to create a new discount for.
954
1093
  */
955
1094
  promotion_code?: string;
956
1095
  }
957
1096
 
1097
+ namespace Discount {
1098
+ interface DiscountEnd {
1099
+ /**
1100
+ * Time span for the redeemed discount.
1101
+ */
1102
+ duration?: DiscountEnd.Duration;
1103
+
1104
+ /**
1105
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1106
+ */
1107
+ timestamp?: number;
1108
+
1109
+ /**
1110
+ * The type of calculation made to determine when the discount ends.
1111
+ */
1112
+ type: DiscountEnd.Type;
1113
+ }
1114
+
1115
+ namespace DiscountEnd {
1116
+ interface Duration {
1117
+ /**
1118
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1119
+ */
1120
+ interval: Duration.Interval;
1121
+
1122
+ /**
1123
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1124
+ */
1125
+ interval_count: number;
1126
+ }
1127
+
1128
+ namespace Duration {
1129
+ type Interval = 'day' | 'month' | 'week' | 'year';
1130
+ }
1131
+
1132
+ type Type = 'duration' | 'timestamp';
1133
+ }
1134
+ }
1135
+
958
1136
  interface Issuer {
959
1137
  /**
960
1138
  * The connected account being referenced when `type` is `account`.
@@ -1014,6 +1192,13 @@ declare module 'stripe' {
1014
1192
  PaymentMethodOptions.CustomerBalance
1015
1193
  >;
1016
1194
 
1195
+ /**
1196
+ * 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.
1197
+ */
1198
+ id_bank_transfer?: Stripe.Emptyable<
1199
+ PaymentMethodOptions.IdBankTransfer
1200
+ >;
1201
+
1017
1202
  /**
1018
1203
  * If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent.
1019
1204
  */
@@ -1157,6 +1342,8 @@ declare module 'stripe' {
1157
1342
  }
1158
1343
  }
1159
1344
 
1345
+ interface IdBankTransfer {}
1346
+
1160
1347
  interface Konbini {}
1161
1348
 
1162
1349
  interface SepaDebit {}
@@ -1197,6 +1384,11 @@ declare module 'stripe' {
1197
1384
  * The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1198
1385
  */
1199
1386
  account_subcategories?: Array<Filters.AccountSubcategory>;
1387
+
1388
+ /**
1389
+ * ID of the institution to use to filter for selectable accounts.
1390
+ */
1391
+ institution?: string;
1200
1392
  }
1201
1393
 
1202
1394
  namespace Filters {
@@ -1209,7 +1401,11 @@ declare module 'stripe' {
1209
1401
  | 'payment_method'
1210
1402
  | 'transactions';
1211
1403
 
1212
- type Prefetch = 'balances' | 'ownership' | 'transactions';
1404
+ type Prefetch =
1405
+ | 'balances'
1406
+ | 'inferred_balances'
1407
+ | 'ownership'
1408
+ | 'transactions';
1213
1409
  }
1214
1410
 
1215
1411
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -1228,11 +1424,13 @@ declare module 'stripe' {
1228
1424
  | 'boleto'
1229
1425
  | 'card'
1230
1426
  | 'cashapp'
1427
+ | 'custom'
1231
1428
  | 'customer_balance'
1232
1429
  | 'eps'
1233
1430
  | 'fpx'
1234
1431
  | 'giropay'
1235
1432
  | 'grabpay'
1433
+ | 'id_bank_transfer'
1236
1434
  | 'ideal'
1237
1435
  | 'jp_credit_transfer'
1238
1436
  | 'kakao_pay'
@@ -1252,6 +1450,7 @@ declare module 'stripe' {
1252
1450
  | 'sepa_credit_transfer'
1253
1451
  | 'sepa_debit'
1254
1452
  | 'sofort'
1453
+ | 'stripe_balance'
1255
1454
  | 'swish'
1256
1455
  | 'us_bank_account'
1257
1456
  | 'wechat_pay';
@@ -1480,6 +1679,11 @@ declare module 'stripe' {
1480
1679
  */
1481
1680
  customer?: string;
1482
1681
 
1682
+ /**
1683
+ * Only return invoices for the account specified by this account ID.
1684
+ */
1685
+ customer_account?: string;
1686
+
1483
1687
  due_date?: Stripe.RangeQueryParam | number;
1484
1688
 
1485
1689
  /**
@@ -1552,6 +1756,11 @@ declare module 'stripe' {
1552
1756
  */
1553
1757
  invoice_item?: string;
1554
1758
 
1759
+ /**
1760
+ * 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.
1761
+ */
1762
+ margins?: Stripe.Emptyable<Array<string>>;
1763
+
1555
1764
  /**
1556
1765
  * 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`.
1557
1766
  */
@@ -1600,12 +1809,56 @@ declare module 'stripe' {
1600
1809
  */
1601
1810
  discount?: string;
1602
1811
 
1812
+ /**
1813
+ * Details to determine how long the discount should be applied for.
1814
+ */
1815
+ discount_end?: Discount.DiscountEnd;
1816
+
1603
1817
  /**
1604
1818
  * ID of the promotion code to create a new discount for.
1605
1819
  */
1606
1820
  promotion_code?: string;
1607
1821
  }
1608
1822
 
1823
+ namespace Discount {
1824
+ interface DiscountEnd {
1825
+ /**
1826
+ * Time span for the redeemed discount.
1827
+ */
1828
+ duration?: DiscountEnd.Duration;
1829
+
1830
+ /**
1831
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1832
+ */
1833
+ timestamp?: number;
1834
+
1835
+ /**
1836
+ * The type of calculation made to determine when the discount ends.
1837
+ */
1838
+ type: DiscountEnd.Type;
1839
+ }
1840
+
1841
+ namespace DiscountEnd {
1842
+ interface Duration {
1843
+ /**
1844
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1845
+ */
1846
+ interval: Duration.Interval;
1847
+
1848
+ /**
1849
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1850
+ */
1851
+ interval_count: number;
1852
+ }
1853
+
1854
+ namespace Duration {
1855
+ type Interval = 'day' | 'month' | 'week' | 'year';
1856
+ }
1857
+
1858
+ type Type = 'duration' | 'timestamp';
1859
+ }
1860
+ }
1861
+
1609
1862
  interface Period {
1610
1863
  /**
1611
1864
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.
@@ -1807,6 +2060,11 @@ declare module 'stripe' {
1807
2060
  }
1808
2061
 
1809
2062
  interface InvoiceAttachPaymentParams {
2063
+ /**
2064
+ * The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount.
2065
+ */
2066
+ amount_requested?: number;
2067
+
1810
2068
  /**
1811
2069
  * Specifies which fields in the response should be expanded.
1812
2070
  */
@@ -1816,6 +2074,50 @@ declare module 'stripe' {
1816
2074
  * The ID of the PaymentIntent to attach to the invoice.
1817
2075
  */
1818
2076
  payment_intent?: string;
2077
+
2078
+ /**
2079
+ * The ID of the PaymentRecord to attach to the invoice.
2080
+ */
2081
+ payment_record?: string;
2082
+
2083
+ /**
2084
+ * The PaymentRecord data for attaching an out of band payment to the invoice.
2085
+ */
2086
+ payment_record_data?: InvoiceAttachPaymentParams.PaymentRecordData;
2087
+ }
2088
+
2089
+ namespace InvoiceAttachPaymentParams {
2090
+ interface PaymentRecordData {
2091
+ /**
2092
+ * The amount that was paid out of band.
2093
+ */
2094
+ amount: number;
2095
+
2096
+ /**
2097
+ * The currency that was paid out of band.
2098
+ */
2099
+ currency: string;
2100
+
2101
+ /**
2102
+ * 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`.
2103
+ */
2104
+ metadata?: Stripe.Emptyable<Stripe.MetadataParam>;
2105
+
2106
+ /**
2107
+ * The type of money movement for this out of band payment record.
2108
+ */
2109
+ money_movement_type: string;
2110
+
2111
+ /**
2112
+ * The timestamp when this out of band payment was paid.
2113
+ */
2114
+ paid_at?: number;
2115
+
2116
+ /**
2117
+ * The reference for this out of band payment record.
2118
+ */
2119
+ payment_reference?: string;
2120
+ }
1819
2121
  }
1820
2122
 
1821
2123
  interface InvoiceCreatePreviewParams {
@@ -1834,6 +2136,11 @@ declare module 'stripe' {
1834
2136
  */
1835
2137
  customer?: string;
1836
2138
 
2139
+ /**
2140
+ * 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.
2141
+ */
2142
+ customer_account?: string;
2143
+
1837
2144
  /**
1838
2145
  * 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.
1839
2146
  */
@@ -2113,12 +2420,56 @@ declare module 'stripe' {
2113
2420
  */
2114
2421
  discount?: string;
2115
2422
 
2423
+ /**
2424
+ * Details to determine how long the discount should be applied for.
2425
+ */
2426
+ discount_end?: Discount.DiscountEnd;
2427
+
2116
2428
  /**
2117
2429
  * ID of the promotion code to create a new discount for.
2118
2430
  */
2119
2431
  promotion_code?: string;
2120
2432
  }
2121
2433
 
2434
+ namespace Discount {
2435
+ interface DiscountEnd {
2436
+ /**
2437
+ * Time span for the redeemed discount.
2438
+ */
2439
+ duration?: DiscountEnd.Duration;
2440
+
2441
+ /**
2442
+ * A precise Unix timestamp for the discount to end. Must be in the future.
2443
+ */
2444
+ timestamp?: number;
2445
+
2446
+ /**
2447
+ * The type of calculation made to determine when the discount ends.
2448
+ */
2449
+ type: DiscountEnd.Type;
2450
+ }
2451
+
2452
+ namespace DiscountEnd {
2453
+ interface Duration {
2454
+ /**
2455
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2456
+ */
2457
+ interval: Duration.Interval;
2458
+
2459
+ /**
2460
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2461
+ */
2462
+ interval_count: number;
2463
+ }
2464
+
2465
+ namespace Duration {
2466
+ type Interval = 'day' | 'month' | 'week' | 'year';
2467
+ }
2468
+
2469
+ type Type = 'duration' | 'timestamp';
2470
+ }
2471
+ }
2472
+
2122
2473
  interface InvoiceItem {
2123
2474
  /**
2124
2475
  * The integer amount in cents (or local equivalent) of previewed invoice item.
@@ -2213,12 +2564,56 @@ declare module 'stripe' {
2213
2564
  */
2214
2565
  discount?: string;
2215
2566
 
2567
+ /**
2568
+ * Details to determine how long the discount should be applied for.
2569
+ */
2570
+ discount_end?: Discount.DiscountEnd;
2571
+
2216
2572
  /**
2217
2573
  * ID of the promotion code to create a new discount for.
2218
2574
  */
2219
2575
  promotion_code?: string;
2220
2576
  }
2221
2577
 
2578
+ namespace Discount {
2579
+ interface DiscountEnd {
2580
+ /**
2581
+ * Time span for the redeemed discount.
2582
+ */
2583
+ duration?: DiscountEnd.Duration;
2584
+
2585
+ /**
2586
+ * A precise Unix timestamp for the discount to end. Must be in the future.
2587
+ */
2588
+ timestamp?: number;
2589
+
2590
+ /**
2591
+ * The type of calculation made to determine when the discount ends.
2592
+ */
2593
+ type: DiscountEnd.Type;
2594
+ }
2595
+
2596
+ namespace DiscountEnd {
2597
+ interface Duration {
2598
+ /**
2599
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2600
+ */
2601
+ interval: Duration.Interval;
2602
+
2603
+ /**
2604
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2605
+ */
2606
+ interval_count: number;
2607
+ }
2608
+
2609
+ namespace Duration {
2610
+ type Interval = 'day' | 'month' | 'week' | 'year';
2611
+ }
2612
+
2613
+ type Type = 'duration' | 'timestamp';
2614
+ }
2615
+ }
2616
+
2222
2617
  interface Period {
2223
2618
  /**
2224
2619
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.
@@ -2284,6 +2679,21 @@ declare module 'stripe' {
2284
2679
  type PreviewMode = 'next' | 'recurring';
2285
2680
 
2286
2681
  interface ScheduleDetails {
2682
+ /**
2683
+ * Changes to apply to the phases of the subscription schedule, in the order provided.
2684
+ */
2685
+ amendments?: Array<ScheduleDetails.Amendment>;
2686
+
2687
+ /**
2688
+ * 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.
2689
+ */
2690
+ billing_behavior?: ScheduleDetails.BillingBehavior;
2691
+
2692
+ /**
2693
+ * Controls how prorations and invoices for subscriptions are calculated and orchestrated.
2694
+ */
2695
+ billing_mode?: ScheduleDetails.BillingMode;
2696
+
2287
2697
  /**
2288
2698
  * Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
2289
2699
  */
@@ -2294,6 +2704,11 @@ declare module 'stripe' {
2294
2704
  */
2295
2705
  phases?: Array<ScheduleDetails.Phase>;
2296
2706
 
2707
+ /**
2708
+ * Provide any time periods to bill in advance.
2709
+ */
2710
+ prebilling?: Stripe.Emptyable<Array<ScheduleDetails.Prebilling>>;
2711
+
2297
2712
  /**
2298
2713
  * In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
2299
2714
  */
@@ -2301,26 +2716,625 @@ declare module 'stripe' {
2301
2716
  }
2302
2717
 
2303
2718
  namespace ScheduleDetails {
2304
- type EndBehavior = 'cancel' | 'release';
2305
-
2306
- interface Phase {
2719
+ interface Amendment {
2307
2720
  /**
2308
- * 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.
2721
+ * 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.
2309
2722
  */
2310
- add_invoice_items?: Array<Phase.AddInvoiceItem>;
2723
+ amendment_end?: Amendment.AmendmentEnd;
2311
2724
 
2312
2725
  /**
2313
- * 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).
2726
+ * Details to identify the earliest timestamp where the proposed change should take effect.
2314
2727
  */
2315
- application_fee_percent?: number;
2728
+ amendment_start: Amendment.AmendmentStart;
2316
2729
 
2317
2730
  /**
2318
- * Automatic tax settings for this phase.
2731
+ * 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.
2319
2732
  */
2320
- automatic_tax?: Phase.AutomaticTax;
2733
+ billing_cycle_anchor?: Amendment.BillingCycleAnchor;
2321
2734
 
2322
2735
  /**
2323
- * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
2736
+ * Changes to the coupons being redeemed or discounts being applied during the amendment time span.
2737
+ */
2738
+ discount_actions?: Array<Amendment.DiscountAction>;
2739
+
2740
+ /**
2741
+ * Changes to the subscription items during the amendment time span.
2742
+ */
2743
+ item_actions?: Array<Amendment.ItemAction>;
2744
+
2745
+ /**
2746
+ * Instructions for how to modify phase metadata
2747
+ */
2748
+ metadata_actions?: Array<Amendment.MetadataAction>;
2749
+
2750
+ /**
2751
+ * 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`.
2752
+ */
2753
+ proration_behavior?: Amendment.ProrationBehavior;
2754
+
2755
+ /**
2756
+ * Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
2757
+ */
2758
+ set_pause_collection?: Amendment.SetPauseCollection;
2759
+
2760
+ /**
2761
+ * Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
2762
+ */
2763
+ set_schedule_end?: Amendment.SetScheduleEnd;
2764
+
2765
+ /**
2766
+ * Settings related to subscription trials.
2767
+ */
2768
+ trial_settings?: Amendment.TrialSettings;
2769
+ }
2770
+
2771
+ namespace Amendment {
2772
+ interface AmendmentEnd {
2773
+ /**
2774
+ * Use the `end` time of a given discount.
2775
+ */
2776
+ discount_end?: AmendmentEnd.DiscountEnd;
2777
+
2778
+ /**
2779
+ * Time span for the amendment starting from the `amendment_start`.
2780
+ */
2781
+ duration?: AmendmentEnd.Duration;
2782
+
2783
+ /**
2784
+ * A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
2785
+ */
2786
+ timestamp?: number;
2787
+
2788
+ /**
2789
+ * Select one of three ways to pass the `amendment_end`.
2790
+ */
2791
+ type: AmendmentEnd.Type;
2792
+ }
2793
+
2794
+ namespace AmendmentEnd {
2795
+ interface DiscountEnd {
2796
+ /**
2797
+ * The ID of a specific discount.
2798
+ */
2799
+ discount: string;
2800
+ }
2801
+
2802
+ interface Duration {
2803
+ /**
2804
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2805
+ */
2806
+ interval: Duration.Interval;
2807
+
2808
+ /**
2809
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2810
+ */
2811
+ interval_count: number;
2812
+ }
2813
+
2814
+ namespace Duration {
2815
+ type Interval = 'day' | 'month' | 'week' | 'year';
2816
+ }
2817
+
2818
+ type Type =
2819
+ | 'discount_end'
2820
+ | 'duration'
2821
+ | 'schedule_end'
2822
+ | 'timestamp'
2823
+ | 'trial_end'
2824
+ | 'trial_start'
2825
+ | 'upcoming_invoice';
2826
+ }
2827
+
2828
+ interface AmendmentStart {
2829
+ /**
2830
+ * Details of another amendment in the same array, immediately after which this amendment should begin.
2831
+ */
2832
+ amendment_end?: AmendmentStart.AmendmentEnd;
2833
+
2834
+ /**
2835
+ * Use the `end` time of a given discount.
2836
+ */
2837
+ discount_end?: AmendmentStart.DiscountEnd;
2838
+
2839
+ /**
2840
+ * A precise Unix timestamp for the amendment to start.
2841
+ */
2842
+ timestamp?: number;
2843
+
2844
+ /**
2845
+ * Select one of three ways to pass the `amendment_start`.
2846
+ */
2847
+ type: AmendmentStart.Type;
2848
+ }
2849
+
2850
+ namespace AmendmentStart {
2851
+ interface AmendmentEnd {
2852
+ /**
2853
+ * 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.
2854
+ */
2855
+ index: number;
2856
+ }
2857
+
2858
+ interface DiscountEnd {
2859
+ /**
2860
+ * The ID of a specific discount.
2861
+ */
2862
+ discount: string;
2863
+ }
2864
+
2865
+ type Type =
2866
+ | 'amendment_end'
2867
+ | 'discount_end'
2868
+ | 'now'
2869
+ | 'schedule_end'
2870
+ | 'timestamp'
2871
+ | 'trial_end'
2872
+ | 'trial_start'
2873
+ | 'upcoming_invoice';
2874
+ }
2875
+
2876
+ type BillingCycleAnchor = 'amendment_start' | 'automatic';
2877
+
2878
+ interface DiscountAction {
2879
+ /**
2880
+ * Details of the discount to add.
2881
+ */
2882
+ add?: DiscountAction.Add;
2883
+
2884
+ /**
2885
+ * Details of the discount to remove.
2886
+ */
2887
+ remove?: DiscountAction.Remove;
2888
+
2889
+ /**
2890
+ * Details of the discount to replace the existing discounts with.
2891
+ */
2892
+ set?: DiscountAction.Set;
2893
+
2894
+ /**
2895
+ * Determines the type of discount action.
2896
+ */
2897
+ type: DiscountAction.Type;
2898
+ }
2899
+
2900
+ namespace DiscountAction {
2901
+ interface Add {
2902
+ /**
2903
+ * The coupon code to redeem.
2904
+ */
2905
+ coupon?: string;
2906
+
2907
+ /**
2908
+ * An ID of an existing discount for a coupon that was already redeemed.
2909
+ */
2910
+ discount?: string;
2911
+
2912
+ /**
2913
+ * Details to determine how long the discount should be applied for.
2914
+ */
2915
+ discount_end?: Add.DiscountEnd;
2916
+
2917
+ /**
2918
+ * 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.
2919
+ */
2920
+ index?: number;
2921
+
2922
+ /**
2923
+ * The promotion code to redeem.
2924
+ */
2925
+ promotion_code?: string;
2926
+ }
2927
+
2928
+ namespace Add {
2929
+ interface DiscountEnd {
2930
+ /**
2931
+ * The type of calculation made to determine when the discount ends.
2932
+ */
2933
+ type: 'amendment_end';
2934
+ }
2935
+ }
2936
+
2937
+ interface Remove {
2938
+ /**
2939
+ * The coupon code to remove from the `discounts` array.
2940
+ */
2941
+ coupon?: string;
2942
+
2943
+ /**
2944
+ * The ID of a discount to remove from the `discounts` array.
2945
+ */
2946
+ discount?: string;
2947
+
2948
+ /**
2949
+ * The ID of a promotion code to remove from the `discounts` array.
2950
+ */
2951
+ promotion_code?: string;
2952
+ }
2953
+
2954
+ interface Set {
2955
+ /**
2956
+ * The coupon code to replace the `discounts` array with.
2957
+ */
2958
+ coupon?: string;
2959
+
2960
+ /**
2961
+ * An ID of an existing discount to replace the `discounts` array with.
2962
+ */
2963
+ discount?: string;
2964
+
2965
+ /**
2966
+ * An ID of an existing promotion code to replace the `discounts` array with.
2967
+ */
2968
+ promotion_code?: string;
2969
+ }
2970
+
2971
+ type Type = 'add' | 'remove' | 'set';
2972
+ }
2973
+
2974
+ interface ItemAction {
2975
+ /**
2976
+ * 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.
2977
+ */
2978
+ add?: ItemAction.Add;
2979
+
2980
+ /**
2981
+ * Details of the subscription item to remove.
2982
+ */
2983
+ remove?: ItemAction.Remove;
2984
+
2985
+ /**
2986
+ * 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.
2987
+ */
2988
+ set?: ItemAction.Set;
2989
+
2990
+ /**
2991
+ * Determines the type of item action.
2992
+ */
2993
+ type: ItemAction.Type;
2994
+ }
2995
+
2996
+ namespace ItemAction {
2997
+ interface Add {
2998
+ /**
2999
+ * The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
3000
+ */
3001
+ discounts?: Array<Add.Discount>;
3002
+
3003
+ /**
3004
+ * 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`.
3005
+ */
3006
+ metadata?: Stripe.MetadataParam;
3007
+
3008
+ /**
3009
+ * The ID of the price object.
3010
+ */
3011
+ price: string;
3012
+
3013
+ /**
3014
+ * Quantity for this item.
3015
+ */
3016
+ quantity?: number;
3017
+
3018
+ /**
3019
+ * 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`.
3020
+ */
3021
+ tax_rates?: Array<string>;
3022
+
3023
+ /**
3024
+ * Options that configure the trial on the subscription item.
3025
+ */
3026
+ trial?: Add.Trial;
3027
+ }
3028
+
3029
+ namespace Add {
3030
+ interface Discount {
3031
+ /**
3032
+ * ID of the coupon to create a new discount for.
3033
+ */
3034
+ coupon?: string;
3035
+
3036
+ /**
3037
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
3038
+ */
3039
+ discount?: string;
3040
+
3041
+ /**
3042
+ * Details to determine how long the discount should be applied for.
3043
+ */
3044
+ discount_end?: Discount.DiscountEnd;
3045
+
3046
+ /**
3047
+ * ID of the promotion code to create a new discount for.
3048
+ */
3049
+ promotion_code?: string;
3050
+ }
3051
+
3052
+ namespace Discount {
3053
+ interface DiscountEnd {
3054
+ /**
3055
+ * Time span for the redeemed discount.
3056
+ */
3057
+ duration?: DiscountEnd.Duration;
3058
+
3059
+ /**
3060
+ * A precise Unix timestamp for the discount to end. Must be in the future.
3061
+ */
3062
+ timestamp?: number;
3063
+
3064
+ /**
3065
+ * The type of calculation made to determine when the discount ends.
3066
+ */
3067
+ type: DiscountEnd.Type;
3068
+ }
3069
+
3070
+ namespace DiscountEnd {
3071
+ interface Duration {
3072
+ /**
3073
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3074
+ */
3075
+ interval: Duration.Interval;
3076
+
3077
+ /**
3078
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3079
+ */
3080
+ interval_count: number;
3081
+ }
3082
+
3083
+ namespace Duration {
3084
+ type Interval = 'day' | 'month' | 'week' | 'year';
3085
+ }
3086
+
3087
+ type Type = 'duration' | 'timestamp';
3088
+ }
3089
+ }
3090
+
3091
+ interface Trial {
3092
+ /**
3093
+ * 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.
3094
+ */
3095
+ converts_to?: Array<string>;
3096
+
3097
+ /**
3098
+ * Determines the type of trial for this item.
3099
+ */
3100
+ type: Trial.Type;
3101
+ }
3102
+
3103
+ namespace Trial {
3104
+ type Type = 'free' | 'paid';
3105
+ }
3106
+ }
3107
+
3108
+ interface Remove {
3109
+ /**
3110
+ * ID of a price to remove.
3111
+ */
3112
+ price: string;
3113
+ }
3114
+
3115
+ interface Set {
3116
+ /**
3117
+ * 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`.
3118
+ */
3119
+ discounts?: Array<Set.Discount>;
3120
+
3121
+ /**
3122
+ * 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`.
3123
+ */
3124
+ metadata?: Stripe.MetadataParam;
3125
+
3126
+ /**
3127
+ * The ID of the price object.
3128
+ */
3129
+ price: string;
3130
+
3131
+ /**
3132
+ * 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`.
3133
+ */
3134
+ quantity?: number;
3135
+
3136
+ /**
3137
+ * 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`.
3138
+ */
3139
+ tax_rates?: Array<string>;
3140
+
3141
+ /**
3142
+ * 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`.
3143
+ */
3144
+ trial?: Set.Trial;
3145
+ }
3146
+
3147
+ namespace Set {
3148
+ interface Discount {
3149
+ /**
3150
+ * ID of the coupon to create a new discount for.
3151
+ */
3152
+ coupon?: string;
3153
+
3154
+ /**
3155
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
3156
+ */
3157
+ discount?: string;
3158
+
3159
+ /**
3160
+ * Details to determine how long the discount should be applied for.
3161
+ */
3162
+ discount_end?: Discount.DiscountEnd;
3163
+
3164
+ /**
3165
+ * ID of the promotion code to create a new discount for.
3166
+ */
3167
+ promotion_code?: string;
3168
+ }
3169
+
3170
+ namespace Discount {
3171
+ interface DiscountEnd {
3172
+ /**
3173
+ * Time span for the redeemed discount.
3174
+ */
3175
+ duration?: DiscountEnd.Duration;
3176
+
3177
+ /**
3178
+ * A precise Unix timestamp for the discount to end. Must be in the future.
3179
+ */
3180
+ timestamp?: number;
3181
+
3182
+ /**
3183
+ * The type of calculation made to determine when the discount ends.
3184
+ */
3185
+ type: DiscountEnd.Type;
3186
+ }
3187
+
3188
+ namespace DiscountEnd {
3189
+ interface Duration {
3190
+ /**
3191
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3192
+ */
3193
+ interval: Duration.Interval;
3194
+
3195
+ /**
3196
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3197
+ */
3198
+ interval_count: number;
3199
+ }
3200
+
3201
+ namespace Duration {
3202
+ type Interval = 'day' | 'month' | 'week' | 'year';
3203
+ }
3204
+
3205
+ type Type = 'duration' | 'timestamp';
3206
+ }
3207
+ }
3208
+
3209
+ interface Trial {
3210
+ /**
3211
+ * 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.
3212
+ */
3213
+ converts_to?: Array<string>;
3214
+
3215
+ /**
3216
+ * Determines the type of trial for this item.
3217
+ */
3218
+ type: Trial.Type;
3219
+ }
3220
+
3221
+ namespace Trial {
3222
+ type Type = 'free' | 'paid';
3223
+ }
3224
+ }
3225
+
3226
+ type Type = 'add' | 'remove' | 'set';
3227
+ }
3228
+
3229
+ interface MetadataAction {
3230
+ /**
3231
+ * Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
3232
+ */
3233
+ add?: {
3234
+ [key: string]: string;
3235
+ };
3236
+
3237
+ /**
3238
+ * Keys to remove from schedule phase metadata.
3239
+ */
3240
+ remove?: Array<string>;
3241
+
3242
+ /**
3243
+ * Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
3244
+ */
3245
+ set?: Stripe.Emptyable<{
3246
+ [key: string]: string;
3247
+ }>;
3248
+
3249
+ /**
3250
+ * Select one of three ways to update phase-level `metadata` on subscription schedules.
3251
+ */
3252
+ type: MetadataAction.Type;
3253
+ }
3254
+
3255
+ namespace MetadataAction {
3256
+ type Type = 'add' | 'remove' | 'set';
3257
+ }
3258
+
3259
+ type ProrationBehavior =
3260
+ | 'always_invoice'
3261
+ | 'create_prorations'
3262
+ | 'none';
3263
+
3264
+ interface SetPauseCollection {
3265
+ /**
3266
+ * Details of the pause_collection behavior to apply to the amendment.
3267
+ */
3268
+ set?: SetPauseCollection.Set;
3269
+
3270
+ /**
3271
+ * Determines the type of the pause_collection amendment.
3272
+ */
3273
+ type: SetPauseCollection.Type;
3274
+ }
3275
+
3276
+ namespace SetPauseCollection {
3277
+ interface Set {
3278
+ /**
3279
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3280
+ */
3281
+ behavior: Set.Behavior;
3282
+ }
3283
+
3284
+ namespace Set {
3285
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
3286
+ }
3287
+
3288
+ type Type = 'remove' | 'set';
3289
+ }
3290
+
3291
+ type SetScheduleEnd = 'amendment_end' | 'amendment_start';
3292
+
3293
+ interface TrialSettings {
3294
+ /**
3295
+ * Defines how the subscription should behave when a trial ends.
3296
+ */
3297
+ end_behavior?: TrialSettings.EndBehavior;
3298
+ }
3299
+
3300
+ namespace TrialSettings {
3301
+ interface EndBehavior {
3302
+ /**
3303
+ * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3304
+ */
3305
+ prorate_up_front?: EndBehavior.ProrateUpFront;
3306
+ }
3307
+
3308
+ namespace EndBehavior {
3309
+ type ProrateUpFront = 'defer' | 'include';
3310
+ }
3311
+ }
3312
+ }
3313
+
3314
+ type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
3315
+
3316
+ type BillingMode = 'classic' | 'flexible';
3317
+
3318
+ type EndBehavior = 'cancel' | 'release';
3319
+
3320
+ interface Phase {
3321
+ /**
3322
+ * 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.
3323
+ */
3324
+ add_invoice_items?: Array<Phase.AddInvoiceItem>;
3325
+
3326
+ /**
3327
+ * 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).
3328
+ */
3329
+ application_fee_percent?: number;
3330
+
3331
+ /**
3332
+ * Automatic tax settings for this phase.
3333
+ */
3334
+ automatic_tax?: Phase.AutomaticTax;
3335
+
3336
+ /**
3337
+ * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
2324
3338
  */
2325
3339
  billing_cycle_anchor?: Phase.BillingCycleAnchor;
2326
3340
 
@@ -2389,6 +3403,11 @@ declare module 'stripe' {
2389
3403
  */
2390
3404
  on_behalf_of?: string;
2391
3405
 
3406
+ /**
3407
+ * 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).
3408
+ */
3409
+ pause_collection?: Phase.PauseCollection;
3410
+
2392
3411
  /**
2393
3412
  * 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.
2394
3413
  */
@@ -2409,10 +3428,20 @@ declare module 'stripe' {
2409
3428
  */
2410
3429
  trial?: boolean;
2411
3430
 
3431
+ /**
3432
+ * Specify trial behavior when crossing phase boundaries
3433
+ */
3434
+ trial_continuation?: Phase.TrialContinuation;
3435
+
2412
3436
  /**
2413
3437
  * 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`
2414
3438
  */
2415
3439
  trial_end?: number | 'now';
3440
+
3441
+ /**
3442
+ * Settings related to subscription trials.
3443
+ */
3444
+ trial_settings?: Phase.TrialSettings;
2416
3445
  }
2417
3446
 
2418
3447
  namespace Phase {
@@ -2455,12 +3484,56 @@ declare module 'stripe' {
2455
3484
  */
2456
3485
  discount?: string;
2457
3486
 
3487
+ /**
3488
+ * Details to determine how long the discount should be applied for.
3489
+ */
3490
+ discount_end?: Discount.DiscountEnd;
3491
+
2458
3492
  /**
2459
3493
  * ID of the promotion code to create a new discount for.
2460
3494
  */
2461
3495
  promotion_code?: string;
2462
3496
  }
2463
3497
 
3498
+ namespace Discount {
3499
+ interface DiscountEnd {
3500
+ /**
3501
+ * Time span for the redeemed discount.
3502
+ */
3503
+ duration?: DiscountEnd.Duration;
3504
+
3505
+ /**
3506
+ * A precise Unix timestamp for the discount to end. Must be in the future.
3507
+ */
3508
+ timestamp?: number;
3509
+
3510
+ /**
3511
+ * The type of calculation made to determine when the discount ends.
3512
+ */
3513
+ type: DiscountEnd.Type;
3514
+ }
3515
+
3516
+ namespace DiscountEnd {
3517
+ interface Duration {
3518
+ /**
3519
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3520
+ */
3521
+ interval: Duration.Interval;
3522
+
3523
+ /**
3524
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3525
+ */
3526
+ interval_count: number;
3527
+ }
3528
+
3529
+ namespace Duration {
3530
+ type Interval = 'day' | 'month' | 'week' | 'year';
3531
+ }
3532
+
3533
+ type Type = 'duration' | 'timestamp';
3534
+ }
3535
+ }
3536
+
2464
3537
  interface PriceData {
2465
3538
  /**
2466
3539
  * 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).
@@ -2550,12 +3623,56 @@ declare module 'stripe' {
2550
3623
  */
2551
3624
  discount?: string;
2552
3625
 
3626
+ /**
3627
+ * Details to determine how long the discount should be applied for.
3628
+ */
3629
+ discount_end?: Discount.DiscountEnd;
3630
+
2553
3631
  /**
2554
3632
  * ID of the promotion code to create a new discount for.
2555
3633
  */
2556
3634
  promotion_code?: string;
2557
3635
  }
2558
3636
 
3637
+ namespace Discount {
3638
+ interface DiscountEnd {
3639
+ /**
3640
+ * Time span for the redeemed discount.
3641
+ */
3642
+ duration?: DiscountEnd.Duration;
3643
+
3644
+ /**
3645
+ * A precise Unix timestamp for the discount to end. Must be in the future.
3646
+ */
3647
+ timestamp?: number;
3648
+
3649
+ /**
3650
+ * The type of calculation made to determine when the discount ends.
3651
+ */
3652
+ type: DiscountEnd.Type;
3653
+ }
3654
+
3655
+ namespace DiscountEnd {
3656
+ interface Duration {
3657
+ /**
3658
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3659
+ */
3660
+ interval: Duration.Interval;
3661
+
3662
+ /**
3663
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3664
+ */
3665
+ interval_count: number;
3666
+ }
3667
+
3668
+ namespace Duration {
3669
+ type Interval = 'day' | 'month' | 'week' | 'year';
3670
+ }
3671
+
3672
+ type Type = 'duration' | 'timestamp';
3673
+ }
3674
+ }
3675
+
2559
3676
  interface InvoiceSettings {
2560
3677
  /**
2561
3678
  * 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.
@@ -2631,6 +3748,11 @@ declare module 'stripe' {
2631
3748
  * 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.
2632
3749
  */
2633
3750
  tax_rates?: Stripe.Emptyable<Array<string>>;
3751
+
3752
+ /**
3753
+ * Options that configure the trial on the subscription item.
3754
+ */
3755
+ trial?: Item.Trial;
2634
3756
  }
2635
3757
 
2636
3758
  namespace Item {
@@ -2652,12 +3774,56 @@ declare module 'stripe' {
2652
3774
  */
2653
3775
  discount?: string;
2654
3776
 
3777
+ /**
3778
+ * Details to determine how long the discount should be applied for.
3779
+ */
3780
+ discount_end?: Discount.DiscountEnd;
3781
+
2655
3782
  /**
2656
3783
  * ID of the promotion code to create a new discount for.
2657
3784
  */
2658
3785
  promotion_code?: string;
2659
3786
  }
2660
3787
 
3788
+ namespace Discount {
3789
+ interface DiscountEnd {
3790
+ /**
3791
+ * Time span for the redeemed discount.
3792
+ */
3793
+ duration?: DiscountEnd.Duration;
3794
+
3795
+ /**
3796
+ * A precise Unix timestamp for the discount to end. Must be in the future.
3797
+ */
3798
+ timestamp?: number;
3799
+
3800
+ /**
3801
+ * The type of calculation made to determine when the discount ends.
3802
+ */
3803
+ type: DiscountEnd.Type;
3804
+ }
3805
+
3806
+ namespace DiscountEnd {
3807
+ interface Duration {
3808
+ /**
3809
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3810
+ */
3811
+ interval: Duration.Interval;
3812
+
3813
+ /**
3814
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3815
+ */
3816
+ interval_count: number;
3817
+ }
3818
+
3819
+ namespace Duration {
3820
+ type Interval = 'day' | 'month' | 'week' | 'year';
3821
+ }
3822
+
3823
+ type Type = 'duration' | 'timestamp';
3824
+ }
3825
+ }
3826
+
2661
3827
  interface PriceData {
2662
3828
  /**
2663
3829
  * 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).
@@ -2709,6 +3875,33 @@ declare module 'stripe' {
2709
3875
 
2710
3876
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
2711
3877
  }
3878
+
3879
+ interface Trial {
3880
+ /**
3881
+ * 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.
3882
+ */
3883
+ converts_to?: Array<string>;
3884
+
3885
+ /**
3886
+ * Determines the type of trial for this item.
3887
+ */
3888
+ type: Trial.Type;
3889
+ }
3890
+
3891
+ namespace Trial {
3892
+ type Type = 'free' | 'paid';
3893
+ }
3894
+ }
3895
+
3896
+ interface PauseCollection {
3897
+ /**
3898
+ * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3899
+ */
3900
+ behavior: PauseCollection.Behavior;
3901
+ }
3902
+
3903
+ namespace PauseCollection {
3904
+ type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
2712
3905
  }
2713
3906
 
2714
3907
  type ProrationBehavior =
@@ -2727,6 +3920,95 @@ declare module 'stripe' {
2727
3920
  */
2728
3921
  destination: string;
2729
3922
  }
3923
+
3924
+ type TrialContinuation = 'continue' | 'none';
3925
+
3926
+ interface TrialSettings {
3927
+ /**
3928
+ * Defines how the subscription should behave when a trial ends.
3929
+ */
3930
+ end_behavior?: TrialSettings.EndBehavior;
3931
+ }
3932
+
3933
+ namespace TrialSettings {
3934
+ interface EndBehavior {
3935
+ /**
3936
+ * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3937
+ */
3938
+ prorate_up_front?: EndBehavior.ProrateUpFront;
3939
+ }
3940
+
3941
+ namespace EndBehavior {
3942
+ type ProrateUpFront = 'defer' | 'include';
3943
+ }
3944
+ }
3945
+ }
3946
+
3947
+ interface Prebilling {
3948
+ /**
3949
+ * The end of the prebilled time period.
3950
+ */
3951
+ bill_until?: Prebilling.BillUntil;
3952
+
3953
+ /**
3954
+ * This is used to determine the number of billing cycles to prebill.
3955
+ */
3956
+ iterations?: number;
3957
+ }
3958
+
3959
+ namespace Prebilling {
3960
+ interface BillUntil {
3961
+ /**
3962
+ * End the prebilled period when a specified amendment ends.
3963
+ */
3964
+ amendment_end?: BillUntil.AmendmentEnd;
3965
+
3966
+ /**
3967
+ * Time span for prebilling, starting from `bill_from`.
3968
+ */
3969
+ duration?: BillUntil.Duration;
3970
+
3971
+ /**
3972
+ * End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
3973
+ */
3974
+ timestamp?: number;
3975
+
3976
+ /**
3977
+ * Select one of several ways to pass the `bill_until` value.
3978
+ */
3979
+ type: BillUntil.Type;
3980
+ }
3981
+
3982
+ namespace BillUntil {
3983
+ interface AmendmentEnd {
3984
+ /**
3985
+ * 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.
3986
+ */
3987
+ index: number;
3988
+ }
3989
+
3990
+ interface Duration {
3991
+ /**
3992
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3993
+ */
3994
+ interval: Duration.Interval;
3995
+
3996
+ /**
3997
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3998
+ */
3999
+ interval_count: number;
4000
+ }
4001
+
4002
+ namespace Duration {
4003
+ type Interval = 'day' | 'month' | 'week' | 'year';
4004
+ }
4005
+
4006
+ type Type =
4007
+ | 'amendment_end'
4008
+ | 'duration'
4009
+ | 'schedule_end'
4010
+ | 'timestamp';
4011
+ }
2730
4012
  }
2731
4013
 
2732
4014
  type ProrationBehavior =
@@ -2741,10 +4023,15 @@ declare module 'stripe' {
2741
4023
  */
2742
4024
  billing_cycle_anchor?: SubscriptionDetails.BillingCycleAnchor | number;
2743
4025
 
4026
+ /**
4027
+ * Controls how prorations and invoices for subscriptions are calculated and orchestrated.
4028
+ */
4029
+ billing_mode?: SubscriptionDetails.BillingMode;
4030
+
2744
4031
  /**
2745
4032
  * 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.
2746
4033
  */
2747
- cancel_at?: Stripe.Emptyable<number>;
4034
+ cancel_at?: Stripe.Emptyable<number | SubscriptionDetails.CancelAt>;
2748
4035
 
2749
4036
  /**
2750
4037
  * Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead.
@@ -2766,6 +4053,11 @@ declare module 'stripe' {
2766
4053
  */
2767
4054
  items?: Array<SubscriptionDetails.Item>;
2768
4055
 
4056
+ /**
4057
+ * The pre-billing to apply to the subscription as a preview.
4058
+ */
4059
+ prebilling?: SubscriptionDetails.Prebilling;
4060
+
2769
4061
  /**
2770
4062
  * 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`.
2771
4063
  */
@@ -2795,6 +4087,10 @@ declare module 'stripe' {
2795
4087
  namespace SubscriptionDetails {
2796
4088
  type BillingCycleAnchor = 'now' | 'unchanged';
2797
4089
 
4090
+ type BillingMode = 'classic' | 'flexible';
4091
+
4092
+ type CancelAt = 'max_period_end' | 'min_period_end';
4093
+
2798
4094
  interface Item {
2799
4095
  /**
2800
4096
  * 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.
@@ -2871,12 +4167,56 @@ declare module 'stripe' {
2871
4167
  */
2872
4168
  discount?: string;
2873
4169
 
4170
+ /**
4171
+ * Details to determine how long the discount should be applied for.
4172
+ */
4173
+ discount_end?: Discount.DiscountEnd;
4174
+
2874
4175
  /**
2875
4176
  * ID of the promotion code to create a new discount for.
2876
4177
  */
2877
4178
  promotion_code?: string;
2878
4179
  }
2879
4180
 
4181
+ namespace Discount {
4182
+ interface DiscountEnd {
4183
+ /**
4184
+ * Time span for the redeemed discount.
4185
+ */
4186
+ duration?: DiscountEnd.Duration;
4187
+
4188
+ /**
4189
+ * A precise Unix timestamp for the discount to end. Must be in the future.
4190
+ */
4191
+ timestamp?: number;
4192
+
4193
+ /**
4194
+ * The type of calculation made to determine when the discount ends.
4195
+ */
4196
+ type: DiscountEnd.Type;
4197
+ }
4198
+
4199
+ namespace DiscountEnd {
4200
+ interface Duration {
4201
+ /**
4202
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
4203
+ */
4204
+ interval: Duration.Interval;
4205
+
4206
+ /**
4207
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
4208
+ */
4209
+ interval_count: number;
4210
+ }
4211
+
4212
+ namespace Duration {
4213
+ type Interval = 'day' | 'month' | 'week' | 'year';
4214
+ }
4215
+
4216
+ type Type = 'duration' | 'timestamp';
4217
+ }
4218
+ }
4219
+
2880
4220
  interface PriceData {
2881
4221
  /**
2882
4222
  * 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).
@@ -2930,6 +4270,13 @@ declare module 'stripe' {
2930
4270
  }
2931
4271
  }
2932
4272
 
4273
+ interface Prebilling {
4274
+ /**
4275
+ * This is used to determine the number of billing cycles to prebill.
4276
+ */
4277
+ iterations: number;
4278
+ }
4279
+
2933
4280
  type ProrationBehavior =
2934
4281
  | 'always_invoice'
2935
4282
  | 'create_prorations'
@@ -3114,6 +4461,11 @@ declare module 'stripe' {
3114
4461
  */
3115
4462
  id: string;
3116
4463
 
4464
+ /**
4465
+ * 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.
4466
+ */
4467
+ margins?: Stripe.Emptyable<Array<string>>;
4468
+
3117
4469
  /**
3118
4470
  * 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.
3119
4471
  */
@@ -3162,12 +4514,56 @@ declare module 'stripe' {
3162
4514
  */
3163
4515
  discount?: string;
3164
4516
 
4517
+ /**
4518
+ * Details to determine how long the discount should be applied for.
4519
+ */
4520
+ discount_end?: Discount.DiscountEnd;
4521
+
3165
4522
  /**
3166
4523
  * ID of the promotion code to create a new discount for.
3167
4524
  */
3168
4525
  promotion_code?: string;
3169
4526
  }
3170
4527
 
4528
+ namespace Discount {
4529
+ interface DiscountEnd {
4530
+ /**
4531
+ * Time span for the redeemed discount.
4532
+ */
4533
+ duration?: DiscountEnd.Duration;
4534
+
4535
+ /**
4536
+ * A precise Unix timestamp for the discount to end. Must be in the future.
4537
+ */
4538
+ timestamp?: number;
4539
+
4540
+ /**
4541
+ * The type of calculation made to determine when the discount ends.
4542
+ */
4543
+ type: DiscountEnd.Type;
4544
+ }
4545
+
4546
+ namespace DiscountEnd {
4547
+ interface Duration {
4548
+ /**
4549
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
4550
+ */
4551
+ interval: Duration.Interval;
4552
+
4553
+ /**
4554
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
4555
+ */
4556
+ interval_count: number;
4557
+ }
4558
+
4559
+ namespace Duration {
4560
+ type Interval = 'day' | 'month' | 'week' | 'year';
4561
+ }
4562
+
4563
+ type Type = 'duration' | 'timestamp';
4564
+ }
4565
+ }
4566
+
3171
4567
  interface Period {
3172
4568
  /**
3173
4569
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.
@@ -3394,6 +4790,11 @@ declare module 'stripe' {
3394
4790
  */
3395
4791
  expand?: Array<string>;
3396
4792
 
4793
+ /**
4794
+ * 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.
4795
+ */
4796
+ margins?: Stripe.Emptyable<Array<string>>;
4797
+
3397
4798
  /**
3398
4799
  * 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.
3399
4800
  */
@@ -3444,12 +4845,56 @@ declare module 'stripe' {
3444
4845
  */
3445
4846
  discount?: string;
3446
4847
 
4848
+ /**
4849
+ * Details to determine how long the discount should be applied for.
4850
+ */
4851
+ discount_end?: Discount.DiscountEnd;
4852
+
3447
4853
  /**
3448
4854
  * ID of the promotion code to create a new discount for.
3449
4855
  */
3450
4856
  promotion_code?: string;
3451
4857
  }
3452
4858
 
4859
+ namespace Discount {
4860
+ interface DiscountEnd {
4861
+ /**
4862
+ * Time span for the redeemed discount.
4863
+ */
4864
+ duration?: DiscountEnd.Duration;
4865
+
4866
+ /**
4867
+ * A precise Unix timestamp for the discount to end. Must be in the future.
4868
+ */
4869
+ timestamp?: number;
4870
+
4871
+ /**
4872
+ * The type of calculation made to determine when the discount ends.
4873
+ */
4874
+ type: DiscountEnd.Type;
4875
+ }
4876
+
4877
+ namespace DiscountEnd {
4878
+ interface Duration {
4879
+ /**
4880
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
4881
+ */
4882
+ interval: Duration.Interval;
4883
+
4884
+ /**
4885
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
4886
+ */
4887
+ interval_count: number;
4888
+ }
4889
+
4890
+ namespace Duration {
4891
+ type Interval = 'day' | 'month' | 'week' | 'year';
4892
+ }
4893
+
4894
+ type Type = 'duration' | 'timestamp';
4895
+ }
4896
+ }
4897
+
3453
4898
  interface Period {
3454
4899
  /**
3455
4900
  * The end of the period, which must be greater than or equal to the start. This value is inclusive.