increase 0.339.0 → 0.340.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/index.d.mts +6 -0
  3. package/index.d.ts +6 -0
  4. package/index.d.ts.map +1 -1
  5. package/index.js +8 -0
  6. package/index.js.map +1 -1
  7. package/index.mjs +8 -0
  8. package/index.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/fednow-transfers.d.ts +479 -0
  11. package/resources/fednow-transfers.d.ts.map +1 -0
  12. package/resources/fednow-transfers.js +80 -0
  13. package/resources/fednow-transfers.js.map +1 -0
  14. package/resources/fednow-transfers.mjs +75 -0
  15. package/resources/fednow-transfers.mjs.map +1 -0
  16. package/resources/inbound-fednow-transfers.d.ts +192 -0
  17. package/resources/inbound-fednow-transfers.d.ts.map +1 -0
  18. package/resources/inbound-fednow-transfers.js +38 -0
  19. package/resources/inbound-fednow-transfers.js.map +1 -0
  20. package/resources/inbound-fednow-transfers.mjs +33 -0
  21. package/resources/inbound-fednow-transfers.mjs.map +1 -0
  22. package/resources/index.d.ts +2 -0
  23. package/resources/index.d.ts.map +1 -1
  24. package/resources/index.js +8 -2
  25. package/resources/index.js.map +1 -1
  26. package/resources/index.mjs +2 -0
  27. package/resources/index.mjs.map +1 -1
  28. package/resources/simulations/inbound-fednow-transfers.d.ts +50 -0
  29. package/resources/simulations/inbound-fednow-transfers.d.ts.map +1 -0
  30. package/resources/simulations/inbound-fednow-transfers.js +26 -0
  31. package/resources/simulations/inbound-fednow-transfers.js.map +1 -0
  32. package/resources/simulations/inbound-fednow-transfers.mjs +22 -0
  33. package/resources/simulations/inbound-fednow-transfers.mjs.map +1 -0
  34. package/resources/simulations/index.d.ts +1 -0
  35. package/resources/simulations/index.d.ts.map +1 -1
  36. package/resources/simulations/index.js +3 -1
  37. package/resources/simulations/index.js.map +1 -1
  38. package/resources/simulations/index.mjs +1 -0
  39. package/resources/simulations/index.mjs.map +1 -1
  40. package/resources/simulations/simulations.d.ts +4 -0
  41. package/resources/simulations/simulations.d.ts.map +1 -1
  42. package/resources/simulations/simulations.js +4 -0
  43. package/resources/simulations/simulations.js.map +1 -1
  44. package/resources/simulations/simulations.mjs +4 -0
  45. package/resources/simulations/simulations.mjs.map +1 -1
  46. package/src/index.ts +34 -0
  47. package/src/resources/fednow-transfers.ts +613 -0
  48. package/src/resources/inbound-fednow-transfers.ts +255 -0
  49. package/src/resources/index.ts +13 -0
  50. package/src/resources/simulations/inbound-fednow-transfers.ts +64 -0
  51. package/src/resources/simulations/index.ts +1 -0
  52. package/src/resources/simulations/simulations.ts +10 -0
  53. package/src/version.ts +1 -1
  54. package/version.d.ts +1 -1
  55. package/version.js +1 -1
  56. package/version.mjs +1 -1
@@ -0,0 +1,613 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../resource';
4
+ import { isRequestOptions } from '../core';
5
+ import * as Core from '../core';
6
+ import { Page, type PageParams } from '../pagination';
7
+
8
+ export class FednowTransfers extends APIResource {
9
+ /**
10
+ * Create a FedNow Transfer
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const fednowTransfer = await client.fednowTransfers.create({
15
+ * account_id: 'account_in71c4amph0vgo2qllky',
16
+ * amount: 100,
17
+ * creditor_name: 'Ian Crease',
18
+ * debtor_name: 'National Phonograph Company',
19
+ * source_account_number_id:
20
+ * 'account_number_v18nkfqm6afpsrvy82b2',
21
+ * unstructured_remittance_information: 'Invoice 29582',
22
+ * });
23
+ * ```
24
+ */
25
+ create(body: FednowTransferCreateParams, options?: Core.RequestOptions): Core.APIPromise<FednowTransfer> {
26
+ return this._client.post('/fednow_transfers', { body, ...options });
27
+ }
28
+
29
+ /**
30
+ * Retrieve a FedNow Transfer
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const fednowTransfer =
35
+ * await client.fednowTransfers.retrieve(
36
+ * 'fednow_transfer_4i0mptrdu1mueg1196bg',
37
+ * );
38
+ * ```
39
+ */
40
+ retrieve(fednowTransferId: string, options?: Core.RequestOptions): Core.APIPromise<FednowTransfer> {
41
+ return this._client.get(`/fednow_transfers/${fednowTransferId}`, options);
42
+ }
43
+
44
+ /**
45
+ * List FedNow Transfers
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * // Automatically fetches more pages as needed.
50
+ * for await (const fednowTransfer of client.fednowTransfers.list()) {
51
+ * // ...
52
+ * }
53
+ * ```
54
+ */
55
+ list(
56
+ query?: FednowTransferListParams,
57
+ options?: Core.RequestOptions,
58
+ ): Core.PagePromise<FednowTransfersPage, FednowTransfer>;
59
+ list(options?: Core.RequestOptions): Core.PagePromise<FednowTransfersPage, FednowTransfer>;
60
+ list(
61
+ query: FednowTransferListParams | Core.RequestOptions = {},
62
+ options?: Core.RequestOptions,
63
+ ): Core.PagePromise<FednowTransfersPage, FednowTransfer> {
64
+ if (isRequestOptions(query)) {
65
+ return this.list({}, query);
66
+ }
67
+ return this._client.getAPIList('/fednow_transfers', FednowTransfersPage, { query, ...options });
68
+ }
69
+
70
+ /**
71
+ * Approve a FedNow Transfer
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const fednowTransfer = await client.fednowTransfers.approve(
76
+ * 'fednow_transfer_4i0mptrdu1mueg1196bg',
77
+ * );
78
+ * ```
79
+ */
80
+ approve(fednowTransferId: string, options?: Core.RequestOptions): Core.APIPromise<FednowTransfer> {
81
+ return this._client.post(`/fednow_transfers/${fednowTransferId}/approve`, options);
82
+ }
83
+
84
+ /**
85
+ * Cancel a pending FedNow Transfer
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * const fednowTransfer = await client.fednowTransfers.cancel(
90
+ * 'fednow_transfer_4i0mptrdu1mueg1196bg',
91
+ * );
92
+ * ```
93
+ */
94
+ cancel(fednowTransferId: string, options?: Core.RequestOptions): Core.APIPromise<FednowTransfer> {
95
+ return this._client.post(`/fednow_transfers/${fednowTransferId}/cancel`, options);
96
+ }
97
+ }
98
+
99
+ export class FednowTransfersPage extends Page<FednowTransfer> {}
100
+
101
+ /**
102
+ * FedNow transfers move funds, within seconds, between your Increase account and
103
+ * any other account supporting FedNow.
104
+ */
105
+ export interface FednowTransfer {
106
+ /**
107
+ * The FedNow Transfer's identifier.
108
+ */
109
+ id: string;
110
+
111
+ /**
112
+ * The Account from which the transfer was sent.
113
+ */
114
+ account_id: string;
115
+
116
+ /**
117
+ * The destination account number.
118
+ */
119
+ account_number: string;
120
+
121
+ /**
122
+ * If the transfer is acknowledged by the recipient bank, this will contain
123
+ * supplemental details.
124
+ */
125
+ acknowledgement: FednowTransfer.Acknowledgement | null;
126
+
127
+ /**
128
+ * The transfer amount in USD cents.
129
+ */
130
+ amount: number;
131
+
132
+ /**
133
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which
134
+ * the transfer was created.
135
+ */
136
+ created_at: string;
137
+
138
+ /**
139
+ * What object created the transfer, either via the API or the dashboard.
140
+ */
141
+ created_by: FednowTransfer.CreatedBy | null;
142
+
143
+ /**
144
+ * The name of the transfer's recipient. This is set by the sender when creating
145
+ * the transfer.
146
+ */
147
+ creditor_name: string;
148
+
149
+ /**
150
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's
151
+ * currency. For FedNow transfers this is always equal to `USD`.
152
+ *
153
+ * - `CAD` - Canadian Dollar (CAD)
154
+ * - `CHF` - Swiss Franc (CHF)
155
+ * - `EUR` - Euro (EUR)
156
+ * - `GBP` - British Pound (GBP)
157
+ * - `JPY` - Japanese Yen (JPY)
158
+ * - `USD` - US Dollar (USD)
159
+ */
160
+ currency: 'CAD' | 'CHF' | 'EUR' | 'GBP' | 'JPY' | 'USD';
161
+
162
+ /**
163
+ * The name of the transfer's sender. If not provided, defaults to the name of the
164
+ * account's entity.
165
+ */
166
+ debtor_name: string;
167
+
168
+ /**
169
+ * The identifier of the External Account the transfer was made to, if any.
170
+ */
171
+ external_account_id: string | null;
172
+
173
+ /**
174
+ * The idempotency key you chose for this object. This value is unique across
175
+ * Increase and is used to ensure that a request is only processed once. Learn more
176
+ * about [idempotency](https://increase.com/documentation/idempotency-keys).
177
+ */
178
+ idempotency_key: string | null;
179
+
180
+ /**
181
+ * The ID for the pending transaction representing the transfer.
182
+ */
183
+ pending_transaction_id: string | null;
184
+
185
+ /**
186
+ * If the transfer is rejected by FedNow or the destination financial institution,
187
+ * this will contain supplemental details.
188
+ */
189
+ rejection: FednowTransfer.Rejection | null;
190
+
191
+ /**
192
+ * The destination American Bankers' Association (ABA) Routing Transit Number
193
+ * (RTN).
194
+ */
195
+ routing_number: string;
196
+
197
+ /**
198
+ * The Account Number the recipient will see as having sent the transfer.
199
+ */
200
+ source_account_number_id: string;
201
+
202
+ /**
203
+ * The lifecycle status of the transfer.
204
+ *
205
+ * - `pending_reviewing` - The transfer is pending review by Increase.
206
+ * - `canceled` - The transfer has been canceled.
207
+ * - `reviewing_rejected` - The transfer has been rejected by Increase.
208
+ * - `requires_attention` - The transfer requires attention from an Increase
209
+ * operator.
210
+ * - `pending_approval` - The transfer is pending approval.
211
+ * - `pending_submitting` - The transfer is queued to be submitted to FedNow.
212
+ * - `pending_response` - The transfer has been submitted and is pending a response
213
+ * from FedNow.
214
+ * - `complete` - The transfer has been sent successfully and is complete.
215
+ * - `rejected` - The transfer was rejected by the network or the recipient's bank.
216
+ */
217
+ status:
218
+ | 'pending_reviewing'
219
+ | 'canceled'
220
+ | 'reviewing_rejected'
221
+ | 'requires_attention'
222
+ | 'pending_approval'
223
+ | 'pending_submitting'
224
+ | 'pending_response'
225
+ | 'complete'
226
+ | 'rejected';
227
+
228
+ /**
229
+ * After the transfer is submitted to FedNow, this will contain supplemental
230
+ * details.
231
+ */
232
+ submission: FednowTransfer.Submission | null;
233
+
234
+ /**
235
+ * The Transaction funding the transfer once it is complete.
236
+ */
237
+ transaction_id: string | null;
238
+
239
+ /**
240
+ * A constant representing the object's type. For this resource it will always be
241
+ * `fednow_transfer`.
242
+ */
243
+ type: 'fednow_transfer';
244
+
245
+ /**
246
+ * The Unique End-to-end Transaction Reference
247
+ * ([UETR](https://www.swift.com/payments/what-unique-end-end-transaction-reference-uetr))
248
+ * of the transfer.
249
+ */
250
+ unique_end_to_end_transaction_reference: string;
251
+
252
+ /**
253
+ * Unstructured information that will show on the recipient's bank statement.
254
+ */
255
+ unstructured_remittance_information: string;
256
+ }
257
+
258
+ export namespace FednowTransfer {
259
+ /**
260
+ * If the transfer is acknowledged by the recipient bank, this will contain
261
+ * supplemental details.
262
+ */
263
+ export interface Acknowledgement {
264
+ /**
265
+ * When the transfer was acknowledged.
266
+ */
267
+ acknowledged_at: string;
268
+ }
269
+
270
+ /**
271
+ * What object created the transfer, either via the API or the dashboard.
272
+ */
273
+ export interface CreatedBy {
274
+ /**
275
+ * If present, details about the API key that created the transfer.
276
+ */
277
+ api_key: CreatedBy.APIKey | null;
278
+
279
+ /**
280
+ * The type of object that created this transfer.
281
+ *
282
+ * - `api_key` - An API key. Details will be under the `api_key` object.
283
+ * - `oauth_application` - An OAuth application you connected to Increase. Details
284
+ * will be under the `oauth_application` object.
285
+ * - `user` - A User in the Increase dashboard. Details will be under the `user`
286
+ * object.
287
+ */
288
+ category: 'api_key' | 'oauth_application' | 'user';
289
+
290
+ /**
291
+ * If present, details about the OAuth Application that created the transfer.
292
+ */
293
+ oauth_application: CreatedBy.OAuthApplication | null;
294
+
295
+ /**
296
+ * If present, details about the User that created the transfer.
297
+ */
298
+ user: CreatedBy.User | null;
299
+ }
300
+
301
+ export namespace CreatedBy {
302
+ /**
303
+ * If present, details about the API key that created the transfer.
304
+ */
305
+ export interface APIKey {
306
+ /**
307
+ * The description set for the API key when it was created.
308
+ */
309
+ description: string | null;
310
+ }
311
+
312
+ /**
313
+ * If present, details about the OAuth Application that created the transfer.
314
+ */
315
+ export interface OAuthApplication {
316
+ /**
317
+ * The name of the OAuth Application.
318
+ */
319
+ name: string;
320
+ }
321
+
322
+ /**
323
+ * If present, details about the User that created the transfer.
324
+ */
325
+ export interface User {
326
+ /**
327
+ * The email address of the User.
328
+ */
329
+ email: string;
330
+ }
331
+ }
332
+
333
+ /**
334
+ * If the transfer is rejected by FedNow or the destination financial institution,
335
+ * this will contain supplemental details.
336
+ */
337
+ export interface Rejection {
338
+ /**
339
+ * Additional information about the rejection provided by the recipient bank.
340
+ */
341
+ reject_reason_additional_information: string | null;
342
+
343
+ /**
344
+ * The reason the transfer was rejected as provided by the recipient bank or the
345
+ * FedNow network.
346
+ *
347
+ * - `account_closed` - The destination account is closed. Corresponds to the
348
+ * FedNow reason code `AC04`.
349
+ * - `account_blocked` - The destination account is currently blocked from
350
+ * receiving transactions. Corresponds to the FedNow reason code `AC06`.
351
+ * - `invalid_creditor_account_type` - The destination account is ineligible to
352
+ * receive FedNow transfers. Corresponds to the FedNow reason code `AC14`.
353
+ * - `invalid_creditor_account_number` - The destination account does not exist.
354
+ * Corresponds to the FedNow reason code `AC03`.
355
+ * - `invalid_creditor_financial_institution_identifier` - The destination routing
356
+ * number is invalid. Corresponds to the FedNow reason code `RC04`.
357
+ * - `end_customer_deceased` - The destination account holder is deceased.
358
+ * Corresponds to the FedNow reason code `MD07`.
359
+ * - `narrative` - The reason is provided as narrative information in the
360
+ * additional information field. Corresponds to the FedNow reason code `NARR`.
361
+ * - `transaction_forbidden` - FedNow transfers are not allowed to the destination
362
+ * account. Corresponds to the FedNow reason code `AG01`.
363
+ * - `transaction_type_not_supported` - FedNow transfers are not enabled for the
364
+ * destination account. Corresponds to the FedNow reason code `AG03`.
365
+ * - `amount_exceeds_bank_limits` - The amount is higher than the recipient is
366
+ * authorized to send or receive. Corresponds to the FedNow reason code `E990`.
367
+ * - `invalid_creditor_address` - The creditor's address is required, but missing
368
+ * or invalid. Corresponds to the FedNow reason code `BE04`.
369
+ * - `invalid_debtor_address` - The debtor's address is required, but missing or
370
+ * invalid. Corresponds to the FedNow reason code `BE07`.
371
+ * - `timeout` - There was a timeout processing the transfer. Corresponds to the
372
+ * FedNow reason code `E997`.
373
+ * - `processing_error` - The transfer was rejected due to an internal Increase
374
+ * issue. We have been notified.
375
+ * - `other` - Some other error or issue has occurred.
376
+ */
377
+ reject_reason_code:
378
+ | 'account_closed'
379
+ | 'account_blocked'
380
+ | 'invalid_creditor_account_type'
381
+ | 'invalid_creditor_account_number'
382
+ | 'invalid_creditor_financial_institution_identifier'
383
+ | 'end_customer_deceased'
384
+ | 'narrative'
385
+ | 'transaction_forbidden'
386
+ | 'transaction_type_not_supported'
387
+ | 'amount_exceeds_bank_limits'
388
+ | 'invalid_creditor_address'
389
+ | 'invalid_debtor_address'
390
+ | 'timeout'
391
+ | 'processing_error'
392
+ | 'other';
393
+
394
+ /**
395
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which
396
+ * the transfer was rejected.
397
+ */
398
+ rejected_at: string | null;
399
+ }
400
+
401
+ /**
402
+ * After the transfer is submitted to FedNow, this will contain supplemental
403
+ * details.
404
+ */
405
+ export interface Submission {
406
+ /**
407
+ * The FedNow network identification of the message submitted.
408
+ */
409
+ message_identification: string;
410
+
411
+ /**
412
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which
413
+ * the transfer was submitted to FedNow.
414
+ */
415
+ submitted_at: string | null;
416
+ }
417
+ }
418
+
419
+ export interface FednowTransferCreateParams {
420
+ /**
421
+ * The identifier for the account that will send the transfer.
422
+ */
423
+ account_id: string;
424
+
425
+ /**
426
+ * The amount, in minor units, to send to the creditor.
427
+ */
428
+ amount: number;
429
+
430
+ /**
431
+ * The creditor's name.
432
+ */
433
+ creditor_name: string;
434
+
435
+ /**
436
+ * The debtor's name.
437
+ */
438
+ debtor_name: string;
439
+
440
+ /**
441
+ * The Account Number to include in the transfer as the debtor's account number.
442
+ */
443
+ source_account_number_id: string;
444
+
445
+ /**
446
+ * Unstructured remittance information to include in the transfer.
447
+ */
448
+ unstructured_remittance_information: string;
449
+
450
+ /**
451
+ * The creditor's account number.
452
+ */
453
+ account_number?: string;
454
+
455
+ /**
456
+ * The creditor's address.
457
+ */
458
+ creditor_address?: FednowTransferCreateParams.CreditorAddress;
459
+
460
+ /**
461
+ * The debtor's address.
462
+ */
463
+ debtor_address?: FednowTransferCreateParams.DebtorAddress;
464
+
465
+ /**
466
+ * The ID of an External Account to initiate a transfer to. If this parameter is
467
+ * provided, `account_number` and `routing_number` must be absent.
468
+ */
469
+ external_account_id?: string;
470
+
471
+ /**
472
+ * Whether the transfer requires explicit approval via the dashboard or API.
473
+ */
474
+ require_approval?: boolean;
475
+
476
+ /**
477
+ * The creditor's bank account routing number.
478
+ */
479
+ routing_number?: string;
480
+ }
481
+
482
+ export namespace FednowTransferCreateParams {
483
+ /**
484
+ * The creditor's address.
485
+ */
486
+ export interface CreditorAddress {
487
+ /**
488
+ * The city, district, town, or village of the address.
489
+ */
490
+ city: string;
491
+
492
+ /**
493
+ * The postal code component of the address.
494
+ */
495
+ postal_code: string;
496
+
497
+ /**
498
+ * The US state component of the address.
499
+ */
500
+ state: string;
501
+
502
+ /**
503
+ * The first line of the address. This is usually the street number and street.
504
+ */
505
+ line1?: string;
506
+ }
507
+
508
+ /**
509
+ * The debtor's address.
510
+ */
511
+ export interface DebtorAddress {
512
+ /**
513
+ * The city, district, town, or village of the address.
514
+ */
515
+ city: string;
516
+
517
+ /**
518
+ * The postal code component of the address.
519
+ */
520
+ postal_code: string;
521
+
522
+ /**
523
+ * The US state component of the address.
524
+ */
525
+ state: string;
526
+
527
+ /**
528
+ * The first line of the address. This is usually the street number and street.
529
+ */
530
+ line1?: string;
531
+ }
532
+ }
533
+
534
+ export interface FednowTransferListParams extends PageParams {
535
+ /**
536
+ * Filter FedNow Transfers to those that originated from the specified Account.
537
+ */
538
+ account_id?: string;
539
+
540
+ created_at?: FednowTransferListParams.CreatedAt;
541
+
542
+ /**
543
+ * Filter FedNow Transfers to those made to the specified External Account.
544
+ */
545
+ external_account_id?: string;
546
+
547
+ /**
548
+ * Filter records to the one with the specified `idempotency_key` you chose for
549
+ * that object. This value is unique across Increase and is used to ensure that a
550
+ * request is only processed once. Learn more about
551
+ * [idempotency](https://increase.com/documentation/idempotency-keys).
552
+ */
553
+ idempotency_key?: string;
554
+
555
+ status?: FednowTransferListParams.Status;
556
+ }
557
+
558
+ export namespace FednowTransferListParams {
559
+ export interface CreatedAt {
560
+ /**
561
+ * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
562
+ * timestamp.
563
+ */
564
+ after?: string;
565
+
566
+ /**
567
+ * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
568
+ * timestamp.
569
+ */
570
+ before?: string;
571
+
572
+ /**
573
+ * Return results on or after this
574
+ * [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
575
+ */
576
+ on_or_after?: string;
577
+
578
+ /**
579
+ * Return results on or before this
580
+ * [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
581
+ */
582
+ on_or_before?: string;
583
+ }
584
+
585
+ export interface Status {
586
+ /**
587
+ * Return results whose value is in the provided list. For GET requests, this
588
+ * should be encoded as a comma-delimited string, such as `?in=one,two,three`.
589
+ */
590
+ in?: Array<
591
+ | 'pending_reviewing'
592
+ | 'canceled'
593
+ | 'reviewing_rejected'
594
+ | 'requires_attention'
595
+ | 'pending_approval'
596
+ | 'pending_submitting'
597
+ | 'pending_response'
598
+ | 'complete'
599
+ | 'rejected'
600
+ >;
601
+ }
602
+ }
603
+
604
+ FednowTransfers.FednowTransfersPage = FednowTransfersPage;
605
+
606
+ export declare namespace FednowTransfers {
607
+ export {
608
+ type FednowTransfer as FednowTransfer,
609
+ FednowTransfersPage as FednowTransfersPage,
610
+ type FednowTransferCreateParams as FednowTransferCreateParams,
611
+ type FednowTransferListParams as FednowTransferListParams,
612
+ };
613
+ }