@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.
- package/CHANGELOG.md +13 -0
- package/client.d.mts +22 -10
- package/client.d.mts.map +1 -1
- package/client.d.ts +22 -10
- package/client.d.ts.map +1 -1
- package/client.js +14 -2
- package/client.js.map +1 -1
- package/client.mjs +15 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/api-keys.d.mts +16 -2
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +16 -2
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +7 -4
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +7 -4
- package/resources/api-keys.mjs.map +1 -1
- package/resources/escalations.d.mts +1124 -0
- package/resources/escalations.d.mts.map +1 -0
- package/resources/escalations.d.ts +1124 -0
- package/resources/escalations.d.ts.map +1 -0
- package/resources/escalations.js +110 -0
- package/resources/escalations.js.map +1 -0
- package/resources/escalations.mjs +106 -0
- package/resources/escalations.mjs.map +1 -0
- package/resources/index.d.mts +6 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invitations.d.mts +16 -7
- package/resources/invitations.d.mts.map +1 -1
- package/resources/invitations.d.ts +16 -7
- package/resources/invitations.d.ts.map +1 -1
- package/resources/invitations.js +6 -4
- package/resources/invitations.js.map +1 -1
- package/resources/invitations.mjs +6 -4
- package/resources/invitations.mjs.map +1 -1
- package/resources/parties.d.mts +53 -26
- package/resources/parties.d.mts.map +1 -1
- package/resources/parties.d.ts +53 -26
- package/resources/parties.d.ts.map +1 -1
- package/resources/parties.js +27 -1
- package/resources/parties.js.map +1 -1
- package/resources/parties.mjs +27 -1
- package/resources/parties.mjs.map +1 -1
- package/resources/payment-requests.d.mts +738 -33
- package/resources/payment-requests.d.mts.map +1 -1
- package/resources/payment-requests.d.ts +738 -33
- package/resources/payment-requests.d.ts.map +1 -1
- package/resources/payment-requests.js +82 -1
- package/resources/payment-requests.js.map +1 -1
- package/resources/payment-requests.mjs +82 -1
- package/resources/payment-requests.mjs.map +1 -1
- package/resources/payments.d.mts +390 -24
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +390 -24
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +53 -3
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +53 -3
- package/resources/payments.mjs.map +1 -1
- package/resources/transactions.d.mts +50 -118
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +50 -118
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +2 -2
- package/resources/transactions.mjs +2 -2
- package/resources/transfers.d.mts +1030 -0
- package/resources/transfers.d.mts.map +1 -0
- package/resources/transfers.d.ts +1030 -0
- package/resources/transfers.d.ts.map +1 -0
- package/resources/transfers.js +114 -0
- package/resources/transfers.js.map +1 -0
- package/resources/transfers.mjs +110 -0
- package/resources/transfers.mjs.map +1 -0
- package/resources/wallet.d.mts +1 -189
- package/resources/wallet.d.mts.map +1 -1
- package/resources/wallet.d.ts +1 -189
- package/resources/wallet.d.ts.map +1 -1
- package/resources/wallet.js +0 -66
- package/resources/wallet.js.map +1 -1
- package/resources/wallet.mjs +0 -66
- package/resources/wallet.mjs.map +1 -1
- package/resources/webhooks.d.mts +7 -7
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +7 -7
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +87 -11
- package/src/resources/api-keys.ts +26 -4
- package/src/resources/escalations.ts +1422 -0
- package/src/resources/index.ts +39 -5
- package/src/resources/invitations.ts +26 -10
- package/src/resources/parties.ts +85 -30
- package/src/resources/payment-requests.ts +949 -58
- package/src/resources/payments.ts +518 -23
- package/src/resources/transactions.ts +50 -136
- package/src/resources/transfers.ts +1338 -0
- package/src/resources/wallet.ts +0 -268
- package/src/resources/webhooks.ts +7 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -12,7 +12,7 @@ export declare class PaymentRequests extends APIResource {
|
|
|
12
12
|
* ```ts
|
|
13
13
|
* const paymentRequest = await client.paymentRequests.create({
|
|
14
14
|
* amount: 1,
|
|
15
|
-
* payer: {
|
|
15
|
+
* payer: { type: 'type', value: 'dev@stainless.com' },
|
|
16
16
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
17
17
|
* });
|
|
18
18
|
* ```
|
|
@@ -27,6 +27,37 @@ export declare class PaymentRequests extends APIResource {
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
list(params?: PaymentRequestListParams | null | undefined, options?: RequestOptions): APIPromise<PaymentRequestListResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Decline an open payment request where the authenticated party is expected to
|
|
32
|
+
* pay.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const response = await client.paymentRequests.decline(
|
|
37
|
+
* 'prq_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
38
|
+
* { 'Idempotency-Key': 'Idempotency-Key' },
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
decline(paymentRequestID: string, params: PaymentRequestDeclineParams, options?: RequestOptions): APIPromise<PaymentRequestDeclineResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Fulfill an open payment request from inside the authenticated app.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const response = await client.paymentRequests.fulfill(
|
|
49
|
+
* 'prq_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
50
|
+
* {
|
|
51
|
+
* paymentSource: {
|
|
52
|
+
* type: 'type',
|
|
53
|
+
* walletId: 'wal_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
54
|
+
* },
|
|
55
|
+
* 'Idempotency-Key': 'Idempotency-Key',
|
|
56
|
+
* },
|
|
57
|
+
* );
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
fulfill(paymentRequestID: string, params: PaymentRequestFulfillParams, options?: RequestOptions): APIPromise<PaymentRequestFulfillResponse>;
|
|
30
61
|
/**
|
|
31
62
|
* Get a single payment request visible to the authenticated requester party.
|
|
32
63
|
*
|
|
@@ -38,6 +69,16 @@ export declare class PaymentRequests extends APIResource {
|
|
|
38
69
|
* ```
|
|
39
70
|
*/
|
|
40
71
|
get(paymentRequestID: string, params?: PaymentRequestGetParams | null | undefined, options?: RequestOptions): APIPromise<PaymentRequestGetResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* List open payment requests where the authenticated party is expected to pay.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const response =
|
|
78
|
+
* await client.paymentRequests.listIncoming();
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
listIncoming(params?: PaymentRequestListIncomingParams | null | undefined, options?: RequestOptions): APIPromise<PaymentRequestListIncomingResponse>;
|
|
41
82
|
}
|
|
42
83
|
export interface PaymentRequestCreateResponse {
|
|
43
84
|
data: PaymentRequestCreateResponse.Data;
|
|
@@ -52,6 +93,10 @@ export declare namespace PaymentRequestCreateResponse {
|
|
|
52
93
|
* Resource attributes
|
|
53
94
|
*/
|
|
54
95
|
attributes: Data.Attributes;
|
|
96
|
+
/**
|
|
97
|
+
* Resource relationships
|
|
98
|
+
*/
|
|
99
|
+
relationships: Data.Relationships;
|
|
55
100
|
/**
|
|
56
101
|
* Resource type
|
|
57
102
|
*/
|
|
@@ -75,7 +120,7 @@ export declare namespace PaymentRequestCreateResponse {
|
|
|
75
120
|
*/
|
|
76
121
|
currency: string;
|
|
77
122
|
/**
|
|
78
|
-
* Free-form description provided at creation
|
|
123
|
+
* Free-form description provided at creation. Maximum 500 characters.
|
|
79
124
|
*/
|
|
80
125
|
description: string | null;
|
|
81
126
|
/**
|
|
@@ -107,11 +152,11 @@ export declare namespace PaymentRequestCreateResponse {
|
|
|
107
152
|
*/
|
|
108
153
|
paymentLinkUrl: string;
|
|
109
154
|
/**
|
|
110
|
-
* Email of the
|
|
155
|
+
* Email of the party requesting payment
|
|
111
156
|
*/
|
|
112
157
|
requesterEmail: string | null;
|
|
113
158
|
/**
|
|
114
|
-
* Display name of the
|
|
159
|
+
* Display name of the party requesting payment
|
|
115
160
|
*/
|
|
116
161
|
requesterName: string | null;
|
|
117
162
|
/**
|
|
@@ -128,6 +173,63 @@ export declare namespace PaymentRequestCreateResponse {
|
|
|
128
173
|
*/
|
|
129
174
|
updatedAt: string;
|
|
130
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Resource relationships
|
|
178
|
+
*/
|
|
179
|
+
interface Relationships {
|
|
180
|
+
/**
|
|
181
|
+
* Resolved payer party, if the payer is known to Natural
|
|
182
|
+
*/
|
|
183
|
+
payerParty: Relationships.PayerParty;
|
|
184
|
+
/**
|
|
185
|
+
* Party requesting the payment
|
|
186
|
+
*/
|
|
187
|
+
requesterParty: Relationships.RequesterParty;
|
|
188
|
+
}
|
|
189
|
+
namespace Relationships {
|
|
190
|
+
/**
|
|
191
|
+
* Resolved payer party, if the payer is known to Natural
|
|
192
|
+
*/
|
|
193
|
+
interface PayerParty {
|
|
194
|
+
/**
|
|
195
|
+
* Related resource identifier
|
|
196
|
+
*/
|
|
197
|
+
data: PayerParty.Data | null;
|
|
198
|
+
}
|
|
199
|
+
namespace PayerParty {
|
|
200
|
+
/**
|
|
201
|
+
* Related resource identifier
|
|
202
|
+
*/
|
|
203
|
+
interface Data {
|
|
204
|
+
id: string;
|
|
205
|
+
/**
|
|
206
|
+
* Resource type
|
|
207
|
+
*/
|
|
208
|
+
type: string;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Party requesting the payment
|
|
213
|
+
*/
|
|
214
|
+
interface RequesterParty {
|
|
215
|
+
/**
|
|
216
|
+
* Related resource identifier
|
|
217
|
+
*/
|
|
218
|
+
data: RequesterParty.Data;
|
|
219
|
+
}
|
|
220
|
+
namespace RequesterParty {
|
|
221
|
+
/**
|
|
222
|
+
* Related resource identifier
|
|
223
|
+
*/
|
|
224
|
+
interface Data {
|
|
225
|
+
id: string;
|
|
226
|
+
/**
|
|
227
|
+
* Resource type
|
|
228
|
+
*/
|
|
229
|
+
type: string;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
131
233
|
}
|
|
132
234
|
}
|
|
133
235
|
export interface PaymentRequestListResponse {
|
|
@@ -144,6 +246,10 @@ export declare namespace PaymentRequestListResponse {
|
|
|
144
246
|
* Resource attributes
|
|
145
247
|
*/
|
|
146
248
|
attributes: Data.Attributes;
|
|
249
|
+
/**
|
|
250
|
+
* Resource relationships
|
|
251
|
+
*/
|
|
252
|
+
relationships: Data.Relationships;
|
|
147
253
|
/**
|
|
148
254
|
* Resource type
|
|
149
255
|
*/
|
|
@@ -167,7 +273,7 @@ export declare namespace PaymentRequestListResponse {
|
|
|
167
273
|
*/
|
|
168
274
|
currency: string;
|
|
169
275
|
/**
|
|
170
|
-
* Free-form description provided at creation
|
|
276
|
+
* Free-form description provided at creation. Maximum 500 characters.
|
|
171
277
|
*/
|
|
172
278
|
description: string | null;
|
|
173
279
|
/**
|
|
@@ -199,11 +305,11 @@ export declare namespace PaymentRequestListResponse {
|
|
|
199
305
|
*/
|
|
200
306
|
paymentLinkUrl: string;
|
|
201
307
|
/**
|
|
202
|
-
* Email of the
|
|
308
|
+
* Email of the party requesting payment
|
|
203
309
|
*/
|
|
204
310
|
requesterEmail: string | null;
|
|
205
311
|
/**
|
|
206
|
-
* Display name of the
|
|
312
|
+
* Display name of the party requesting payment
|
|
207
313
|
*/
|
|
208
314
|
requesterName: string | null;
|
|
209
315
|
/**
|
|
@@ -220,6 +326,88 @@ export declare namespace PaymentRequestListResponse {
|
|
|
220
326
|
*/
|
|
221
327
|
updatedAt: string;
|
|
222
328
|
}
|
|
329
|
+
/**
|
|
330
|
+
* Resource relationships
|
|
331
|
+
*/
|
|
332
|
+
interface Relationships {
|
|
333
|
+
/**
|
|
334
|
+
* Resolved payer party, if the payer is known to Natural
|
|
335
|
+
*/
|
|
336
|
+
payerParty: Relationships.PayerParty;
|
|
337
|
+
/**
|
|
338
|
+
* Party requesting the payment
|
|
339
|
+
*/
|
|
340
|
+
requesterParty: Relationships.RequesterParty;
|
|
341
|
+
/**
|
|
342
|
+
* Wallet that receives the funds
|
|
343
|
+
*/
|
|
344
|
+
wallet: Relationships.Wallet;
|
|
345
|
+
}
|
|
346
|
+
namespace Relationships {
|
|
347
|
+
/**
|
|
348
|
+
* Resolved payer party, if the payer is known to Natural
|
|
349
|
+
*/
|
|
350
|
+
interface PayerParty {
|
|
351
|
+
/**
|
|
352
|
+
* Related resource identifier
|
|
353
|
+
*/
|
|
354
|
+
data: PayerParty.Data | null;
|
|
355
|
+
}
|
|
356
|
+
namespace PayerParty {
|
|
357
|
+
/**
|
|
358
|
+
* Related resource identifier
|
|
359
|
+
*/
|
|
360
|
+
interface Data {
|
|
361
|
+
id: string;
|
|
362
|
+
/**
|
|
363
|
+
* Resource type
|
|
364
|
+
*/
|
|
365
|
+
type: string;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Party requesting the payment
|
|
370
|
+
*/
|
|
371
|
+
interface RequesterParty {
|
|
372
|
+
/**
|
|
373
|
+
* Related resource identifier
|
|
374
|
+
*/
|
|
375
|
+
data: RequesterParty.Data;
|
|
376
|
+
}
|
|
377
|
+
namespace RequesterParty {
|
|
378
|
+
/**
|
|
379
|
+
* Related resource identifier
|
|
380
|
+
*/
|
|
381
|
+
interface Data {
|
|
382
|
+
id: string;
|
|
383
|
+
/**
|
|
384
|
+
* Resource type
|
|
385
|
+
*/
|
|
386
|
+
type: string;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Wallet that receives the funds
|
|
391
|
+
*/
|
|
392
|
+
interface Wallet {
|
|
393
|
+
/**
|
|
394
|
+
* Related resource identifier
|
|
395
|
+
*/
|
|
396
|
+
data: Wallet.Data;
|
|
397
|
+
}
|
|
398
|
+
namespace Wallet {
|
|
399
|
+
/**
|
|
400
|
+
* Related resource identifier
|
|
401
|
+
*/
|
|
402
|
+
interface Data {
|
|
403
|
+
id: string;
|
|
404
|
+
/**
|
|
405
|
+
* Resource type
|
|
406
|
+
*/
|
|
407
|
+
type: string;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
223
411
|
}
|
|
224
412
|
interface Meta {
|
|
225
413
|
pagination: Meta.Pagination;
|
|
@@ -231,6 +419,198 @@ export declare namespace PaymentRequestListResponse {
|
|
|
231
419
|
}
|
|
232
420
|
}
|
|
233
421
|
}
|
|
422
|
+
export interface PaymentRequestDeclineResponse {
|
|
423
|
+
data: PaymentRequestDeclineResponse.Data;
|
|
424
|
+
}
|
|
425
|
+
export declare namespace PaymentRequestDeclineResponse {
|
|
426
|
+
interface Data {
|
|
427
|
+
/**
|
|
428
|
+
* Resource ID (prq\_\*)
|
|
429
|
+
*/
|
|
430
|
+
id: string;
|
|
431
|
+
/**
|
|
432
|
+
* Resource attributes
|
|
433
|
+
*/
|
|
434
|
+
attributes: Data.Attributes;
|
|
435
|
+
/**
|
|
436
|
+
* Resource relationships
|
|
437
|
+
*/
|
|
438
|
+
relationships: Data.Relationships;
|
|
439
|
+
/**
|
|
440
|
+
* Resource type
|
|
441
|
+
*/
|
|
442
|
+
type: string;
|
|
443
|
+
}
|
|
444
|
+
namespace Data {
|
|
445
|
+
/**
|
|
446
|
+
* Resource attributes
|
|
447
|
+
*/
|
|
448
|
+
interface Attributes {
|
|
449
|
+
/**
|
|
450
|
+
* Amount in cents
|
|
451
|
+
*/
|
|
452
|
+
amount: number;
|
|
453
|
+
/**
|
|
454
|
+
* ISO 8601 timestamp when the payment request was created
|
|
455
|
+
*/
|
|
456
|
+
createdAt: string;
|
|
457
|
+
/**
|
|
458
|
+
* Currency code
|
|
459
|
+
*/
|
|
460
|
+
currency: string;
|
|
461
|
+
/**
|
|
462
|
+
* Free-form description provided at creation. Maximum 500 characters.
|
|
463
|
+
*/
|
|
464
|
+
description: string | null;
|
|
465
|
+
/**
|
|
466
|
+
* Email of the payer if addressed by email
|
|
467
|
+
*/
|
|
468
|
+
payerEmail: string | null;
|
|
469
|
+
/**
|
|
470
|
+
* The identifier value used to address the payer
|
|
471
|
+
*/
|
|
472
|
+
payerIdentifier: string;
|
|
473
|
+
/**
|
|
474
|
+
* Which identifier type was used to address the payer
|
|
475
|
+
*/
|
|
476
|
+
payerIdentifierType: 'email' | 'phone' | 'party_id' | 'agent_id';
|
|
477
|
+
/**
|
|
478
|
+
* Display name of the payer
|
|
479
|
+
*/
|
|
480
|
+
payerName: string | null;
|
|
481
|
+
/**
|
|
482
|
+
* Natural party ID (pty\_\*) resolved for the payer, including agent owner parties
|
|
483
|
+
*/
|
|
484
|
+
payerPartyId: string | null;
|
|
485
|
+
/**
|
|
486
|
+
* Phone of the payer in E.164 format if addressed by phone
|
|
487
|
+
*/
|
|
488
|
+
payerPhone: string | null;
|
|
489
|
+
/**
|
|
490
|
+
* URL the payer visits to complete payment
|
|
491
|
+
*/
|
|
492
|
+
paymentLinkUrl: string;
|
|
493
|
+
/**
|
|
494
|
+
* Email of the party requesting payment
|
|
495
|
+
*/
|
|
496
|
+
requesterEmail: string | null;
|
|
497
|
+
/**
|
|
498
|
+
* Display name of the party requesting payment
|
|
499
|
+
*/
|
|
500
|
+
requesterName: string | null;
|
|
501
|
+
/**
|
|
502
|
+
* Current status of the payment request
|
|
503
|
+
*/
|
|
504
|
+
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
505
|
+
/**
|
|
506
|
+
* ID of the transaction created by the most recent payment attempt, or null if no
|
|
507
|
+
* attempt yet
|
|
508
|
+
*/
|
|
509
|
+
transactionId: string | null;
|
|
510
|
+
/**
|
|
511
|
+
* ISO 8601 timestamp when the payment request was last updated
|
|
512
|
+
*/
|
|
513
|
+
updatedAt: string;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Resource relationships
|
|
517
|
+
*/
|
|
518
|
+
interface Relationships {
|
|
519
|
+
/**
|
|
520
|
+
* Resolved payer party, if the payer is known to Natural
|
|
521
|
+
*/
|
|
522
|
+
payerParty: Relationships.PayerParty;
|
|
523
|
+
/**
|
|
524
|
+
* Party requesting the payment
|
|
525
|
+
*/
|
|
526
|
+
requesterParty: Relationships.RequesterParty;
|
|
527
|
+
/**
|
|
528
|
+
* Wallet that receives the funds
|
|
529
|
+
*/
|
|
530
|
+
wallet: Relationships.Wallet;
|
|
531
|
+
}
|
|
532
|
+
namespace Relationships {
|
|
533
|
+
/**
|
|
534
|
+
* Resolved payer party, if the payer is known to Natural
|
|
535
|
+
*/
|
|
536
|
+
interface PayerParty {
|
|
537
|
+
/**
|
|
538
|
+
* Related resource identifier
|
|
539
|
+
*/
|
|
540
|
+
data: PayerParty.Data | null;
|
|
541
|
+
}
|
|
542
|
+
namespace PayerParty {
|
|
543
|
+
/**
|
|
544
|
+
* Related resource identifier
|
|
545
|
+
*/
|
|
546
|
+
interface Data {
|
|
547
|
+
id: string;
|
|
548
|
+
/**
|
|
549
|
+
* Resource type
|
|
550
|
+
*/
|
|
551
|
+
type: string;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Party requesting the payment
|
|
556
|
+
*/
|
|
557
|
+
interface RequesterParty {
|
|
558
|
+
/**
|
|
559
|
+
* Related resource identifier
|
|
560
|
+
*/
|
|
561
|
+
data: RequesterParty.Data;
|
|
562
|
+
}
|
|
563
|
+
namespace RequesterParty {
|
|
564
|
+
/**
|
|
565
|
+
* Related resource identifier
|
|
566
|
+
*/
|
|
567
|
+
interface Data {
|
|
568
|
+
id: string;
|
|
569
|
+
/**
|
|
570
|
+
* Resource type
|
|
571
|
+
*/
|
|
572
|
+
type: string;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Wallet that receives the funds
|
|
577
|
+
*/
|
|
578
|
+
interface Wallet {
|
|
579
|
+
/**
|
|
580
|
+
* Related resource identifier
|
|
581
|
+
*/
|
|
582
|
+
data: Wallet.Data;
|
|
583
|
+
}
|
|
584
|
+
namespace Wallet {
|
|
585
|
+
/**
|
|
586
|
+
* Related resource identifier
|
|
587
|
+
*/
|
|
588
|
+
interface Data {
|
|
589
|
+
id: string;
|
|
590
|
+
/**
|
|
591
|
+
* Resource type
|
|
592
|
+
*/
|
|
593
|
+
type: string;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
export interface PaymentRequestFulfillResponse {
|
|
600
|
+
data: PaymentRequestFulfillResponse.Data;
|
|
601
|
+
}
|
|
602
|
+
export declare namespace PaymentRequestFulfillResponse {
|
|
603
|
+
interface Data {
|
|
604
|
+
id: string;
|
|
605
|
+
attributes: Data.Attributes;
|
|
606
|
+
type: string;
|
|
607
|
+
}
|
|
608
|
+
namespace Data {
|
|
609
|
+
interface Attributes {
|
|
610
|
+
outcome: 'processing' | 'failed' | 'completed' | 'in_review';
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
234
614
|
export interface PaymentRequestGetResponse {
|
|
235
615
|
data: PaymentRequestGetResponse.Data;
|
|
236
616
|
}
|
|
@@ -244,6 +624,10 @@ export declare namespace PaymentRequestGetResponse {
|
|
|
244
624
|
* Resource attributes
|
|
245
625
|
*/
|
|
246
626
|
attributes: Data.Attributes;
|
|
627
|
+
/**
|
|
628
|
+
* Resource relationships
|
|
629
|
+
*/
|
|
630
|
+
relationships: Data.Relationships;
|
|
247
631
|
/**
|
|
248
632
|
* Resource type
|
|
249
633
|
*/
|
|
@@ -267,7 +651,7 @@ export declare namespace PaymentRequestGetResponse {
|
|
|
267
651
|
*/
|
|
268
652
|
currency: string;
|
|
269
653
|
/**
|
|
270
|
-
* Free-form description provided at creation
|
|
654
|
+
* Free-form description provided at creation. Maximum 500 characters.
|
|
271
655
|
*/
|
|
272
656
|
description: string | null;
|
|
273
657
|
/**
|
|
@@ -299,11 +683,11 @@ export declare namespace PaymentRequestGetResponse {
|
|
|
299
683
|
*/
|
|
300
684
|
paymentLinkUrl: string;
|
|
301
685
|
/**
|
|
302
|
-
* Email of the
|
|
686
|
+
* Email of the party requesting payment
|
|
303
687
|
*/
|
|
304
688
|
requesterEmail: string | null;
|
|
305
689
|
/**
|
|
306
|
-
* Display name of the
|
|
690
|
+
* Display name of the party requesting payment
|
|
307
691
|
*/
|
|
308
692
|
requesterName: string | null;
|
|
309
693
|
/**
|
|
@@ -320,17 +704,287 @@ export declare namespace PaymentRequestGetResponse {
|
|
|
320
704
|
*/
|
|
321
705
|
updatedAt: string;
|
|
322
706
|
}
|
|
707
|
+
/**
|
|
708
|
+
* Resource relationships
|
|
709
|
+
*/
|
|
710
|
+
interface Relationships {
|
|
711
|
+
/**
|
|
712
|
+
* Resolved payer party, if the payer is known to Natural
|
|
713
|
+
*/
|
|
714
|
+
payerParty: Relationships.PayerParty;
|
|
715
|
+
/**
|
|
716
|
+
* Party requesting the payment
|
|
717
|
+
*/
|
|
718
|
+
requesterParty: Relationships.RequesterParty;
|
|
719
|
+
/**
|
|
720
|
+
* Wallet that receives the funds
|
|
721
|
+
*/
|
|
722
|
+
wallet: Relationships.Wallet;
|
|
723
|
+
}
|
|
724
|
+
namespace Relationships {
|
|
725
|
+
/**
|
|
726
|
+
* Resolved payer party, if the payer is known to Natural
|
|
727
|
+
*/
|
|
728
|
+
interface PayerParty {
|
|
729
|
+
/**
|
|
730
|
+
* Related resource identifier
|
|
731
|
+
*/
|
|
732
|
+
data: PayerParty.Data | null;
|
|
733
|
+
}
|
|
734
|
+
namespace PayerParty {
|
|
735
|
+
/**
|
|
736
|
+
* Related resource identifier
|
|
737
|
+
*/
|
|
738
|
+
interface Data {
|
|
739
|
+
id: string;
|
|
740
|
+
/**
|
|
741
|
+
* Resource type
|
|
742
|
+
*/
|
|
743
|
+
type: string;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Party requesting the payment
|
|
748
|
+
*/
|
|
749
|
+
interface RequesterParty {
|
|
750
|
+
/**
|
|
751
|
+
* Related resource identifier
|
|
752
|
+
*/
|
|
753
|
+
data: RequesterParty.Data;
|
|
754
|
+
}
|
|
755
|
+
namespace RequesterParty {
|
|
756
|
+
/**
|
|
757
|
+
* Related resource identifier
|
|
758
|
+
*/
|
|
759
|
+
interface Data {
|
|
760
|
+
id: string;
|
|
761
|
+
/**
|
|
762
|
+
* Resource type
|
|
763
|
+
*/
|
|
764
|
+
type: string;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Wallet that receives the funds
|
|
769
|
+
*/
|
|
770
|
+
interface Wallet {
|
|
771
|
+
/**
|
|
772
|
+
* Related resource identifier
|
|
773
|
+
*/
|
|
774
|
+
data: Wallet.Data;
|
|
775
|
+
}
|
|
776
|
+
namespace Wallet {
|
|
777
|
+
/**
|
|
778
|
+
* Related resource identifier
|
|
779
|
+
*/
|
|
780
|
+
interface Data {
|
|
781
|
+
id: string;
|
|
782
|
+
/**
|
|
783
|
+
* Resource type
|
|
784
|
+
*/
|
|
785
|
+
type: string;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
export interface PaymentRequestListIncomingResponse {
|
|
792
|
+
data: Array<PaymentRequestListIncomingResponse.Data>;
|
|
793
|
+
meta: PaymentRequestListIncomingResponse.Meta;
|
|
794
|
+
}
|
|
795
|
+
export declare namespace PaymentRequestListIncomingResponse {
|
|
796
|
+
interface Data {
|
|
797
|
+
/**
|
|
798
|
+
* Resource ID (prq\_\*)
|
|
799
|
+
*/
|
|
800
|
+
id: string;
|
|
801
|
+
/**
|
|
802
|
+
* Resource attributes
|
|
803
|
+
*/
|
|
804
|
+
attributes: Data.Attributes;
|
|
805
|
+
/**
|
|
806
|
+
* Resource relationships
|
|
807
|
+
*/
|
|
808
|
+
relationships: Data.Relationships;
|
|
809
|
+
/**
|
|
810
|
+
* Resource type
|
|
811
|
+
*/
|
|
812
|
+
type: string;
|
|
813
|
+
}
|
|
814
|
+
namespace Data {
|
|
815
|
+
/**
|
|
816
|
+
* Resource attributes
|
|
817
|
+
*/
|
|
818
|
+
interface Attributes {
|
|
819
|
+
/**
|
|
820
|
+
* Amount in cents
|
|
821
|
+
*/
|
|
822
|
+
amount: number;
|
|
823
|
+
/**
|
|
824
|
+
* ISO 8601 timestamp when the payment request was created
|
|
825
|
+
*/
|
|
826
|
+
createdAt: string;
|
|
827
|
+
/**
|
|
828
|
+
* Currency code
|
|
829
|
+
*/
|
|
830
|
+
currency: string;
|
|
831
|
+
/**
|
|
832
|
+
* Free-form description provided at creation. Maximum 500 characters.
|
|
833
|
+
*/
|
|
834
|
+
description: string | null;
|
|
835
|
+
/**
|
|
836
|
+
* Email of the payer if addressed by email
|
|
837
|
+
*/
|
|
838
|
+
payerEmail: string | null;
|
|
839
|
+
/**
|
|
840
|
+
* The identifier value used to address the payer
|
|
841
|
+
*/
|
|
842
|
+
payerIdentifier: string;
|
|
843
|
+
/**
|
|
844
|
+
* Which identifier type was used to address the payer
|
|
845
|
+
*/
|
|
846
|
+
payerIdentifierType: 'email' | 'phone' | 'party_id' | 'agent_id';
|
|
847
|
+
/**
|
|
848
|
+
* Display name of the payer
|
|
849
|
+
*/
|
|
850
|
+
payerName: string | null;
|
|
851
|
+
/**
|
|
852
|
+
* Natural party ID (pty\_\*) resolved for the payer, including agent owner parties
|
|
853
|
+
*/
|
|
854
|
+
payerPartyId: string | null;
|
|
855
|
+
/**
|
|
856
|
+
* Phone of the payer in E.164 format if addressed by phone
|
|
857
|
+
*/
|
|
858
|
+
payerPhone: string | null;
|
|
859
|
+
/**
|
|
860
|
+
* URL the payer visits to complete payment
|
|
861
|
+
*/
|
|
862
|
+
paymentLinkUrl: string;
|
|
863
|
+
/**
|
|
864
|
+
* Email of the party requesting payment
|
|
865
|
+
*/
|
|
866
|
+
requesterEmail: string | null;
|
|
867
|
+
/**
|
|
868
|
+
* Display name of the party requesting payment
|
|
869
|
+
*/
|
|
870
|
+
requesterName: string | null;
|
|
871
|
+
/**
|
|
872
|
+
* Current status of the payment request
|
|
873
|
+
*/
|
|
874
|
+
status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
|
|
875
|
+
/**
|
|
876
|
+
* ID of the transaction created by the most recent payment attempt, or null if no
|
|
877
|
+
* attempt yet
|
|
878
|
+
*/
|
|
879
|
+
transactionId: string | null;
|
|
880
|
+
/**
|
|
881
|
+
* ISO 8601 timestamp when the payment request was last updated
|
|
882
|
+
*/
|
|
883
|
+
updatedAt: string;
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* Resource relationships
|
|
887
|
+
*/
|
|
888
|
+
interface Relationships {
|
|
889
|
+
/**
|
|
890
|
+
* Resolved payer party, if the payer is known to Natural
|
|
891
|
+
*/
|
|
892
|
+
payerParty: Relationships.PayerParty;
|
|
893
|
+
/**
|
|
894
|
+
* Party requesting the payment
|
|
895
|
+
*/
|
|
896
|
+
requesterParty: Relationships.RequesterParty;
|
|
897
|
+
/**
|
|
898
|
+
* Wallet that receives the funds
|
|
899
|
+
*/
|
|
900
|
+
wallet: Relationships.Wallet;
|
|
901
|
+
}
|
|
902
|
+
namespace Relationships {
|
|
903
|
+
/**
|
|
904
|
+
* Resolved payer party, if the payer is known to Natural
|
|
905
|
+
*/
|
|
906
|
+
interface PayerParty {
|
|
907
|
+
/**
|
|
908
|
+
* Related resource identifier
|
|
909
|
+
*/
|
|
910
|
+
data: PayerParty.Data | null;
|
|
911
|
+
}
|
|
912
|
+
namespace PayerParty {
|
|
913
|
+
/**
|
|
914
|
+
* Related resource identifier
|
|
915
|
+
*/
|
|
916
|
+
interface Data {
|
|
917
|
+
id: string;
|
|
918
|
+
/**
|
|
919
|
+
* Resource type
|
|
920
|
+
*/
|
|
921
|
+
type: string;
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
/**
|
|
925
|
+
* Party requesting the payment
|
|
926
|
+
*/
|
|
927
|
+
interface RequesterParty {
|
|
928
|
+
/**
|
|
929
|
+
* Related resource identifier
|
|
930
|
+
*/
|
|
931
|
+
data: RequesterParty.Data;
|
|
932
|
+
}
|
|
933
|
+
namespace RequesterParty {
|
|
934
|
+
/**
|
|
935
|
+
* Related resource identifier
|
|
936
|
+
*/
|
|
937
|
+
interface Data {
|
|
938
|
+
id: string;
|
|
939
|
+
/**
|
|
940
|
+
* Resource type
|
|
941
|
+
*/
|
|
942
|
+
type: string;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* Wallet that receives the funds
|
|
947
|
+
*/
|
|
948
|
+
interface Wallet {
|
|
949
|
+
/**
|
|
950
|
+
* Related resource identifier
|
|
951
|
+
*/
|
|
952
|
+
data: Wallet.Data;
|
|
953
|
+
}
|
|
954
|
+
namespace Wallet {
|
|
955
|
+
/**
|
|
956
|
+
* Related resource identifier
|
|
957
|
+
*/
|
|
958
|
+
interface Data {
|
|
959
|
+
id: string;
|
|
960
|
+
/**
|
|
961
|
+
* Resource type
|
|
962
|
+
*/
|
|
963
|
+
type: string;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
interface Meta {
|
|
969
|
+
pagination: Meta.Pagination;
|
|
970
|
+
}
|
|
971
|
+
namespace Meta {
|
|
972
|
+
interface Pagination {
|
|
973
|
+
hasMore: boolean;
|
|
974
|
+
nextCursor: string | null;
|
|
975
|
+
}
|
|
323
976
|
}
|
|
324
977
|
}
|
|
325
978
|
export interface PaymentRequestCreateParams {
|
|
326
979
|
/**
|
|
327
|
-
* Body param: Amount in cents
|
|
980
|
+
* Body param: Amount in minor units (cents for USD)
|
|
328
981
|
*/
|
|
329
982
|
amount: number;
|
|
330
983
|
/**
|
|
331
|
-
* Body param: Who pays — exactly one
|
|
984
|
+
* Body param: Who pays — exactly one typed email, phone, party ID, or agent ID
|
|
985
|
+
* value.
|
|
332
986
|
*/
|
|
333
|
-
payer: PaymentRequestCreateParams.UnionMember0 | PaymentRequestCreateParams.UnionMember1
|
|
987
|
+
payer: PaymentRequestCreateParams.UnionMember0 | PaymentRequestCreateParams.UnionMember1;
|
|
334
988
|
/**
|
|
335
989
|
* Header param: Unique key for idempotent request handling. If a request with the
|
|
336
990
|
* same key was already processed, the original response is returned.
|
|
@@ -346,7 +1000,7 @@ export interface PaymentRequestCreateParams {
|
|
|
346
1000
|
*/
|
|
347
1001
|
customerPartyId?: string;
|
|
348
1002
|
/**
|
|
349
|
-
* Body param: Free-form description shown to the payer
|
|
1003
|
+
* Body param: Free-form description shown to the payer. Maximum 500 characters.
|
|
350
1004
|
*/
|
|
351
1005
|
description?: string;
|
|
352
1006
|
/**
|
|
@@ -375,30 +1029,16 @@ export interface PaymentRequestCreateParams {
|
|
|
375
1029
|
}
|
|
376
1030
|
export declare namespace PaymentRequestCreateParams {
|
|
377
1031
|
interface UnionMember0 {
|
|
378
|
-
|
|
1032
|
+
type: string;
|
|
379
1033
|
/**
|
|
380
|
-
*
|
|
1034
|
+
* Email address
|
|
381
1035
|
*/
|
|
382
1036
|
value: string;
|
|
383
1037
|
}
|
|
384
1038
|
interface UnionMember1 {
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Payer phone in E.164 format
|
|
388
|
-
*/
|
|
389
|
-
value: string;
|
|
390
|
-
}
|
|
391
|
-
interface UnionMember2 {
|
|
392
|
-
kind: 'party_id';
|
|
393
|
-
/**
|
|
394
|
-
* Natural party ID (pty\_\*) of the payer
|
|
395
|
-
*/
|
|
396
|
-
value: string;
|
|
397
|
-
}
|
|
398
|
-
interface UnionMember3 {
|
|
399
|
-
kind: 'agent_id';
|
|
1039
|
+
type: string;
|
|
400
1040
|
/**
|
|
401
|
-
*
|
|
1041
|
+
* Phone number in E.164 format
|
|
402
1042
|
*/
|
|
403
1043
|
value: string;
|
|
404
1044
|
}
|
|
@@ -432,6 +1072,52 @@ export interface PaymentRequestListParams {
|
|
|
432
1072
|
*/
|
|
433
1073
|
'X-Instance-ID'?: string;
|
|
434
1074
|
}
|
|
1075
|
+
export interface PaymentRequestDeclineParams {
|
|
1076
|
+
/**
|
|
1077
|
+
* Unique key for idempotent request handling. If a request with the same key was
|
|
1078
|
+
* already processed, the original response is returned.
|
|
1079
|
+
*/
|
|
1080
|
+
'Idempotency-Key': string;
|
|
1081
|
+
/**
|
|
1082
|
+
* Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1083
|
+
*/
|
|
1084
|
+
'X-Agent-ID'?: string;
|
|
1085
|
+
/**
|
|
1086
|
+
* Required when X-Agent-ID is present. Session or conversation ID for agent
|
|
1087
|
+
* observability.
|
|
1088
|
+
*/
|
|
1089
|
+
'X-Instance-ID'?: string;
|
|
1090
|
+
}
|
|
1091
|
+
export interface PaymentRequestFulfillParams {
|
|
1092
|
+
/**
|
|
1093
|
+
* Body param
|
|
1094
|
+
*/
|
|
1095
|
+
paymentSource: PaymentRequestFulfillParams.UnionMember0 | PaymentRequestFulfillParams.UnionMember1;
|
|
1096
|
+
/**
|
|
1097
|
+
* Header param: Unique key for idempotent request handling. If a request with the
|
|
1098
|
+
* same key was already processed, the original response is returned.
|
|
1099
|
+
*/
|
|
1100
|
+
'Idempotency-Key': string;
|
|
1101
|
+
/**
|
|
1102
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1103
|
+
*/
|
|
1104
|
+
'X-Agent-ID'?: string;
|
|
1105
|
+
/**
|
|
1106
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
1107
|
+
* for agent observability.
|
|
1108
|
+
*/
|
|
1109
|
+
'X-Instance-ID'?: string;
|
|
1110
|
+
}
|
|
1111
|
+
export declare namespace PaymentRequestFulfillParams {
|
|
1112
|
+
interface UnionMember0 {
|
|
1113
|
+
type: string;
|
|
1114
|
+
walletId: string;
|
|
1115
|
+
}
|
|
1116
|
+
interface UnionMember1 {
|
|
1117
|
+
externalAccountId: string;
|
|
1118
|
+
type: string;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
435
1121
|
export interface PaymentRequestGetParams {
|
|
436
1122
|
/**
|
|
437
1123
|
* Agent ID (agt_xxx) identifying which agent is making the request.
|
|
@@ -443,7 +1129,26 @@ export interface PaymentRequestGetParams {
|
|
|
443
1129
|
*/
|
|
444
1130
|
'X-Instance-ID'?: string;
|
|
445
1131
|
}
|
|
1132
|
+
export interface PaymentRequestListIncomingParams {
|
|
1133
|
+
/**
|
|
1134
|
+
* Query param: Pagination cursor returned by the previous response
|
|
1135
|
+
*/
|
|
1136
|
+
cursor?: string;
|
|
1137
|
+
/**
|
|
1138
|
+
* Query param: Results per page (1-100)
|
|
1139
|
+
*/
|
|
1140
|
+
limit?: number;
|
|
1141
|
+
/**
|
|
1142
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1143
|
+
*/
|
|
1144
|
+
'X-Agent-ID'?: string;
|
|
1145
|
+
/**
|
|
1146
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
1147
|
+
* for agent observability.
|
|
1148
|
+
*/
|
|
1149
|
+
'X-Instance-ID'?: string;
|
|
1150
|
+
}
|
|
446
1151
|
export declare namespace PaymentRequests {
|
|
447
|
-
export { type PaymentRequestCreateResponse as PaymentRequestCreateResponse, type PaymentRequestListResponse as PaymentRequestListResponse, type PaymentRequestGetResponse as PaymentRequestGetResponse, type PaymentRequestCreateParams as PaymentRequestCreateParams, type PaymentRequestListParams as PaymentRequestListParams, type PaymentRequestGetParams as PaymentRequestGetParams, };
|
|
1152
|
+
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, };
|
|
448
1153
|
}
|
|
449
1154
|
//# sourceMappingURL=payment-requests.d.mts.map
|