@naturalpay/sdk 0.3.0 → 0.4.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 (109) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/client.d.mts +22 -10
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +22 -10
  5. package/client.d.ts.map +1 -1
  6. package/client.js +14 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +15 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/api-keys.d.mts +16 -2
  12. package/resources/api-keys.d.mts.map +1 -1
  13. package/resources/api-keys.d.ts +16 -2
  14. package/resources/api-keys.d.ts.map +1 -1
  15. package/resources/api-keys.js +7 -4
  16. package/resources/api-keys.js.map +1 -1
  17. package/resources/api-keys.mjs +7 -4
  18. package/resources/api-keys.mjs.map +1 -1
  19. package/resources/escalations.d.mts +1124 -0
  20. package/resources/escalations.d.mts.map +1 -0
  21. package/resources/escalations.d.ts +1124 -0
  22. package/resources/escalations.d.ts.map +1 -0
  23. package/resources/escalations.js +110 -0
  24. package/resources/escalations.js.map +1 -0
  25. package/resources/escalations.mjs +106 -0
  26. package/resources/escalations.mjs.map +1 -0
  27. package/resources/index.d.mts +6 -4
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +6 -4
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js +5 -1
  32. package/resources/index.js.map +1 -1
  33. package/resources/index.mjs +3 -1
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/invitations.d.mts +16 -7
  36. package/resources/invitations.d.mts.map +1 -1
  37. package/resources/invitations.d.ts +16 -7
  38. package/resources/invitations.d.ts.map +1 -1
  39. package/resources/invitations.js +6 -4
  40. package/resources/invitations.js.map +1 -1
  41. package/resources/invitations.mjs +6 -4
  42. package/resources/invitations.mjs.map +1 -1
  43. package/resources/parties.d.mts +53 -26
  44. package/resources/parties.d.mts.map +1 -1
  45. package/resources/parties.d.ts +53 -26
  46. package/resources/parties.d.ts.map +1 -1
  47. package/resources/parties.js +27 -1
  48. package/resources/parties.js.map +1 -1
  49. package/resources/parties.mjs +27 -1
  50. package/resources/parties.mjs.map +1 -1
  51. package/resources/payment-requests.d.mts +738 -33
  52. package/resources/payment-requests.d.mts.map +1 -1
  53. package/resources/payment-requests.d.ts +738 -33
  54. package/resources/payment-requests.d.ts.map +1 -1
  55. package/resources/payment-requests.js +82 -1
  56. package/resources/payment-requests.js.map +1 -1
  57. package/resources/payment-requests.mjs +82 -1
  58. package/resources/payment-requests.mjs.map +1 -1
  59. package/resources/payments.d.mts +390 -24
  60. package/resources/payments.d.mts.map +1 -1
  61. package/resources/payments.d.ts +390 -24
  62. package/resources/payments.d.ts.map +1 -1
  63. package/resources/payments.js +53 -3
  64. package/resources/payments.js.map +1 -1
  65. package/resources/payments.mjs +53 -3
  66. package/resources/payments.mjs.map +1 -1
  67. package/resources/transactions.d.mts +50 -118
  68. package/resources/transactions.d.mts.map +1 -1
  69. package/resources/transactions.d.ts +50 -118
  70. package/resources/transactions.d.ts.map +1 -1
  71. package/resources/transactions.js +2 -2
  72. package/resources/transactions.mjs +2 -2
  73. package/resources/transfers.d.mts +1030 -0
  74. package/resources/transfers.d.mts.map +1 -0
  75. package/resources/transfers.d.ts +1030 -0
  76. package/resources/transfers.d.ts.map +1 -0
  77. package/resources/transfers.js +114 -0
  78. package/resources/transfers.js.map +1 -0
  79. package/resources/transfers.mjs +110 -0
  80. package/resources/transfers.mjs.map +1 -0
  81. package/resources/wallet.d.mts +1 -189
  82. package/resources/wallet.d.mts.map +1 -1
  83. package/resources/wallet.d.ts +1 -189
  84. package/resources/wallet.d.ts.map +1 -1
  85. package/resources/wallet.js +0 -66
  86. package/resources/wallet.js.map +1 -1
  87. package/resources/wallet.mjs +0 -66
  88. package/resources/wallet.mjs.map +1 -1
  89. package/resources/webhooks.d.mts +7 -7
  90. package/resources/webhooks.d.mts.map +1 -1
  91. package/resources/webhooks.d.ts +7 -7
  92. package/resources/webhooks.d.ts.map +1 -1
  93. package/src/client.ts +87 -11
  94. package/src/resources/api-keys.ts +26 -4
  95. package/src/resources/escalations.ts +1422 -0
  96. package/src/resources/index.ts +39 -5
  97. package/src/resources/invitations.ts +26 -10
  98. package/src/resources/parties.ts +85 -30
  99. package/src/resources/payment-requests.ts +949 -58
  100. package/src/resources/payments.ts +518 -23
  101. package/src/resources/transactions.ts +50 -136
  102. package/src/resources/transfers.ts +1338 -0
  103. package/src/resources/wallet.ts +0 -268
  104. package/src/resources/webhooks.ts +7 -0
  105. package/src/version.ts +1 -1
  106. package/version.d.mts +1 -1
  107. package/version.d.ts +1 -1
  108. package/version.js +1 -1
  109. package/version.mjs +1 -1
@@ -0,0 +1,1338 @@
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 { buildHeaders } from '../internal/headers';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ /**
10
+ * Deposit and withdrawal operations
11
+ */
12
+ export class Transfers extends APIResource {
13
+ /**
14
+ * List deposits and withdrawals for the authenticated party.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const transfers = await client.transfers.list();
19
+ * ```
20
+ */
21
+ list(
22
+ params: TransferListParams | null | undefined = {},
23
+ options?: RequestOptions,
24
+ ): APIPromise<TransferListResponse> {
25
+ const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
26
+ return this._client.get('/transfers', {
27
+ query,
28
+ ...options,
29
+ headers: buildHeaders([
30
+ {
31
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
32
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
33
+ },
34
+ options?.headers,
35
+ ]),
36
+ });
37
+ }
38
+
39
+ /**
40
+ * Get a deposit or withdrawal by ID.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const transfer = await client.transfers.get(
45
+ * 'trf_ecc2efdd09bd231a9ad9bd2aada37aa7',
46
+ * );
47
+ * ```
48
+ */
49
+ get(
50
+ transferID: string,
51
+ params: TransferGetParams | null | undefined = {},
52
+ options?: RequestOptions,
53
+ ): APIPromise<TransferGetResponse> {
54
+ const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
55
+ return this._client.get(path`/transfers/${transferID}`, {
56
+ query,
57
+ ...options,
58
+ headers: buildHeaders([
59
+ {
60
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
61
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
62
+ },
63
+ options?.headers,
64
+ ]),
65
+ });
66
+ }
67
+
68
+ /**
69
+ * Initiate a wallet deposit.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const response = await client.transfers.initiateDeposit({
74
+ * amount: 1,
75
+ * externalAccountId: 'eac_ecc2efdd09bd231a9ad9bd2aada37aa7',
76
+ * 'Idempotency-Key': 'Idempotency-Key',
77
+ * });
78
+ * ```
79
+ */
80
+ initiateDeposit(
81
+ params: TransferInitiateDepositParams,
82
+ options?: RequestOptions,
83
+ ): APIPromise<TransferInitiateDepositResponse> {
84
+ const {
85
+ 'Idempotency-Key': idempotencyKey,
86
+ 'X-Agent-ID': xAgentID,
87
+ 'X-Instance-ID': xInstanceID,
88
+ ...body
89
+ } = params;
90
+ return this._client.post('/transfers/deposit', {
91
+ body,
92
+ ...options,
93
+ headers: buildHeaders([
94
+ {
95
+ 'Idempotency-Key': idempotencyKey,
96
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
97
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
98
+ },
99
+ options?.headers,
100
+ ]),
101
+ });
102
+ }
103
+
104
+ /**
105
+ * Initiate a wallet withdrawal.
106
+ *
107
+ * @example
108
+ * ```ts
109
+ * const response = await client.transfers.initiateWithdrawal({
110
+ * amount: 1,
111
+ * externalAccountId: 'eac_ecc2efdd09bd231a9ad9bd2aada37aa7',
112
+ * 'Idempotency-Key': 'Idempotency-Key',
113
+ * });
114
+ * ```
115
+ */
116
+ initiateWithdrawal(
117
+ params: TransferInitiateWithdrawalParams,
118
+ options?: RequestOptions,
119
+ ): APIPromise<TransferInitiateWithdrawalResponse> {
120
+ const {
121
+ 'Idempotency-Key': idempotencyKey,
122
+ 'X-Agent-ID': xAgentID,
123
+ 'X-Instance-ID': xInstanceID,
124
+ ...body
125
+ } = params;
126
+ return this._client.post('/transfers/withdraw', {
127
+ body,
128
+ ...options,
129
+ headers: buildHeaders([
130
+ {
131
+ 'Idempotency-Key': idempotencyKey,
132
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
133
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
134
+ },
135
+ options?.headers,
136
+ ]),
137
+ });
138
+ }
139
+ }
140
+
141
+ export interface TransferListResponse {
142
+ data: Array<TransferListResponse.Data>;
143
+
144
+ meta: TransferListResponse.Meta;
145
+ }
146
+
147
+ export namespace TransferListResponse {
148
+ export interface Data {
149
+ id: string;
150
+
151
+ /**
152
+ * Resource attributes
153
+ */
154
+ attributes: Data.Attributes;
155
+
156
+ /**
157
+ * Resource relationships
158
+ */
159
+ relationships: Data.Relationships;
160
+
161
+ type: string;
162
+ }
163
+
164
+ export namespace Data {
165
+ /**
166
+ * Resource attributes
167
+ */
168
+ export interface Attributes {
169
+ /**
170
+ * Amount in cents
171
+ */
172
+ amount: number;
173
+
174
+ /**
175
+ * When this transfer was created
176
+ */
177
+ createdAt: string;
178
+
179
+ /**
180
+ * Currency code
181
+ */
182
+ currency: string;
183
+
184
+ /**
185
+ * Transfer description
186
+ */
187
+ description: string | null;
188
+
189
+ /**
190
+ * Expected availability time, when known
191
+ */
192
+ expectedAvailableAt: string | null;
193
+
194
+ /**
195
+ * Masked external account display
196
+ */
197
+ externalAccountDisplayMask: string | null;
198
+
199
+ /**
200
+ * Failure details when this transfer failed.
201
+ */
202
+ failure: Attributes.Failure | null;
203
+
204
+ /**
205
+ * Return details when this transfer was returned.
206
+ */
207
+ return: Attributes.Return | null;
208
+
209
+ /**
210
+ * When this transfer settled
211
+ */
212
+ settledAt: string | null;
213
+
214
+ /**
215
+ * Transfer status
216
+ */
217
+ status:
218
+ | 'CREATED'
219
+ | 'APPROVAL_DENIED'
220
+ | 'PROCESSING'
221
+ | 'IN_REVIEW'
222
+ | 'COMPLETED'
223
+ | 'FAILED'
224
+ | 'RETURNED'
225
+ | 'CANCELLED';
226
+
227
+ /**
228
+ * When this transfer was submitted
229
+ */
230
+ submittedAt: string | null;
231
+
232
+ /**
233
+ * Transfer type
234
+ */
235
+ type: 'deposit' | 'withdrawal';
236
+
237
+ /**
238
+ * When this transfer was last updated
239
+ */
240
+ updatedAt: string | null;
241
+ }
242
+
243
+ export namespace Attributes {
244
+ /**
245
+ * Failure details when this transfer failed.
246
+ */
247
+ export interface Failure {
248
+ /**
249
+ * Failure code, when available
250
+ */
251
+ code: string | null;
252
+
253
+ /**
254
+ * Failure reason, when available
255
+ */
256
+ reason: string | null;
257
+ }
258
+
259
+ /**
260
+ * Return details when this transfer was returned.
261
+ */
262
+ export interface Return {
263
+ /**
264
+ * Return code, when available
265
+ */
266
+ code: string | null;
267
+
268
+ /**
269
+ * Return reason, when available
270
+ */
271
+ reason: string | null;
272
+
273
+ /**
274
+ * When this transfer returned
275
+ */
276
+ returnedAt: string | null;
277
+ }
278
+ }
279
+
280
+ /**
281
+ * Resource relationships
282
+ */
283
+ export interface Relationships {
284
+ /**
285
+ * External account used for this transfer, when available.
286
+ */
287
+ externalAccount: Relationships.ExternalAccount;
288
+
289
+ /**
290
+ * Party that owns the transfer
291
+ */
292
+ party: Relationships.Party;
293
+
294
+ /**
295
+ * Primary transaction row for this transfer, when available.
296
+ */
297
+ transaction: Relationships.Transaction;
298
+
299
+ /**
300
+ * Wallet for this transfer
301
+ */
302
+ wallet: Relationships.Wallet;
303
+ }
304
+
305
+ export namespace Relationships {
306
+ /**
307
+ * External account used for this transfer, when available.
308
+ */
309
+ export interface ExternalAccount {
310
+ /**
311
+ * Related resource identifier
312
+ */
313
+ data: ExternalAccount.Data | null;
314
+ }
315
+
316
+ export namespace ExternalAccount {
317
+ /**
318
+ * Related resource identifier
319
+ */
320
+ export interface Data {
321
+ id: string;
322
+
323
+ /**
324
+ * Resource type
325
+ */
326
+ type: string;
327
+ }
328
+ }
329
+
330
+ /**
331
+ * Party that owns the transfer
332
+ */
333
+ export interface Party {
334
+ /**
335
+ * Related resource identifier
336
+ */
337
+ data: Party.Data;
338
+ }
339
+
340
+ export namespace Party {
341
+ /**
342
+ * Related resource identifier
343
+ */
344
+ export interface Data {
345
+ id: string;
346
+
347
+ /**
348
+ * Resource type
349
+ */
350
+ type: string;
351
+ }
352
+ }
353
+
354
+ /**
355
+ * Primary transaction row for this transfer, when available.
356
+ */
357
+ export interface Transaction {
358
+ /**
359
+ * Related resource identifier
360
+ */
361
+ data: Transaction.Data | null;
362
+ }
363
+
364
+ export namespace Transaction {
365
+ /**
366
+ * Related resource identifier
367
+ */
368
+ export interface Data {
369
+ id: string;
370
+
371
+ /**
372
+ * Resource type
373
+ */
374
+ type: string;
375
+ }
376
+ }
377
+
378
+ /**
379
+ * Wallet for this transfer
380
+ */
381
+ export interface Wallet {
382
+ /**
383
+ * Related resource identifier
384
+ */
385
+ data: Wallet.Data;
386
+ }
387
+
388
+ export namespace Wallet {
389
+ /**
390
+ * Related resource identifier
391
+ */
392
+ export interface Data {
393
+ id: string;
394
+
395
+ /**
396
+ * Resource type
397
+ */
398
+ type: string;
399
+ }
400
+ }
401
+ }
402
+ }
403
+
404
+ export interface Meta {
405
+ pagination: Meta.Pagination;
406
+ }
407
+
408
+ export namespace Meta {
409
+ export interface Pagination {
410
+ hasMore: boolean;
411
+
412
+ nextCursor: string | null;
413
+ }
414
+ }
415
+ }
416
+
417
+ export interface TransferGetResponse {
418
+ data: TransferGetResponse.Data;
419
+ }
420
+
421
+ export namespace TransferGetResponse {
422
+ export interface Data {
423
+ id: string;
424
+
425
+ /**
426
+ * Resource attributes
427
+ */
428
+ attributes: Data.Attributes;
429
+
430
+ /**
431
+ * Resource relationships
432
+ */
433
+ relationships: Data.Relationships;
434
+
435
+ type: string;
436
+ }
437
+
438
+ export namespace Data {
439
+ /**
440
+ * Resource attributes
441
+ */
442
+ export interface Attributes {
443
+ /**
444
+ * Amount in cents
445
+ */
446
+ amount: number;
447
+
448
+ /**
449
+ * When this transfer was created
450
+ */
451
+ createdAt: string;
452
+
453
+ /**
454
+ * Currency code
455
+ */
456
+ currency: string;
457
+
458
+ /**
459
+ * Transfer description
460
+ */
461
+ description: string | null;
462
+
463
+ /**
464
+ * Expected availability time, when known
465
+ */
466
+ expectedAvailableAt: string | null;
467
+
468
+ /**
469
+ * Masked external account display
470
+ */
471
+ externalAccountDisplayMask: string | null;
472
+
473
+ /**
474
+ * Failure details when this transfer failed.
475
+ */
476
+ failure: Attributes.Failure | null;
477
+
478
+ /**
479
+ * Return details when this transfer was returned.
480
+ */
481
+ return: Attributes.Return | null;
482
+
483
+ /**
484
+ * When this transfer settled
485
+ */
486
+ settledAt: string | null;
487
+
488
+ /**
489
+ * Transfer status
490
+ */
491
+ status:
492
+ | 'CREATED'
493
+ | 'APPROVAL_DENIED'
494
+ | 'PROCESSING'
495
+ | 'IN_REVIEW'
496
+ | 'COMPLETED'
497
+ | 'FAILED'
498
+ | 'RETURNED'
499
+ | 'CANCELLED';
500
+
501
+ /**
502
+ * When this transfer was submitted
503
+ */
504
+ submittedAt: string | null;
505
+
506
+ /**
507
+ * Transfer type
508
+ */
509
+ type: 'deposit' | 'withdrawal';
510
+
511
+ /**
512
+ * When this transfer was last updated
513
+ */
514
+ updatedAt: string | null;
515
+ }
516
+
517
+ export namespace Attributes {
518
+ /**
519
+ * Failure details when this transfer failed.
520
+ */
521
+ export interface Failure {
522
+ /**
523
+ * Failure code, when available
524
+ */
525
+ code: string | null;
526
+
527
+ /**
528
+ * Failure reason, when available
529
+ */
530
+ reason: string | null;
531
+ }
532
+
533
+ /**
534
+ * Return details when this transfer was returned.
535
+ */
536
+ export interface Return {
537
+ /**
538
+ * Return code, when available
539
+ */
540
+ code: string | null;
541
+
542
+ /**
543
+ * Return reason, when available
544
+ */
545
+ reason: string | null;
546
+
547
+ /**
548
+ * When this transfer returned
549
+ */
550
+ returnedAt: string | null;
551
+ }
552
+ }
553
+
554
+ /**
555
+ * Resource relationships
556
+ */
557
+ export interface Relationships {
558
+ /**
559
+ * External account used for this transfer, when available.
560
+ */
561
+ externalAccount: Relationships.ExternalAccount;
562
+
563
+ /**
564
+ * Party that owns the transfer
565
+ */
566
+ party: Relationships.Party;
567
+
568
+ /**
569
+ * Primary transaction row for this transfer, when available.
570
+ */
571
+ transaction: Relationships.Transaction;
572
+
573
+ /**
574
+ * Wallet for this transfer
575
+ */
576
+ wallet: Relationships.Wallet;
577
+ }
578
+
579
+ export namespace Relationships {
580
+ /**
581
+ * External account used for this transfer, when available.
582
+ */
583
+ export interface ExternalAccount {
584
+ /**
585
+ * Related resource identifier
586
+ */
587
+ data: ExternalAccount.Data | null;
588
+ }
589
+
590
+ export namespace ExternalAccount {
591
+ /**
592
+ * Related resource identifier
593
+ */
594
+ export interface Data {
595
+ id: string;
596
+
597
+ /**
598
+ * Resource type
599
+ */
600
+ type: string;
601
+ }
602
+ }
603
+
604
+ /**
605
+ * Party that owns the transfer
606
+ */
607
+ export interface Party {
608
+ /**
609
+ * Related resource identifier
610
+ */
611
+ data: Party.Data;
612
+ }
613
+
614
+ export namespace Party {
615
+ /**
616
+ * Related resource identifier
617
+ */
618
+ export interface Data {
619
+ id: string;
620
+
621
+ /**
622
+ * Resource type
623
+ */
624
+ type: string;
625
+ }
626
+ }
627
+
628
+ /**
629
+ * Primary transaction row for this transfer, when available.
630
+ */
631
+ export interface Transaction {
632
+ /**
633
+ * Related resource identifier
634
+ */
635
+ data: Transaction.Data | null;
636
+ }
637
+
638
+ export namespace Transaction {
639
+ /**
640
+ * Related resource identifier
641
+ */
642
+ export interface Data {
643
+ id: string;
644
+
645
+ /**
646
+ * Resource type
647
+ */
648
+ type: string;
649
+ }
650
+ }
651
+
652
+ /**
653
+ * Wallet for this transfer
654
+ */
655
+ export interface Wallet {
656
+ /**
657
+ * Related resource identifier
658
+ */
659
+ data: Wallet.Data;
660
+ }
661
+
662
+ export namespace Wallet {
663
+ /**
664
+ * Related resource identifier
665
+ */
666
+ export interface Data {
667
+ id: string;
668
+
669
+ /**
670
+ * Resource type
671
+ */
672
+ type: string;
673
+ }
674
+ }
675
+ }
676
+ }
677
+ }
678
+
679
+ export interface TransferInitiateDepositResponse {
680
+ data: TransferInitiateDepositResponse.Data;
681
+ }
682
+
683
+ export namespace TransferInitiateDepositResponse {
684
+ export interface Data {
685
+ id: string;
686
+
687
+ /**
688
+ * Resource attributes
689
+ */
690
+ attributes: Data.Attributes;
691
+
692
+ /**
693
+ * Resource relationships
694
+ */
695
+ relationships: Data.Relationships;
696
+
697
+ type: string;
698
+ }
699
+
700
+ export namespace Data {
701
+ /**
702
+ * Resource attributes
703
+ */
704
+ export interface Attributes {
705
+ /**
706
+ * Amount in cents
707
+ */
708
+ amount: number;
709
+
710
+ /**
711
+ * When this transfer was created
712
+ */
713
+ createdAt: string;
714
+
715
+ /**
716
+ * Currency code
717
+ */
718
+ currency: string;
719
+
720
+ /**
721
+ * Transfer description
722
+ */
723
+ description: string | null;
724
+
725
+ /**
726
+ * Expected availability time, when known
727
+ */
728
+ expectedAvailableAt: string | null;
729
+
730
+ /**
731
+ * Masked external account display
732
+ */
733
+ externalAccountDisplayMask: string | null;
734
+
735
+ /**
736
+ * Failure details when this transfer failed.
737
+ */
738
+ failure: Attributes.Failure | null;
739
+
740
+ /**
741
+ * Return details when this transfer was returned.
742
+ */
743
+ return: Attributes.Return | null;
744
+
745
+ /**
746
+ * When this transfer settled
747
+ */
748
+ settledAt: string | null;
749
+
750
+ /**
751
+ * Transfer status
752
+ */
753
+ status:
754
+ | 'CREATED'
755
+ | 'APPROVAL_DENIED'
756
+ | 'PROCESSING'
757
+ | 'IN_REVIEW'
758
+ | 'COMPLETED'
759
+ | 'FAILED'
760
+ | 'RETURNED'
761
+ | 'CANCELLED';
762
+
763
+ /**
764
+ * When this transfer was submitted
765
+ */
766
+ submittedAt: string | null;
767
+
768
+ /**
769
+ * Transfer type
770
+ */
771
+ type: 'deposit' | 'withdrawal';
772
+
773
+ /**
774
+ * When this transfer was last updated
775
+ */
776
+ updatedAt: string | null;
777
+ }
778
+
779
+ export namespace Attributes {
780
+ /**
781
+ * Failure details when this transfer failed.
782
+ */
783
+ export interface Failure {
784
+ /**
785
+ * Failure code, when available
786
+ */
787
+ code: string | null;
788
+
789
+ /**
790
+ * Failure reason, when available
791
+ */
792
+ reason: string | null;
793
+ }
794
+
795
+ /**
796
+ * Return details when this transfer was returned.
797
+ */
798
+ export interface Return {
799
+ /**
800
+ * Return code, when available
801
+ */
802
+ code: string | null;
803
+
804
+ /**
805
+ * Return reason, when available
806
+ */
807
+ reason: string | null;
808
+
809
+ /**
810
+ * When this transfer returned
811
+ */
812
+ returnedAt: string | null;
813
+ }
814
+ }
815
+
816
+ /**
817
+ * Resource relationships
818
+ */
819
+ export interface Relationships {
820
+ /**
821
+ * External account used for this transfer, when available.
822
+ */
823
+ externalAccount: Relationships.ExternalAccount;
824
+
825
+ /**
826
+ * Party that owns the transfer
827
+ */
828
+ party: Relationships.Party;
829
+
830
+ /**
831
+ * Primary transaction row for this transfer, when available.
832
+ */
833
+ transaction: Relationships.Transaction;
834
+
835
+ /**
836
+ * Wallet for this transfer
837
+ */
838
+ wallet: Relationships.Wallet;
839
+ }
840
+
841
+ export namespace Relationships {
842
+ /**
843
+ * External account used for this transfer, when available.
844
+ */
845
+ export interface ExternalAccount {
846
+ /**
847
+ * Related resource identifier
848
+ */
849
+ data: ExternalAccount.Data | null;
850
+ }
851
+
852
+ export namespace ExternalAccount {
853
+ /**
854
+ * Related resource identifier
855
+ */
856
+ export interface Data {
857
+ id: string;
858
+
859
+ /**
860
+ * Resource type
861
+ */
862
+ type: string;
863
+ }
864
+ }
865
+
866
+ /**
867
+ * Party that owns the transfer
868
+ */
869
+ export interface Party {
870
+ /**
871
+ * Related resource identifier
872
+ */
873
+ data: Party.Data;
874
+ }
875
+
876
+ export namespace Party {
877
+ /**
878
+ * Related resource identifier
879
+ */
880
+ export interface Data {
881
+ id: string;
882
+
883
+ /**
884
+ * Resource type
885
+ */
886
+ type: string;
887
+ }
888
+ }
889
+
890
+ /**
891
+ * Primary transaction row for this transfer, when available.
892
+ */
893
+ export interface Transaction {
894
+ /**
895
+ * Related resource identifier
896
+ */
897
+ data: Transaction.Data | null;
898
+ }
899
+
900
+ export namespace Transaction {
901
+ /**
902
+ * Related resource identifier
903
+ */
904
+ export interface Data {
905
+ id: string;
906
+
907
+ /**
908
+ * Resource type
909
+ */
910
+ type: string;
911
+ }
912
+ }
913
+
914
+ /**
915
+ * Wallet for this transfer
916
+ */
917
+ export interface Wallet {
918
+ /**
919
+ * Related resource identifier
920
+ */
921
+ data: Wallet.Data;
922
+ }
923
+
924
+ export namespace Wallet {
925
+ /**
926
+ * Related resource identifier
927
+ */
928
+ export interface Data {
929
+ id: string;
930
+
931
+ /**
932
+ * Resource type
933
+ */
934
+ type: string;
935
+ }
936
+ }
937
+ }
938
+ }
939
+ }
940
+
941
+ export interface TransferInitiateWithdrawalResponse {
942
+ data: TransferInitiateWithdrawalResponse.Data;
943
+ }
944
+
945
+ export namespace TransferInitiateWithdrawalResponse {
946
+ export interface Data {
947
+ id: string;
948
+
949
+ /**
950
+ * Resource attributes
951
+ */
952
+ attributes: Data.Attributes;
953
+
954
+ /**
955
+ * Resource relationships
956
+ */
957
+ relationships: Data.Relationships;
958
+
959
+ type: string;
960
+ }
961
+
962
+ export namespace Data {
963
+ /**
964
+ * Resource attributes
965
+ */
966
+ export interface Attributes {
967
+ /**
968
+ * Amount in cents
969
+ */
970
+ amount: number;
971
+
972
+ /**
973
+ * When this transfer was created
974
+ */
975
+ createdAt: string;
976
+
977
+ /**
978
+ * Currency code
979
+ */
980
+ currency: string;
981
+
982
+ /**
983
+ * Transfer description
984
+ */
985
+ description: string | null;
986
+
987
+ /**
988
+ * Expected availability time, when known
989
+ */
990
+ expectedAvailableAt: string | null;
991
+
992
+ /**
993
+ * Masked external account display
994
+ */
995
+ externalAccountDisplayMask: string | null;
996
+
997
+ /**
998
+ * Failure details when this transfer failed.
999
+ */
1000
+ failure: Attributes.Failure | null;
1001
+
1002
+ /**
1003
+ * Return details when this transfer was returned.
1004
+ */
1005
+ return: Attributes.Return | null;
1006
+
1007
+ /**
1008
+ * When this transfer settled
1009
+ */
1010
+ settledAt: string | null;
1011
+
1012
+ /**
1013
+ * Transfer status
1014
+ */
1015
+ status:
1016
+ | 'CREATED'
1017
+ | 'APPROVAL_DENIED'
1018
+ | 'PROCESSING'
1019
+ | 'IN_REVIEW'
1020
+ | 'COMPLETED'
1021
+ | 'FAILED'
1022
+ | 'RETURNED'
1023
+ | 'CANCELLED';
1024
+
1025
+ /**
1026
+ * When this transfer was submitted
1027
+ */
1028
+ submittedAt: string | null;
1029
+
1030
+ /**
1031
+ * Transfer type
1032
+ */
1033
+ type: 'deposit' | 'withdrawal';
1034
+
1035
+ /**
1036
+ * When this transfer was last updated
1037
+ */
1038
+ updatedAt: string | null;
1039
+ }
1040
+
1041
+ export namespace Attributes {
1042
+ /**
1043
+ * Failure details when this transfer failed.
1044
+ */
1045
+ export interface Failure {
1046
+ /**
1047
+ * Failure code, when available
1048
+ */
1049
+ code: string | null;
1050
+
1051
+ /**
1052
+ * Failure reason, when available
1053
+ */
1054
+ reason: string | null;
1055
+ }
1056
+
1057
+ /**
1058
+ * Return details when this transfer was returned.
1059
+ */
1060
+ export interface Return {
1061
+ /**
1062
+ * Return code, when available
1063
+ */
1064
+ code: string | null;
1065
+
1066
+ /**
1067
+ * Return reason, when available
1068
+ */
1069
+ reason: string | null;
1070
+
1071
+ /**
1072
+ * When this transfer returned
1073
+ */
1074
+ returnedAt: string | null;
1075
+ }
1076
+ }
1077
+
1078
+ /**
1079
+ * Resource relationships
1080
+ */
1081
+ export interface Relationships {
1082
+ /**
1083
+ * External account used for this transfer, when available.
1084
+ */
1085
+ externalAccount: Relationships.ExternalAccount;
1086
+
1087
+ /**
1088
+ * Party that owns the transfer
1089
+ */
1090
+ party: Relationships.Party;
1091
+
1092
+ /**
1093
+ * Primary transaction row for this transfer, when available.
1094
+ */
1095
+ transaction: Relationships.Transaction;
1096
+
1097
+ /**
1098
+ * Wallet for this transfer
1099
+ */
1100
+ wallet: Relationships.Wallet;
1101
+ }
1102
+
1103
+ export namespace Relationships {
1104
+ /**
1105
+ * External account used for this transfer, when available.
1106
+ */
1107
+ export interface ExternalAccount {
1108
+ /**
1109
+ * Related resource identifier
1110
+ */
1111
+ data: ExternalAccount.Data | null;
1112
+ }
1113
+
1114
+ export namespace ExternalAccount {
1115
+ /**
1116
+ * Related resource identifier
1117
+ */
1118
+ export interface Data {
1119
+ id: string;
1120
+
1121
+ /**
1122
+ * Resource type
1123
+ */
1124
+ type: string;
1125
+ }
1126
+ }
1127
+
1128
+ /**
1129
+ * Party that owns the transfer
1130
+ */
1131
+ export interface Party {
1132
+ /**
1133
+ * Related resource identifier
1134
+ */
1135
+ data: Party.Data;
1136
+ }
1137
+
1138
+ export namespace Party {
1139
+ /**
1140
+ * Related resource identifier
1141
+ */
1142
+ export interface Data {
1143
+ id: string;
1144
+
1145
+ /**
1146
+ * Resource type
1147
+ */
1148
+ type: string;
1149
+ }
1150
+ }
1151
+
1152
+ /**
1153
+ * Primary transaction row for this transfer, when available.
1154
+ */
1155
+ export interface Transaction {
1156
+ /**
1157
+ * Related resource identifier
1158
+ */
1159
+ data: Transaction.Data | null;
1160
+ }
1161
+
1162
+ export namespace Transaction {
1163
+ /**
1164
+ * Related resource identifier
1165
+ */
1166
+ export interface Data {
1167
+ id: string;
1168
+
1169
+ /**
1170
+ * Resource type
1171
+ */
1172
+ type: string;
1173
+ }
1174
+ }
1175
+
1176
+ /**
1177
+ * Wallet for this transfer
1178
+ */
1179
+ export interface Wallet {
1180
+ /**
1181
+ * Related resource identifier
1182
+ */
1183
+ data: Wallet.Data;
1184
+ }
1185
+
1186
+ export namespace Wallet {
1187
+ /**
1188
+ * Related resource identifier
1189
+ */
1190
+ export interface Data {
1191
+ id: string;
1192
+
1193
+ /**
1194
+ * Resource type
1195
+ */
1196
+ type: string;
1197
+ }
1198
+ }
1199
+ }
1200
+ }
1201
+ }
1202
+
1203
+ export interface TransferListParams {
1204
+ /**
1205
+ * Query param: Pagination cursor from previous response
1206
+ */
1207
+ cursor?: string;
1208
+
1209
+ /**
1210
+ * Query param: Results per page
1211
+ */
1212
+ limit?: number;
1213
+
1214
+ /**
1215
+ * Query param: Party ID for delegated transfer lookup
1216
+ */
1217
+ partyId?: string;
1218
+
1219
+ /**
1220
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1221
+ */
1222
+ 'X-Agent-ID'?: string;
1223
+
1224
+ /**
1225
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1226
+ * for agent observability.
1227
+ */
1228
+ 'X-Instance-ID'?: string;
1229
+ }
1230
+
1231
+ export interface TransferGetParams {
1232
+ /**
1233
+ * Query param: Party ID for delegated transfer lookup
1234
+ */
1235
+ partyId?: string;
1236
+
1237
+ /**
1238
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1239
+ */
1240
+ 'X-Agent-ID'?: string;
1241
+
1242
+ /**
1243
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1244
+ * for agent observability.
1245
+ */
1246
+ 'X-Instance-ID'?: string;
1247
+ }
1248
+
1249
+ export interface TransferInitiateDepositParams {
1250
+ /**
1251
+ * Body param: Amount in cents
1252
+ */
1253
+ amount: number;
1254
+
1255
+ /**
1256
+ * Body param: External account ID (eac\_\*)
1257
+ */
1258
+ externalAccountId: string;
1259
+
1260
+ /**
1261
+ * Header param: Unique key for idempotent request handling. If a request with the
1262
+ * same key was already processed, the original response is returned.
1263
+ */
1264
+ 'Idempotency-Key': string;
1265
+
1266
+ /**
1267
+ * Body param: Currency code
1268
+ */
1269
+ currency?: string;
1270
+
1271
+ /**
1272
+ * Body param: Deposit description
1273
+ */
1274
+ description?: string;
1275
+
1276
+ /**
1277
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1278
+ */
1279
+ 'X-Agent-ID'?: string;
1280
+
1281
+ /**
1282
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1283
+ * for agent observability.
1284
+ */
1285
+ 'X-Instance-ID'?: string;
1286
+ }
1287
+
1288
+ export interface TransferInitiateWithdrawalParams {
1289
+ /**
1290
+ * Body param: Amount in cents
1291
+ */
1292
+ amount: number;
1293
+
1294
+ /**
1295
+ * Body param: External account ID (eac\_\*)
1296
+ */
1297
+ externalAccountId: string;
1298
+
1299
+ /**
1300
+ * Header param: Unique key for idempotent request handling. If a request with the
1301
+ * same key was already processed, the original response is returned.
1302
+ */
1303
+ 'Idempotency-Key': string;
1304
+
1305
+ /**
1306
+ * Body param: Currency code
1307
+ */
1308
+ currency?: string;
1309
+
1310
+ /**
1311
+ * Body param: Withdrawal description
1312
+ */
1313
+ description?: string;
1314
+
1315
+ /**
1316
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1317
+ */
1318
+ 'X-Agent-ID'?: string;
1319
+
1320
+ /**
1321
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1322
+ * for agent observability.
1323
+ */
1324
+ 'X-Instance-ID'?: string;
1325
+ }
1326
+
1327
+ export declare namespace Transfers {
1328
+ export {
1329
+ type TransferListResponse as TransferListResponse,
1330
+ type TransferGetResponse as TransferGetResponse,
1331
+ type TransferInitiateDepositResponse as TransferInitiateDepositResponse,
1332
+ type TransferInitiateWithdrawalResponse as TransferInitiateWithdrawalResponse,
1333
+ type TransferListParams as TransferListParams,
1334
+ type TransferGetParams as TransferGetParams,
1335
+ type TransferInitiateDepositParams as TransferInitiateDepositParams,
1336
+ type TransferInitiateWithdrawalParams as TransferInitiateWithdrawalParams,
1337
+ };
1338
+ }