stripe 16.2.0 → 16.3.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 (152) hide show
  1. package/CHANGELOG.md +761 -114
  2. package/README.md +33 -0
  3. package/VERSION +1 -1
  4. package/cjs/RequestSender.js +66 -5
  5. package/cjs/StripeResource.js +1 -1
  6. package/cjs/apiVersion.js +2 -1
  7. package/cjs/multipart.js +1 -1
  8. package/cjs/resources/AccountNotices.js +21 -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/FinancialConnections/Accounts.js +5 -0
  13. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  14. package/cjs/resources/GiftCards/Cards.js +23 -0
  15. package/cjs/resources/GiftCards/Transactions.js +33 -0
  16. package/cjs/resources/Invoices.js +13 -0
  17. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  18. package/cjs/resources/Margins.js +22 -0
  19. package/cjs/resources/OAuth.js +1 -1
  20. package/cjs/resources/Orders.js +24 -0
  21. package/cjs/resources/PaymentIntents.js +4 -0
  22. package/cjs/resources/QuotePhases.js +22 -0
  23. package/cjs/resources/Quotes.js +32 -0
  24. package/cjs/resources/SubscriptionSchedules.js +4 -0
  25. package/cjs/resources/Tax/Forms.js +20 -0
  26. package/cjs/resources/Terminal/Readers.js +12 -0
  27. package/cjs/resources.js +38 -10
  28. package/cjs/stripe.core.js +6 -3
  29. package/cjs/utils.js +30 -3
  30. package/esm/RequestSender.js +67 -6
  31. package/esm/StripeResource.js +2 -2
  32. package/esm/apiVersion.js +1 -0
  33. package/esm/multipart.js +2 -2
  34. package/esm/resources/AccountNotices.js +18 -0
  35. package/esm/resources/Capital/FinancingOffers.js +18 -0
  36. package/esm/resources/Capital/FinancingSummary.js +9 -0
  37. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  38. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  39. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  40. package/esm/resources/GiftCards/Cards.js +20 -0
  41. package/esm/resources/GiftCards/Transactions.js +30 -0
  42. package/esm/resources/Invoices.js +13 -0
  43. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  44. package/esm/resources/Margins.js +19 -0
  45. package/esm/resources/OAuth.js +2 -2
  46. package/esm/resources/Orders.js +21 -0
  47. package/esm/resources/PaymentIntents.js +4 -0
  48. package/esm/resources/QuotePhases.js +19 -0
  49. package/esm/resources/Quotes.js +32 -0
  50. package/esm/resources/SubscriptionSchedules.js +4 -0
  51. package/esm/resources/Tax/Forms.js +17 -0
  52. package/esm/resources/Terminal/Readers.js +12 -0
  53. package/esm/resources.js +24 -0
  54. package/esm/stripe.core.js +6 -3
  55. package/esm/utils.js +27 -1
  56. package/package.json +1 -1
  57. package/types/AccountLinksResource.d.ts +5 -1
  58. package/types/AccountNotices.d.ts +110 -0
  59. package/types/AccountNoticesResource.d.ts +98 -0
  60. package/types/AccountSessions.d.ts +15 -0
  61. package/types/AccountSessionsResource.d.ts +205 -0
  62. package/types/Accounts.d.ts +88 -1
  63. package/types/AccountsResource.d.ts +204 -0
  64. package/types/Capital/FinancingOffers.d.ts +188 -0
  65. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  66. package/types/Capital/FinancingSummary.d.ts +106 -0
  67. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  68. package/types/Capital/FinancingTransactions.d.ts +135 -0
  69. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  70. package/types/Charges.d.ts +67 -0
  71. package/types/ChargesResource.d.ts +1294 -0
  72. package/types/Checkout/Sessions.d.ts +28 -1
  73. package/types/Checkout/SessionsResource.d.ts +15 -1
  74. package/types/ConfirmationTokens.d.ts +83 -0
  75. package/types/Coupons.d.ts +1 -1
  76. package/types/CouponsResource.d.ts +1 -1
  77. package/types/CreditNotes.d.ts +21 -0
  78. package/types/CreditNotesResource.d.ts +51 -0
  79. package/types/CustomerSessions.d.ts +76 -0
  80. package/types/CustomerSessionsResource.d.ts +76 -0
  81. package/types/CustomersResource.d.ts +2 -0
  82. package/types/Disputes.d.ts +167 -0
  83. package/types/DisputesResource.d.ts +120 -0
  84. package/types/EventTypes.d.ts +426 -0
  85. package/types/Events.d.ts +83 -0
  86. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  87. package/types/FinancialConnections/Accounts.d.ts +29 -1
  88. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  89. package/types/FinancialConnections/Institutions.d.ts +93 -0
  90. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  91. package/types/FinancialConnections/Sessions.d.ts +49 -1
  92. package/types/FinancialConnections/SessionsResource.d.ts +38 -1
  93. package/types/GiftCards/Cards.d.ts +118 -0
  94. package/types/GiftCards/CardsResource.d.ts +159 -0
  95. package/types/GiftCards/Transactions.d.ts +129 -0
  96. package/types/GiftCards/TransactionsResource.d.ts +201 -0
  97. package/types/InvoiceItems.d.ts +5 -0
  98. package/types/InvoiceItemsResource.d.ts +98 -0
  99. package/types/InvoiceLineItems.d.ts +22 -0
  100. package/types/InvoicePayments.d.ts +91 -0
  101. package/types/Invoices.d.ts +116 -1
  102. package/types/InvoicesResource.d.ts +5395 -1818
  103. package/types/Issuing/CardholdersResource.d.ts +2 -1
  104. package/types/Issuing/Cards.d.ts +34 -0
  105. package/types/Issuing/CardsResource.d.ts +125 -0
  106. package/types/Issuing/CreditUnderwritingRecords.d.ts +446 -0
  107. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1017 -0
  108. package/types/LineItems.d.ts +7 -0
  109. package/types/Mandates.d.ts +77 -0
  110. package/types/Margins.d.ts +56 -0
  111. package/types/MarginsResource.d.ts +114 -0
  112. package/types/Orders.d.ts +1057 -0
  113. package/types/OrdersResource.d.ts +2711 -0
  114. package/types/PaymentIntents.d.ts +469 -1
  115. package/types/PaymentIntentsResource.d.ts +6721 -3373
  116. package/types/PaymentMethods.d.ts +62 -0
  117. package/types/PaymentMethodsResource.d.ts +110 -0
  118. package/types/Prices.d.ts +22 -0
  119. package/types/PricesResource.d.ts +22 -0
  120. package/types/Products.d.ts +39 -0
  121. package/types/ProductsResource.d.ts +36 -0
  122. package/types/QuoteLines.d.ts +634 -0
  123. package/types/QuotePhases.d.ts +198 -0
  124. package/types/QuotePhasesResource.d.ts +67 -0
  125. package/types/QuotePreviewInvoices.d.ts +1535 -0
  126. package/types/QuotePreviewSubscriptionSchedules.d.ts +778 -0
  127. package/types/Quotes.d.ts +578 -1
  128. package/types/QuotesResource.d.ts +3174 -265
  129. package/types/SetupAttempts.d.ts +9 -0
  130. package/types/SetupIntents.d.ts +110 -1
  131. package/types/SetupIntentsResource.d.ts +498 -3
  132. package/types/Sources.d.ts +23 -0
  133. package/types/SubscriptionItems.d.ts +21 -0
  134. package/types/SubscriptionItemsResource.d.ts +109 -0
  135. package/types/SubscriptionSchedules.d.ts +164 -0
  136. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  137. package/types/Subscriptions.d.ts +46 -1
  138. package/types/SubscriptionsResource.d.ts +347 -2
  139. package/types/Tax/Forms.d.ts +133 -0
  140. package/types/Tax/FormsResource.d.ts +90 -0
  141. package/types/Terminal/Readers.d.ts +278 -0
  142. package/types/Terminal/ReadersResource.d.ts +208 -0
  143. package/types/TestHelpers/ConfirmationTokensResource.d.ts +55 -0
  144. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  145. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  146. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  147. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  148. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  149. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  150. package/types/WebhookEndpointsResource.d.ts +50 -0
  151. package/types/index.d.ts +64 -0
  152. package/types/lib.d.ts +12 -0
package/types/Events.d.ts CHANGED
@@ -21,6 +21,59 @@ declare module 'stripe' {
21
21
  interface PreviousAttributes {}
22
22
  }
23
23
 
24
+ interface Reason {
25
+ automation_action?: Reason.AutomationAction;
26
+
27
+ request?: Reason.Request;
28
+
29
+ /**
30
+ * The type of the reason for the event.
31
+ */
32
+ type: Reason.Type;
33
+ }
34
+
35
+ namespace Reason {
36
+ interface AutomationAction {
37
+ stripe_send_webhook_custom_event?: AutomationAction.StripeSendWebhookCustomEvent;
38
+
39
+ /**
40
+ * The trigger name of the automation that triggered this action.
41
+ * Please visit [Revenue and retention automations](https://docs.stripe.com/billing/automations#choose-a-trigger) for all possible trigger names.
42
+ */
43
+ trigger: string;
44
+
45
+ /**
46
+ * The type of the `automation_action`.
47
+ */
48
+ type: 'stripe_send_webhook_custom_event';
49
+ }
50
+
51
+ namespace AutomationAction {
52
+ interface StripeSendWebhookCustomEvent {
53
+ /**
54
+ * Set of key-value pairs attached to the action when creating an Automation.
55
+ */
56
+ custom_data: {
57
+ [key: string]: string;
58
+ } | null;
59
+ }
60
+ }
61
+
62
+ interface Request {
63
+ /**
64
+ * ID of the API request that caused the event. If null, the event was automatic (e.g., Stripe's automatic subscription handling). Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API.
65
+ */
66
+ id: string | null;
67
+
68
+ /**
69
+ * The idempotency key transmitted during the request, if any. *Note: This property is populated only for events on or after May 23, 2017*.
70
+ */
71
+ idempotency_key: string | null;
72
+ }
73
+
74
+ type Type = 'automation_action' | 'request';
75
+ }
76
+
24
77
  interface Request {
25
78
  /**
26
79
  * ID of the API request that caused the event. If null, the event was automatic (e.g., Stripe's automatic subscription handling). Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API.
@@ -40,6 +93,8 @@ declare module 'stripe' {
40
93
  | 'account.external_account.deleted'
41
94
  | 'account.external_account.updated'
42
95
  | 'account.updated'
96
+ | 'account_notice.created'
97
+ | 'account_notice.updated'
43
98
  | 'application_fee.created'
44
99
  | 'application_fee.refund.updated'
45
100
  | 'application_fee.refunded'
@@ -48,6 +103,15 @@ declare module 'stripe' {
48
103
  | 'billing_portal.configuration.updated'
49
104
  | 'billing_portal.session.created'
50
105
  | 'capability.updated'
106
+ | 'capital.financing_offer.accepted'
107
+ | 'capital.financing_offer.canceled'
108
+ | 'capital.financing_offer.created'
109
+ | 'capital.financing_offer.expired'
110
+ | 'capital.financing_offer.fully_repaid'
111
+ | 'capital.financing_offer.paid_out'
112
+ | 'capital.financing_offer.rejected'
113
+ | 'capital.financing_offer.replacement_created'
114
+ | 'capital.financing_transaction.created'
51
115
  | 'cash_balance.funds_available'
52
116
  | 'charge.captured'
53
117
  | 'charge.dispute.closed'
@@ -88,7 +152,10 @@ declare module 'stripe' {
88
152
  | 'customer.source.deleted'
89
153
  | 'customer.source.expiring'
90
154
  | 'customer.source.updated'
155
+ | 'customer.subscription.collection_paused'
156
+ | 'customer.subscription.collection_resumed'
91
157
  | 'customer.subscription.created'
158
+ | 'customer.subscription.custom_event'
92
159
  | 'customer.subscription.deleted'
93
160
  | 'customer.subscription.paused'
94
161
  | 'customer.subscription.pending_update_applied'
@@ -108,8 +175,10 @@ declare module 'stripe' {
108
175
  | 'financial_connections.account.disconnected'
109
176
  | 'financial_connections.account.reactivated'
110
177
  | 'financial_connections.account.refreshed_balance'
178
+ | 'financial_connections.account.refreshed_inferred_balances'
111
179
  | 'financial_connections.account.refreshed_ownership'
112
180
  | 'financial_connections.account.refreshed_transactions'
181
+ | 'financial_connections.session.updated'
113
182
  | 'identity.verification_session.canceled'
114
183
  | 'identity.verification_session.created'
115
184
  | 'identity.verification_session.processing'
@@ -122,6 +191,7 @@ declare module 'stripe' {
122
191
  | 'invoice.finalized'
123
192
  | 'invoice.marked_uncollectible'
124
193
  | 'invoice.paid'
194
+ | 'invoice.payment.overpaid'
125
195
  | 'invoice.payment_action_required'
126
196
  | 'invoice.payment_failed'
127
197
  | 'invoice.payment_succeeded'
@@ -186,10 +256,16 @@ declare module 'stripe' {
186
256
  | 'product.updated'
187
257
  | 'promotion_code.created'
188
258
  | 'promotion_code.updated'
259
+ | 'quote.accept_failed'
189
260
  | 'quote.accepted'
261
+ | 'quote.accepting'
190
262
  | 'quote.canceled'
191
263
  | 'quote.created'
264
+ | 'quote.draft'
192
265
  | 'quote.finalized'
266
+ | 'quote.reestimate_failed'
267
+ | 'quote.reestimated'
268
+ | 'quote.stale'
193
269
  | 'radar.early_fraud_warning.created'
194
270
  | 'radar.early_fraud_warning.updated'
195
271
  | 'refund.created'
@@ -219,11 +295,13 @@ declare module 'stripe' {
219
295
  | 'subscription_schedule.expiring'
220
296
  | 'subscription_schedule.released'
221
297
  | 'subscription_schedule.updated'
298
+ | 'tax.form.updated'
222
299
  | 'tax.settings.updated'
223
300
  | 'tax_rate.created'
224
301
  | 'tax_rate.updated'
225
302
  | 'terminal.reader.action_failed'
226
303
  | 'terminal.reader.action_succeeded'
304
+ | 'terminal.reader.action_updated'
227
305
  | 'test_helpers.test_clock.advancing'
228
306
  | 'test_helpers.test_clock.created'
229
307
  | 'test_helpers.test_clock.deleted'
@@ -339,6 +417,11 @@ declare module 'stripe' {
339
417
  */
340
418
  pending_webhooks: number;
341
419
 
420
+ /**
421
+ * Information about the action that causes the event. Only present when the event is triggered by an API request or an [Automation](https://docs.stripe.com/billing/automations) action.
422
+ */
423
+ reason?: Event.Reason | null;
424
+
342
425
  /**
343
426
  * Information on the API request that triggers the event.
344
427
  */
@@ -0,0 +1,38 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace FinancialConnections {
6
+ /**
7
+ * A historical balance for the account on a particular day. It may be sourced from a balance snapshot provided by a financial institution, or inferred using transactions data.
8
+ */
9
+ interface AccountInferredBalance {
10
+ /**
11
+ * Unique identifier for the object.
12
+ */
13
+ id: string;
14
+
15
+ /**
16
+ * String representing the object's type. Objects of the same type share the same value.
17
+ */
18
+ object: 'financial_connections.account_inferred_balance';
19
+
20
+ /**
21
+ * The time for which this balance was calculated, measured in seconds since the Unix epoch. If the balance was computed by Stripe and not provided directly by a financial institution, it will always be 23:59:59 UTC.
22
+ */
23
+ as_of: number;
24
+
25
+ /**
26
+ * The balances owed to (or by) the account holder.
27
+ *
28
+ * Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
29
+ *
30
+ * Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.
31
+ */
32
+ current: {
33
+ [key: string]: number;
34
+ };
35
+ }
36
+ }
37
+ }
38
+ }
@@ -47,6 +47,11 @@ declare module 'stripe' {
47
47
  */
48
48
  display_name: string | null;
49
49
 
50
+ /**
51
+ * The state of the most recent attempt to refresh the account's inferred balance history.
52
+ */
53
+ inferred_balances_refresh?: Account.InferredBalancesRefresh | null;
54
+
50
55
  /**
51
56
  * The name of the institution that holds this account.
52
57
  */
@@ -103,7 +108,7 @@ declare module 'stripe' {
103
108
  /**
104
109
  * The list of data refresh subscriptions requested on this account.
105
110
  */
106
- subscriptions: Array<'transactions'> | null;
111
+ subscriptions: Array<Account.Subscription> | null;
107
112
 
108
113
  /**
109
114
  * The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account.
@@ -220,6 +225,27 @@ declare module 'stripe' {
220
225
 
221
226
  type Category = 'cash' | 'credit' | 'investment' | 'other';
222
227
 
228
+ interface InferredBalancesRefresh {
229
+ /**
230
+ * The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch.
231
+ */
232
+ last_attempted_at: number;
233
+
234
+ /**
235
+ * Time at which the next inferred balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch.
236
+ */
237
+ next_refresh_available_at: number | null;
238
+
239
+ /**
240
+ * The status of the last refresh attempt.
241
+ */
242
+ status: InferredBalancesRefresh.Status;
243
+ }
244
+
245
+ namespace InferredBalancesRefresh {
246
+ type Status = 'failed' | 'pending' | 'succeeded';
247
+ }
248
+
223
249
  interface OwnershipRefresh {
224
250
  /**
225
251
  * The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch.
@@ -257,6 +283,8 @@ declare module 'stripe' {
257
283
  | 'other'
258
284
  | 'savings';
259
285
 
286
+ type Subscription = 'balance' | 'inferred_balances' | 'transactions';
287
+
260
288
  type SupportedPaymentMethodType = 'link' | 'us_bank_account';
261
289
 
262
290
  interface TransactionRefresh {
@@ -48,6 +48,13 @@ declare module 'stripe' {
48
48
  expand?: Array<string>;
49
49
  }
50
50
 
51
+ interface AccountListInferredBalancesParams extends PaginationParams {
52
+ /**
53
+ * Specifies which fields in the response should be expanded.
54
+ */
55
+ expand?: Array<string>;
56
+ }
57
+
51
58
  interface AccountListOwnersParams extends PaginationParams {
52
59
  /**
53
60
  * The ID of the ownership object to fetch owners from.
@@ -73,14 +80,18 @@ declare module 'stripe' {
73
80
  }
74
81
 
75
82
  namespace AccountRefreshParams {
76
- type Feature = 'balance' | 'ownership' | 'transactions';
83
+ type Feature =
84
+ | 'balance'
85
+ | 'inferred_balances'
86
+ | 'ownership'
87
+ | 'transactions';
77
88
  }
78
89
 
79
90
  interface AccountSubscribeParams {
80
91
  /**
81
92
  * The list of account features to which you would like to subscribe.
82
93
  */
83
- features: Array<'transactions'>;
94
+ features: Array<AccountSubscribeParams.Feature>;
84
95
 
85
96
  /**
86
97
  * Specifies which fields in the response should be expanded.
@@ -88,11 +99,15 @@ declare module 'stripe' {
88
99
  expand?: Array<string>;
89
100
  }
90
101
 
102
+ namespace AccountSubscribeParams {
103
+ type Feature = 'balance' | 'inferred_balances' | 'transactions';
104
+ }
105
+
91
106
  interface AccountUnsubscribeParams {
92
107
  /**
93
108
  * The list of account features from which you would like to unsubscribe.
94
109
  */
95
- features: Array<'transactions'>;
110
+ features: Array<AccountUnsubscribeParams.Feature>;
96
111
 
97
112
  /**
98
113
  * Specifies which fields in the response should be expanded.
@@ -100,6 +115,10 @@ declare module 'stripe' {
100
115
  expand?: Array<string>;
101
116
  }
102
117
 
118
+ namespace AccountUnsubscribeParams {
119
+ type Feature = 'balance' | 'inferred_balances' | 'transactions';
120
+ }
121
+
103
122
  class AccountsResource {
104
123
  /**
105
124
  * Retrieves the details of an Financial Connections Account.
@@ -138,6 +157,19 @@ declare module 'stripe' {
138
157
  options?: RequestOptions
139
158
  ): Promise<Stripe.Response<Stripe.FinancialConnections.Account>>;
140
159
 
160
+ /**
161
+ * Lists the recorded inferred balances for a Financial Connections Account.
162
+ */
163
+ listInferredBalances(
164
+ id: string,
165
+ params?: AccountListInferredBalancesParams,
166
+ options?: RequestOptions
167
+ ): ApiListPromise<Stripe.FinancialConnections.AccountInferredBalance>;
168
+ listInferredBalances(
169
+ id: string,
170
+ options?: RequestOptions
171
+ ): ApiListPromise<Stripe.FinancialConnections.AccountInferredBalance>;
172
+
141
173
  /**
142
174
  * Lists all owners for a given Account
143
175
  */
@@ -0,0 +1,93 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace FinancialConnections {
6
+ /**
7
+ * An institution represents a banking institution which may be available for an end user to select in the Financial Connections authentication flow.
8
+ */
9
+ interface Institution {
10
+ /**
11
+ * Unique identifier for the object.
12
+ */
13
+ id: string;
14
+
15
+ /**
16
+ * String representing the object's type. Objects of the same type share the same value.
17
+ */
18
+ object: 'financial_connections.institution';
19
+
20
+ features: Institution.Features;
21
+
22
+ /**
23
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
24
+ */
25
+ livemode: boolean;
26
+
27
+ /**
28
+ * The name of this institution.
29
+ */
30
+ name: string;
31
+
32
+ /**
33
+ * A list of routing numbers which are known to correspond to this institution.
34
+ */
35
+ routing_numbers: Array<string>;
36
+
37
+ /**
38
+ * The status of this institution in the Financial Connections authentication flow.
39
+ */
40
+ status: Institution.Status;
41
+
42
+ /**
43
+ * The URL for this institution's website.
44
+ */
45
+ url: string | null;
46
+ }
47
+
48
+ namespace Institution {
49
+ interface Features {
50
+ balances: Features.Balances;
51
+
52
+ ownership: Features.Ownership;
53
+
54
+ payment_method: Features.PaymentMethod;
55
+
56
+ transactions: Features.Transactions;
57
+ }
58
+
59
+ namespace Features {
60
+ interface Balances {
61
+ /**
62
+ * Whether the given feature is supported by this institution.
63
+ */
64
+ supported: boolean;
65
+ }
66
+
67
+ interface Ownership {
68
+ /**
69
+ * Whether the given feature is supported by this institution.
70
+ */
71
+ supported: boolean;
72
+ }
73
+
74
+ interface PaymentMethod {
75
+ /**
76
+ * Whether the given feature is supported by this institution.
77
+ */
78
+ supported: boolean;
79
+ }
80
+
81
+ interface Transactions {
82
+ /**
83
+ * Whether the given feature is supported by this institution.
84
+ */
85
+ supported: boolean;
86
+ }
87
+ }
88
+
89
+ type Status = 'active' | 'degraded' | 'inactive';
90
+ }
91
+ }
92
+ }
93
+ }
@@ -0,0 +1,47 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace FinancialConnections {
6
+ interface InstitutionRetrieveParams {
7
+ /**
8
+ * Specifies which fields in the response should be expanded.
9
+ */
10
+ expand?: Array<string>;
11
+ }
12
+
13
+ interface InstitutionListParams extends PaginationParams {
14
+ /**
15
+ * Specifies which fields in the response should be expanded.
16
+ */
17
+ expand?: Array<string>;
18
+ }
19
+
20
+ class InstitutionsResource {
21
+ /**
22
+ * Retrieves the details of a Financial Connections Institution.
23
+ */
24
+ retrieve(
25
+ id: string,
26
+ params?: InstitutionRetrieveParams,
27
+ options?: RequestOptions
28
+ ): Promise<Stripe.Response<Stripe.FinancialConnections.Institution>>;
29
+ retrieve(
30
+ id: string,
31
+ options?: RequestOptions
32
+ ): Promise<Stripe.Response<Stripe.FinancialConnections.Institution>>;
33
+
34
+ /**
35
+ * Returns a list of Financial Connections Institution objects.
36
+ */
37
+ list(
38
+ params?: InstitutionListParams,
39
+ options?: RequestOptions
40
+ ): ApiListPromise<Stripe.FinancialConnections.Institution>;
41
+ list(
42
+ options?: RequestOptions
43
+ ): ApiListPromise<Stripe.FinancialConnections.Institution>;
44
+ }
45
+ }
46
+ }
47
+ }
@@ -34,11 +34,15 @@ declare module 'stripe' {
34
34
 
35
35
  filters?: Session.Filters;
36
36
 
37
+ limits?: Session.Limits;
38
+
37
39
  /**
38
40
  * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
39
41
  */
40
42
  livemode: boolean;
41
43
 
44
+ manual_entry?: Session.ManualEntry;
45
+
42
46
  /**
43
47
  * Permissions requested for accounts collected during this session.
44
48
  */
@@ -53,6 +57,13 @@ declare module 'stripe' {
53
57
  * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
54
58
  */
55
59
  return_url?: string;
60
+
61
+ /**
62
+ * The current state of the session.
63
+ */
64
+ status?: Session.Status;
65
+
66
+ status_details?: Session.StatusDetails;
56
67
  }
57
68
 
58
69
  namespace Session {
@@ -87,6 +98,11 @@ declare module 'stripe' {
87
98
  * List of countries from which to filter accounts.
88
99
  */
89
100
  countries: Array<string> | null;
101
+
102
+ /**
103
+ * Stripe ID of the institution with which the customer should be directed to log in.
104
+ */
105
+ institution?: string;
90
106
  }
91
107
 
92
108
  namespace Filters {
@@ -98,13 +114,45 @@ declare module 'stripe' {
98
114
  | 'savings';
99
115
  }
100
116
 
117
+ interface Limits {
118
+ /**
119
+ * The number of accounts that can be linked in this Session.
120
+ */
121
+ accounts: number;
122
+ }
123
+
124
+ interface ManualEntry {}
125
+
101
126
  type Permission =
102
127
  | 'balances'
103
128
  | 'ownership'
104
129
  | 'payment_method'
105
130
  | 'transactions';
106
131
 
107
- type Prefetch = 'balances' | 'ownership' | 'transactions';
132
+ type Prefetch =
133
+ | 'balances'
134
+ | 'inferred_balances'
135
+ | 'ownership'
136
+ | 'transactions';
137
+
138
+ type Status = 'cancelled' | 'failed' | 'pending' | 'succeeded';
139
+
140
+ interface StatusDetails {
141
+ cancelled?: StatusDetails.Cancelled;
142
+ }
143
+
144
+ namespace StatusDetails {
145
+ interface Cancelled {
146
+ /**
147
+ * The reason for the Session being cancelled.
148
+ */
149
+ reason: Cancelled.Reason;
150
+ }
151
+
152
+ namespace Cancelled {
153
+ type Reason = 'custom_manual_entry' | 'other';
154
+ }
155
+ }
108
156
  }
109
157
  }
110
158
  }
@@ -26,6 +26,16 @@ declare module 'stripe' {
26
26
  */
27
27
  filters?: SessionCreateParams.Filters;
28
28
 
29
+ /**
30
+ * Settings for configuring Session-specific limits.
31
+ */
32
+ limits?: SessionCreateParams.Limits;
33
+
34
+ /**
35
+ * Settings for configuring manual entry of account details for this Session.
36
+ */
37
+ manual_entry?: SessionCreateParams.ManualEntry;
38
+
29
39
  /**
30
40
  * List of data features that you would like to retrieve upon account creation.
31
41
  */
@@ -69,6 +79,11 @@ declare module 'stripe' {
69
79
  * List of countries from which to collect accounts.
70
80
  */
71
81
  countries?: Array<string>;
82
+
83
+ /**
84
+ * Stripe ID of the institution with which the customer should be directed to log in.
85
+ */
86
+ institution?: string;
72
87
  }
73
88
 
74
89
  namespace Filters {
@@ -80,13 +95,35 @@ declare module 'stripe' {
80
95
  | 'savings';
81
96
  }
82
97
 
98
+ interface Limits {
99
+ /**
100
+ * The number of accounts that can be linked in this Session.
101
+ */
102
+ accounts: number;
103
+ }
104
+
105
+ interface ManualEntry {
106
+ /**
107
+ * Whether manual entry will be handled by Stripe during the Session.
108
+ */
109
+ mode?: ManualEntry.Mode;
110
+ }
111
+
112
+ namespace ManualEntry {
113
+ type Mode = 'automatic' | 'custom';
114
+ }
115
+
83
116
  type Permission =
84
117
  | 'balances'
85
118
  | 'ownership'
86
119
  | 'payment_method'
87
120
  | 'transactions';
88
121
 
89
- type Prefetch = 'balances' | 'ownership' | 'transactions';
122
+ type Prefetch =
123
+ | 'balances'
124
+ | 'inferred_balances'
125
+ | 'ownership'
126
+ | 'transactions';
90
127
  }
91
128
 
92
129
  interface SessionRetrieveParams {