@naturalpay/sdk 0.9.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 (103) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/agents.d.mts +33 -26
  10. package/resources/agents.d.mts.map +1 -1
  11. package/resources/agents.d.ts +33 -26
  12. package/resources/agents.d.ts.map +1 -1
  13. package/resources/agents.js +1 -1
  14. package/resources/agents.mjs +1 -1
  15. package/resources/api-keys.d.mts +16 -16
  16. package/resources/api-keys.d.mts.map +1 -1
  17. package/resources/api-keys.d.ts +16 -16
  18. package/resources/api-keys.d.ts.map +1 -1
  19. package/resources/approvals.d.mts +16 -16
  20. package/resources/approvals.d.mts.map +1 -1
  21. package/resources/approvals.d.ts +16 -16
  22. package/resources/approvals.d.ts.map +1 -1
  23. package/resources/counterparties.d.mts +1 -1
  24. package/resources/counterparties.d.mts.map +1 -1
  25. package/resources/counterparties.d.ts +1 -1
  26. package/resources/counterparties.d.ts.map +1 -1
  27. package/resources/customers.d.mts +6 -6
  28. package/resources/customers.d.mts.map +1 -1
  29. package/resources/customers.d.ts +6 -6
  30. package/resources/customers.d.ts.map +1 -1
  31. package/resources/external-accounts.d.mts +4 -4
  32. package/resources/external-accounts.d.mts.map +1 -1
  33. package/resources/external-accounts.d.ts +4 -4
  34. package/resources/external-accounts.d.ts.map +1 -1
  35. package/resources/index.d.mts +1 -1
  36. package/resources/index.d.mts.map +1 -1
  37. package/resources/index.d.ts +1 -1
  38. package/resources/index.d.ts.map +1 -1
  39. package/resources/index.js.map +1 -1
  40. package/resources/index.mjs.map +1 -1
  41. package/resources/invitations.d.mts +3 -3
  42. package/resources/invitations.d.mts.map +1 -1
  43. package/resources/invitations.d.ts +3 -3
  44. package/resources/invitations.d.ts.map +1 -1
  45. package/resources/parties.d.mts +4 -4
  46. package/resources/parties.d.mts.map +1 -1
  47. package/resources/parties.d.ts +4 -4
  48. package/resources/parties.d.ts.map +1 -1
  49. package/resources/payment-requests.d.mts +314 -33
  50. package/resources/payment-requests.d.mts.map +1 -1
  51. package/resources/payment-requests.d.ts +314 -33
  52. package/resources/payment-requests.d.ts.map +1 -1
  53. package/resources/payment-requests.js +2 -2
  54. package/resources/payment-requests.mjs +2 -2
  55. package/resources/payments.d.mts +400 -20
  56. package/resources/payments.d.mts.map +1 -1
  57. package/resources/payments.d.ts +400 -20
  58. package/resources/payments.d.ts.map +1 -1
  59. package/resources/payments.js +26 -1
  60. package/resources/payments.js.map +1 -1
  61. package/resources/payments.mjs +26 -1
  62. package/resources/payments.mjs.map +1 -1
  63. package/resources/transactions.d.mts +10 -10
  64. package/resources/transactions.d.mts.map +1 -1
  65. package/resources/transactions.d.ts +10 -10
  66. package/resources/transactions.d.ts.map +1 -1
  67. package/resources/transfers.d.mts +20 -20
  68. package/resources/transfers.d.mts.map +1 -1
  69. package/resources/transfers.d.ts +20 -20
  70. package/resources/transfers.d.ts.map +1 -1
  71. package/resources/wallet.d.mts +4 -4
  72. package/resources/wallet.d.mts.map +1 -1
  73. package/resources/wallet.d.ts +4 -4
  74. package/resources/wallet.d.ts.map +1 -1
  75. package/resources/webhooks.d.mts +12 -12
  76. package/resources/webhooks.d.mts.map +1 -1
  77. package/resources/webhooks.d.ts +12 -12
  78. package/resources/webhooks.d.ts.map +1 -1
  79. package/src/client.ts +4 -0
  80. package/src/resources/agents.ts +39 -26
  81. package/src/resources/api-keys.ts +16 -16
  82. package/src/resources/approvals.ts +16 -16
  83. package/src/resources/counterparties.ts +1 -1
  84. package/src/resources/customers.ts +6 -6
  85. package/src/resources/external-accounts.ts +4 -4
  86. package/src/resources/index.ts +2 -0
  87. package/src/resources/invitations.ts +3 -3
  88. package/src/resources/parties.ts +4 -4
  89. package/src/resources/payment-requests.ts +413 -33
  90. package/src/resources/payments.ts +498 -16
  91. package/src/resources/transactions.ts +10 -10
  92. package/src/resources/transfers.ts +20 -20
  93. package/src/resources/wallet.ts +4 -4
  94. package/src/resources/webhooks.ts +12 -12
  95. package/src/version.ts +1 -1
  96. package/version.d.mts +1 -1
  97. package/version.d.mts.map +1 -1
  98. package/version.d.ts +1 -1
  99. package/version.d.ts.map +1 -1
  100. package/version.js +1 -1
  101. package/version.js.map +1 -1
  102. package/version.mjs +1 -1
  103. package/version.mjs.map +1 -1
@@ -17,7 +17,7 @@ export class PaymentRequests extends APIResource {
17
17
  * ```ts
18
18
  * const paymentRequest = await client.paymentRequests.create({
19
19
  * amount: 1,
20
- * payer: { type: 'type', value: 'dev@stainless.com' },
20
+ * payer: { type: 'email', value: 'dev@stainless.com' },
21
21
  * 'Idempotency-Key': 'Idempotency-Key',
22
22
  * });
23
23
  * ```
@@ -116,7 +116,7 @@ export class PaymentRequests extends APIResource {
116
116
  * 'prq_ecc2efdd09bd231a9ad9bd2aada37aa7',
117
117
  * {
118
118
  * paymentSource: {
119
- * type: 'type',
119
+ * type: 'wallet',
120
120
  * walletId: 'wal_ecc2efdd09bd231a9ad9bd2aada37aa7',
121
121
  * },
122
122
  * 'Idempotency-Key': 'Idempotency-Key',
@@ -229,7 +229,7 @@ export namespace PaymentRequestCreateResponse {
229
229
  /**
230
230
  * Resource type
231
231
  */
232
- type: string;
232
+ type: 'paymentRequest';
233
233
  }
234
234
 
235
235
  export namespace Data {
@@ -305,7 +305,15 @@ export namespace PaymentRequestCreateResponse {
305
305
  /**
306
306
  * Current status of the payment request
307
307
  */
308
- status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
308
+ status:
309
+ | 'OPEN'
310
+ | 'PROCESSING'
311
+ | 'COMPLETED'
312
+ | 'FAILED'
313
+ | 'RETURNED'
314
+ | 'CANCELLED'
315
+ | 'DECLINED'
316
+ | 'EXPIRED';
309
317
 
310
318
  /**
311
319
  * ID of the transaction created by the most recent payment attempt, or null if no
@@ -355,7 +363,7 @@ export namespace PaymentRequestCreateResponse {
355
363
  /**
356
364
  * Resource type
357
365
  */
358
- type: string;
366
+ type: 'party';
359
367
  }
360
368
  }
361
369
 
@@ -379,7 +387,7 @@ export namespace PaymentRequestCreateResponse {
379
387
  /**
380
388
  * Resource type
381
389
  */
382
- type: string;
390
+ type: 'party';
383
391
  }
384
392
  }
385
393
  }
@@ -412,7 +420,7 @@ export namespace PaymentRequestListResponse {
412
420
  /**
413
421
  * Resource type
414
422
  */
415
- type: string;
423
+ type: 'paymentRequest';
416
424
  }
417
425
 
418
426
  export namespace Data {
@@ -488,7 +496,15 @@ export namespace PaymentRequestListResponse {
488
496
  /**
489
497
  * Current status of the payment request
490
498
  */
491
- status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
499
+ status:
500
+ | 'OPEN'
501
+ | 'PROCESSING'
502
+ | 'COMPLETED'
503
+ | 'FAILED'
504
+ | 'RETURNED'
505
+ | 'CANCELLED'
506
+ | 'DECLINED'
507
+ | 'EXPIRED';
492
508
 
493
509
  /**
494
510
  * ID of the transaction created by the most recent payment attempt, or null if no
@@ -511,6 +527,11 @@ export namespace PaymentRequestListResponse {
511
527
  */
512
528
  payerParty: Relationships.PayerParty;
513
529
 
530
+ /**
531
+ * Payment submitted for this payment request, if one exists.
532
+ */
533
+ payment: Relationships.Payment;
534
+
514
535
  /**
515
536
  * Party requesting the payment
516
537
  */
@@ -543,7 +564,31 @@ export namespace PaymentRequestListResponse {
543
564
  /**
544
565
  * Resource type
545
566
  */
546
- type: string;
567
+ type: 'party';
568
+ }
569
+ }
570
+
571
+ /**
572
+ * Payment submitted for this payment request, if one exists.
573
+ */
574
+ export interface Payment {
575
+ /**
576
+ * Related resource identifier
577
+ */
578
+ data: Payment.Data | null;
579
+ }
580
+
581
+ export namespace Payment {
582
+ /**
583
+ * Related resource identifier
584
+ */
585
+ export interface Data {
586
+ id: string;
587
+
588
+ /**
589
+ * Resource type
590
+ */
591
+ type: 'payment';
547
592
  }
548
593
  }
549
594
 
@@ -567,7 +612,7 @@ export namespace PaymentRequestListResponse {
567
612
  /**
568
613
  * Resource type
569
614
  */
570
- type: string;
615
+ type: 'party';
571
616
  }
572
617
  }
573
618
 
@@ -591,7 +636,7 @@ export namespace PaymentRequestListResponse {
591
636
  /**
592
637
  * Resource type
593
638
  */
594
- type: string;
639
+ type: 'wallet';
595
640
  }
596
641
  }
597
642
  }
@@ -634,7 +679,7 @@ export namespace PaymentRequestDeclineResponse {
634
679
  /**
635
680
  * Resource type
636
681
  */
637
- type: string;
682
+ type: 'paymentRequest';
638
683
  }
639
684
 
640
685
  export namespace Data {
@@ -710,7 +755,15 @@ export namespace PaymentRequestDeclineResponse {
710
755
  /**
711
756
  * Current status of the payment request
712
757
  */
713
- status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
758
+ status:
759
+ | 'OPEN'
760
+ | 'PROCESSING'
761
+ | 'COMPLETED'
762
+ | 'FAILED'
763
+ | 'RETURNED'
764
+ | 'CANCELLED'
765
+ | 'DECLINED'
766
+ | 'EXPIRED';
714
767
 
715
768
  /**
716
769
  * ID of the transaction created by the most recent payment attempt, or null if no
@@ -733,6 +786,11 @@ export namespace PaymentRequestDeclineResponse {
733
786
  */
734
787
  payerParty: Relationships.PayerParty;
735
788
 
789
+ /**
790
+ * Payment submitted for this payment request, if one exists.
791
+ */
792
+ payment: Relationships.Payment;
793
+
736
794
  /**
737
795
  * Party requesting the payment
738
796
  */
@@ -765,7 +823,31 @@ export namespace PaymentRequestDeclineResponse {
765
823
  /**
766
824
  * Resource type
767
825
  */
768
- type: string;
826
+ type: 'party';
827
+ }
828
+ }
829
+
830
+ /**
831
+ * Payment submitted for this payment request, if one exists.
832
+ */
833
+ export interface Payment {
834
+ /**
835
+ * Related resource identifier
836
+ */
837
+ data: Payment.Data | null;
838
+ }
839
+
840
+ export namespace Payment {
841
+ /**
842
+ * Related resource identifier
843
+ */
844
+ export interface Data {
845
+ id: string;
846
+
847
+ /**
848
+ * Resource type
849
+ */
850
+ type: 'payment';
769
851
  }
770
852
  }
771
853
 
@@ -789,7 +871,7 @@ export namespace PaymentRequestDeclineResponse {
789
871
  /**
790
872
  * Resource type
791
873
  */
792
- type: string;
874
+ type: 'party';
793
875
  }
794
876
  }
795
877
 
@@ -813,7 +895,7 @@ export namespace PaymentRequestDeclineResponse {
813
895
  /**
814
896
  * Resource type
815
897
  */
816
- type: string;
898
+ type: 'wallet';
817
899
  }
818
900
  }
819
901
  }
@@ -828,14 +910,216 @@ export namespace PaymentRequestFulfillResponse {
828
910
  export interface Data {
829
911
  id: string;
830
912
 
913
+ /**
914
+ * Resource attributes
915
+ */
831
916
  attributes: Data.Attributes;
832
917
 
833
- type: string;
918
+ /**
919
+ * Resource relationships
920
+ */
921
+ relationships: Data.Relationships;
922
+
923
+ type: 'payment';
834
924
  }
835
925
 
836
926
  export namespace Data {
927
+ /**
928
+ * Resource attributes
929
+ */
837
930
  export interface Attributes {
838
- outcome: 'processing' | 'failed' | 'completed' | 'in_review';
931
+ /**
932
+ * Amount in cents
933
+ */
934
+ amount: number;
935
+
936
+ /**
937
+ * When this payment was created
938
+ */
939
+ createdAt: string;
940
+
941
+ /**
942
+ * Currency code
943
+ */
944
+ currency: string;
945
+
946
+ /**
947
+ * Payment description
948
+ */
949
+ description: string | null;
950
+
951
+ /**
952
+ * Payment status
953
+ */
954
+ status:
955
+ | 'CREATED'
956
+ | 'PROCESSING'
957
+ | 'PENDING_CLAIM'
958
+ | 'IN_REVIEW'
959
+ | 'COMPLETED'
960
+ | 'FAILED'
961
+ | 'RETURNED'
962
+ | 'APPROVAL_DENIED'
963
+ | 'CANCELLED';
964
+
965
+ /**
966
+ * When this payment was last updated
967
+ */
968
+ updatedAt: string | null;
969
+ }
970
+
971
+ /**
972
+ * Resource relationships
973
+ */
974
+ export interface Relationships {
975
+ /**
976
+ * Payment request that produced this payment, when applicable.
977
+ */
978
+ paymentRequest: Relationships.PaymentRequest;
979
+
980
+ /**
981
+ * Recipient party for this payment, when known.
982
+ */
983
+ recipient: Relationships.Recipient;
984
+
985
+ /**
986
+ * Recipient agent when the caller addressed an agent ID. Null otherwise, including
987
+ * when the recipient was addressed as an email, phone, or party ID.
988
+ */
989
+ recipientAgent: Relationships.RecipientAgent;
990
+
991
+ /**
992
+ * Party that initiated the payment
993
+ */
994
+ sender: Relationships.Sender;
995
+
996
+ /**
997
+ * Sender-side transaction row for this payment, when available.
998
+ */
999
+ transaction: Relationships.Transaction;
1000
+ }
1001
+
1002
+ export namespace Relationships {
1003
+ /**
1004
+ * Payment request that produced this payment, when applicable.
1005
+ */
1006
+ export interface PaymentRequest {
1007
+ /**
1008
+ * Related resource identifier
1009
+ */
1010
+ data: PaymentRequest.Data | null;
1011
+ }
1012
+
1013
+ export namespace PaymentRequest {
1014
+ /**
1015
+ * Related resource identifier
1016
+ */
1017
+ export interface Data {
1018
+ id: string;
1019
+
1020
+ /**
1021
+ * Resource type
1022
+ */
1023
+ type: 'paymentRequest';
1024
+ }
1025
+ }
1026
+
1027
+ /**
1028
+ * Recipient party for this payment, when known.
1029
+ */
1030
+ export interface Recipient {
1031
+ /**
1032
+ * Related resource identifier
1033
+ */
1034
+ data: Recipient.Data | null;
1035
+ }
1036
+
1037
+ export namespace Recipient {
1038
+ /**
1039
+ * Related resource identifier
1040
+ */
1041
+ export interface Data {
1042
+ id: string;
1043
+
1044
+ /**
1045
+ * Resource type
1046
+ */
1047
+ type: 'party';
1048
+ }
1049
+ }
1050
+
1051
+ /**
1052
+ * Recipient agent when the caller addressed an agent ID. Null otherwise, including
1053
+ * when the recipient was addressed as an email, phone, or party ID.
1054
+ */
1055
+ export interface RecipientAgent {
1056
+ /**
1057
+ * Related resource identifier
1058
+ */
1059
+ data: RecipientAgent.Data | null;
1060
+ }
1061
+
1062
+ export namespace RecipientAgent {
1063
+ /**
1064
+ * Related resource identifier
1065
+ */
1066
+ export interface Data {
1067
+ id: string;
1068
+
1069
+ /**
1070
+ * Resource type
1071
+ */
1072
+ type: 'agent';
1073
+ }
1074
+ }
1075
+
1076
+ /**
1077
+ * Party that initiated the payment
1078
+ */
1079
+ export interface Sender {
1080
+ /**
1081
+ * Related resource identifier
1082
+ */
1083
+ data: Sender.Data;
1084
+ }
1085
+
1086
+ export namespace Sender {
1087
+ /**
1088
+ * Related resource identifier
1089
+ */
1090
+ export interface Data {
1091
+ id: string;
1092
+
1093
+ /**
1094
+ * Resource type
1095
+ */
1096
+ type: 'party';
1097
+ }
1098
+ }
1099
+
1100
+ /**
1101
+ * Sender-side transaction row for this payment, when available.
1102
+ */
1103
+ export interface Transaction {
1104
+ /**
1105
+ * Related resource identifier
1106
+ */
1107
+ data: Transaction.Data | null;
1108
+ }
1109
+
1110
+ export namespace Transaction {
1111
+ /**
1112
+ * Related resource identifier
1113
+ */
1114
+ export interface Data {
1115
+ id: string;
1116
+
1117
+ /**
1118
+ * Resource type
1119
+ */
1120
+ type: 'transaction';
1121
+ }
1122
+ }
839
1123
  }
840
1124
  }
841
1125
  }
@@ -864,7 +1148,7 @@ export namespace PaymentRequestGetResponse {
864
1148
  /**
865
1149
  * Resource type
866
1150
  */
867
- type: string;
1151
+ type: 'paymentRequest';
868
1152
  }
869
1153
 
870
1154
  export namespace Data {
@@ -940,7 +1224,15 @@ export namespace PaymentRequestGetResponse {
940
1224
  /**
941
1225
  * Current status of the payment request
942
1226
  */
943
- status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
1227
+ status:
1228
+ | 'OPEN'
1229
+ | 'PROCESSING'
1230
+ | 'COMPLETED'
1231
+ | 'FAILED'
1232
+ | 'RETURNED'
1233
+ | 'CANCELLED'
1234
+ | 'DECLINED'
1235
+ | 'EXPIRED';
944
1236
 
945
1237
  /**
946
1238
  * ID of the transaction created by the most recent payment attempt, or null if no
@@ -963,6 +1255,11 @@ export namespace PaymentRequestGetResponse {
963
1255
  */
964
1256
  payerParty: Relationships.PayerParty;
965
1257
 
1258
+ /**
1259
+ * Payment submitted for this payment request, if one exists.
1260
+ */
1261
+ payment: Relationships.Payment;
1262
+
966
1263
  /**
967
1264
  * Party requesting the payment
968
1265
  */
@@ -995,7 +1292,31 @@ export namespace PaymentRequestGetResponse {
995
1292
  /**
996
1293
  * Resource type
997
1294
  */
998
- type: string;
1295
+ type: 'party';
1296
+ }
1297
+ }
1298
+
1299
+ /**
1300
+ * Payment submitted for this payment request, if one exists.
1301
+ */
1302
+ export interface Payment {
1303
+ /**
1304
+ * Related resource identifier
1305
+ */
1306
+ data: Payment.Data | null;
1307
+ }
1308
+
1309
+ export namespace Payment {
1310
+ /**
1311
+ * Related resource identifier
1312
+ */
1313
+ export interface Data {
1314
+ id: string;
1315
+
1316
+ /**
1317
+ * Resource type
1318
+ */
1319
+ type: 'payment';
999
1320
  }
1000
1321
  }
1001
1322
 
@@ -1019,7 +1340,7 @@ export namespace PaymentRequestGetResponse {
1019
1340
  /**
1020
1341
  * Resource type
1021
1342
  */
1022
- type: string;
1343
+ type: 'party';
1023
1344
  }
1024
1345
  }
1025
1346
 
@@ -1043,7 +1364,7 @@ export namespace PaymentRequestGetResponse {
1043
1364
  /**
1044
1365
  * Resource type
1045
1366
  */
1046
- type: string;
1367
+ type: 'wallet';
1047
1368
  }
1048
1369
  }
1049
1370
  }
@@ -1076,7 +1397,7 @@ export namespace PaymentRequestListIncomingResponse {
1076
1397
  /**
1077
1398
  * Resource type
1078
1399
  */
1079
- type: string;
1400
+ type: 'paymentRequest';
1080
1401
  }
1081
1402
 
1082
1403
  export namespace Data {
@@ -1152,7 +1473,15 @@ export namespace PaymentRequestListIncomingResponse {
1152
1473
  /**
1153
1474
  * Current status of the payment request
1154
1475
  */
1155
- status: 'OPEN' | 'PROCESSING' | 'COMPLETED' | 'CANCELLED' | 'DECLINED' | 'EXPIRED';
1476
+ status:
1477
+ | 'OPEN'
1478
+ | 'PROCESSING'
1479
+ | 'COMPLETED'
1480
+ | 'FAILED'
1481
+ | 'RETURNED'
1482
+ | 'CANCELLED'
1483
+ | 'DECLINED'
1484
+ | 'EXPIRED';
1156
1485
 
1157
1486
  /**
1158
1487
  * ID of the transaction created by the most recent payment attempt, or null if no
@@ -1175,6 +1504,11 @@ export namespace PaymentRequestListIncomingResponse {
1175
1504
  */
1176
1505
  payerParty: Relationships.PayerParty;
1177
1506
 
1507
+ /**
1508
+ * Payment submitted for this payment request, if one exists.
1509
+ */
1510
+ payment: Relationships.Payment;
1511
+
1178
1512
  /**
1179
1513
  * Party requesting the payment
1180
1514
  */
@@ -1207,7 +1541,31 @@ export namespace PaymentRequestListIncomingResponse {
1207
1541
  /**
1208
1542
  * Resource type
1209
1543
  */
1210
- type: string;
1544
+ type: 'party';
1545
+ }
1546
+ }
1547
+
1548
+ /**
1549
+ * Payment submitted for this payment request, if one exists.
1550
+ */
1551
+ export interface Payment {
1552
+ /**
1553
+ * Related resource identifier
1554
+ */
1555
+ data: Payment.Data | null;
1556
+ }
1557
+
1558
+ export namespace Payment {
1559
+ /**
1560
+ * Related resource identifier
1561
+ */
1562
+ export interface Data {
1563
+ id: string;
1564
+
1565
+ /**
1566
+ * Resource type
1567
+ */
1568
+ type: 'payment';
1211
1569
  }
1212
1570
  }
1213
1571
 
@@ -1231,7 +1589,7 @@ export namespace PaymentRequestListIncomingResponse {
1231
1589
  /**
1232
1590
  * Resource type
1233
1591
  */
1234
- type: string;
1592
+ type: 'party';
1235
1593
  }
1236
1594
  }
1237
1595
 
@@ -1255,7 +1613,7 @@ export namespace PaymentRequestListIncomingResponse {
1255
1613
  /**
1256
1614
  * Resource type
1257
1615
  */
1258
- type: string;
1616
+ type: 'wallet';
1259
1617
  }
1260
1618
  }
1261
1619
  }
@@ -1284,7 +1642,11 @@ export interface PaymentRequestCreateParams {
1284
1642
  * Body param: Who pays — exactly one typed email, phone, party ID, or agent ID
1285
1643
  * value.
1286
1644
  */
1287
- payer: PaymentRequestCreateParams.UnionMember0 | PaymentRequestCreateParams.UnionMember1;
1645
+ payer:
1646
+ | PaymentRequestCreateParams.UnionMember0
1647
+ | PaymentRequestCreateParams.UnionMember1
1648
+ | PaymentRequestCreateParams.UnionMember2
1649
+ | PaymentRequestCreateParams.UnionMember3;
1288
1650
 
1289
1651
  /**
1290
1652
  * Header param: Unique key for idempotent request handling. If a request with the
@@ -1339,7 +1701,7 @@ export interface PaymentRequestCreateParams {
1339
1701
 
1340
1702
  export namespace PaymentRequestCreateParams {
1341
1703
  export interface UnionMember0 {
1342
- type: string;
1704
+ type: 'email';
1343
1705
 
1344
1706
  /**
1345
1707
  * Email address
@@ -1348,7 +1710,7 @@ export namespace PaymentRequestCreateParams {
1348
1710
  }
1349
1711
 
1350
1712
  export interface UnionMember1 {
1351
- type: string;
1713
+ type: 'phone';
1352
1714
 
1353
1715
  /**
1354
1716
  * Phone number in E.164 format
@@ -1356,6 +1718,24 @@ export namespace PaymentRequestCreateParams {
1356
1718
  value: string;
1357
1719
  }
1358
1720
 
1721
+ export interface UnionMember2 {
1722
+ type: 'party_id';
1723
+
1724
+ /**
1725
+ * Natural party ID (pty\_\*)
1726
+ */
1727
+ value: string;
1728
+ }
1729
+
1730
+ export interface UnionMember3 {
1731
+ type: 'agent_id';
1732
+
1733
+ /**
1734
+ * Natural agent ID (agt\_\*)
1735
+ */
1736
+ value: string;
1737
+ }
1738
+
1359
1739
  /**
1360
1740
  * If provided, immediately deliver the payment link to the payer via the named
1361
1741
  * channel
@@ -1436,7 +1816,7 @@ export interface PaymentRequestFulfillParams {
1436
1816
 
1437
1817
  export namespace PaymentRequestFulfillParams {
1438
1818
  export interface UnionMember0 {
1439
- type: string;
1819
+ type: 'wallet';
1440
1820
 
1441
1821
  walletId: string;
1442
1822
  }
@@ -1444,7 +1824,7 @@ export namespace PaymentRequestFulfillParams {
1444
1824
  export interface UnionMember1 {
1445
1825
  externalAccountId: string;
1446
1826
 
1447
- type: string;
1827
+ type: 'external_account';
1448
1828
  }
1449
1829
  }
1450
1830