increase 0.396.0 → 0.398.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/src/client.ts CHANGED
@@ -350,6 +350,13 @@ import {
350
350
  SupplementalDocumentListParams,
351
351
  SupplementalDocuments,
352
352
  } from './resources/supplemental-documents';
353
+ import {
354
+ SwiftTransfer,
355
+ SwiftTransferCreateParams,
356
+ SwiftTransferListParams,
357
+ SwiftTransfers,
358
+ SwiftTransfersPage,
359
+ } from './resources/swift-transfers';
353
360
  import { Transaction, TransactionListParams, Transactions, TransactionsPage } from './resources/transactions';
354
361
  import {
355
362
  WireDrawdownRequest,
@@ -1141,6 +1148,7 @@ export class Increase {
1141
1148
  new API.InboundRealTimePaymentsTransfers(this);
1142
1149
  fednowTransfers: API.FednowTransfers = new API.FednowTransfers(this);
1143
1150
  inboundFednowTransfers: API.InboundFednowTransfers = new API.InboundFednowTransfers(this);
1151
+ swiftTransfers: API.SwiftTransfers = new API.SwiftTransfers(this);
1144
1152
  checkDeposits: API.CheckDeposits = new API.CheckDeposits(this);
1145
1153
  lockboxes: API.Lockboxes = new API.Lockboxes(this);
1146
1154
  inboundMailItems: API.InboundMailItems = new API.InboundMailItems(this);
@@ -1199,6 +1207,7 @@ Increase.RealTimePaymentsTransfers = RealTimePaymentsTransfers;
1199
1207
  Increase.InboundRealTimePaymentsTransfers = InboundRealTimePaymentsTransfers;
1200
1208
  Increase.FednowTransfers = FednowTransfers;
1201
1209
  Increase.InboundFednowTransfers = InboundFednowTransfers;
1210
+ Increase.SwiftTransfers = SwiftTransfers;
1202
1211
  Increase.CheckDeposits = CheckDeposits;
1203
1212
  Increase.Lockboxes = Lockboxes;
1204
1213
  Increase.InboundMailItems = InboundMailItems;
@@ -1459,6 +1468,14 @@ export declare namespace Increase {
1459
1468
  type InboundFednowTransferListParams as InboundFednowTransferListParams,
1460
1469
  };
1461
1470
 
1471
+ export {
1472
+ SwiftTransfers as SwiftTransfers,
1473
+ type SwiftTransfer as SwiftTransfer,
1474
+ type SwiftTransfersPage as SwiftTransfersPage,
1475
+ type SwiftTransferCreateParams as SwiftTransferCreateParams,
1476
+ type SwiftTransferListParams as SwiftTransferListParams,
1477
+ };
1478
+
1462
1479
  export {
1463
1480
  CheckDeposits as CheckDeposits,
1464
1481
  type CheckDeposit as CheckDeposit,
@@ -338,6 +338,13 @@ export {
338
338
  type SupplementalDocumentListParams,
339
339
  type EntitySupplementalDocumentsPage,
340
340
  } from './supplemental-documents';
341
+ export {
342
+ SwiftTransfers,
343
+ type SwiftTransfer,
344
+ type SwiftTransferCreateParams,
345
+ type SwiftTransferListParams,
346
+ type SwiftTransfersPage,
347
+ } from './swift-transfers';
341
348
  export {
342
349
  Transactions,
343
350
  type Transaction,
@@ -0,0 +1,612 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { Page, type PageParams, PagePromise } from '../core/pagination';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class SwiftTransfers extends APIResource {
10
+ /**
11
+ * Create a Swift Transfer
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const swiftTransfer = await client.swiftTransfers.create({
16
+ * account_id: 'account_in71c4amph0vgo2qllky',
17
+ * account_number: '987654321',
18
+ * bank_identification_code: 'ECBFDEFFTPP',
19
+ * creditor_address: {
20
+ * city: 'Frankfurt',
21
+ * country: 'DE',
22
+ * line1: 'Sonnemannstrasse 20',
23
+ * },
24
+ * creditor_name: 'Ian Crease',
25
+ * debtor_address: {
26
+ * city: 'New York',
27
+ * country: 'US',
28
+ * line1: '33 Liberty Street',
29
+ * },
30
+ * debtor_name: 'National Phonograph Company',
31
+ * instructed_amount: 100,
32
+ * instructed_currency: 'USD',
33
+ * source_account_number_id:
34
+ * 'account_number_v18nkfqm6afpsrvy82b2',
35
+ * unstructured_remittance_information: 'New Swift transfer',
36
+ * });
37
+ * ```
38
+ */
39
+ create(body: SwiftTransferCreateParams, options?: RequestOptions): APIPromise<SwiftTransfer> {
40
+ return this._client.post('/swift_transfers', { body, ...options });
41
+ }
42
+
43
+ /**
44
+ * Retrieve a Swift Transfer
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const swiftTransfer = await client.swiftTransfers.retrieve(
49
+ * 'swift_transfer_29h21xkng03788zwd3fh',
50
+ * );
51
+ * ```
52
+ */
53
+ retrieve(swiftTransferID: string, options?: RequestOptions): APIPromise<SwiftTransfer> {
54
+ return this._client.get(path`/swift_transfers/${swiftTransferID}`, options);
55
+ }
56
+
57
+ /**
58
+ * List Swift Transfers
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * // Automatically fetches more pages as needed.
63
+ * for await (const swiftTransfer of client.swiftTransfers.list()) {
64
+ * // ...
65
+ * }
66
+ * ```
67
+ */
68
+ list(
69
+ query: SwiftTransferListParams | null | undefined = {},
70
+ options?: RequestOptions,
71
+ ): PagePromise<SwiftTransfersPage, SwiftTransfer> {
72
+ return this._client.getAPIList('/swift_transfers', Page<SwiftTransfer>, { query, ...options });
73
+ }
74
+
75
+ /**
76
+ * Approve a Swift Transfer
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const swiftTransfer = await client.swiftTransfers.approve(
81
+ * 'swift_transfer_29h21xkng03788zwd3fh',
82
+ * );
83
+ * ```
84
+ */
85
+ approve(swiftTransferID: string, options?: RequestOptions): APIPromise<SwiftTransfer> {
86
+ return this._client.post(path`/swift_transfers/${swiftTransferID}/approve`, options);
87
+ }
88
+
89
+ /**
90
+ * Cancel a pending Swift Transfer
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * const swiftTransfer = await client.swiftTransfers.cancel(
95
+ * 'swift_transfer_29h21xkng03788zwd3fh',
96
+ * );
97
+ * ```
98
+ */
99
+ cancel(swiftTransferID: string, options?: RequestOptions): APIPromise<SwiftTransfer> {
100
+ return this._client.post(path`/swift_transfers/${swiftTransferID}/cancel`, options);
101
+ }
102
+ }
103
+
104
+ export type SwiftTransfersPage = Page<SwiftTransfer>;
105
+
106
+ /**
107
+ * Swift Transfers send funds internationally.
108
+ */
109
+ export interface SwiftTransfer {
110
+ /**
111
+ * The Swift transfer's identifier.
112
+ */
113
+ id: string;
114
+
115
+ /**
116
+ * The Account to which the transfer belongs.
117
+ */
118
+ account_id: string;
119
+
120
+ /**
121
+ * The creditor's account number.
122
+ */
123
+ account_number: string;
124
+
125
+ /**
126
+ * The transfer amount in USD cents.
127
+ */
128
+ amount: number;
129
+
130
+ /**
131
+ * The bank identification code (BIC) of the creditor.
132
+ */
133
+ bank_identification_code: string;
134
+
135
+ /**
136
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which
137
+ * the transfer was created.
138
+ */
139
+ created_at: string;
140
+
141
+ /**
142
+ * What object created the transfer, either via the API or the dashboard.
143
+ */
144
+ created_by: SwiftTransfer.CreatedBy;
145
+
146
+ /**
147
+ * The creditor's address.
148
+ */
149
+ creditor_address: SwiftTransfer.CreditorAddress;
150
+
151
+ /**
152
+ * The creditor's name.
153
+ */
154
+ creditor_name: string;
155
+
156
+ /**
157
+ * The debtor's address.
158
+ */
159
+ debtor_address: SwiftTransfer.DebtorAddress;
160
+
161
+ /**
162
+ * The debtor's name.
163
+ */
164
+ debtor_name: string;
165
+
166
+ /**
167
+ * The idempotency key you chose for this object. This value is unique across
168
+ * Increase and is used to ensure that a request is only processed once. Learn more
169
+ * about [idempotency](https://increase.com/documentation/idempotency-keys).
170
+ */
171
+ idempotency_key: string | null;
172
+
173
+ /**
174
+ * The amount that was instructed to be transferred in minor units of the
175
+ * `instructed_currency`.
176
+ */
177
+ instructed_amount: number;
178
+
179
+ /**
180
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the
181
+ * instructed amount.
182
+ *
183
+ * - `USD` - United States Dollar
184
+ */
185
+ instructed_currency: 'USD';
186
+
187
+ /**
188
+ * The ID for the pending transaction representing the transfer.
189
+ */
190
+ pending_transaction_id: string | null;
191
+
192
+ /**
193
+ * The creditor's bank account routing or transit number. Required in certain
194
+ * countries.
195
+ */
196
+ routing_number: string | null;
197
+
198
+ /**
199
+ * The Account Number included in the transfer as the debtor's account number.
200
+ */
201
+ source_account_number_id: string;
202
+
203
+ /**
204
+ * The lifecycle status of the transfer.
205
+ *
206
+ * - `pending_approval` - The transfer is pending approval.
207
+ * - `canceled` - The transfer has been canceled.
208
+ * - `pending_reviewing` - The transfer is pending review by Increase.
209
+ * - `requires_attention` - The transfer requires attention from an Increase
210
+ * operator.
211
+ * - `pending_initiating` - The transfer is pending initiation.
212
+ * - `initiated` - The transfer has been initiated.
213
+ * - `rejected` - The transfer has been rejected by Increase.
214
+ * - `returned` - The transfer has been returned.
215
+ */
216
+ status:
217
+ | 'pending_approval'
218
+ | 'canceled'
219
+ | 'pending_reviewing'
220
+ | 'requires_attention'
221
+ | 'pending_initiating'
222
+ | 'initiated'
223
+ | 'rejected'
224
+ | 'returned';
225
+
226
+ /**
227
+ * The ID for the transaction funding the transfer. This will be populated after
228
+ * the transfer is initiated.
229
+ */
230
+ transaction_id: string | null;
231
+
232
+ /**
233
+ * A constant representing the object's type. For this resource it will always be
234
+ * `swift_transfer`.
235
+ */
236
+ type: 'swift_transfer';
237
+
238
+ /**
239
+ * The Unique End-to-end Transaction Reference
240
+ * ([UETR](https://www.swift.com/payments/what-unique-end-end-transaction-reference-uetr))
241
+ * for the transfer.
242
+ */
243
+ unique_end_to_end_transaction_reference: string;
244
+
245
+ /**
246
+ * The unstructured remittance information that was included with the transfer.
247
+ */
248
+ unstructured_remittance_information: string;
249
+ }
250
+
251
+ export namespace SwiftTransfer {
252
+ /**
253
+ * What object created the transfer, either via the API or the dashboard.
254
+ */
255
+ export interface CreatedBy {
256
+ /**
257
+ * If present, details about the API key that created the transfer.
258
+ */
259
+ api_key: CreatedBy.APIKey | null;
260
+
261
+ /**
262
+ * The type of object that created this transfer.
263
+ *
264
+ * - `api_key` - An API key. Details will be under the `api_key` object.
265
+ * - `oauth_application` - An OAuth application you connected to Increase. Details
266
+ * will be under the `oauth_application` object.
267
+ * - `user` - A User in the Increase dashboard. Details will be under the `user`
268
+ * object.
269
+ */
270
+ category: 'api_key' | 'oauth_application' | 'user';
271
+
272
+ /**
273
+ * If present, details about the OAuth Application that created the transfer.
274
+ */
275
+ oauth_application: CreatedBy.OAuthApplication | null;
276
+
277
+ /**
278
+ * If present, details about the User that created the transfer.
279
+ */
280
+ user: CreatedBy.User | null;
281
+ }
282
+
283
+ export namespace CreatedBy {
284
+ /**
285
+ * If present, details about the API key that created the transfer.
286
+ */
287
+ export interface APIKey {
288
+ /**
289
+ * The description set for the API key when it was created.
290
+ */
291
+ description: string | null;
292
+ }
293
+
294
+ /**
295
+ * If present, details about the OAuth Application that created the transfer.
296
+ */
297
+ export interface OAuthApplication {
298
+ /**
299
+ * The name of the OAuth Application.
300
+ */
301
+ name: string;
302
+ }
303
+
304
+ /**
305
+ * If present, details about the User that created the transfer.
306
+ */
307
+ export interface User {
308
+ /**
309
+ * The email address of the User.
310
+ */
311
+ email: string;
312
+ }
313
+ }
314
+
315
+ /**
316
+ * The creditor's address.
317
+ */
318
+ export interface CreditorAddress {
319
+ /**
320
+ * The city, district, town, or village of the address.
321
+ */
322
+ city: string | null;
323
+
324
+ /**
325
+ * The two-letter
326
+ * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for
327
+ * the country of the address.
328
+ */
329
+ country: string;
330
+
331
+ /**
332
+ * The first line of the address.
333
+ */
334
+ line1: string;
335
+
336
+ /**
337
+ * The second line of the address.
338
+ */
339
+ line2: string | null;
340
+
341
+ /**
342
+ * The ZIP or postal code of the address.
343
+ */
344
+ postal_code: string | null;
345
+
346
+ /**
347
+ * The state, province, or region of the address. Required in certain countries.
348
+ */
349
+ state: string | null;
350
+ }
351
+
352
+ /**
353
+ * The debtor's address.
354
+ */
355
+ export interface DebtorAddress {
356
+ /**
357
+ * The city, district, town, or village of the address.
358
+ */
359
+ city: string | null;
360
+
361
+ /**
362
+ * The two-letter
363
+ * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for
364
+ * the country of the address.
365
+ */
366
+ country: string;
367
+
368
+ /**
369
+ * The first line of the address.
370
+ */
371
+ line1: string;
372
+
373
+ /**
374
+ * The second line of the address.
375
+ */
376
+ line2: string | null;
377
+
378
+ /**
379
+ * The ZIP or postal code of the address.
380
+ */
381
+ postal_code: string | null;
382
+
383
+ /**
384
+ * The state, province, or region of the address. Required in certain countries.
385
+ */
386
+ state: string | null;
387
+ }
388
+ }
389
+
390
+ export interface SwiftTransferCreateParams {
391
+ /**
392
+ * The identifier for the account that will send the transfer.
393
+ */
394
+ account_id: string;
395
+
396
+ /**
397
+ * The creditor's account number.
398
+ */
399
+ account_number: string;
400
+
401
+ /**
402
+ * The bank identification code (BIC) of the creditor. If it ends with the
403
+ * three-character branch code, this must be 11 characters long. Otherwise this
404
+ * must be 8 characters and the branch code will be assumed to be `XXX`.
405
+ */
406
+ bank_identification_code: string;
407
+
408
+ /**
409
+ * The creditor's address.
410
+ */
411
+ creditor_address: SwiftTransferCreateParams.CreditorAddress;
412
+
413
+ /**
414
+ * The creditor's name.
415
+ */
416
+ creditor_name: string;
417
+
418
+ /**
419
+ * The debtor's address.
420
+ */
421
+ debtor_address: SwiftTransferCreateParams.DebtorAddress;
422
+
423
+ /**
424
+ * The debtor's name.
425
+ */
426
+ debtor_name: string;
427
+
428
+ /**
429
+ * The amount, in minor units of `instructed_currency`, to send to the creditor.
430
+ */
431
+ instructed_amount: number;
432
+
433
+ /**
434
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the
435
+ * instructed amount.
436
+ *
437
+ * - `USD` - United States Dollar
438
+ */
439
+ instructed_currency: 'USD';
440
+
441
+ /**
442
+ * The Account Number to include in the transfer as the debtor's account number.
443
+ */
444
+ source_account_number_id: string;
445
+
446
+ /**
447
+ * Unstructured remittance information to include in the transfer.
448
+ */
449
+ unstructured_remittance_information: string;
450
+
451
+ /**
452
+ * Whether the transfer requires explicit approval via the dashboard or API.
453
+ */
454
+ require_approval?: boolean;
455
+
456
+ /**
457
+ * The creditor's bank account routing or transit number. Required in certain
458
+ * countries.
459
+ */
460
+ routing_number?: string;
461
+
462
+ [k: string]: unknown;
463
+ }
464
+
465
+ export namespace SwiftTransferCreateParams {
466
+ /**
467
+ * The creditor's address.
468
+ */
469
+ export interface CreditorAddress {
470
+ /**
471
+ * The city, district, town, or village of the address.
472
+ */
473
+ city: string;
474
+
475
+ /**
476
+ * The two-letter
477
+ * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for
478
+ * the country of the address.
479
+ */
480
+ country: string;
481
+
482
+ /**
483
+ * The first line of the address. This is usually the street number and street.
484
+ */
485
+ line1: string;
486
+
487
+ /**
488
+ * The second line of the address. This might be the floor or room number.
489
+ */
490
+ line2?: string;
491
+
492
+ /**
493
+ * The ZIP or postal code of the address. Required in certain countries.
494
+ */
495
+ postal_code?: string;
496
+
497
+ /**
498
+ * The state, province, or region of the address. Required in certain countries.
499
+ */
500
+ state?: string;
501
+ }
502
+
503
+ /**
504
+ * The debtor's address.
505
+ */
506
+ export interface DebtorAddress {
507
+ /**
508
+ * The city, district, town, or village of the address.
509
+ */
510
+ city: string;
511
+
512
+ /**
513
+ * The two-letter
514
+ * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for
515
+ * the country of the address.
516
+ */
517
+ country: string;
518
+
519
+ /**
520
+ * The first line of the address. This is usually the street number and street.
521
+ */
522
+ line1: string;
523
+
524
+ /**
525
+ * The second line of the address. This might be the floor or room number.
526
+ */
527
+ line2?: string;
528
+
529
+ /**
530
+ * The ZIP or postal code of the address. Required in certain countries.
531
+ */
532
+ postal_code?: string;
533
+
534
+ /**
535
+ * The state, province, or region of the address. Required in certain countries.
536
+ */
537
+ state?: string;
538
+ }
539
+ }
540
+
541
+ export interface SwiftTransferListParams extends PageParams {
542
+ /**
543
+ * Filter Swift Transfers to those that originated from the specified Account.
544
+ */
545
+ account_id?: string;
546
+
547
+ created_at?: SwiftTransferListParams.CreatedAt;
548
+
549
+ /**
550
+ * Filter records to the one with the specified `idempotency_key` you chose for
551
+ * that object. This value is unique across Increase and is used to ensure that a
552
+ * request is only processed once. Learn more about
553
+ * [idempotency](https://increase.com/documentation/idempotency-keys).
554
+ */
555
+ idempotency_key?: string;
556
+
557
+ status?: SwiftTransferListParams.Status;
558
+ }
559
+
560
+ export namespace SwiftTransferListParams {
561
+ export interface CreatedAt {
562
+ /**
563
+ * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
564
+ * timestamp.
565
+ */
566
+ after?: string;
567
+
568
+ /**
569
+ * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
570
+ * timestamp.
571
+ */
572
+ before?: string;
573
+
574
+ /**
575
+ * Return results on or after this
576
+ * [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
577
+ */
578
+ on_or_after?: string;
579
+
580
+ /**
581
+ * Return results on or before this
582
+ * [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
583
+ */
584
+ on_or_before?: string;
585
+ }
586
+
587
+ export interface Status {
588
+ /**
589
+ * Return results whose value is in the provided list. For GET requests, this
590
+ * should be encoded as a comma-delimited string, such as `?in=one,two,three`.
591
+ */
592
+ in?: Array<
593
+ | 'pending_approval'
594
+ | 'canceled'
595
+ | 'pending_reviewing'
596
+ | 'requires_attention'
597
+ | 'pending_initiating'
598
+ | 'initiated'
599
+ | 'rejected'
600
+ | 'returned'
601
+ >;
602
+ }
603
+ }
604
+
605
+ export declare namespace SwiftTransfers {
606
+ export {
607
+ type SwiftTransfer as SwiftTransfer,
608
+ type SwiftTransfersPage as SwiftTransfersPage,
609
+ type SwiftTransferCreateParams as SwiftTransferCreateParams,
610
+ type SwiftTransferListParams as SwiftTransferListParams,
611
+ };
612
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.396.0'; // x-release-please-version
1
+ export const VERSION = '0.398.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.396.0";
1
+ export declare const VERSION = "0.398.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.396.0";
1
+ export declare const VERSION = "0.398.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.396.0'; // x-release-please-version
4
+ exports.VERSION = '0.398.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.396.0'; // x-release-please-version
1
+ export const VERSION = '0.398.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map