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
@@ -3,11 +3,6 @@
3
3
  declare module 'stripe' {
4
4
  namespace Stripe {
5
5
  interface SubscriptionCreateParams {
6
- /**
7
- * The identifier of the customer to subscribe.
8
- */
9
- customer: string;
10
-
11
6
  /**
12
7
  * A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items.
13
8
  */
@@ -53,7 +48,7 @@ declare module 'stripe' {
53
48
  /**
54
49
  * 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.
55
50
  */
56
- cancel_at?: number;
51
+ cancel_at?: number | SubscriptionCreateParams.CancelAt;
57
52
 
58
53
  /**
59
54
  * Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
@@ -70,6 +65,16 @@ declare module 'stripe' {
70
65
  */
71
66
  currency?: string;
72
67
 
68
+ /**
69
+ * The identifier of the customer to subscribe.
70
+ */
71
+ customer?: string;
72
+
73
+ /**
74
+ * The identifier of the account to subscribe.
75
+ */
76
+ customer_account?: string;
77
+
73
78
  /**
74
79
  * Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.
75
80
  */
@@ -157,6 +162,11 @@ declare module 'stripe' {
157
162
  SubscriptionCreateParams.PendingInvoiceItemInterval
158
163
  >;
159
164
 
165
+ /**
166
+ * If specified, the invoicing for the given billing cycle iterations will be processed now.
167
+ */
168
+ prebilling?: SubscriptionCreateParams.Prebilling;
169
+
160
170
  /**
161
171
  * Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`.
162
172
  */
@@ -228,12 +238,56 @@ declare module 'stripe' {
228
238
  */
229
239
  discount?: string;
230
240
 
241
+ /**
242
+ * Details to determine how long the discount should be applied for.
243
+ */
244
+ discount_end?: Discount.DiscountEnd;
245
+
231
246
  /**
232
247
  * ID of the promotion code to create a new discount for.
233
248
  */
234
249
  promotion_code?: string;
235
250
  }
236
251
 
252
+ namespace Discount {
253
+ interface DiscountEnd {
254
+ /**
255
+ * Time span for the redeemed discount.
256
+ */
257
+ duration?: DiscountEnd.Duration;
258
+
259
+ /**
260
+ * A precise Unix timestamp for the discount to end. Must be in the future.
261
+ */
262
+ timestamp?: number;
263
+
264
+ /**
265
+ * The type of calculation made to determine when the discount ends.
266
+ */
267
+ type: DiscountEnd.Type;
268
+ }
269
+
270
+ namespace DiscountEnd {
271
+ interface Duration {
272
+ /**
273
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
274
+ */
275
+ interval: Duration.Interval;
276
+
277
+ /**
278
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
279
+ */
280
+ interval_count: number;
281
+ }
282
+
283
+ namespace Duration {
284
+ type Interval = 'day' | 'month' | 'week' | 'year';
285
+ }
286
+
287
+ type Type = 'duration' | 'timestamp';
288
+ }
289
+ }
290
+
237
291
  interface PriceData {
238
292
  /**
239
293
  * 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).
@@ -343,6 +397,8 @@ declare module 'stripe' {
343
397
  reset_billing_cycle_anchor?: boolean;
344
398
  }
345
399
 
400
+ type CancelAt = 'max_period_end' | 'min_period_end';
401
+
346
402
  type CollectionMethod = 'charge_automatically' | 'send_invoice';
347
403
 
348
404
  interface Discount {
@@ -356,12 +412,56 @@ declare module 'stripe' {
356
412
  */
357
413
  discount?: string;
358
414
 
415
+ /**
416
+ * Details to determine how long the discount should be applied for.
417
+ */
418
+ discount_end?: Discount.DiscountEnd;
419
+
359
420
  /**
360
421
  * ID of the promotion code to create a new discount for.
361
422
  */
362
423
  promotion_code?: string;
363
424
  }
364
425
 
426
+ namespace Discount {
427
+ interface DiscountEnd {
428
+ /**
429
+ * Time span for the redeemed discount.
430
+ */
431
+ duration?: DiscountEnd.Duration;
432
+
433
+ /**
434
+ * A precise Unix timestamp for the discount to end. Must be in the future.
435
+ */
436
+ timestamp?: number;
437
+
438
+ /**
439
+ * The type of calculation made to determine when the discount ends.
440
+ */
441
+ type: DiscountEnd.Type;
442
+ }
443
+
444
+ namespace DiscountEnd {
445
+ interface Duration {
446
+ /**
447
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
448
+ */
449
+ interval: Duration.Interval;
450
+
451
+ /**
452
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
453
+ */
454
+ interval_count: number;
455
+ }
456
+
457
+ namespace Duration {
458
+ type Interval = 'day' | 'month' | 'week' | 'year';
459
+ }
460
+
461
+ type Type = 'duration' | 'timestamp';
462
+ }
463
+ }
464
+
365
465
  interface InvoiceSettings {
366
466
  /**
367
467
  * The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
@@ -432,6 +532,11 @@ declare module 'stripe' {
432
532
  * 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.
433
533
  */
434
534
  tax_rates?: Stripe.Emptyable<Array<string>>;
535
+
536
+ /**
537
+ * Define options to configure the trial on the subscription item.
538
+ */
539
+ trial?: Item.Trial;
435
540
  }
436
541
 
437
542
  namespace Item {
@@ -453,12 +558,56 @@ declare module 'stripe' {
453
558
  */
454
559
  discount?: string;
455
560
 
561
+ /**
562
+ * Details to determine how long the discount should be applied for.
563
+ */
564
+ discount_end?: Discount.DiscountEnd;
565
+
456
566
  /**
457
567
  * ID of the promotion code to create a new discount for.
458
568
  */
459
569
  promotion_code?: string;
460
570
  }
461
571
 
572
+ namespace Discount {
573
+ interface DiscountEnd {
574
+ /**
575
+ * Time span for the redeemed discount.
576
+ */
577
+ duration?: DiscountEnd.Duration;
578
+
579
+ /**
580
+ * A precise Unix timestamp for the discount to end. Must be in the future.
581
+ */
582
+ timestamp?: number;
583
+
584
+ /**
585
+ * The type of calculation made to determine when the discount ends.
586
+ */
587
+ type: DiscountEnd.Type;
588
+ }
589
+
590
+ namespace DiscountEnd {
591
+ interface Duration {
592
+ /**
593
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
594
+ */
595
+ interval: Duration.Interval;
596
+
597
+ /**
598
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
599
+ */
600
+ interval_count: number;
601
+ }
602
+
603
+ namespace Duration {
604
+ type Interval = 'day' | 'month' | 'week' | 'year';
605
+ }
606
+
607
+ type Type = 'duration' | 'timestamp';
608
+ }
609
+ }
610
+
462
611
  interface PriceData {
463
612
  /**
464
613
  * 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).
@@ -510,6 +659,22 @@ declare module 'stripe' {
510
659
 
511
660
  type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
512
661
  }
662
+
663
+ interface Trial {
664
+ /**
665
+ * 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.
666
+ */
667
+ converts_to?: Array<string>;
668
+
669
+ /**
670
+ * Determines the type of trial for this item.
671
+ */
672
+ type: Trial.Type;
673
+ }
674
+
675
+ namespace Trial {
676
+ type Type = 'free' | 'paid';
677
+ }
513
678
  }
514
679
 
515
680
  type PaymentBehavior =
@@ -561,6 +726,13 @@ declare module 'stripe' {
561
726
  PaymentMethodOptions.CustomerBalance
562
727
  >;
563
728
 
729
+ /**
730
+ * This sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent.
731
+ */
732
+ id_bank_transfer?: Stripe.Emptyable<
733
+ PaymentMethodOptions.IdBankTransfer
734
+ >;
735
+
564
736
  /**
565
737
  * This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent.
566
738
  */
@@ -710,6 +882,8 @@ declare module 'stripe' {
710
882
  }
711
883
  }
712
884
 
885
+ interface IdBankTransfer {}
886
+
713
887
  interface Konbini {}
714
888
 
715
889
  interface SepaDebit {}
@@ -750,6 +924,11 @@ declare module 'stripe' {
750
924
  * The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
751
925
  */
752
926
  account_subcategories?: Array<Filters.AccountSubcategory>;
927
+
928
+ /**
929
+ * ID of the institution to use to filter for selectable accounts.
930
+ */
931
+ institution?: string;
753
932
  }
754
933
 
755
934
  namespace Filters {
@@ -762,7 +941,11 @@ declare module 'stripe' {
762
941
  | 'payment_method'
763
942
  | 'transactions';
764
943
 
765
- type Prefetch = 'balances' | 'ownership' | 'transactions';
944
+ type Prefetch =
945
+ | 'balances'
946
+ | 'inferred_balances'
947
+ | 'ownership'
948
+ | 'transactions';
766
949
  }
767
950
 
768
951
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -782,11 +965,13 @@ declare module 'stripe' {
782
965
  | 'card'
783
966
  | 'cashapp'
784
967
  | 'crypto'
968
+ | 'custom'
785
969
  | 'customer_balance'
786
970
  | 'eps'
787
971
  | 'fpx'
788
972
  | 'giropay'
789
973
  | 'grabpay'
974
+ | 'id_bank_transfer'
790
975
  | 'ideal'
791
976
  | 'jp_credit_transfer'
792
977
  | 'kakao_pay'
@@ -806,6 +991,7 @@ declare module 'stripe' {
806
991
  | 'sepa_credit_transfer'
807
992
  | 'sepa_debit'
808
993
  | 'sofort'
994
+ | 'stripe_balance'
809
995
  | 'swish'
810
996
  | 'us_bank_account'
811
997
  | 'wechat_pay';
@@ -829,6 +1015,22 @@ declare module 'stripe' {
829
1015
  type Interval = 'day' | 'month' | 'week' | 'year';
830
1016
  }
831
1017
 
1018
+ interface Prebilling {
1019
+ /**
1020
+ * This is used to determine the number of billing cycles to prebill.
1021
+ */
1022
+ iterations: number;
1023
+
1024
+ /**
1025
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1026
+ */
1027
+ update_behavior?: Prebilling.UpdateBehavior;
1028
+ }
1029
+
1030
+ namespace Prebilling {
1031
+ type UpdateBehavior = 'prebill' | 'reset';
1032
+ }
1033
+
832
1034
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
833
1035
 
834
1036
  interface TransferData {
@@ -902,7 +1104,7 @@ declare module 'stripe' {
902
1104
  /**
903
1105
  * 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.
904
1106
  */
905
- cancel_at?: Stripe.Emptyable<number>;
1107
+ cancel_at?: Stripe.Emptyable<number | SubscriptionUpdateParams.CancelAt>;
906
1108
 
907
1109
  /**
908
1110
  * Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
@@ -1009,6 +1211,11 @@ declare module 'stripe' {
1009
1211
  SubscriptionUpdateParams.PendingInvoiceItemInterval
1010
1212
  >;
1011
1213
 
1214
+ /**
1215
+ * If specified, the invoicing for the given billing cycle iterations will be processed now.
1216
+ */
1217
+ prebilling?: SubscriptionUpdateParams.Prebilling;
1218
+
1012
1219
  /**
1013
1220
  * 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`.
1014
1221
  */
@@ -1080,12 +1287,56 @@ declare module 'stripe' {
1080
1287
  */
1081
1288
  discount?: string;
1082
1289
 
1290
+ /**
1291
+ * Details to determine how long the discount should be applied for.
1292
+ */
1293
+ discount_end?: Discount.DiscountEnd;
1294
+
1083
1295
  /**
1084
1296
  * ID of the promotion code to create a new discount for.
1085
1297
  */
1086
1298
  promotion_code?: string;
1087
1299
  }
1088
1300
 
1301
+ namespace Discount {
1302
+ interface DiscountEnd {
1303
+ /**
1304
+ * Time span for the redeemed discount.
1305
+ */
1306
+ duration?: DiscountEnd.Duration;
1307
+
1308
+ /**
1309
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1310
+ */
1311
+ timestamp?: number;
1312
+
1313
+ /**
1314
+ * The type of calculation made to determine when the discount ends.
1315
+ */
1316
+ type: DiscountEnd.Type;
1317
+ }
1318
+
1319
+ namespace DiscountEnd {
1320
+ interface Duration {
1321
+ /**
1322
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1323
+ */
1324
+ interval: Duration.Interval;
1325
+
1326
+ /**
1327
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1328
+ */
1329
+ interval_count: number;
1330
+ }
1331
+
1332
+ namespace Duration {
1333
+ type Interval = 'day' | 'month' | 'week' | 'year';
1334
+ }
1335
+
1336
+ type Type = 'duration' | 'timestamp';
1337
+ }
1338
+ }
1339
+
1089
1340
  interface PriceData {
1090
1341
  /**
1091
1342
  * 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).
@@ -1162,6 +1413,8 @@ declare module 'stripe' {
1162
1413
  reset_billing_cycle_anchor?: boolean;
1163
1414
  }
1164
1415
 
1416
+ type CancelAt = 'max_period_end' | 'min_period_end';
1417
+
1165
1418
  interface CancellationDetails {
1166
1419
  /**
1167
1420
  * Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
@@ -1199,12 +1452,56 @@ declare module 'stripe' {
1199
1452
  */
1200
1453
  discount?: string;
1201
1454
 
1455
+ /**
1456
+ * Details to determine how long the discount should be applied for.
1457
+ */
1458
+ discount_end?: Discount.DiscountEnd;
1459
+
1202
1460
  /**
1203
1461
  * ID of the promotion code to create a new discount for.
1204
1462
  */
1205
1463
  promotion_code?: string;
1206
1464
  }
1207
1465
 
1466
+ namespace Discount {
1467
+ interface DiscountEnd {
1468
+ /**
1469
+ * Time span for the redeemed discount.
1470
+ */
1471
+ duration?: DiscountEnd.Duration;
1472
+
1473
+ /**
1474
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1475
+ */
1476
+ timestamp?: number;
1477
+
1478
+ /**
1479
+ * The type of calculation made to determine when the discount ends.
1480
+ */
1481
+ type: DiscountEnd.Type;
1482
+ }
1483
+
1484
+ namespace DiscountEnd {
1485
+ interface Duration {
1486
+ /**
1487
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1488
+ */
1489
+ interval: Duration.Interval;
1490
+
1491
+ /**
1492
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1493
+ */
1494
+ interval_count: number;
1495
+ }
1496
+
1497
+ namespace Duration {
1498
+ type Interval = 'day' | 'month' | 'week' | 'year';
1499
+ }
1500
+
1501
+ type Type = 'duration' | 'timestamp';
1502
+ }
1503
+ }
1504
+
1208
1505
  interface InvoiceSettings {
1209
1506
  /**
1210
1507
  * The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
@@ -1311,12 +1608,56 @@ declare module 'stripe' {
1311
1608
  */
1312
1609
  discount?: string;
1313
1610
 
1611
+ /**
1612
+ * Details to determine how long the discount should be applied for.
1613
+ */
1614
+ discount_end?: Discount.DiscountEnd;
1615
+
1314
1616
  /**
1315
1617
  * ID of the promotion code to create a new discount for.
1316
1618
  */
1317
1619
  promotion_code?: string;
1318
1620
  }
1319
1621
 
1622
+ namespace Discount {
1623
+ interface DiscountEnd {
1624
+ /**
1625
+ * Time span for the redeemed discount.
1626
+ */
1627
+ duration?: DiscountEnd.Duration;
1628
+
1629
+ /**
1630
+ * A precise Unix timestamp for the discount to end. Must be in the future.
1631
+ */
1632
+ timestamp?: number;
1633
+
1634
+ /**
1635
+ * The type of calculation made to determine when the discount ends.
1636
+ */
1637
+ type: DiscountEnd.Type;
1638
+ }
1639
+
1640
+ namespace DiscountEnd {
1641
+ interface Duration {
1642
+ /**
1643
+ * Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1644
+ */
1645
+ interval: Duration.Interval;
1646
+
1647
+ /**
1648
+ * The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1649
+ */
1650
+ interval_count: number;
1651
+ }
1652
+
1653
+ namespace Duration {
1654
+ type Interval = 'day' | 'month' | 'week' | 'year';
1655
+ }
1656
+
1657
+ type Type = 'duration' | 'timestamp';
1658
+ }
1659
+ }
1660
+
1320
1661
  interface PriceData {
1321
1662
  /**
1322
1663
  * 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).
@@ -1435,6 +1776,13 @@ declare module 'stripe' {
1435
1776
  PaymentMethodOptions.CustomerBalance
1436
1777
  >;
1437
1778
 
1779
+ /**
1780
+ * This sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent.
1781
+ */
1782
+ id_bank_transfer?: Stripe.Emptyable<
1783
+ PaymentMethodOptions.IdBankTransfer
1784
+ >;
1785
+
1438
1786
  /**
1439
1787
  * This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent.
1440
1788
  */
@@ -1584,6 +1932,8 @@ declare module 'stripe' {
1584
1932
  }
1585
1933
  }
1586
1934
 
1935
+ interface IdBankTransfer {}
1936
+
1587
1937
  interface Konbini {}
1588
1938
 
1589
1939
  interface SepaDebit {}
@@ -1624,6 +1974,11 @@ declare module 'stripe' {
1624
1974
  * The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1625
1975
  */
1626
1976
  account_subcategories?: Array<Filters.AccountSubcategory>;
1977
+
1978
+ /**
1979
+ * ID of the institution to use to filter for selectable accounts.
1980
+ */
1981
+ institution?: string;
1627
1982
  }
1628
1983
 
1629
1984
  namespace Filters {
@@ -1636,7 +1991,11 @@ declare module 'stripe' {
1636
1991
  | 'payment_method'
1637
1992
  | 'transactions';
1638
1993
 
1639
- type Prefetch = 'balances' | 'ownership' | 'transactions';
1994
+ type Prefetch =
1995
+ | 'balances'
1996
+ | 'inferred_balances'
1997
+ | 'ownership'
1998
+ | 'transactions';
1640
1999
  }
1641
2000
 
1642
2001
  type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
@@ -1656,11 +2015,13 @@ declare module 'stripe' {
1656
2015
  | 'card'
1657
2016
  | 'cashapp'
1658
2017
  | 'crypto'
2018
+ | 'custom'
1659
2019
  | 'customer_balance'
1660
2020
  | 'eps'
1661
2021
  | 'fpx'
1662
2022
  | 'giropay'
1663
2023
  | 'grabpay'
2024
+ | 'id_bank_transfer'
1664
2025
  | 'ideal'
1665
2026
  | 'jp_credit_transfer'
1666
2027
  | 'kakao_pay'
@@ -1680,6 +2041,7 @@ declare module 'stripe' {
1680
2041
  | 'sepa_credit_transfer'
1681
2042
  | 'sepa_debit'
1682
2043
  | 'sofort'
2044
+ | 'stripe_balance'
1683
2045
  | 'swish'
1684
2046
  | 'us_bank_account'
1685
2047
  | 'wechat_pay';
@@ -1703,6 +2065,22 @@ declare module 'stripe' {
1703
2065
  type Interval = 'day' | 'month' | 'week' | 'year';
1704
2066
  }
1705
2067
 
2068
+ interface Prebilling {
2069
+ /**
2070
+ * This is used to determine the number of billing cycles to prebill.
2071
+ */
2072
+ iterations: number;
2073
+
2074
+ /**
2075
+ * Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2076
+ */
2077
+ update_behavior?: Prebilling.UpdateBehavior;
2078
+ }
2079
+
2080
+ namespace Prebilling {
2081
+ type UpdateBehavior = 'prebill' | 'reset';
2082
+ }
2083
+
1706
2084
  type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';
1707
2085
 
1708
2086
  interface TransferData {
@@ -1769,6 +2147,11 @@ declare module 'stripe' {
1769
2147
  */
1770
2148
  customer?: string;
1771
2149
 
2150
+ /**
2151
+ * The ID of the account whose subscriptions will be retrieved.
2152
+ */
2153
+ customer_account?: string;
2154
+
1772
2155
  /**
1773
2156
  * Specifies which fields in the response should be expanded.
1774
2157
  */
@@ -1947,7 +2330,10 @@ declare module 'stripe' {
1947
2330
  * Schedules provide the flexibility to model more complex billing configurations that change over time.
1948
2331
  */
1949
2332
  create(
1950
- params: SubscriptionCreateParams,
2333
+ params?: SubscriptionCreateParams,
2334
+ options?: RequestOptions
2335
+ ): Promise<Stripe.Response<Stripe.Subscription>>;
2336
+ create(
1951
2337
  options?: RequestOptions
1952
2338
  ): Promise<Stripe.Response<Stripe.Subscription>>;
1953
2339