@naturalpay/sdk 0.8.0 → 0.10.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 (104) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +19 -0
  3. package/client.d.mts +2 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/agents.d.mts +33 -26
  11. package/resources/agents.d.mts.map +1 -1
  12. package/resources/agents.d.ts +33 -26
  13. package/resources/agents.d.ts.map +1 -1
  14. package/resources/agents.js +1 -1
  15. package/resources/agents.mjs +1 -1
  16. package/resources/api-keys.d.mts +16 -16
  17. package/resources/api-keys.d.mts.map +1 -1
  18. package/resources/api-keys.d.ts +16 -16
  19. package/resources/api-keys.d.ts.map +1 -1
  20. package/resources/approvals.d.mts +16 -16
  21. package/resources/approvals.d.mts.map +1 -1
  22. package/resources/approvals.d.ts +16 -16
  23. package/resources/approvals.d.ts.map +1 -1
  24. package/resources/counterparties.d.mts +1 -1
  25. package/resources/counterparties.d.mts.map +1 -1
  26. package/resources/counterparties.d.ts +1 -1
  27. package/resources/counterparties.d.ts.map +1 -1
  28. package/resources/customers.d.mts +6 -6
  29. package/resources/customers.d.mts.map +1 -1
  30. package/resources/customers.d.ts +6 -6
  31. package/resources/customers.d.ts.map +1 -1
  32. package/resources/external-accounts.d.mts +4 -4
  33. package/resources/external-accounts.d.mts.map +1 -1
  34. package/resources/external-accounts.d.ts +4 -4
  35. package/resources/external-accounts.d.ts.map +1 -1
  36. package/resources/index.d.mts +1 -1
  37. package/resources/index.d.mts.map +1 -1
  38. package/resources/index.d.ts +1 -1
  39. package/resources/index.d.ts.map +1 -1
  40. package/resources/index.js.map +1 -1
  41. package/resources/index.mjs.map +1 -1
  42. package/resources/invitations.d.mts +3 -3
  43. package/resources/invitations.d.mts.map +1 -1
  44. package/resources/invitations.d.ts +3 -3
  45. package/resources/invitations.d.ts.map +1 -1
  46. package/resources/parties.d.mts +4 -4
  47. package/resources/parties.d.mts.map +1 -1
  48. package/resources/parties.d.ts +4 -4
  49. package/resources/parties.d.ts.map +1 -1
  50. package/resources/payment-requests.d.mts +315 -34
  51. package/resources/payment-requests.d.mts.map +1 -1
  52. package/resources/payment-requests.d.ts +315 -34
  53. package/resources/payment-requests.d.ts.map +1 -1
  54. package/resources/payment-requests.js +3 -3
  55. package/resources/payment-requests.mjs +3 -3
  56. package/resources/payments.d.mts +400 -20
  57. package/resources/payments.d.mts.map +1 -1
  58. package/resources/payments.d.ts +400 -20
  59. package/resources/payments.d.ts.map +1 -1
  60. package/resources/payments.js +26 -1
  61. package/resources/payments.js.map +1 -1
  62. package/resources/payments.mjs +26 -1
  63. package/resources/payments.mjs.map +1 -1
  64. package/resources/transactions.d.mts +10 -10
  65. package/resources/transactions.d.mts.map +1 -1
  66. package/resources/transactions.d.ts +10 -10
  67. package/resources/transactions.d.ts.map +1 -1
  68. package/resources/transfers.d.mts +20 -20
  69. package/resources/transfers.d.mts.map +1 -1
  70. package/resources/transfers.d.ts +20 -20
  71. package/resources/transfers.d.ts.map +1 -1
  72. package/resources/wallet.d.mts +4 -4
  73. package/resources/wallet.d.mts.map +1 -1
  74. package/resources/wallet.d.ts +4 -4
  75. package/resources/wallet.d.ts.map +1 -1
  76. package/resources/webhooks.d.mts +12 -12
  77. package/resources/webhooks.d.mts.map +1 -1
  78. package/resources/webhooks.d.ts +12 -12
  79. package/resources/webhooks.d.ts.map +1 -1
  80. package/src/client.ts +4 -0
  81. package/src/resources/agents.ts +39 -26
  82. package/src/resources/api-keys.ts +16 -16
  83. package/src/resources/approvals.ts +16 -16
  84. package/src/resources/counterparties.ts +1 -1
  85. package/src/resources/customers.ts +6 -6
  86. package/src/resources/external-accounts.ts +4 -4
  87. package/src/resources/index.ts +2 -0
  88. package/src/resources/invitations.ts +3 -3
  89. package/src/resources/parties.ts +4 -4
  90. package/src/resources/payment-requests.ts +414 -34
  91. package/src/resources/payments.ts +498 -16
  92. package/src/resources/transactions.ts +10 -10
  93. package/src/resources/transfers.ts +20 -20
  94. package/src/resources/wallet.ts +4 -4
  95. package/src/resources/webhooks.ts +12 -12
  96. package/src/version.ts +1 -1
  97. package/version.d.mts +1 -1
  98. package/version.d.mts.map +1 -1
  99. package/version.d.ts +1 -1
  100. package/version.d.ts.map +1 -1
  101. package/version.js +1 -1
  102. package/version.js.map +1 -1
  103. package/version.mjs +1 -1
  104. package/version.mjs.map +1 -1
@@ -18,7 +18,7 @@ export class Payments extends APIResource {
18
18
  * const payment = await client.payments.create({
19
19
  * amount: 1,
20
20
  * counterparty: {
21
- * type: 'type',
21
+ * type: 'email',
22
22
  * value: 'dev@stainless.com',
23
23
  * },
24
24
  * 'Idempotency-Key': 'Idempotency-Key',
@@ -72,6 +72,40 @@ export class Payments extends APIResource {
72
72
  });
73
73
  }
74
74
 
75
+ /**
76
+ * Cancel a pending-claim payment before the recipient starts claiming it.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const response = await client.payments.cancel(
81
+ * 'pay_ecc2efdd09bd231a9ad9bd2aada37aa7',
82
+ * { 'Idempotency-Key': 'Idempotency-Key' },
83
+ * );
84
+ * ```
85
+ */
86
+ cancel(
87
+ paymentID: string,
88
+ params: PaymentCancelParams,
89
+ options?: RequestOptions,
90
+ ): APIPromise<PaymentCancelResponse> {
91
+ const {
92
+ 'Idempotency-Key': idempotencyKey,
93
+ 'X-Agent-ID': xAgentID,
94
+ 'X-Instance-ID': xInstanceID,
95
+ } = params;
96
+ return this._client.post(path`/payments/${paymentID}/cancel`, {
97
+ ...options,
98
+ headers: buildHeaders([
99
+ {
100
+ 'Idempotency-Key': idempotencyKey,
101
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
102
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
103
+ },
104
+ options?.headers,
105
+ ]),
106
+ });
107
+ }
108
+
75
109
  /**
76
110
  * Get a payment initiated by the authenticated party.
77
111
  *
@@ -120,7 +154,7 @@ export namespace PaymentCreateResponse {
120
154
  */
121
155
  relationships: Data.Relationships;
122
156
 
123
- type: string;
157
+ type: 'payment';
124
158
  }
125
159
 
126
160
  export namespace Data {
@@ -158,6 +192,7 @@ export namespace PaymentCreateResponse {
158
192
  | 'IN_REVIEW'
159
193
  | 'COMPLETED'
160
194
  | 'FAILED'
195
+ | 'RETURNED'
161
196
  | 'APPROVAL_DENIED'
162
197
  | 'CANCELLED';
163
198
 
@@ -171,11 +206,22 @@ export namespace PaymentCreateResponse {
171
206
  * Resource relationships
172
207
  */
173
208
  export interface Relationships {
209
+ /**
210
+ * Payment request that produced this payment, when applicable.
211
+ */
212
+ paymentRequest: Relationships.PaymentRequest;
213
+
174
214
  /**
175
215
  * Recipient party for this payment, when known.
176
216
  */
177
217
  recipient: Relationships.Recipient;
178
218
 
219
+ /**
220
+ * Recipient agent when the caller addressed an agent ID. Null otherwise, including
221
+ * when the recipient was addressed as an email, phone, or party ID.
222
+ */
223
+ recipientAgent: Relationships.RecipientAgent;
224
+
179
225
  /**
180
226
  * Party that initiated the payment
181
227
  */
@@ -188,6 +234,30 @@ export namespace PaymentCreateResponse {
188
234
  }
189
235
 
190
236
  export namespace Relationships {
237
+ /**
238
+ * Payment request that produced this payment, when applicable.
239
+ */
240
+ export interface PaymentRequest {
241
+ /**
242
+ * Related resource identifier
243
+ */
244
+ data: PaymentRequest.Data | null;
245
+ }
246
+
247
+ export namespace PaymentRequest {
248
+ /**
249
+ * Related resource identifier
250
+ */
251
+ export interface Data {
252
+ id: string;
253
+
254
+ /**
255
+ * Resource type
256
+ */
257
+ type: 'paymentRequest';
258
+ }
259
+ }
260
+
191
261
  /**
192
262
  * Recipient party for this payment, when known.
193
263
  */
@@ -208,7 +278,32 @@ export namespace PaymentCreateResponse {
208
278
  /**
209
279
  * Resource type
210
280
  */
211
- type: string;
281
+ type: 'party';
282
+ }
283
+ }
284
+
285
+ /**
286
+ * Recipient agent when the caller addressed an agent ID. Null otherwise, including
287
+ * when the recipient was addressed as an email, phone, or party ID.
288
+ */
289
+ export interface RecipientAgent {
290
+ /**
291
+ * Related resource identifier
292
+ */
293
+ data: RecipientAgent.Data | null;
294
+ }
295
+
296
+ export namespace RecipientAgent {
297
+ /**
298
+ * Related resource identifier
299
+ */
300
+ export interface Data {
301
+ id: string;
302
+
303
+ /**
304
+ * Resource type
305
+ */
306
+ type: 'agent';
212
307
  }
213
308
  }
214
309
 
@@ -232,7 +327,7 @@ export namespace PaymentCreateResponse {
232
327
  /**
233
328
  * Resource type
234
329
  */
235
- type: string;
330
+ type: 'party';
236
331
  }
237
332
  }
238
333
 
@@ -256,7 +351,7 @@ export namespace PaymentCreateResponse {
256
351
  /**
257
352
  * Resource type
258
353
  */
259
- type: string;
354
+ type: 'transaction';
260
355
  }
261
356
  }
262
357
  }
@@ -283,7 +378,7 @@ export namespace PaymentListResponse {
283
378
  */
284
379
  relationships: Data.Relationships;
285
380
 
286
- type: string;
381
+ type: 'payment';
287
382
  }
288
383
 
289
384
  export namespace Data {
@@ -321,6 +416,7 @@ export namespace PaymentListResponse {
321
416
  | 'IN_REVIEW'
322
417
  | 'COMPLETED'
323
418
  | 'FAILED'
419
+ | 'RETURNED'
324
420
  | 'APPROVAL_DENIED'
325
421
  | 'CANCELLED';
326
422
 
@@ -334,11 +430,22 @@ export namespace PaymentListResponse {
334
430
  * Resource relationships
335
431
  */
336
432
  export interface Relationships {
433
+ /**
434
+ * Payment request that produced this payment, when applicable.
435
+ */
436
+ paymentRequest: Relationships.PaymentRequest;
437
+
337
438
  /**
338
439
  * Recipient party for this payment, when known.
339
440
  */
340
441
  recipient: Relationships.Recipient;
341
442
 
443
+ /**
444
+ * Recipient agent when the caller addressed an agent ID. Null otherwise, including
445
+ * when the recipient was addressed as an email, phone, or party ID.
446
+ */
447
+ recipientAgent: Relationships.RecipientAgent;
448
+
342
449
  /**
343
450
  * Party that initiated the payment
344
451
  */
@@ -351,6 +458,30 @@ export namespace PaymentListResponse {
351
458
  }
352
459
 
353
460
  export namespace Relationships {
461
+ /**
462
+ * Payment request that produced this payment, when applicable.
463
+ */
464
+ export interface PaymentRequest {
465
+ /**
466
+ * Related resource identifier
467
+ */
468
+ data: PaymentRequest.Data | null;
469
+ }
470
+
471
+ export namespace PaymentRequest {
472
+ /**
473
+ * Related resource identifier
474
+ */
475
+ export interface Data {
476
+ id: string;
477
+
478
+ /**
479
+ * Resource type
480
+ */
481
+ type: 'paymentRequest';
482
+ }
483
+ }
484
+
354
485
  /**
355
486
  * Recipient party for this payment, when known.
356
487
  */
@@ -371,7 +502,32 @@ export namespace PaymentListResponse {
371
502
  /**
372
503
  * Resource type
373
504
  */
374
- type: string;
505
+ type: 'party';
506
+ }
507
+ }
508
+
509
+ /**
510
+ * Recipient agent when the caller addressed an agent ID. Null otherwise, including
511
+ * when the recipient was addressed as an email, phone, or party ID.
512
+ */
513
+ export interface RecipientAgent {
514
+ /**
515
+ * Related resource identifier
516
+ */
517
+ data: RecipientAgent.Data | null;
518
+ }
519
+
520
+ export namespace RecipientAgent {
521
+ /**
522
+ * Related resource identifier
523
+ */
524
+ export interface Data {
525
+ id: string;
526
+
527
+ /**
528
+ * Resource type
529
+ */
530
+ type: 'agent';
375
531
  }
376
532
  }
377
533
 
@@ -395,7 +551,7 @@ export namespace PaymentListResponse {
395
551
  /**
396
552
  * Resource type
397
553
  */
398
- type: string;
554
+ type: 'party';
399
555
  }
400
556
  }
401
557
 
@@ -419,7 +575,7 @@ export namespace PaymentListResponse {
419
575
  /**
420
576
  * Resource type
421
577
  */
422
- type: string;
578
+ type: 'transaction';
423
579
  }
424
580
  }
425
581
  }
@@ -438,6 +594,228 @@ export namespace PaymentListResponse {
438
594
  }
439
595
  }
440
596
 
597
+ export interface PaymentCancelResponse {
598
+ data: PaymentCancelResponse.Data;
599
+ }
600
+
601
+ export namespace PaymentCancelResponse {
602
+ export interface Data {
603
+ id: string;
604
+
605
+ /**
606
+ * Resource attributes
607
+ */
608
+ attributes: Data.Attributes;
609
+
610
+ /**
611
+ * Resource relationships
612
+ */
613
+ relationships: Data.Relationships;
614
+
615
+ type: 'payment';
616
+ }
617
+
618
+ export namespace Data {
619
+ /**
620
+ * Resource attributes
621
+ */
622
+ export interface Attributes {
623
+ /**
624
+ * Amount in cents
625
+ */
626
+ amount: number;
627
+
628
+ /**
629
+ * When this payment was created
630
+ */
631
+ createdAt: string;
632
+
633
+ /**
634
+ * Currency code
635
+ */
636
+ currency: string;
637
+
638
+ /**
639
+ * Payment description
640
+ */
641
+ description: string | null;
642
+
643
+ /**
644
+ * Payment status
645
+ */
646
+ status:
647
+ | 'CREATED'
648
+ | 'PROCESSING'
649
+ | 'PENDING_CLAIM'
650
+ | 'IN_REVIEW'
651
+ | 'COMPLETED'
652
+ | 'FAILED'
653
+ | 'RETURNED'
654
+ | 'APPROVAL_DENIED'
655
+ | 'CANCELLED';
656
+
657
+ /**
658
+ * When this payment was last updated
659
+ */
660
+ updatedAt: string | null;
661
+ }
662
+
663
+ /**
664
+ * Resource relationships
665
+ */
666
+ export interface Relationships {
667
+ /**
668
+ * Payment request that produced this payment, when applicable.
669
+ */
670
+ paymentRequest: Relationships.PaymentRequest;
671
+
672
+ /**
673
+ * Recipient party for this payment, when known.
674
+ */
675
+ recipient: Relationships.Recipient;
676
+
677
+ /**
678
+ * Recipient agent when the caller addressed an agent ID. Null otherwise, including
679
+ * when the recipient was addressed as an email, phone, or party ID.
680
+ */
681
+ recipientAgent: Relationships.RecipientAgent;
682
+
683
+ /**
684
+ * Party that initiated the payment
685
+ */
686
+ sender: Relationships.Sender;
687
+
688
+ /**
689
+ * Sender-side transaction row for this payment, when available.
690
+ */
691
+ transaction: Relationships.Transaction;
692
+ }
693
+
694
+ export namespace Relationships {
695
+ /**
696
+ * Payment request that produced this payment, when applicable.
697
+ */
698
+ export interface PaymentRequest {
699
+ /**
700
+ * Related resource identifier
701
+ */
702
+ data: PaymentRequest.Data | null;
703
+ }
704
+
705
+ export namespace PaymentRequest {
706
+ /**
707
+ * Related resource identifier
708
+ */
709
+ export interface Data {
710
+ id: string;
711
+
712
+ /**
713
+ * Resource type
714
+ */
715
+ type: 'paymentRequest';
716
+ }
717
+ }
718
+
719
+ /**
720
+ * Recipient party for this payment, when known.
721
+ */
722
+ export interface Recipient {
723
+ /**
724
+ * Related resource identifier
725
+ */
726
+ data: Recipient.Data | null;
727
+ }
728
+
729
+ export namespace Recipient {
730
+ /**
731
+ * Related resource identifier
732
+ */
733
+ export interface Data {
734
+ id: string;
735
+
736
+ /**
737
+ * Resource type
738
+ */
739
+ type: 'party';
740
+ }
741
+ }
742
+
743
+ /**
744
+ * Recipient agent when the caller addressed an agent ID. Null otherwise, including
745
+ * when the recipient was addressed as an email, phone, or party ID.
746
+ */
747
+ export interface RecipientAgent {
748
+ /**
749
+ * Related resource identifier
750
+ */
751
+ data: RecipientAgent.Data | null;
752
+ }
753
+
754
+ export namespace RecipientAgent {
755
+ /**
756
+ * Related resource identifier
757
+ */
758
+ export interface Data {
759
+ id: string;
760
+
761
+ /**
762
+ * Resource type
763
+ */
764
+ type: 'agent';
765
+ }
766
+ }
767
+
768
+ /**
769
+ * Party that initiated the payment
770
+ */
771
+ export interface Sender {
772
+ /**
773
+ * Related resource identifier
774
+ */
775
+ data: Sender.Data;
776
+ }
777
+
778
+ export namespace Sender {
779
+ /**
780
+ * Related resource identifier
781
+ */
782
+ export interface Data {
783
+ id: string;
784
+
785
+ /**
786
+ * Resource type
787
+ */
788
+ type: 'party';
789
+ }
790
+ }
791
+
792
+ /**
793
+ * Sender-side transaction row for this payment, when available.
794
+ */
795
+ export interface Transaction {
796
+ /**
797
+ * Related resource identifier
798
+ */
799
+ data: Transaction.Data | null;
800
+ }
801
+
802
+ export namespace Transaction {
803
+ /**
804
+ * Related resource identifier
805
+ */
806
+ export interface Data {
807
+ id: string;
808
+
809
+ /**
810
+ * Resource type
811
+ */
812
+ type: 'transaction';
813
+ }
814
+ }
815
+ }
816
+ }
817
+ }
818
+
441
819
  export interface PaymentGetResponse {
442
820
  data: PaymentGetResponse.Data;
443
821
  }
@@ -456,7 +834,7 @@ export namespace PaymentGetResponse {
456
834
  */
457
835
  relationships: Data.Relationships;
458
836
 
459
- type: string;
837
+ type: 'payment';
460
838
  }
461
839
 
462
840
  export namespace Data {
@@ -494,6 +872,7 @@ export namespace PaymentGetResponse {
494
872
  | 'IN_REVIEW'
495
873
  | 'COMPLETED'
496
874
  | 'FAILED'
875
+ | 'RETURNED'
497
876
  | 'APPROVAL_DENIED'
498
877
  | 'CANCELLED';
499
878
 
@@ -507,11 +886,22 @@ export namespace PaymentGetResponse {
507
886
  * Resource relationships
508
887
  */
509
888
  export interface Relationships {
889
+ /**
890
+ * Payment request that produced this payment, when applicable.
891
+ */
892
+ paymentRequest: Relationships.PaymentRequest;
893
+
510
894
  /**
511
895
  * Recipient party for this payment, when known.
512
896
  */
513
897
  recipient: Relationships.Recipient;
514
898
 
899
+ /**
900
+ * Recipient agent when the caller addressed an agent ID. Null otherwise, including
901
+ * when the recipient was addressed as an email, phone, or party ID.
902
+ */
903
+ recipientAgent: Relationships.RecipientAgent;
904
+
515
905
  /**
516
906
  * Party that initiated the payment
517
907
  */
@@ -524,6 +914,30 @@ export namespace PaymentGetResponse {
524
914
  }
525
915
 
526
916
  export namespace Relationships {
917
+ /**
918
+ * Payment request that produced this payment, when applicable.
919
+ */
920
+ export interface PaymentRequest {
921
+ /**
922
+ * Related resource identifier
923
+ */
924
+ data: PaymentRequest.Data | null;
925
+ }
926
+
927
+ export namespace PaymentRequest {
928
+ /**
929
+ * Related resource identifier
930
+ */
931
+ export interface Data {
932
+ id: string;
933
+
934
+ /**
935
+ * Resource type
936
+ */
937
+ type: 'paymentRequest';
938
+ }
939
+ }
940
+
527
941
  /**
528
942
  * Recipient party for this payment, when known.
529
943
  */
@@ -544,7 +958,32 @@ export namespace PaymentGetResponse {
544
958
  /**
545
959
  * Resource type
546
960
  */
547
- type: string;
961
+ type: 'party';
962
+ }
963
+ }
964
+
965
+ /**
966
+ * Recipient agent when the caller addressed an agent ID. Null otherwise, including
967
+ * when the recipient was addressed as an email, phone, or party ID.
968
+ */
969
+ export interface RecipientAgent {
970
+ /**
971
+ * Related resource identifier
972
+ */
973
+ data: RecipientAgent.Data | null;
974
+ }
975
+
976
+ export namespace RecipientAgent {
977
+ /**
978
+ * Related resource identifier
979
+ */
980
+ export interface Data {
981
+ id: string;
982
+
983
+ /**
984
+ * Resource type
985
+ */
986
+ type: 'agent';
548
987
  }
549
988
  }
550
989
 
@@ -568,7 +1007,7 @@ export namespace PaymentGetResponse {
568
1007
  /**
569
1008
  * Resource type
570
1009
  */
571
- type: string;
1010
+ type: 'party';
572
1011
  }
573
1012
  }
574
1013
 
@@ -592,7 +1031,7 @@ export namespace PaymentGetResponse {
592
1031
  /**
593
1032
  * Resource type
594
1033
  */
595
- type: string;
1034
+ type: 'transaction';
596
1035
  }
597
1036
  }
598
1037
  }
@@ -609,7 +1048,11 @@ export interface PaymentCreateParams {
609
1048
  * Body param: Recipient identifier. Provide exactly one typed email, phone, party
610
1049
  * ID, or agent ID value.
611
1050
  */
612
- counterparty: PaymentCreateParams.UnionMember0 | PaymentCreateParams.UnionMember1;
1051
+ counterparty:
1052
+ | PaymentCreateParams.UnionMember0
1053
+ | PaymentCreateParams.UnionMember1
1054
+ | PaymentCreateParams.UnionMember2
1055
+ | PaymentCreateParams.UnionMember3;
613
1056
 
614
1057
  /**
615
1058
  * Header param: Unique key for idempotent request handling. If a request with the
@@ -647,7 +1090,7 @@ export interface PaymentCreateParams {
647
1090
 
648
1091
  export namespace PaymentCreateParams {
649
1092
  export interface UnionMember0 {
650
- type: string;
1093
+ type: 'email';
651
1094
 
652
1095
  /**
653
1096
  * Email address
@@ -656,13 +1099,31 @@ export namespace PaymentCreateParams {
656
1099
  }
657
1100
 
658
1101
  export interface UnionMember1 {
659
- type: string;
1102
+ type: 'phone';
660
1103
 
661
1104
  /**
662
1105
  * Phone number in E.164 format
663
1106
  */
664
1107
  value: string;
665
1108
  }
1109
+
1110
+ export interface UnionMember2 {
1111
+ type: 'party_id';
1112
+
1113
+ /**
1114
+ * Natural party ID (pty\_\*)
1115
+ */
1116
+ value: string;
1117
+ }
1118
+
1119
+ export interface UnionMember3 {
1120
+ type: 'agent_id';
1121
+
1122
+ /**
1123
+ * Natural agent ID (agt\_\*)
1124
+ */
1125
+ value: string;
1126
+ }
666
1127
  }
667
1128
 
668
1129
  export interface PaymentListParams {
@@ -693,6 +1154,25 @@ export interface PaymentListParams {
693
1154
  'X-Instance-ID'?: string;
694
1155
  }
695
1156
 
1157
+ export interface PaymentCancelParams {
1158
+ /**
1159
+ * Unique key for idempotent request handling. If a request with the same key was
1160
+ * already processed, the original response is returned.
1161
+ */
1162
+ 'Idempotency-Key': string;
1163
+
1164
+ /**
1165
+ * Agent ID (agt_xxx) identifying which agent is making the request.
1166
+ */
1167
+ 'X-Agent-ID'?: string;
1168
+
1169
+ /**
1170
+ * Required when X-Agent-ID is present. Session or conversation ID for agent
1171
+ * observability.
1172
+ */
1173
+ 'X-Instance-ID'?: string;
1174
+ }
1175
+
696
1176
  export interface PaymentGetParams {
697
1177
  /**
698
1178
  * Query param: Party ID for delegated payment lookup
@@ -715,9 +1195,11 @@ export declare namespace Payments {
715
1195
  export {
716
1196
  type PaymentCreateResponse as PaymentCreateResponse,
717
1197
  type PaymentListResponse as PaymentListResponse,
1198
+ type PaymentCancelResponse as PaymentCancelResponse,
718
1199
  type PaymentGetResponse as PaymentGetResponse,
719
1200
  type PaymentCreateParams as PaymentCreateParams,
720
1201
  type PaymentListParams as PaymentListParams,
1202
+ type PaymentCancelParams as PaymentCancelParams,
721
1203
  type PaymentGetParams as PaymentGetParams,
722
1204
  };
723
1205
  }