stripe 16.4.0 → 16.6.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 (167) hide show
  1. package/CHANGELOG.md +794 -109
  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/Billing/Alerts.js +27 -0
  10. package/cjs/resources/Capital/FinancingOffers.js +21 -0
  11. package/cjs/resources/Capital/FinancingSummary.js +12 -0
  12. package/cjs/resources/Capital/FinancingTransactions.js +17 -0
  13. package/cjs/resources/Checkout/Sessions.js +4 -0
  14. package/cjs/resources/FinancialConnections/Accounts.js +5 -0
  15. package/cjs/resources/FinancialConnections/Institutions.js +17 -0
  16. package/cjs/resources/GiftCards/Cards.js +23 -0
  17. package/cjs/resources/GiftCards/Transactions.js +33 -0
  18. package/cjs/resources/Invoices.js +13 -0
  19. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
  20. package/cjs/resources/Margins.js +22 -0
  21. package/cjs/resources/OAuth.js +1 -1
  22. package/cjs/resources/Orders.js +24 -0
  23. package/cjs/resources/PaymentIntents.js +4 -0
  24. package/cjs/resources/QuotePhases.js +22 -0
  25. package/cjs/resources/Quotes.js +32 -0
  26. package/cjs/resources/SubscriptionSchedules.js +4 -0
  27. package/cjs/resources/Tax/Associations.js +9 -0
  28. package/cjs/resources/Tax/Forms.js +20 -0
  29. package/cjs/resources/Terminal/Readers.js +12 -0
  30. package/cjs/resources.js +42 -10
  31. package/cjs/stripe.core.js +6 -3
  32. package/cjs/utils.js +30 -3
  33. package/esm/RequestSender.js +67 -6
  34. package/esm/StripeResource.js +2 -2
  35. package/esm/apiVersion.js +1 -0
  36. package/esm/multipart.js +2 -2
  37. package/esm/resources/AccountNotices.js +18 -0
  38. package/esm/resources/Billing/Alerts.js +24 -0
  39. package/esm/resources/Capital/FinancingOffers.js +18 -0
  40. package/esm/resources/Capital/FinancingSummary.js +9 -0
  41. package/esm/resources/Capital/FinancingTransactions.js +14 -0
  42. package/esm/resources/Checkout/Sessions.js +4 -0
  43. package/esm/resources/FinancialConnections/Accounts.js +5 -0
  44. package/esm/resources/FinancialConnections/Institutions.js +14 -0
  45. package/esm/resources/GiftCards/Cards.js +20 -0
  46. package/esm/resources/GiftCards/Transactions.js +30 -0
  47. package/esm/resources/Invoices.js +13 -0
  48. package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
  49. package/esm/resources/Margins.js +19 -0
  50. package/esm/resources/OAuth.js +2 -2
  51. package/esm/resources/Orders.js +21 -0
  52. package/esm/resources/PaymentIntents.js +4 -0
  53. package/esm/resources/QuotePhases.js +19 -0
  54. package/esm/resources/Quotes.js +32 -0
  55. package/esm/resources/SubscriptionSchedules.js +4 -0
  56. package/esm/resources/Tax/Associations.js +6 -0
  57. package/esm/resources/Tax/Forms.js +17 -0
  58. package/esm/resources/Terminal/Readers.js +12 -0
  59. package/esm/resources.js +28 -0
  60. package/esm/stripe.core.js +6 -3
  61. package/esm/utils.js +27 -1
  62. package/package.json +1 -1
  63. package/types/AccountLinksResource.d.ts +5 -1
  64. package/types/AccountNotices.d.ts +113 -0
  65. package/types/AccountNoticesResource.d.ts +98 -0
  66. package/types/AccountSessions.d.ts +45 -0
  67. package/types/AccountSessionsResource.d.ts +205 -0
  68. package/types/Accounts.d.ts +109 -4
  69. package/types/AccountsResource.d.ts +272 -26
  70. package/types/Billing/AlertTriggereds.d.ts +42 -0
  71. package/types/Billing/Alerts.d.ts +80 -0
  72. package/types/Billing/AlertsResource.d.ts +176 -0
  73. package/types/Capital/FinancingOffers.d.ts +188 -0
  74. package/types/Capital/FinancingOffersResource.d.ts +97 -0
  75. package/types/Capital/FinancingSummary.d.ts +106 -0
  76. package/types/Capital/FinancingSummaryResource.d.ts +27 -0
  77. package/types/Capital/FinancingTransactions.d.ts +135 -0
  78. package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
  79. package/types/Charges.d.ts +106 -3
  80. package/types/ChargesResource.d.ts +1294 -0
  81. package/types/Checkout/Sessions.d.ts +28 -1
  82. package/types/Checkout/SessionsResource.d.ts +36 -1
  83. package/types/ConfirmationTokens.d.ts +80 -0
  84. package/types/Coupons.d.ts +1 -1
  85. package/types/CouponsResource.d.ts +1 -1
  86. package/types/CreditNotes.d.ts +21 -0
  87. package/types/CreditNotesResource.d.ts +51 -0
  88. package/types/CustomersResource.d.ts +2 -0
  89. package/types/Disputes.d.ts +177 -0
  90. package/types/DisputesResource.d.ts +120 -0
  91. package/types/EventTypes.d.ts +477 -0
  92. package/types/Events.d.ts +86 -0
  93. package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
  94. package/types/FinancialConnections/Accounts.d.ts +29 -1
  95. package/types/FinancialConnections/AccountsResource.d.ts +35 -3
  96. package/types/FinancialConnections/Institutions.d.ts +93 -0
  97. package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
  98. package/types/FinancialConnections/Sessions.d.ts +49 -1
  99. package/types/FinancialConnections/SessionsResource.d.ts +38 -1
  100. package/types/GiftCards/Cards.d.ts +118 -0
  101. package/types/GiftCards/CardsResource.d.ts +159 -0
  102. package/types/GiftCards/Transactions.d.ts +129 -0
  103. package/types/GiftCards/TransactionsResource.d.ts +201 -0
  104. package/types/InvoiceItems.d.ts +5 -0
  105. package/types/InvoiceItemsResource.d.ts +98 -0
  106. package/types/InvoiceLineItems.d.ts +22 -0
  107. package/types/InvoicePayments.d.ts +138 -0
  108. package/types/Invoices.d.ts +116 -1
  109. package/types/InvoicesResource.d.ts +5395 -1818
  110. package/types/Issuing/CardholdersResource.d.ts +2 -1
  111. package/types/Issuing/CreditUnderwritingRecords.d.ts +446 -0
  112. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1017 -0
  113. package/types/LineItems.d.ts +7 -0
  114. package/types/Mandates.d.ts +77 -0
  115. package/types/Margins.d.ts +56 -0
  116. package/types/MarginsResource.d.ts +114 -0
  117. package/types/Orders.d.ts +1057 -0
  118. package/types/OrdersResource.d.ts +2711 -0
  119. package/types/PaymentIntents.d.ts +491 -2
  120. package/types/PaymentIntentsResource.d.ts +6884 -3356
  121. package/types/PaymentMethodConfigurations.d.ts +72 -0
  122. package/types/PaymentMethodConfigurationsResource.d.ts +100 -0
  123. package/types/PaymentMethods.d.ts +80 -0
  124. package/types/PaymentMethodsResource.d.ts +110 -0
  125. package/types/Prices.d.ts +22 -0
  126. package/types/PricesResource.d.ts +22 -0
  127. package/types/Products.d.ts +39 -0
  128. package/types/ProductsResource.d.ts +36 -0
  129. package/types/QuoteLines.d.ts +634 -0
  130. package/types/QuotePhases.d.ts +198 -0
  131. package/types/QuotePhasesResource.d.ts +67 -0
  132. package/types/QuotePreviewInvoices.d.ts +1528 -0
  133. package/types/QuotePreviewSubscriptionSchedules.d.ts +778 -0
  134. package/types/Quotes.d.ts +578 -1
  135. package/types/QuotesResource.d.ts +3174 -265
  136. package/types/RefundsResource.d.ts +1 -1
  137. package/types/SetupAttempts.d.ts +9 -0
  138. package/types/SetupIntents.d.ts +110 -1
  139. package/types/SetupIntentsResource.d.ts +498 -3
  140. package/types/Sources.d.ts +23 -0
  141. package/types/SubscriptionItems.d.ts +21 -0
  142. package/types/SubscriptionItemsResource.d.ts +109 -0
  143. package/types/SubscriptionSchedules.d.ts +164 -0
  144. package/types/SubscriptionSchedulesResource.d.ts +1234 -16
  145. package/types/Subscriptions.d.ts +46 -1
  146. package/types/SubscriptionsResource.d.ts +347 -2
  147. package/types/Tax/Associations.d.ts +126 -0
  148. package/types/Tax/AssociationsResource.d.ts +29 -0
  149. package/types/Tax/Calculations.d.ts +1 -1
  150. package/types/Tax/CalculationsResource.d.ts +1 -3
  151. package/types/Tax/Forms.d.ts +133 -0
  152. package/types/Tax/FormsResource.d.ts +90 -0
  153. package/types/Terminal/Readers.d.ts +278 -0
  154. package/types/Terminal/ReadersResource.d.ts +208 -0
  155. package/types/TestHelpers/ConfirmationTokensResource.d.ts +55 -0
  156. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
  157. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
  158. package/types/TokensResource.d.ts +7 -7
  159. package/types/Treasury/FinancialAccounts.d.ts +5 -0
  160. package/types/Treasury/FinancialAccountsResource.d.ts +10 -0
  161. package/types/Treasury/OutboundTransfers.d.ts +26 -0
  162. package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
  163. package/types/Treasury/ReceivedCredits.d.ts +26 -0
  164. package/types/Treasury/ReceivedDebits.d.ts +31 -0
  165. package/types/WebhookEndpointsResource.d.ts +56 -0
  166. package/types/index.d.ts +71 -0
  167. package/types/lib.d.ts +12 -0
@@ -0,0 +1,80 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Billing {
6
+ /**
7
+ * A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.
8
+ */
9
+ interface Alert {
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: 'billing.alert';
19
+
20
+ /**
21
+ * Defines the type of the alert.
22
+ */
23
+ alert_type: 'usage_threshold';
24
+
25
+ /**
26
+ * Limits the scope of the alert to a specific [customer](https://stripe.com/docs/api/customers).
27
+ */
28
+ filter: Alert.Filter | null;
29
+
30
+ /**
31
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
32
+ */
33
+ livemode: boolean;
34
+
35
+ /**
36
+ * Status of the alert. This can be active, inactive or archived.
37
+ */
38
+ status: Alert.Status | null;
39
+
40
+ /**
41
+ * Title of the alert.
42
+ */
43
+ title: string;
44
+
45
+ /**
46
+ * Encapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://stripe.com/docs/api/billing/meter).
47
+ */
48
+ usage_threshold_config: Alert.UsageThresholdConfig | null;
49
+ }
50
+
51
+ namespace Alert {
52
+ interface Filter {
53
+ /**
54
+ * Limit the scope of the alert to this customer ID
55
+ */
56
+ customer: string | Stripe.Customer | null;
57
+ }
58
+
59
+ type Status = 'active' | 'archived' | 'inactive';
60
+
61
+ interface UsageThresholdConfig {
62
+ /**
63
+ * The value at which this alert will trigger.
64
+ */
65
+ gte: number;
66
+
67
+ /**
68
+ * The [Billing Meter](https://stripe.com/api/billing/meter) ID whose usage is monitored.
69
+ */
70
+ meter: string | Stripe.Billing.Meter;
71
+
72
+ /**
73
+ * Defines how the alert will behave.
74
+ */
75
+ recurrence: 'one_time';
76
+ }
77
+ }
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,176 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Billing {
6
+ interface AlertCreateParams {
7
+ /**
8
+ * The type of alert to create.
9
+ */
10
+ alert_type: 'usage_threshold';
11
+
12
+ /**
13
+ * The title of the alert.
14
+ */
15
+ title: string;
16
+
17
+ /**
18
+ * Specifies which fields in the response should be expanded.
19
+ */
20
+ expand?: Array<string>;
21
+
22
+ /**
23
+ * Filters to limit the scope of an alert.
24
+ */
25
+ filter?: AlertCreateParams.Filter;
26
+
27
+ /**
28
+ * The configuration of the usage threshold.
29
+ */
30
+ usage_threshold_config?: AlertCreateParams.UsageThresholdConfig;
31
+ }
32
+
33
+ namespace AlertCreateParams {
34
+ interface Filter {
35
+ /**
36
+ * Limit the scope to this alert only to this customer.
37
+ */
38
+ customer?: string;
39
+ }
40
+
41
+ interface UsageThresholdConfig {
42
+ /**
43
+ * Defines at which value the alert will fire.
44
+ */
45
+ gte: number;
46
+
47
+ /**
48
+ * The [Billing Meter](https://stripe.com/api/billing/meter) ID whose usage is monitored.
49
+ */
50
+ meter?: string;
51
+
52
+ /**
53
+ * Whether the alert should only fire only once, or once per billing cycle.
54
+ */
55
+ recurrence: 'one_time';
56
+ }
57
+ }
58
+
59
+ interface AlertRetrieveParams {
60
+ /**
61
+ * Specifies which fields in the response should be expanded.
62
+ */
63
+ expand?: Array<string>;
64
+ }
65
+
66
+ interface AlertListParams extends PaginationParams {
67
+ /**
68
+ * Filter results to only include this type of alert.
69
+ */
70
+ alert_type?: 'usage_threshold';
71
+
72
+ /**
73
+ * Specifies which fields in the response should be expanded.
74
+ */
75
+ expand?: Array<string>;
76
+
77
+ /**
78
+ * Filter results to only include alerts with the given meter.
79
+ */
80
+ meter?: string;
81
+ }
82
+
83
+ interface AlertActivateParams {
84
+ /**
85
+ * Specifies which fields in the response should be expanded.
86
+ */
87
+ expand?: Array<string>;
88
+ }
89
+
90
+ interface AlertArchiveParams {
91
+ /**
92
+ * Specifies which fields in the response should be expanded.
93
+ */
94
+ expand?: Array<string>;
95
+ }
96
+
97
+ interface AlertDeactivateParams {
98
+ /**
99
+ * Specifies which fields in the response should be expanded.
100
+ */
101
+ expand?: Array<string>;
102
+ }
103
+
104
+ class AlertsResource {
105
+ /**
106
+ * Creates a billing alert
107
+ */
108
+ create(
109
+ params: AlertCreateParams,
110
+ options?: RequestOptions
111
+ ): Promise<Stripe.Response<Stripe.Billing.Alert>>;
112
+
113
+ /**
114
+ * Retrieves a billing alert given an ID
115
+ */
116
+ retrieve(
117
+ id: string,
118
+ params?: AlertRetrieveParams,
119
+ options?: RequestOptions
120
+ ): Promise<Stripe.Response<Stripe.Billing.Alert>>;
121
+ retrieve(
122
+ id: string,
123
+ options?: RequestOptions
124
+ ): Promise<Stripe.Response<Stripe.Billing.Alert>>;
125
+
126
+ /**
127
+ * Lists billing active and inactive alerts
128
+ */
129
+ list(
130
+ params?: AlertListParams,
131
+ options?: RequestOptions
132
+ ): ApiListPromise<Stripe.Billing.Alert>;
133
+ list(options?: RequestOptions): ApiListPromise<Stripe.Billing.Alert>;
134
+
135
+ /**
136
+ * Reactivates this alert, allowing it to trigger again.
137
+ */
138
+ activate(
139
+ id: string,
140
+ params?: AlertActivateParams,
141
+ options?: RequestOptions
142
+ ): Promise<Stripe.Response<Stripe.Billing.Alert>>;
143
+ activate(
144
+ id: string,
145
+ options?: RequestOptions
146
+ ): Promise<Stripe.Response<Stripe.Billing.Alert>>;
147
+
148
+ /**
149
+ * Archives this alert, removing it from the list view and APIs. This is non-reversible.
150
+ */
151
+ archive(
152
+ id: string,
153
+ params?: AlertArchiveParams,
154
+ options?: RequestOptions
155
+ ): Promise<Stripe.Response<Stripe.Billing.Alert>>;
156
+ archive(
157
+ id: string,
158
+ options?: RequestOptions
159
+ ): Promise<Stripe.Response<Stripe.Billing.Alert>>;
160
+
161
+ /**
162
+ * Deactivates this alert, preventing it from triggering.
163
+ */
164
+ deactivate(
165
+ id: string,
166
+ params?: AlertDeactivateParams,
167
+ options?: RequestOptions
168
+ ): Promise<Stripe.Response<Stripe.Billing.Alert>>;
169
+ deactivate(
170
+ id: string,
171
+ options?: RequestOptions
172
+ ): Promise<Stripe.Response<Stripe.Billing.Alert>>;
173
+ }
174
+ }
175
+ }
176
+ }
@@ -0,0 +1,188 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Capital {
6
+ /**
7
+ * This is an object representing an offer of financing from
8
+ * Stripe Capital to a Connect subaccount.
9
+ */
10
+ interface FinancingOffer {
11
+ /**
12
+ * A unique identifier for the financing object.
13
+ */
14
+ id: string;
15
+
16
+ /**
17
+ * The object type: financing_offer.
18
+ */
19
+ object: 'capital.financing_offer';
20
+
21
+ /**
22
+ * This is an object representing the terms of an offer of financing from
23
+ * Stripe Capital to a Connected account. This resource represents
24
+ * the terms accepted by the Connected account, which may differ from those
25
+ * offered.
26
+ */
27
+ accepted_terms?: FinancingOffer.AcceptedTerms;
28
+
29
+ /**
30
+ * The ID of the merchant associated with this financing object.
31
+ */
32
+ account: string;
33
+
34
+ /**
35
+ * The time at which this financing offer was charged off, if applicable. Given in seconds since unix epoch.
36
+ */
37
+ charged_off_at?: number;
38
+
39
+ /**
40
+ * Time at which the offer was created. Given in seconds since unix epoch.
41
+ */
42
+ created: number;
43
+
44
+ /**
45
+ * Time at which the offer expires. Given in seconds since unix epoch.
46
+ */
47
+ expires_after: number;
48
+
49
+ /**
50
+ * The type of financing being offered.
51
+ */
52
+ financing_type?: FinancingOffer.FinancingType;
53
+
54
+ /**
55
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
56
+ */
57
+ livemode: boolean;
58
+
59
+ /**
60
+ * 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.
61
+ */
62
+ metadata?: Stripe.Metadata;
63
+
64
+ /**
65
+ * This is an object representing the terms of an offer of financing from
66
+ * Stripe Capital to a Connected account. This resource represents
67
+ * both the terms offered to the Connected account.
68
+ */
69
+ offered_terms?: FinancingOffer.OfferedTerms;
70
+
71
+ /**
72
+ * Financing product identifier.
73
+ */
74
+ product_type?: FinancingOffer.ProductType;
75
+
76
+ /**
77
+ * The ID of the financing offer that replaced this offer.
78
+ */
79
+ replacement?: string;
80
+
81
+ /**
82
+ * The ID of the financing offer that this offer is a replacement for.
83
+ */
84
+ replacement_for?: string;
85
+
86
+ /**
87
+ * The current status of the offer.
88
+ */
89
+ status: FinancingOffer.Status;
90
+
91
+ /**
92
+ * See [financing_type](https://stripe.com/docs/api/capital/connect_financing_object#financing_offer_object-financing_type).
93
+ */
94
+ type?: FinancingOffer.Type;
95
+ }
96
+
97
+ namespace FinancingOffer {
98
+ interface AcceptedTerms {
99
+ /**
100
+ * Amount of financing offered, in minor units.
101
+ */
102
+ advance_amount: number;
103
+
104
+ /**
105
+ * Currency that the financing offer is transacted in. For example, `usd`.
106
+ */
107
+ currency: string;
108
+
109
+ /**
110
+ * Fixed fee amount, in minor units.
111
+ */
112
+ fee_amount: number;
113
+
114
+ /**
115
+ * Populated when the `product_type` of the `financingoffer` is `refill`.
116
+ * Represents the discount amount on remaining premium for the existing loan at payout time.
117
+ */
118
+ previous_financing_fee_discount_amount: number | null;
119
+
120
+ /**
121
+ * Per-transaction rate at which Stripe will withhold funds to repay the financing.
122
+ */
123
+ withhold_rate: number;
124
+ }
125
+
126
+ type FinancingType = 'cash_advance' | 'flex_loan';
127
+
128
+ interface OfferedTerms {
129
+ /**
130
+ * Amount of financing offered, in minor units.
131
+ */
132
+ advance_amount: number;
133
+
134
+ /**
135
+ * Describes the type of user the offer is being extended to.
136
+ */
137
+ campaign_type: OfferedTerms.CampaignType;
138
+
139
+ /**
140
+ * Currency that the financing offer is transacted in. For example, `usd`.
141
+ */
142
+ currency: string;
143
+
144
+ /**
145
+ * Fixed fee amount, in minor units.
146
+ */
147
+ fee_amount: number;
148
+
149
+ /**
150
+ * Populated when the `product_type` of the `financingoffer` is `refill`.
151
+ * Represents the discount rate percentage on remaining fee on the existing loan. When the `financing_offer`
152
+ * is paid out, the `previous_financing_fee_discount_amount` will be computed as the multiple of this rate
153
+ * and the remaining fee.
154
+ */
155
+ previous_financing_fee_discount_rate: number | null;
156
+
157
+ /**
158
+ * Per-transaction rate at which Stripe will withhold funds to repay the financing.
159
+ */
160
+ withhold_rate: number;
161
+ }
162
+
163
+ namespace OfferedTerms {
164
+ type CampaignType =
165
+ | 'newly_eligible_user'
166
+ | 'previously_eligible_user'
167
+ | 'repeat_user';
168
+ }
169
+
170
+ type ProductType = 'refill' | 'standard';
171
+
172
+ type Status =
173
+ | 'accepted'
174
+ | 'canceled'
175
+ | 'completed'
176
+ | 'delivered'
177
+ | 'expired'
178
+ | 'fully_repaid'
179
+ | 'paid_out'
180
+ | 'rejected'
181
+ | 'replaced'
182
+ | 'undelivered';
183
+
184
+ type Type = 'cash_advance' | 'flex_loan';
185
+ }
186
+ }
187
+ }
188
+ }
@@ -0,0 +1,97 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Capital {
6
+ interface FinancingOfferRetrieveParams {
7
+ /**
8
+ * Specifies which fields in the response should be expanded.
9
+ */
10
+ expand?: Array<string>;
11
+ }
12
+
13
+ interface FinancingOfferListParams extends PaginationParams {
14
+ /**
15
+ * limit list to offers belonging to given connected account
16
+ */
17
+ connected_account?: string;
18
+
19
+ /**
20
+ * Only return offers that were created during the given date interval.
21
+ */
22
+ created?: Stripe.RangeQueryParam | number;
23
+
24
+ /**
25
+ * Specifies which fields in the response should be expanded.
26
+ */
27
+ expand?: Array<string>;
28
+
29
+ /**
30
+ * limit list to offers with given status
31
+ */
32
+ status?: FinancingOfferListParams.Status;
33
+ }
34
+
35
+ namespace FinancingOfferListParams {
36
+ type Status =
37
+ | 'accepted'
38
+ | 'canceled'
39
+ | 'completed'
40
+ | 'delivered'
41
+ | 'expired'
42
+ | 'fully_repaid'
43
+ | 'paid_out'
44
+ | 'rejected'
45
+ | 'revoked'
46
+ | 'undelivered';
47
+ }
48
+
49
+ interface FinancingOfferMarkDeliveredParams {
50
+ /**
51
+ * Specifies which fields in the response should be expanded.
52
+ */
53
+ expand?: Array<string>;
54
+ }
55
+
56
+ class FinancingOffersResource {
57
+ /**
58
+ * Get the details of the financing offer
59
+ */
60
+ retrieve(
61
+ id: string,
62
+ params?: FinancingOfferRetrieveParams,
63
+ options?: RequestOptions
64
+ ): Promise<Stripe.Response<Stripe.Capital.FinancingOffer>>;
65
+ retrieve(
66
+ id: string,
67
+ options?: RequestOptions
68
+ ): Promise<Stripe.Response<Stripe.Capital.FinancingOffer>>;
69
+
70
+ /**
71
+ * Retrieves the financing offers available for Connected accounts that belong to your platform.
72
+ */
73
+ list(
74
+ params?: FinancingOfferListParams,
75
+ options?: RequestOptions
76
+ ): ApiListPromise<Stripe.Capital.FinancingOffer>;
77
+ list(
78
+ options?: RequestOptions
79
+ ): ApiListPromise<Stripe.Capital.FinancingOffer>;
80
+
81
+ /**
82
+ * Acknowledges that platform has received and delivered the financing_offer to
83
+ * the intended merchant recipient.
84
+ */
85
+ markDelivered(
86
+ id: string,
87
+ params?: FinancingOfferMarkDeliveredParams,
88
+ options?: RequestOptions
89
+ ): Promise<Stripe.Response<Stripe.Capital.FinancingOffer>>;
90
+ markDelivered(
91
+ id: string,
92
+ options?: RequestOptions
93
+ ): Promise<Stripe.Response<Stripe.Capital.FinancingOffer>>;
94
+ }
95
+ }
96
+ }
97
+ }
@@ -0,0 +1,106 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Capital {
6
+ /**
7
+ * A financing object describes an account's current financing state. Used by Connect
8
+ * platforms to read the state of Capital offered to their connected accounts.
9
+ */
10
+ interface FinancingSummary {
11
+ /**
12
+ * The object type: financing_summary
13
+ */
14
+ object: 'capital.financing_summary';
15
+
16
+ /**
17
+ * Additional information about the financing summary. Describes currency, advance amount,
18
+ * fee amount, withhold rate, remaining amount, paid amount, current repayment interval,
19
+ * repayment start date, and advance payout date.
20
+ */
21
+ details: FinancingSummary.Details | null;
22
+
23
+ /**
24
+ * The Financing Offer ID this Financing Summary corresponds to
25
+ */
26
+ financing_offer: string | null;
27
+
28
+ /**
29
+ * Status of the Connected Account's financing. [/v1/capital/financing_summary](https://stripe.com/docs/api/capital/financing_summary) will only return `details` for `paid_out` financing.
30
+ */
31
+ status: FinancingSummary.Status | null;
32
+ }
33
+
34
+ namespace FinancingSummary {
35
+ interface Details {
36
+ /**
37
+ * Amount of financing offered, in minor units.
38
+ */
39
+ advance_amount: number;
40
+
41
+ /**
42
+ * The time at which the funds were paid out to the connected account's Stripe balance. Given in milliseconds since unix epoch.
43
+ */
44
+ advance_paid_out_at: number | null;
45
+
46
+ /**
47
+ * Currency that the financing offer is transacted in. For example, `usd`.
48
+ */
49
+ currency: string;
50
+
51
+ /**
52
+ * The chronologically current repayment interval for the financing offer.
53
+ */
54
+ current_repayment_interval: Details.CurrentRepaymentInterval | null;
55
+
56
+ /**
57
+ * Fixed fee amount, in minor units.
58
+ */
59
+ fee_amount: number;
60
+
61
+ /**
62
+ * The amount the Connected account has paid toward the financing debt so far.
63
+ */
64
+ paid_amount: number;
65
+
66
+ /**
67
+ * The balance remaining to be paid on the financing, in minor units.
68
+ */
69
+ remaining_amount: number;
70
+
71
+ /**
72
+ * The time at which Capital will begin withholding from payments. Given in seconds since unix epoch.
73
+ */
74
+ repayments_begin_at: number | null;
75
+
76
+ /**
77
+ * Per-transaction rate at which Stripe will withhold funds to repay the financing.
78
+ */
79
+ withhold_rate: number;
80
+ }
81
+
82
+ namespace Details {
83
+ interface CurrentRepaymentInterval {
84
+ /**
85
+ * The time at which the minimum payment amount will be due. If not met through withholding, the Connected account's linked bank account or account balance will be debited.
86
+ * Given in seconds since unix epoch.
87
+ */
88
+ due_at: number;
89
+
90
+ /**
91
+ * The amount that has already been paid in the current repayment interval.
92
+ */
93
+ paid_amount: number | null;
94
+
95
+ /**
96
+ * The amount that is yet to be paid in the current repayment interval.
97
+ */
98
+ remaining_amount: number;
99
+ }
100
+ }
101
+
102
+ type Status = 'accepted' | 'delivered' | 'none';
103
+ }
104
+ }
105
+ }
106
+ }
@@ -0,0 +1,27 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Capital {
6
+ interface FinancingSummaryRetrieveParams {
7
+ /**
8
+ * Specifies which fields in the response should be expanded.
9
+ */
10
+ expand?: Array<string>;
11
+ }
12
+
13
+ class FinancingSummaryResource {
14
+ /**
15
+ * Retrieve the financing state for the account that was authenticated in the request.
16
+ */
17
+ retrieve(
18
+ params?: FinancingSummaryRetrieveParams,
19
+ options?: RequestOptions
20
+ ): Promise<Stripe.Response<Stripe.Capital.FinancingSummary>>;
21
+ retrieve(
22
+ options?: RequestOptions
23
+ ): Promise<Stripe.Response<Stripe.Capital.FinancingSummary>>;
24
+ }
25
+ }
26
+ }
27
+ }