@naturalpay/sdk 0.9.0 → 0.11.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 +20 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents.d.mts +33 -26
- package/resources/agents.d.mts.map +1 -1
- package/resources/agents.d.ts +33 -26
- package/resources/agents.d.ts.map +1 -1
- package/resources/agents.js +1 -1
- package/resources/agents.mjs +1 -1
- package/resources/api-keys.d.mts +16 -16
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +16 -16
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/approvals.d.mts +16 -16
- package/resources/approvals.d.mts.map +1 -1
- package/resources/approvals.d.ts +16 -16
- package/resources/approvals.d.ts.map +1 -1
- package/resources/counterparties.d.mts +1 -1
- package/resources/counterparties.d.mts.map +1 -1
- package/resources/counterparties.d.ts +1 -1
- package/resources/counterparties.d.ts.map +1 -1
- package/resources/customers.d.mts +6 -6
- package/resources/customers.d.mts.map +1 -1
- package/resources/customers.d.ts +6 -6
- package/resources/customers.d.ts.map +1 -1
- package/resources/external-accounts.d.mts +4 -4
- package/resources/external-accounts.d.mts.map +1 -1
- package/resources/external-accounts.d.ts +4 -4
- package/resources/external-accounts.d.ts.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invitations.d.mts +3 -3
- package/resources/invitations.d.mts.map +1 -1
- package/resources/invitations.d.ts +3 -3
- package/resources/invitations.d.ts.map +1 -1
- package/resources/parties.d.mts +4 -4
- package/resources/parties.d.mts.map +1 -1
- package/resources/parties.d.ts +4 -4
- package/resources/parties.d.ts.map +1 -1
- package/resources/payment-requests.d.mts +374 -82
- package/resources/payment-requests.d.mts.map +1 -1
- package/resources/payment-requests.d.ts +374 -82
- package/resources/payment-requests.d.ts.map +1 -1
- package/resources/payment-requests.js +35 -48
- package/resources/payment-requests.js.map +1 -1
- package/resources/payment-requests.mjs +35 -48
- package/resources/payment-requests.mjs.map +1 -1
- package/resources/payments.d.mts +433 -44
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +433 -44
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +40 -22
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +40 -22
- package/resources/payments.mjs.map +1 -1
- package/resources/transactions.d.mts +26 -28
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +26 -28
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +6 -18
- package/resources/transactions.js.map +1 -1
- package/resources/transactions.mjs +6 -18
- package/resources/transactions.mjs.map +1 -1
- package/resources/transfers.d.mts +64 -57
- package/resources/transfers.d.mts.map +1 -1
- package/resources/transfers.d.ts +64 -57
- package/resources/transfers.d.ts.map +1 -1
- package/resources/transfers.js +20 -29
- package/resources/transfers.js.map +1 -1
- package/resources/transfers.mjs +20 -29
- package/resources/transfers.mjs.map +1 -1
- package/resources/wallet.d.mts +4 -4
- package/resources/wallet.d.mts.map +1 -1
- package/resources/wallet.d.ts +4 -4
- package/resources/wallet.d.ts.map +1 -1
- package/resources/webhooks.d.mts +12 -12
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +12 -12
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +4 -0
- package/src/resources/agents.ts +39 -26
- package/src/resources/api-keys.ts +16 -16
- package/src/resources/approvals.ts +16 -16
- package/src/resources/counterparties.ts +1 -1
- package/src/resources/customers.ts +6 -6
- package/src/resources/external-accounts.ts +4 -4
- package/src/resources/index.ts +2 -0
- package/src/resources/invitations.ts +3 -3
- package/src/resources/parties.ts +4 -4
- package/src/resources/payment-requests.ts +484 -126
- package/src/resources/payments.ts +531 -67
- package/src/resources/transactions.ts +32 -49
- package/src/resources/transfers.ts +72 -88
- package/src/resources/wallet.ts +4 -4
- package/src/resources/webhooks.ts +12 -12
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -12,8 +12,10 @@ export declare class PaymentRequests extends APIResource {
|
|
|
12
12
|
* ```ts
|
|
13
13
|
* const paymentRequest = await client.paymentRequests.create({
|
|
14
14
|
* amount: 1,
|
|
15
|
-
* payer: { type: '
|
|
15
|
+
* payer: { type: 'email', value: 'dev@stainless.com' },
|
|
16
16
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
17
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
18
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
17
19
|
* });
|
|
18
20
|
* ```
|
|
19
21
|
*/
|
|
@@ -23,10 +25,13 @@ export declare class PaymentRequests extends APIResource {
|
|
|
23
25
|
*
|
|
24
26
|
* @example
|
|
25
27
|
* ```ts
|
|
26
|
-
* const paymentRequests = await client.paymentRequests.list(
|
|
28
|
+
* const paymentRequests = await client.paymentRequests.list({
|
|
29
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
30
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
31
|
+
* });
|
|
27
32
|
* ```
|
|
28
33
|
*/
|
|
29
|
-
list(params
|
|
34
|
+
list(params: PaymentRequestListParams, options?: RequestOptions): APIPromise<PaymentRequestListResponse>;
|
|
30
35
|
/**
|
|
31
36
|
* Decline an open payment request where the authenticated party is expected to
|
|
32
37
|
* pay.
|
|
@@ -35,7 +40,11 @@ export declare class PaymentRequests extends APIResource {
|
|
|
35
40
|
* ```ts
|
|
36
41
|
* const response = await client.paymentRequests.decline(
|
|
37
42
|
* 'prq_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
38
|
-
* {
|
|
43
|
+
* {
|
|
44
|
+
* 'Idempotency-Key': 'Idempotency-Key',
|
|
45
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
46
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
47
|
+
* },
|
|
39
48
|
* );
|
|
40
49
|
* ```
|
|
41
50
|
*/
|
|
@@ -49,10 +58,12 @@ export declare class PaymentRequests extends APIResource {
|
|
|
49
58
|
* 'prq_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
50
59
|
* {
|
|
51
60
|
* paymentSource: {
|
|
52
|
-
* type: '
|
|
61
|
+
* type: 'wallet',
|
|
53
62
|
* walletId: 'wal_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
54
63
|
* },
|
|
55
64
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
65
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
66
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
56
67
|
* },
|
|
57
68
|
* );
|
|
58
69
|
* ```
|
|
@@ -65,20 +76,26 @@ export declare class PaymentRequests extends APIResource {
|
|
|
65
76
|
* ```ts
|
|
66
77
|
* const paymentRequest = await client.paymentRequests.get(
|
|
67
78
|
* 'prq_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
79
|
+
* {
|
|
80
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
81
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
82
|
+
* },
|
|
68
83
|
* );
|
|
69
84
|
* ```
|
|
70
85
|
*/
|
|
71
|
-
get(paymentRequestID: string, params
|
|
86
|
+
get(paymentRequestID: string, params: PaymentRequestGetParams, options?: RequestOptions): APIPromise<PaymentRequestGetResponse>;
|
|
72
87
|
/**
|
|
73
88
|
* List open payment requests where the authenticated party is expected to pay.
|
|
74
89
|
*
|
|
75
90
|
* @example
|
|
76
91
|
* ```ts
|
|
77
|
-
* const response =
|
|
78
|
-
*
|
|
92
|
+
* const response = await client.paymentRequests.listIncoming({
|
|
93
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
94
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
95
|
+
* });
|
|
79
96
|
* ```
|
|
80
97
|
*/
|
|
81
|
-
listIncoming(params
|
|
98
|
+
listIncoming(params: PaymentRequestListIncomingParams, options?: RequestOptions): APIPromise<PaymentRequestListIncomingResponse>;
|
|
82
99
|
}
|
|
83
100
|
export interface PaymentRequestCreateResponse {
|
|
84
101
|
data: PaymentRequestCreateResponse.Data;
|
|
@@ -100,7 +117,7 @@ export declare namespace PaymentRequestCreateResponse {
|
|
|
100
117
|
/**
|
|
101
118
|
* Resource type
|
|
102
119
|
*/
|
|
103
|
-
type:
|
|
120
|
+
type: 'paymentRequest';
|
|
104
121
|
}
|
|
105
122
|
namespace Data {
|
|
106
123
|
/**
|
|
@@ -162,7 +179,7 @@ export declare namespace PaymentRequestCreateResponse {
|
|
|
162
179
|
/**
|
|
163
180
|
* Current status of the payment request
|
|
164
181
|
*/
|
|
165
|
-
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
182
|
+
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'RETURNED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
166
183
|
/**
|
|
167
184
|
* ID of the transaction created by the most recent payment attempt, or null if no
|
|
168
185
|
* attempt yet
|
|
@@ -205,7 +222,7 @@ export declare namespace PaymentRequestCreateResponse {
|
|
|
205
222
|
/**
|
|
206
223
|
* Resource type
|
|
207
224
|
*/
|
|
208
|
-
type:
|
|
225
|
+
type: 'party';
|
|
209
226
|
}
|
|
210
227
|
}
|
|
211
228
|
/**
|
|
@@ -226,7 +243,7 @@ export declare namespace PaymentRequestCreateResponse {
|
|
|
226
243
|
/**
|
|
227
244
|
* Resource type
|
|
228
245
|
*/
|
|
229
|
-
type:
|
|
246
|
+
type: 'party';
|
|
230
247
|
}
|
|
231
248
|
}
|
|
232
249
|
}
|
|
@@ -253,7 +270,7 @@ export declare namespace PaymentRequestListResponse {
|
|
|
253
270
|
/**
|
|
254
271
|
* Resource type
|
|
255
272
|
*/
|
|
256
|
-
type:
|
|
273
|
+
type: 'paymentRequest';
|
|
257
274
|
}
|
|
258
275
|
namespace Data {
|
|
259
276
|
/**
|
|
@@ -315,7 +332,7 @@ export declare namespace PaymentRequestListResponse {
|
|
|
315
332
|
/**
|
|
316
333
|
* Current status of the payment request
|
|
317
334
|
*/
|
|
318
|
-
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
335
|
+
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'RETURNED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
319
336
|
/**
|
|
320
337
|
* ID of the transaction created by the most recent payment attempt, or null if no
|
|
321
338
|
* attempt yet
|
|
@@ -334,6 +351,10 @@ export declare namespace PaymentRequestListResponse {
|
|
|
334
351
|
* Resolved payer party, if the payer is known to Natural
|
|
335
352
|
*/
|
|
336
353
|
payerParty: Relationships.PayerParty;
|
|
354
|
+
/**
|
|
355
|
+
* Payment submitted for this payment request, if one exists.
|
|
356
|
+
*/
|
|
357
|
+
payment: Relationships.Payment;
|
|
337
358
|
/**
|
|
338
359
|
* Party requesting the payment
|
|
339
360
|
*/
|
|
@@ -362,7 +383,28 @@ export declare namespace PaymentRequestListResponse {
|
|
|
362
383
|
/**
|
|
363
384
|
* Resource type
|
|
364
385
|
*/
|
|
365
|
-
type:
|
|
386
|
+
type: 'party';
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Payment submitted for this payment request, if one exists.
|
|
391
|
+
*/
|
|
392
|
+
interface Payment {
|
|
393
|
+
/**
|
|
394
|
+
* Related resource identifier
|
|
395
|
+
*/
|
|
396
|
+
data: Payment.Data | null;
|
|
397
|
+
}
|
|
398
|
+
namespace Payment {
|
|
399
|
+
/**
|
|
400
|
+
* Related resource identifier
|
|
401
|
+
*/
|
|
402
|
+
interface Data {
|
|
403
|
+
id: string;
|
|
404
|
+
/**
|
|
405
|
+
* Resource type
|
|
406
|
+
*/
|
|
407
|
+
type: 'payment';
|
|
366
408
|
}
|
|
367
409
|
}
|
|
368
410
|
/**
|
|
@@ -383,7 +425,7 @@ export declare namespace PaymentRequestListResponse {
|
|
|
383
425
|
/**
|
|
384
426
|
* Resource type
|
|
385
427
|
*/
|
|
386
|
-
type:
|
|
428
|
+
type: 'party';
|
|
387
429
|
}
|
|
388
430
|
}
|
|
389
431
|
/**
|
|
@@ -404,7 +446,7 @@ export declare namespace PaymentRequestListResponse {
|
|
|
404
446
|
/**
|
|
405
447
|
* Resource type
|
|
406
448
|
*/
|
|
407
|
-
type:
|
|
449
|
+
type: 'wallet';
|
|
408
450
|
}
|
|
409
451
|
}
|
|
410
452
|
}
|
|
@@ -439,7 +481,7 @@ export declare namespace PaymentRequestDeclineResponse {
|
|
|
439
481
|
/**
|
|
440
482
|
* Resource type
|
|
441
483
|
*/
|
|
442
|
-
type:
|
|
484
|
+
type: 'paymentRequest';
|
|
443
485
|
}
|
|
444
486
|
namespace Data {
|
|
445
487
|
/**
|
|
@@ -501,7 +543,7 @@ export declare namespace PaymentRequestDeclineResponse {
|
|
|
501
543
|
/**
|
|
502
544
|
* Current status of the payment request
|
|
503
545
|
*/
|
|
504
|
-
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
546
|
+
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'RETURNED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
505
547
|
/**
|
|
506
548
|
* ID of the transaction created by the most recent payment attempt, or null if no
|
|
507
549
|
* attempt yet
|
|
@@ -520,6 +562,10 @@ export declare namespace PaymentRequestDeclineResponse {
|
|
|
520
562
|
* Resolved payer party, if the payer is known to Natural
|
|
521
563
|
*/
|
|
522
564
|
payerParty: Relationships.PayerParty;
|
|
565
|
+
/**
|
|
566
|
+
* Payment submitted for this payment request, if one exists.
|
|
567
|
+
*/
|
|
568
|
+
payment: Relationships.Payment;
|
|
523
569
|
/**
|
|
524
570
|
* Party requesting the payment
|
|
525
571
|
*/
|
|
@@ -548,7 +594,28 @@ export declare namespace PaymentRequestDeclineResponse {
|
|
|
548
594
|
/**
|
|
549
595
|
* Resource type
|
|
550
596
|
*/
|
|
551
|
-
type:
|
|
597
|
+
type: 'party';
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Payment submitted for this payment request, if one exists.
|
|
602
|
+
*/
|
|
603
|
+
interface Payment {
|
|
604
|
+
/**
|
|
605
|
+
* Related resource identifier
|
|
606
|
+
*/
|
|
607
|
+
data: Payment.Data | null;
|
|
608
|
+
}
|
|
609
|
+
namespace Payment {
|
|
610
|
+
/**
|
|
611
|
+
* Related resource identifier
|
|
612
|
+
*/
|
|
613
|
+
interface Data {
|
|
614
|
+
id: string;
|
|
615
|
+
/**
|
|
616
|
+
* Resource type
|
|
617
|
+
*/
|
|
618
|
+
type: 'payment';
|
|
552
619
|
}
|
|
553
620
|
}
|
|
554
621
|
/**
|
|
@@ -569,7 +636,7 @@ export declare namespace PaymentRequestDeclineResponse {
|
|
|
569
636
|
/**
|
|
570
637
|
* Resource type
|
|
571
638
|
*/
|
|
572
|
-
type:
|
|
639
|
+
type: 'party';
|
|
573
640
|
}
|
|
574
641
|
}
|
|
575
642
|
/**
|
|
@@ -590,7 +657,7 @@ export declare namespace PaymentRequestDeclineResponse {
|
|
|
590
657
|
/**
|
|
591
658
|
* Resource type
|
|
592
659
|
*/
|
|
593
|
-
type:
|
|
660
|
+
type: 'wallet';
|
|
594
661
|
}
|
|
595
662
|
}
|
|
596
663
|
}
|
|
@@ -602,12 +669,179 @@ export interface PaymentRequestFulfillResponse {
|
|
|
602
669
|
export declare namespace PaymentRequestFulfillResponse {
|
|
603
670
|
interface Data {
|
|
604
671
|
id: string;
|
|
672
|
+
/**
|
|
673
|
+
* Resource attributes
|
|
674
|
+
*/
|
|
605
675
|
attributes: Data.Attributes;
|
|
606
|
-
|
|
676
|
+
/**
|
|
677
|
+
* Resource relationships
|
|
678
|
+
*/
|
|
679
|
+
relationships: Data.Relationships;
|
|
680
|
+
type: 'payment';
|
|
607
681
|
}
|
|
608
682
|
namespace Data {
|
|
683
|
+
/**
|
|
684
|
+
* Resource attributes
|
|
685
|
+
*/
|
|
609
686
|
interface Attributes {
|
|
610
|
-
|
|
687
|
+
/**
|
|
688
|
+
* Amount in cents
|
|
689
|
+
*/
|
|
690
|
+
amount: number;
|
|
691
|
+
/**
|
|
692
|
+
* When this payment was created
|
|
693
|
+
*/
|
|
694
|
+
createdAt: string;
|
|
695
|
+
/**
|
|
696
|
+
* Currency code
|
|
697
|
+
*/
|
|
698
|
+
currency: string;
|
|
699
|
+
/**
|
|
700
|
+
* Payment description
|
|
701
|
+
*/
|
|
702
|
+
description: string | null;
|
|
703
|
+
/**
|
|
704
|
+
* Payment status
|
|
705
|
+
*/
|
|
706
|
+
status: 'CREATED' | 'PROCESSING' | 'PENDING_CLAIM' | 'IN_REVIEW' | 'COMPLETED' | 'FAILED' | 'RETURNED' | 'APPROVAL_DENIED' | 'CANCELLED';
|
|
707
|
+
/**
|
|
708
|
+
* When this payment was last updated
|
|
709
|
+
*/
|
|
710
|
+
updatedAt: string | null;
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Resource relationships
|
|
714
|
+
*/
|
|
715
|
+
interface Relationships {
|
|
716
|
+
/**
|
|
717
|
+
* Payment request that produced this payment, when applicable.
|
|
718
|
+
*/
|
|
719
|
+
paymentRequest: Relationships.PaymentRequest;
|
|
720
|
+
/**
|
|
721
|
+
* Recipient party for this payment, when known.
|
|
722
|
+
*/
|
|
723
|
+
recipient: Relationships.Recipient;
|
|
724
|
+
/**
|
|
725
|
+
* Recipient agent when the caller addressed an agent ID. Null otherwise, including
|
|
726
|
+
* when the recipient was addressed as an email, phone, or party ID.
|
|
727
|
+
*/
|
|
728
|
+
recipientAgent: Relationships.RecipientAgent;
|
|
729
|
+
/**
|
|
730
|
+
* Party that initiated the payment
|
|
731
|
+
*/
|
|
732
|
+
sender: Relationships.Sender;
|
|
733
|
+
/**
|
|
734
|
+
* Sender-side transaction row for this payment, when available.
|
|
735
|
+
*/
|
|
736
|
+
transaction: Relationships.Transaction;
|
|
737
|
+
}
|
|
738
|
+
namespace Relationships {
|
|
739
|
+
/**
|
|
740
|
+
* Payment request that produced this payment, when applicable.
|
|
741
|
+
*/
|
|
742
|
+
interface PaymentRequest {
|
|
743
|
+
/**
|
|
744
|
+
* Related resource identifier
|
|
745
|
+
*/
|
|
746
|
+
data: PaymentRequest.Data | null;
|
|
747
|
+
}
|
|
748
|
+
namespace PaymentRequest {
|
|
749
|
+
/**
|
|
750
|
+
* Related resource identifier
|
|
751
|
+
*/
|
|
752
|
+
interface Data {
|
|
753
|
+
id: string;
|
|
754
|
+
/**
|
|
755
|
+
* Resource type
|
|
756
|
+
*/
|
|
757
|
+
type: 'paymentRequest';
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Recipient party for this payment, when known.
|
|
762
|
+
*/
|
|
763
|
+
interface Recipient {
|
|
764
|
+
/**
|
|
765
|
+
* Related resource identifier
|
|
766
|
+
*/
|
|
767
|
+
data: Recipient.Data | null;
|
|
768
|
+
}
|
|
769
|
+
namespace Recipient {
|
|
770
|
+
/**
|
|
771
|
+
* Related resource identifier
|
|
772
|
+
*/
|
|
773
|
+
interface Data {
|
|
774
|
+
id: string;
|
|
775
|
+
/**
|
|
776
|
+
* Resource type
|
|
777
|
+
*/
|
|
778
|
+
type: 'party';
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Recipient agent when the caller addressed an agent ID. Null otherwise, including
|
|
783
|
+
* when the recipient was addressed as an email, phone, or party ID.
|
|
784
|
+
*/
|
|
785
|
+
interface RecipientAgent {
|
|
786
|
+
/**
|
|
787
|
+
* Related resource identifier
|
|
788
|
+
*/
|
|
789
|
+
data: RecipientAgent.Data | null;
|
|
790
|
+
}
|
|
791
|
+
namespace RecipientAgent {
|
|
792
|
+
/**
|
|
793
|
+
* Related resource identifier
|
|
794
|
+
*/
|
|
795
|
+
interface Data {
|
|
796
|
+
id: string;
|
|
797
|
+
/**
|
|
798
|
+
* Resource type
|
|
799
|
+
*/
|
|
800
|
+
type: 'agent';
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Party that initiated the payment
|
|
805
|
+
*/
|
|
806
|
+
interface Sender {
|
|
807
|
+
/**
|
|
808
|
+
* Related resource identifier
|
|
809
|
+
*/
|
|
810
|
+
data: Sender.Data;
|
|
811
|
+
}
|
|
812
|
+
namespace Sender {
|
|
813
|
+
/**
|
|
814
|
+
* Related resource identifier
|
|
815
|
+
*/
|
|
816
|
+
interface Data {
|
|
817
|
+
id: string;
|
|
818
|
+
/**
|
|
819
|
+
* Resource type
|
|
820
|
+
*/
|
|
821
|
+
type: 'party';
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Sender-side transaction row for this payment, when available.
|
|
826
|
+
*/
|
|
827
|
+
interface Transaction {
|
|
828
|
+
/**
|
|
829
|
+
* Related resource identifier
|
|
830
|
+
*/
|
|
831
|
+
data: Transaction.Data | null;
|
|
832
|
+
}
|
|
833
|
+
namespace Transaction {
|
|
834
|
+
/**
|
|
835
|
+
* Related resource identifier
|
|
836
|
+
*/
|
|
837
|
+
interface Data {
|
|
838
|
+
id: string;
|
|
839
|
+
/**
|
|
840
|
+
* Resource type
|
|
841
|
+
*/
|
|
842
|
+
type: 'transaction';
|
|
843
|
+
}
|
|
844
|
+
}
|
|
611
845
|
}
|
|
612
846
|
}
|
|
613
847
|
}
|
|
@@ -631,7 +865,7 @@ export declare namespace PaymentRequestGetResponse {
|
|
|
631
865
|
/**
|
|
632
866
|
* Resource type
|
|
633
867
|
*/
|
|
634
|
-
type:
|
|
868
|
+
type: 'paymentRequest';
|
|
635
869
|
}
|
|
636
870
|
namespace Data {
|
|
637
871
|
/**
|
|
@@ -693,7 +927,7 @@ export declare namespace PaymentRequestGetResponse {
|
|
|
693
927
|
/**
|
|
694
928
|
* Current status of the payment request
|
|
695
929
|
*/
|
|
696
|
-
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
930
|
+
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'RETURNED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
697
931
|
/**
|
|
698
932
|
* ID of the transaction created by the most recent payment attempt, or null if no
|
|
699
933
|
* attempt yet
|
|
@@ -712,6 +946,10 @@ export declare namespace PaymentRequestGetResponse {
|
|
|
712
946
|
* Resolved payer party, if the payer is known to Natural
|
|
713
947
|
*/
|
|
714
948
|
payerParty: Relationships.PayerParty;
|
|
949
|
+
/**
|
|
950
|
+
* Payment submitted for this payment request, if one exists.
|
|
951
|
+
*/
|
|
952
|
+
payment: Relationships.Payment;
|
|
715
953
|
/**
|
|
716
954
|
* Party requesting the payment
|
|
717
955
|
*/
|
|
@@ -740,7 +978,28 @@ export declare namespace PaymentRequestGetResponse {
|
|
|
740
978
|
/**
|
|
741
979
|
* Resource type
|
|
742
980
|
*/
|
|
743
|
-
type:
|
|
981
|
+
type: 'party';
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* Payment submitted for this payment request, if one exists.
|
|
986
|
+
*/
|
|
987
|
+
interface Payment {
|
|
988
|
+
/**
|
|
989
|
+
* Related resource identifier
|
|
990
|
+
*/
|
|
991
|
+
data: Payment.Data | null;
|
|
992
|
+
}
|
|
993
|
+
namespace Payment {
|
|
994
|
+
/**
|
|
995
|
+
* Related resource identifier
|
|
996
|
+
*/
|
|
997
|
+
interface Data {
|
|
998
|
+
id: string;
|
|
999
|
+
/**
|
|
1000
|
+
* Resource type
|
|
1001
|
+
*/
|
|
1002
|
+
type: 'payment';
|
|
744
1003
|
}
|
|
745
1004
|
}
|
|
746
1005
|
/**
|
|
@@ -761,7 +1020,7 @@ export declare namespace PaymentRequestGetResponse {
|
|
|
761
1020
|
/**
|
|
762
1021
|
* Resource type
|
|
763
1022
|
*/
|
|
764
|
-
type:
|
|
1023
|
+
type: 'party';
|
|
765
1024
|
}
|
|
766
1025
|
}
|
|
767
1026
|
/**
|
|
@@ -782,7 +1041,7 @@ export declare namespace PaymentRequestGetResponse {
|
|
|
782
1041
|
/**
|
|
783
1042
|
* Resource type
|
|
784
1043
|
*/
|
|
785
|
-
type:
|
|
1044
|
+
type: 'wallet';
|
|
786
1045
|
}
|
|
787
1046
|
}
|
|
788
1047
|
}
|
|
@@ -809,7 +1068,7 @@ export declare namespace PaymentRequestListIncomingResponse {
|
|
|
809
1068
|
/**
|
|
810
1069
|
* Resource type
|
|
811
1070
|
*/
|
|
812
|
-
type:
|
|
1071
|
+
type: 'paymentRequest';
|
|
813
1072
|
}
|
|
814
1073
|
namespace Data {
|
|
815
1074
|
/**
|
|
@@ -871,7 +1130,7 @@ export declare namespace PaymentRequestListIncomingResponse {
|
|
|
871
1130
|
/**
|
|
872
1131
|
* Current status of the payment request
|
|
873
1132
|
*/
|
|
874
|
-
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
1133
|
+
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'RETURNED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
875
1134
|
/**
|
|
876
1135
|
* ID of the transaction created by the most recent payment attempt, or null if no
|
|
877
1136
|
* attempt yet
|
|
@@ -890,6 +1149,10 @@ export declare namespace PaymentRequestListIncomingResponse {
|
|
|
890
1149
|
* Resolved payer party, if the payer is known to Natural
|
|
891
1150
|
*/
|
|
892
1151
|
payerParty: Relationships.PayerParty;
|
|
1152
|
+
/**
|
|
1153
|
+
* Payment submitted for this payment request, if one exists.
|
|
1154
|
+
*/
|
|
1155
|
+
payment: Relationships.Payment;
|
|
893
1156
|
/**
|
|
894
1157
|
* Party requesting the payment
|
|
895
1158
|
*/
|
|
@@ -918,7 +1181,28 @@ export declare namespace PaymentRequestListIncomingResponse {
|
|
|
918
1181
|
/**
|
|
919
1182
|
* Resource type
|
|
920
1183
|
*/
|
|
921
|
-
type:
|
|
1184
|
+
type: 'party';
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
/**
|
|
1188
|
+
* Payment submitted for this payment request, if one exists.
|
|
1189
|
+
*/
|
|
1190
|
+
interface Payment {
|
|
1191
|
+
/**
|
|
1192
|
+
* Related resource identifier
|
|
1193
|
+
*/
|
|
1194
|
+
data: Payment.Data | null;
|
|
1195
|
+
}
|
|
1196
|
+
namespace Payment {
|
|
1197
|
+
/**
|
|
1198
|
+
* Related resource identifier
|
|
1199
|
+
*/
|
|
1200
|
+
interface Data {
|
|
1201
|
+
id: string;
|
|
1202
|
+
/**
|
|
1203
|
+
* Resource type
|
|
1204
|
+
*/
|
|
1205
|
+
type: 'payment';
|
|
922
1206
|
}
|
|
923
1207
|
}
|
|
924
1208
|
/**
|
|
@@ -939,7 +1223,7 @@ export declare namespace PaymentRequestListIncomingResponse {
|
|
|
939
1223
|
/**
|
|
940
1224
|
* Resource type
|
|
941
1225
|
*/
|
|
942
|
-
type:
|
|
1226
|
+
type: 'party';
|
|
943
1227
|
}
|
|
944
1228
|
}
|
|
945
1229
|
/**
|
|
@@ -960,7 +1244,7 @@ export declare namespace PaymentRequestListIncomingResponse {
|
|
|
960
1244
|
/**
|
|
961
1245
|
* Resource type
|
|
962
1246
|
*/
|
|
963
|
-
type:
|
|
1247
|
+
type: 'wallet';
|
|
964
1248
|
}
|
|
965
1249
|
}
|
|
966
1250
|
}
|
|
@@ -984,12 +1268,20 @@ export interface PaymentRequestCreateParams {
|
|
|
984
1268
|
* Body param: Who pays — exactly one typed email, phone, party ID, or agent ID
|
|
985
1269
|
* value.
|
|
986
1270
|
*/
|
|
987
|
-
payer: PaymentRequestCreateParams.UnionMember0 | PaymentRequestCreateParams.UnionMember1;
|
|
1271
|
+
payer: PaymentRequestCreateParams.UnionMember0 | PaymentRequestCreateParams.UnionMember1 | PaymentRequestCreateParams.UnionMember2 | PaymentRequestCreateParams.UnionMember3;
|
|
988
1272
|
/**
|
|
989
1273
|
* Header param: Unique key for idempotent request handling. If a request with the
|
|
990
1274
|
* same key was already processed, the original response is returned.
|
|
991
1275
|
*/
|
|
992
1276
|
'Idempotency-Key': string;
|
|
1277
|
+
/**
|
|
1278
|
+
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1279
|
+
*/
|
|
1280
|
+
'X-Agent-ID': string;
|
|
1281
|
+
/**
|
|
1282
|
+
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1283
|
+
*/
|
|
1284
|
+
'X-Instance-ID': string;
|
|
993
1285
|
/**
|
|
994
1286
|
* Body param: Currency code (currently only USD)
|
|
995
1287
|
*/
|
|
@@ -1017,31 +1309,36 @@ export interface PaymentRequestCreateParams {
|
|
|
1017
1309
|
* party's default wallet.
|
|
1018
1310
|
*/
|
|
1019
1311
|
walletId?: string;
|
|
1020
|
-
/**
|
|
1021
|
-
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1022
|
-
*/
|
|
1023
|
-
'X-Agent-ID'?: string;
|
|
1024
|
-
/**
|
|
1025
|
-
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
1026
|
-
* for agent observability.
|
|
1027
|
-
*/
|
|
1028
|
-
'X-Instance-ID'?: string;
|
|
1029
1312
|
}
|
|
1030
1313
|
export declare namespace PaymentRequestCreateParams {
|
|
1031
1314
|
interface UnionMember0 {
|
|
1032
|
-
type:
|
|
1315
|
+
type: 'email';
|
|
1033
1316
|
/**
|
|
1034
1317
|
* Email address
|
|
1035
1318
|
*/
|
|
1036
1319
|
value: string;
|
|
1037
1320
|
}
|
|
1038
1321
|
interface UnionMember1 {
|
|
1039
|
-
type:
|
|
1322
|
+
type: 'phone';
|
|
1040
1323
|
/**
|
|
1041
1324
|
* Phone number in E.164 format
|
|
1042
1325
|
*/
|
|
1043
1326
|
value: string;
|
|
1044
1327
|
}
|
|
1328
|
+
interface UnionMember2 {
|
|
1329
|
+
type: 'party_id';
|
|
1330
|
+
/**
|
|
1331
|
+
* Natural party ID (pty\_\*)
|
|
1332
|
+
*/
|
|
1333
|
+
value: string;
|
|
1334
|
+
}
|
|
1335
|
+
interface UnionMember3 {
|
|
1336
|
+
type: 'agent_id';
|
|
1337
|
+
/**
|
|
1338
|
+
* Natural agent ID (agt\_\*)
|
|
1339
|
+
*/
|
|
1340
|
+
value: string;
|
|
1341
|
+
}
|
|
1045
1342
|
/**
|
|
1046
1343
|
* If provided, immediately deliver the payment link to the payer via the named
|
|
1047
1344
|
* channel
|
|
@@ -1055,22 +1352,21 @@ export declare namespace PaymentRequestCreateParams {
|
|
|
1055
1352
|
}
|
|
1056
1353
|
export interface PaymentRequestListParams {
|
|
1057
1354
|
/**
|
|
1058
|
-
*
|
|
1355
|
+
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1059
1356
|
*/
|
|
1060
|
-
|
|
1357
|
+
'X-Agent-ID': string;
|
|
1061
1358
|
/**
|
|
1062
|
-
*
|
|
1359
|
+
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1063
1360
|
*/
|
|
1064
|
-
|
|
1361
|
+
'X-Instance-ID': string;
|
|
1065
1362
|
/**
|
|
1066
|
-
*
|
|
1363
|
+
* Query param: Pagination cursor returned by the previous response
|
|
1067
1364
|
*/
|
|
1068
|
-
|
|
1365
|
+
cursor?: string;
|
|
1069
1366
|
/**
|
|
1070
|
-
*
|
|
1071
|
-
* for agent observability.
|
|
1367
|
+
* Query param: Results per page (1-100)
|
|
1072
1368
|
*/
|
|
1073
|
-
|
|
1369
|
+
limit?: number;
|
|
1074
1370
|
}
|
|
1075
1371
|
export interface PaymentRequestDeclineParams {
|
|
1076
1372
|
/**
|
|
@@ -1079,14 +1375,13 @@ export interface PaymentRequestDeclineParams {
|
|
|
1079
1375
|
*/
|
|
1080
1376
|
'Idempotency-Key': string;
|
|
1081
1377
|
/**
|
|
1082
|
-
* Agent ID (agt_xxx)
|
|
1378
|
+
* Agent ID (agt_xxx) used for attribution and audit.
|
|
1083
1379
|
*/
|
|
1084
|
-
'X-Agent-ID'
|
|
1380
|
+
'X-Agent-ID': string;
|
|
1085
1381
|
/**
|
|
1086
|
-
*
|
|
1087
|
-
* observability.
|
|
1382
|
+
* Stable run, session, or conversation ID for agent observability.
|
|
1088
1383
|
*/
|
|
1089
|
-
'X-Instance-ID'
|
|
1384
|
+
'X-Instance-ID': string;
|
|
1090
1385
|
}
|
|
1091
1386
|
export interface PaymentRequestFulfillParams {
|
|
1092
1387
|
/**
|
|
@@ -1099,54 +1394,51 @@ export interface PaymentRequestFulfillParams {
|
|
|
1099
1394
|
*/
|
|
1100
1395
|
'Idempotency-Key': string;
|
|
1101
1396
|
/**
|
|
1102
|
-
* Header param: Agent ID (agt_xxx)
|
|
1397
|
+
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1103
1398
|
*/
|
|
1104
|
-
'X-Agent-ID'
|
|
1399
|
+
'X-Agent-ID': string;
|
|
1105
1400
|
/**
|
|
1106
|
-
* Header param:
|
|
1107
|
-
* for agent observability.
|
|
1401
|
+
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1108
1402
|
*/
|
|
1109
|
-
'X-Instance-ID'
|
|
1403
|
+
'X-Instance-ID': string;
|
|
1110
1404
|
}
|
|
1111
1405
|
export declare namespace PaymentRequestFulfillParams {
|
|
1112
1406
|
interface UnionMember0 {
|
|
1113
|
-
type:
|
|
1407
|
+
type: 'wallet';
|
|
1114
1408
|
walletId: string;
|
|
1115
1409
|
}
|
|
1116
1410
|
interface UnionMember1 {
|
|
1117
1411
|
externalAccountId: string;
|
|
1118
|
-
type:
|
|
1412
|
+
type: 'external_account';
|
|
1119
1413
|
}
|
|
1120
1414
|
}
|
|
1121
1415
|
export interface PaymentRequestGetParams {
|
|
1122
1416
|
/**
|
|
1123
|
-
* Agent ID (agt_xxx)
|
|
1417
|
+
* Agent ID (agt_xxx) used for attribution and audit.
|
|
1124
1418
|
*/
|
|
1125
|
-
'X-Agent-ID'
|
|
1419
|
+
'X-Agent-ID': string;
|
|
1126
1420
|
/**
|
|
1127
|
-
*
|
|
1128
|
-
* observability.
|
|
1421
|
+
* Stable run, session, or conversation ID for agent observability.
|
|
1129
1422
|
*/
|
|
1130
|
-
'X-Instance-ID'
|
|
1423
|
+
'X-Instance-ID': string;
|
|
1131
1424
|
}
|
|
1132
1425
|
export interface PaymentRequestListIncomingParams {
|
|
1133
1426
|
/**
|
|
1134
|
-
*
|
|
1427
|
+
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1135
1428
|
*/
|
|
1136
|
-
|
|
1429
|
+
'X-Agent-ID': string;
|
|
1137
1430
|
/**
|
|
1138
|
-
*
|
|
1431
|
+
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1139
1432
|
*/
|
|
1140
|
-
|
|
1433
|
+
'X-Instance-ID': string;
|
|
1141
1434
|
/**
|
|
1142
|
-
*
|
|
1435
|
+
* Query param: Pagination cursor returned by the previous response
|
|
1143
1436
|
*/
|
|
1144
|
-
|
|
1437
|
+
cursor?: string;
|
|
1145
1438
|
/**
|
|
1146
|
-
*
|
|
1147
|
-
* for agent observability.
|
|
1439
|
+
* Query param: Results per page (1-100)
|
|
1148
1440
|
*/
|
|
1149
|
-
|
|
1441
|
+
limit?: number;
|
|
1150
1442
|
}
|
|
1151
1443
|
export declare namespace PaymentRequests {
|
|
1152
1444
|
export { type PaymentRequestCreateResponse as PaymentRequestCreateResponse, type PaymentRequestListResponse as PaymentRequestListResponse, type PaymentRequestDeclineResponse as PaymentRequestDeclineResponse, type PaymentRequestFulfillResponse as PaymentRequestFulfillResponse, type PaymentRequestGetResponse as PaymentRequestGetResponse, type PaymentRequestListIncomingResponse as PaymentRequestListIncomingResponse, type PaymentRequestCreateParams as PaymentRequestCreateParams, type PaymentRequestListParams as PaymentRequestListParams, type PaymentRequestDeclineParams as PaymentRequestDeclineParams, type PaymentRequestFulfillParams as PaymentRequestFulfillParams, type PaymentRequestGetParams as PaymentRequestGetParams, type PaymentRequestListIncomingParams as PaymentRequestListIncomingParams, };
|