stripe 9.0.0 → 9.3.0
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.
- package/CHANGELOG.md +35 -0
- package/VERSION +1 -1
- package/lib/resources/Apps/Secrets.js +31 -0
- package/lib/resources/Customers.js +5 -0
- package/lib/resources/FinancialConnections/Accounts.js +12 -0
- package/lib/resources/TestHelpers/Treasury/InboundTransfers.js +25 -0
- package/lib/resources/TestHelpers/Treasury/OutboundPayments.js +25 -0
- package/lib/resources/TestHelpers/Treasury/OutboundTransfers.js +25 -0
- package/lib/resources/TestHelpers/Treasury/ReceivedCredits.js +15 -0
- package/lib/resources/TestHelpers/Treasury/ReceivedDebits.js +15 -0
- package/lib/resources/Treasury/CreditReversals.js +26 -0
- package/lib/resources/Treasury/DebitReversals.js +26 -0
- package/lib/resources/Treasury/FinancialAccounts.js +41 -0
- package/lib/resources/Treasury/InboundTransfers.js +31 -0
- package/lib/resources/Treasury/OutboundPayments.js +31 -0
- package/lib/resources/Treasury/OutboundTransfers.js +31 -0
- package/lib/resources/Treasury/ReceivedCredits.js +21 -0
- package/lib/resources/Treasury/ReceivedDebits.js +21 -0
- package/lib/resources/Treasury/TransactionEntries.js +21 -0
- package/lib/resources/Treasury/Transactions.js +21 -0
- package/lib/resources.js +22 -0
- package/package.json +1 -1
- package/types/2020-08-27/Accounts.d.ts +5 -5
- package/types/2020-08-27/Apps/Secrets.d.ts +241 -0
- package/types/2020-08-27/BillingPortal/Configurations.d.ts +1 -1
- package/types/2020-08-27/BillingPortal/Sessions.d.ts +1 -1
- package/types/2020-08-27/Charges.d.ts +8 -0
- package/types/2020-08-27/Checkout/Sessions.d.ts +51 -3
- package/types/2020-08-27/Customers.d.ts +24 -0
- package/types/2020-08-27/Discounts.d.ts +4 -4
- package/types/2020-08-27/FinancialConnections/Accounts.d.ts +63 -0
- package/types/2020-08-27/Invoices.d.ts +3 -0
- package/types/2020-08-27/Issuing/Authorizations.d.ts +22 -0
- package/types/2020-08-27/Issuing/Cards.d.ts +7 -0
- package/types/2020-08-27/Issuing/Disputes.d.ts +29 -0
- package/types/2020-08-27/Issuing/Transactions.d.ts +17 -0
- package/types/2020-08-27/LineItems.d.ts +2 -3
- package/types/2020-08-27/Mandates.d.ts +4 -0
- package/types/2020-08-27/Orders.d.ts +84 -4
- package/types/2020-08-27/PaymentIntents.d.ts +332 -2
- package/types/2020-08-27/PaymentLinks.d.ts +167 -0
- package/types/2020-08-27/PaymentMethods.d.ts +73 -0
- package/types/2020-08-27/PromotionCodes.d.ts +2 -2
- package/types/2020-08-27/Quotes.d.ts +6 -9
- package/types/2020-08-27/Refunds.d.ts +1 -1
- package/types/2020-08-27/SetupAttempts.d.ts +4 -0
- package/types/2020-08-27/SetupIntents.d.ts +157 -0
- package/types/2020-08-27/SubscriptionSchedules.d.ts +15 -0
- package/types/2020-08-27/Subscriptions.d.ts +41 -2
- package/types/2020-08-27/Terminal/Configurations.d.ts +63 -0
- package/types/2020-08-27/TestHelpers/Treasury/InboundTransfers.d.ts +108 -0
- package/types/2020-08-27/TestHelpers/Treasury/OutboundPayments.d.ts +105 -0
- package/types/2020-08-27/TestHelpers/Treasury/OutboundTransfers.d.ts +105 -0
- package/types/2020-08-27/TestHelpers/Treasury/ReceivedCredits.d.ts +93 -0
- package/types/2020-08-27/TestHelpers/Treasury/ReceivedDebits.d.ts +91 -0
- package/types/2020-08-27/Tokens.d.ts +2 -2
- package/types/2020-08-27/Treasury/CreditReversals.d.ts +168 -0
- package/types/2020-08-27/Treasury/DebitReversals.d.ts +187 -0
- package/types/2020-08-27/Treasury/FinancialAccountFeatures.d.ts +622 -0
- package/types/2020-08-27/Treasury/FinancialAccounts.d.ts +833 -0
- package/types/2020-08-27/Treasury/InboundTransfers.d.ts +349 -0
- package/types/2020-08-27/Treasury/OutboundPayments.d.ts +550 -0
- package/types/2020-08-27/Treasury/OutboundTransfers.d.ts +385 -0
- package/types/2020-08-27/Treasury/ReceivedCredits.d.ts +303 -0
- package/types/2020-08-27/Treasury/ReceivedDebits.d.ts +231 -0
- package/types/2020-08-27/Treasury/TransactionEntries.d.ts +257 -0
- package/types/2020-08-27/Treasury/Transactions.d.ts +268 -0
- package/types/2020-08-27/WebhookEndpoints.d.ts +62 -2
- package/types/2020-08-27/index.d.ts +39 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec
|
|
2
|
+
|
|
3
|
+
declare module 'stripe' {
|
|
4
|
+
namespace Stripe {
|
|
5
|
+
namespace Treasury {
|
|
6
|
+
/**
|
|
7
|
+
* The OutboundTransfer object.
|
|
8
|
+
*/
|
|
9
|
+
interface OutboundTransfer {
|
|
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: 'treasury.outbound_transfer';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Amount (in cents) transferred.
|
|
22
|
+
*/
|
|
23
|
+
amount: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Returns `true` if the object can be canceled, and `false` otherwise.
|
|
27
|
+
*/
|
|
28
|
+
cancelable: boolean;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Time at which the object was created. Measured in seconds since the Unix epoch.
|
|
32
|
+
*/
|
|
33
|
+
created: number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 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).
|
|
37
|
+
*/
|
|
38
|
+
currency: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* An arbitrary string attached to the object. Often useful for displaying to users.
|
|
42
|
+
*/
|
|
43
|
+
description: string | null;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The PaymentMethod used as the payment instrument for an OutboundTransfer.
|
|
47
|
+
*/
|
|
48
|
+
destination_payment_method: string;
|
|
49
|
+
|
|
50
|
+
destination_payment_method_details: OutboundTransfer.DestinationPaymentMethodDetails;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The date when funds are expected to arrive in the destination account.
|
|
54
|
+
*/
|
|
55
|
+
expected_arrival_date: number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The FinancialAccount that funds were pulled from.
|
|
59
|
+
*/
|
|
60
|
+
financial_account: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
|
|
64
|
+
*/
|
|
65
|
+
hosted_regulatory_receipt_url: string | null;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
|
69
|
+
*/
|
|
70
|
+
livemode: boolean;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 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.
|
|
74
|
+
*/
|
|
75
|
+
metadata: Stripe.Metadata;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Details about a returned OutboundTransfer. Only set when the status is `returned`.
|
|
79
|
+
*/
|
|
80
|
+
returned_details: OutboundTransfer.ReturnedDetails | null;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Information about the OutboundTransfer to be sent to the recipient account.
|
|
84
|
+
*/
|
|
85
|
+
statement_descriptor: string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. An OutboundTransfer is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`.
|
|
89
|
+
*/
|
|
90
|
+
status: OutboundTransfer.Status;
|
|
91
|
+
|
|
92
|
+
status_transitions: OutboundTransfer.StatusTransitions;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The Transaction associated with this object.
|
|
96
|
+
*/
|
|
97
|
+
transaction: string | Stripe.Treasury.Transaction;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
namespace OutboundTransfer {
|
|
101
|
+
interface DestinationPaymentMethodDetails {
|
|
102
|
+
billing_details: DestinationPaymentMethodDetails.BillingDetails;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The type of the payment method used in the OutboundTransfer.
|
|
106
|
+
*/
|
|
107
|
+
type: 'us_bank_account';
|
|
108
|
+
|
|
109
|
+
us_bank_account?: DestinationPaymentMethodDetails.UsBankAccount;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
namespace DestinationPaymentMethodDetails {
|
|
113
|
+
interface BillingDetails {
|
|
114
|
+
address: Stripe.Address;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Email address.
|
|
118
|
+
*/
|
|
119
|
+
email: string | null;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Full name.
|
|
123
|
+
*/
|
|
124
|
+
name: string | null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface UsBankAccount {
|
|
128
|
+
/**
|
|
129
|
+
* Account holder type: individual or company.
|
|
130
|
+
*/
|
|
131
|
+
account_holder_type: UsBankAccount.AccountHolderType | null;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Account type: checkings or savings. Defaults to checking if omitted.
|
|
135
|
+
*/
|
|
136
|
+
account_type: UsBankAccount.AccountType | null;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Name of the bank associated with the bank account.
|
|
140
|
+
*/
|
|
141
|
+
bank_name: string | null;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
|
|
145
|
+
*/
|
|
146
|
+
fingerprint: string | null;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Last four digits of the bank account number.
|
|
150
|
+
*/
|
|
151
|
+
last4: string | null;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The US bank account network used to send funds.
|
|
155
|
+
*/
|
|
156
|
+
network: UsBankAccount.Network;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Routing number of the bank account.
|
|
160
|
+
*/
|
|
161
|
+
routing_number: string | null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
namespace UsBankAccount {
|
|
165
|
+
type AccountHolderType = 'company' | 'individual';
|
|
166
|
+
|
|
167
|
+
type AccountType = 'checking' | 'savings';
|
|
168
|
+
|
|
169
|
+
type Network = 'ach' | 'us_domestic_wire';
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
interface ReturnedDetails {
|
|
174
|
+
/**
|
|
175
|
+
* Reason for the return.
|
|
176
|
+
*/
|
|
177
|
+
code: ReturnedDetails.Code;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The Transaction associated with this object.
|
|
181
|
+
*/
|
|
182
|
+
transaction: string | Stripe.Treasury.Transaction;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
namespace ReturnedDetails {
|
|
186
|
+
type Code =
|
|
187
|
+
| 'account_closed'
|
|
188
|
+
| 'account_frozen'
|
|
189
|
+
| 'bank_account_restricted'
|
|
190
|
+
| 'bank_ownership_changed'
|
|
191
|
+
| 'declined'
|
|
192
|
+
| 'incorrect_account_holder_name'
|
|
193
|
+
| 'invalid_account_number'
|
|
194
|
+
| 'invalid_currency'
|
|
195
|
+
| 'no_account'
|
|
196
|
+
| 'other';
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
type Status =
|
|
200
|
+
| 'canceled'
|
|
201
|
+
| 'failed'
|
|
202
|
+
| 'posted'
|
|
203
|
+
| 'processing'
|
|
204
|
+
| 'returned';
|
|
205
|
+
|
|
206
|
+
interface StatusTransitions {
|
|
207
|
+
/**
|
|
208
|
+
* Timestamp describing when an OutboundTransfer changed status to `canceled`
|
|
209
|
+
*/
|
|
210
|
+
canceled_at: number | null;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Timestamp describing when an OutboundTransfer changed status to `failed`
|
|
214
|
+
*/
|
|
215
|
+
failed_at: number | null;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Timestamp describing when an OutboundTransfer changed status to `posted`
|
|
219
|
+
*/
|
|
220
|
+
posted_at: number | null;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Timestamp describing when an OutboundTransfer changed status to `returned`
|
|
224
|
+
*/
|
|
225
|
+
returned_at: number | null;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
interface OutboundTransferCreateParams {
|
|
230
|
+
/**
|
|
231
|
+
* Amount (in cents) to be transferred.
|
|
232
|
+
*/
|
|
233
|
+
amount: number;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* 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).
|
|
237
|
+
*/
|
|
238
|
+
currency: string;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* The PaymentMethod to use as the payment instrument for the OutboundTransfer.
|
|
242
|
+
*/
|
|
243
|
+
destination_payment_method: string;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* The FinancialAccount to pull funds from.
|
|
247
|
+
*/
|
|
248
|
+
financial_account: string;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* An arbitrary string attached to the object. Often useful for displaying to users.
|
|
252
|
+
*/
|
|
253
|
+
description?: string;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Hash describing payment method configuration details.
|
|
257
|
+
*/
|
|
258
|
+
destination_payment_method_options?: OutboundTransferCreateParams.DestinationPaymentMethodOptions;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Specifies which fields in the response should be expanded.
|
|
262
|
+
*/
|
|
263
|
+
expand?: Array<string>;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
|
267
|
+
*/
|
|
268
|
+
metadata?: Stripe.MetadataParam;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. The default value is `transfer`.
|
|
272
|
+
*/
|
|
273
|
+
statement_descriptor?: string;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
namespace OutboundTransferCreateParams {
|
|
277
|
+
interface DestinationPaymentMethodOptions {
|
|
278
|
+
/**
|
|
279
|
+
* Optional fields for `us_bank_account`.
|
|
280
|
+
*/
|
|
281
|
+
us_bank_account?: Stripe.Emptyable<
|
|
282
|
+
DestinationPaymentMethodOptions.UsBankAccount
|
|
283
|
+
>;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
namespace DestinationPaymentMethodOptions {
|
|
287
|
+
interface UsBankAccount {
|
|
288
|
+
/**
|
|
289
|
+
* Designate the OutboundTransfer as using a US bank account network configuration.
|
|
290
|
+
*/
|
|
291
|
+
network?: UsBankAccount.Network;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
namespace UsBankAccount {
|
|
295
|
+
type Network = 'ach' | 'us_domestic_wire';
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
interface OutboundTransferRetrieveParams {
|
|
301
|
+
/**
|
|
302
|
+
* Specifies which fields in the response should be expanded.
|
|
303
|
+
*/
|
|
304
|
+
expand?: Array<string>;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
interface OutboundTransferListParams extends PaginationParams {
|
|
308
|
+
/**
|
|
309
|
+
* Returns objects associated with this FinancialAccount.
|
|
310
|
+
*/
|
|
311
|
+
financial_account: string;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Specifies which fields in the response should be expanded.
|
|
315
|
+
*/
|
|
316
|
+
expand?: Array<string>;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`.
|
|
320
|
+
*/
|
|
321
|
+
status?: OutboundTransferListParams.Status;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
namespace OutboundTransferListParams {
|
|
325
|
+
type Status =
|
|
326
|
+
| 'canceled'
|
|
327
|
+
| 'failed'
|
|
328
|
+
| 'posted'
|
|
329
|
+
| 'processing'
|
|
330
|
+
| 'returned';
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
interface OutboundTransferCancelParams {
|
|
334
|
+
/**
|
|
335
|
+
* Specifies which fields in the response should be expanded.
|
|
336
|
+
*/
|
|
337
|
+
expand?: Array<string>;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
class OutboundTransfersResource {
|
|
341
|
+
/**
|
|
342
|
+
* Creates an OutboundTransfer.
|
|
343
|
+
*/
|
|
344
|
+
create(
|
|
345
|
+
params: OutboundTransferCreateParams,
|
|
346
|
+
options?: RequestOptions
|
|
347
|
+
): Promise<Stripe.Response<Stripe.Treasury.OutboundTransfer>>;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list.
|
|
351
|
+
*/
|
|
352
|
+
retrieve(
|
|
353
|
+
id: string,
|
|
354
|
+
params?: OutboundTransferRetrieveParams,
|
|
355
|
+
options?: RequestOptions
|
|
356
|
+
): Promise<Stripe.Response<Stripe.Treasury.OutboundTransfer>>;
|
|
357
|
+
retrieve(
|
|
358
|
+
id: string,
|
|
359
|
+
options?: RequestOptions
|
|
360
|
+
): Promise<Stripe.Response<Stripe.Treasury.OutboundTransfer>>;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Returns a list of OutboundTransfers sent from the specified FinancialAccount.
|
|
364
|
+
*/
|
|
365
|
+
list(
|
|
366
|
+
params: OutboundTransferListParams,
|
|
367
|
+
options?: RequestOptions
|
|
368
|
+
): ApiListPromise<Stripe.Treasury.OutboundTransfer>;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* An OutboundTransfer can be canceled if the funds have not yet been paid out.
|
|
372
|
+
*/
|
|
373
|
+
cancel(
|
|
374
|
+
id: string,
|
|
375
|
+
params?: OutboundTransferCancelParams,
|
|
376
|
+
options?: RequestOptions
|
|
377
|
+
): Promise<Stripe.Response<Stripe.Treasury.OutboundTransfer>>;
|
|
378
|
+
cancel(
|
|
379
|
+
id: string,
|
|
380
|
+
options?: RequestOptions
|
|
381
|
+
): Promise<Stripe.Response<Stripe.Treasury.OutboundTransfer>>;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec
|
|
2
|
+
|
|
3
|
+
declare module 'stripe' {
|
|
4
|
+
namespace Stripe {
|
|
5
|
+
namespace Treasury {
|
|
6
|
+
/**
|
|
7
|
+
* The ReceivedCredit object.
|
|
8
|
+
*/
|
|
9
|
+
interface ReceivedCredit {
|
|
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: 'treasury.received_credit';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Amount (in cents) transferred.
|
|
22
|
+
*/
|
|
23
|
+
amount: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Time at which the object was created. Measured in seconds since the Unix epoch.
|
|
27
|
+
*/
|
|
28
|
+
created: number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 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).
|
|
32
|
+
*/
|
|
33
|
+
currency: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An arbitrary string attached to the object. Often useful for displaying to users.
|
|
37
|
+
*/
|
|
38
|
+
description: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Reason for the failure. A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen.
|
|
42
|
+
*/
|
|
43
|
+
failure_code: ReceivedCredit.FailureCode | null;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The FinancialAccount that received the funds.
|
|
47
|
+
*/
|
|
48
|
+
financial_account: string | null;
|
|
49
|
+
|
|
50
|
+
initiating_payment_method_details: ReceivedCredit.InitiatingPaymentMethodDetails;
|
|
51
|
+
|
|
52
|
+
linked_flows: ReceivedCredit.LinkedFlows;
|
|
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
|
+
* The rails used to send the funds.
|
|
61
|
+
*/
|
|
62
|
+
network: ReceivedCredit.Network;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field.
|
|
66
|
+
*/
|
|
67
|
+
status: ReceivedCredit.Status;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The Transaction associated with this object.
|
|
71
|
+
*/
|
|
72
|
+
transaction: string | Stripe.Treasury.Transaction | null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
namespace ReceivedCredit {
|
|
76
|
+
type FailureCode = 'account_closed' | 'account_frozen' | 'other';
|
|
77
|
+
|
|
78
|
+
interface InitiatingPaymentMethodDetails {
|
|
79
|
+
/**
|
|
80
|
+
* Set when `type` is `balance`.
|
|
81
|
+
*/
|
|
82
|
+
balance?: 'payments';
|
|
83
|
+
|
|
84
|
+
billing_details: InitiatingPaymentMethodDetails.BillingDetails;
|
|
85
|
+
|
|
86
|
+
financial_account?: InitiatingPaymentMethodDetails.FinancialAccount;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID.
|
|
90
|
+
*/
|
|
91
|
+
issuing_card?: string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount.
|
|
95
|
+
*/
|
|
96
|
+
type: InitiatingPaymentMethodDetails.Type;
|
|
97
|
+
|
|
98
|
+
us_bank_account?: InitiatingPaymentMethodDetails.UsBankAccount;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
namespace InitiatingPaymentMethodDetails {
|
|
102
|
+
interface BillingDetails {
|
|
103
|
+
address: Stripe.Address;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Email address.
|
|
107
|
+
*/
|
|
108
|
+
email: string | null;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Full name.
|
|
112
|
+
*/
|
|
113
|
+
name: string | null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
interface FinancialAccount {
|
|
117
|
+
/**
|
|
118
|
+
* The FinancialAccount ID.
|
|
119
|
+
*/
|
|
120
|
+
id: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`.
|
|
124
|
+
*/
|
|
125
|
+
network: 'stripe';
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type Type =
|
|
129
|
+
| 'balance'
|
|
130
|
+
| 'financial_account'
|
|
131
|
+
| 'issuing_card'
|
|
132
|
+
| 'stripe'
|
|
133
|
+
| 'us_bank_account';
|
|
134
|
+
|
|
135
|
+
interface UsBankAccount {
|
|
136
|
+
/**
|
|
137
|
+
* Bank name.
|
|
138
|
+
*/
|
|
139
|
+
bank_name: string | null;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The last four digits of the bank account number.
|
|
143
|
+
*/
|
|
144
|
+
last4: string | null;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The routing number for the bank account.
|
|
148
|
+
*/
|
|
149
|
+
routing_number: string | null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
interface LinkedFlows {
|
|
154
|
+
/**
|
|
155
|
+
* The CreditReversal created as a result of this ReceivedCredit being reversed.
|
|
156
|
+
*/
|
|
157
|
+
credit_reversal: string | null;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object.
|
|
161
|
+
*/
|
|
162
|
+
issuing_authorization: string | null;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://stripe.com/docs/api#issuing_transactions) object.
|
|
166
|
+
*/
|
|
167
|
+
issuing_transaction: string | null;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* ID of the source flow. Set if `network` is `stripe` and the source flow is visible to the merchant. Examples of source flows include OutboundPayments, payouts, or CreditReversals.
|
|
171
|
+
*/
|
|
172
|
+
source_flow: string | null;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* The expandable object of the source flow.
|
|
176
|
+
*/
|
|
177
|
+
source_flow_details: LinkedFlows.SourceFlowDetails | null;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The type of flow that originated the ReceivedCredit (for example, `outbound_payment`).
|
|
181
|
+
*/
|
|
182
|
+
source_flow_type: string | null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
namespace LinkedFlows {
|
|
186
|
+
interface SourceFlowDetails {
|
|
187
|
+
/**
|
|
188
|
+
* You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal.
|
|
189
|
+
*/
|
|
190
|
+
credit_reversal?: Stripe.Treasury.CreditReversal;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers).
|
|
194
|
+
*
|
|
195
|
+
* Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects.
|
|
196
|
+
*/
|
|
197
|
+
outbound_payment?: Stripe.Treasury.OutboundPayment;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* A `Payout` object is created when you receive funds from Stripe, or when you
|
|
201
|
+
* initiate a payout to either a bank account or debit card of a [connected
|
|
202
|
+
* Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts,
|
|
203
|
+
* as well as list all payouts. Payouts are made on [varying
|
|
204
|
+
* schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and
|
|
205
|
+
* industry.
|
|
206
|
+
*
|
|
207
|
+
* Related guide: [Receiving Payouts](https://stripe.com/docs/payouts).
|
|
208
|
+
*/
|
|
209
|
+
payout?: Stripe.Payout;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The type of the source flow that originated the ReceivedCredit.
|
|
213
|
+
*/
|
|
214
|
+
type: SourceFlowDetails.Type;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
namespace SourceFlowDetails {
|
|
218
|
+
type Type =
|
|
219
|
+
| 'credit_reversal'
|
|
220
|
+
| 'other'
|
|
221
|
+
| 'outbound_payment'
|
|
222
|
+
| 'payout';
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
type Network = 'ach' | 'card' | 'stripe' | 'us_domestic_wire';
|
|
227
|
+
|
|
228
|
+
type Status = 'failed' | 'succeeded';
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
interface ReceivedCreditRetrieveParams {
|
|
232
|
+
/**
|
|
233
|
+
* Specifies which fields in the response should be expanded.
|
|
234
|
+
*/
|
|
235
|
+
expand?: Array<string>;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
interface ReceivedCreditListParams extends PaginationParams {
|
|
239
|
+
/**
|
|
240
|
+
* The FinancialAccount that received the funds.
|
|
241
|
+
*/
|
|
242
|
+
financial_account: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Specifies which fields in the response should be expanded.
|
|
246
|
+
*/
|
|
247
|
+
expand?: Array<string>;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Only return ReceivedCredits described by the flow.
|
|
251
|
+
*/
|
|
252
|
+
linked_flows?: ReceivedCreditListParams.LinkedFlows;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Only return ReceivedCredits that have the given status: `succeeded` or `failed`.
|
|
256
|
+
*/
|
|
257
|
+
status?: ReceivedCreditListParams.Status;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
namespace ReceivedCreditListParams {
|
|
261
|
+
interface LinkedFlows {
|
|
262
|
+
/**
|
|
263
|
+
* The source flow type.
|
|
264
|
+
*/
|
|
265
|
+
source_flow_type: LinkedFlows.SourceFlowType;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
namespace LinkedFlows {
|
|
269
|
+
type SourceFlowType =
|
|
270
|
+
| 'credit_reversal'
|
|
271
|
+
| 'other'
|
|
272
|
+
| 'outbound_payment'
|
|
273
|
+
| 'payout';
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
type Status = 'failed' | 'succeeded';
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
class ReceivedCreditsResource {
|
|
280
|
+
/**
|
|
281
|
+
* Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list.
|
|
282
|
+
*/
|
|
283
|
+
retrieve(
|
|
284
|
+
id: string,
|
|
285
|
+
params?: ReceivedCreditRetrieveParams,
|
|
286
|
+
options?: RequestOptions
|
|
287
|
+
): Promise<Stripe.Response<Stripe.Treasury.ReceivedCredit>>;
|
|
288
|
+
retrieve(
|
|
289
|
+
id: string,
|
|
290
|
+
options?: RequestOptions
|
|
291
|
+
): Promise<Stripe.Response<Stripe.Treasury.ReceivedCredit>>;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Returns a list of ReceivedCredits.
|
|
295
|
+
*/
|
|
296
|
+
list(
|
|
297
|
+
params: ReceivedCreditListParams,
|
|
298
|
+
options?: RequestOptions
|
|
299
|
+
): ApiListPromise<Stripe.Treasury.ReceivedCredit>;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|