@naturalpay/sdk 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +2 -2
  3. package/api-promise.d.mts +1 -0
  4. package/api-promise.d.mts.map +1 -1
  5. package/api-promise.d.ts +1 -0
  6. package/api-promise.d.ts.map +1 -1
  7. package/api-promise.mjs +1 -0
  8. package/api-promise.mjs.map +1 -1
  9. package/client.d.mts +37 -13
  10. package/client.d.mts.map +1 -1
  11. package/client.d.ts +37 -13
  12. package/client.d.ts.map +1 -1
  13. package/client.js +30 -6
  14. package/client.js.map +1 -1
  15. package/client.mjs +31 -7
  16. package/client.mjs.map +1 -1
  17. package/core/api-promise.d.mts.map +1 -1
  18. package/core/api-promise.d.ts.map +1 -1
  19. package/core/api-promise.mjs.map +1 -1
  20. package/core/error.mjs.map +1 -1
  21. package/core/resource.d.mts.map +1 -1
  22. package/core/resource.d.ts.map +1 -1
  23. package/core/uploads.d.mts.map +1 -1
  24. package/core/uploads.d.ts.map +1 -1
  25. package/core/uploads.mjs.map +1 -1
  26. package/error.d.mts +1 -0
  27. package/error.d.mts.map +1 -1
  28. package/error.d.ts +1 -0
  29. package/error.d.ts.map +1 -1
  30. package/error.mjs +1 -0
  31. package/error.mjs.map +1 -1
  32. package/index.d.mts.map +1 -1
  33. package/index.d.ts.map +1 -1
  34. package/index.mjs.map +1 -1
  35. package/internal/detect-platform.mjs.map +1 -1
  36. package/internal/headers.mjs.map +1 -1
  37. package/internal/parse.d.mts.map +1 -1
  38. package/internal/parse.d.ts.map +1 -1
  39. package/internal/parse.mjs.map +1 -1
  40. package/internal/qs/formats.d.mts.map +1 -1
  41. package/internal/qs/formats.d.ts.map +1 -1
  42. package/internal/qs/index.d.mts +2 -2
  43. package/internal/qs/index.d.mts.map +1 -1
  44. package/internal/qs/index.d.ts +2 -2
  45. package/internal/qs/index.d.ts.map +1 -1
  46. package/internal/qs/index.mjs.map +1 -1
  47. package/internal/qs/stringify.d.mts.map +1 -1
  48. package/internal/qs/stringify.d.ts.map +1 -1
  49. package/internal/qs/stringify.mjs.map +1 -1
  50. package/internal/qs/utils.d.mts.map +1 -1
  51. package/internal/qs/utils.d.ts.map +1 -1
  52. package/internal/qs/utils.mjs.map +1 -1
  53. package/internal/request-options.d.mts.map +1 -1
  54. package/internal/request-options.d.ts.map +1 -1
  55. package/internal/shims.d.mts +6 -0
  56. package/internal/shims.d.mts.map +1 -1
  57. package/internal/shims.d.ts +6 -0
  58. package/internal/shims.d.ts.map +1 -1
  59. package/internal/to-file.d.mts.map +1 -1
  60. package/internal/to-file.d.ts.map +1 -1
  61. package/internal/to-file.mjs.map +1 -1
  62. package/internal/types.d.mts +4 -4
  63. package/internal/types.d.mts.map +1 -1
  64. package/internal/types.d.ts +4 -4
  65. package/internal/types.d.ts.map +1 -1
  66. package/internal/uploads.d.mts.map +1 -1
  67. package/internal/uploads.d.ts.map +1 -1
  68. package/internal/uploads.mjs.map +1 -1
  69. package/internal/utils/base64.mjs.map +1 -1
  70. package/internal/utils/log.d.mts.map +1 -1
  71. package/internal/utils/log.d.ts.map +1 -1
  72. package/internal/utils/log.mjs.map +1 -1
  73. package/internal/utils/path.mjs.map +1 -1
  74. package/internal/utils/query.mjs.map +1 -1
  75. package/internal/utils/values.mjs.map +1 -1
  76. package/internal/utils.d.mts.map +1 -1
  77. package/internal/utils.d.ts.map +1 -1
  78. package/internal/utils.mjs.map +1 -1
  79. package/lib/envelope.d.mts.map +1 -1
  80. package/lib/envelope.d.ts.map +1 -1
  81. package/lib/envelope.mjs.map +1 -1
  82. package/package.json +1 -1
  83. package/resource.d.mts +1 -0
  84. package/resource.d.mts.map +1 -1
  85. package/resource.d.ts +1 -0
  86. package/resource.d.ts.map +1 -1
  87. package/resource.mjs +1 -0
  88. package/resource.mjs.map +1 -1
  89. package/resources/agents.d.mts +4 -153
  90. package/resources/agents.d.mts.map +1 -1
  91. package/resources/agents.d.ts +4 -153
  92. package/resources/agents.d.ts.map +1 -1
  93. package/resources/agents.js +5 -5
  94. package/resources/agents.js.map +1 -1
  95. package/resources/agents.mjs +5 -5
  96. package/resources/agents.mjs.map +1 -1
  97. package/resources/api-keys.d.mts +16 -2
  98. package/resources/api-keys.d.mts.map +1 -1
  99. package/resources/api-keys.d.ts +16 -2
  100. package/resources/api-keys.d.ts.map +1 -1
  101. package/resources/api-keys.js +7 -4
  102. package/resources/api-keys.js.map +1 -1
  103. package/resources/api-keys.mjs +7 -4
  104. package/resources/api-keys.mjs.map +1 -1
  105. package/resources/counterparties.d.mts +5 -55
  106. package/resources/counterparties.d.mts.map +1 -1
  107. package/resources/counterparties.d.ts +5 -55
  108. package/resources/counterparties.d.ts.map +1 -1
  109. package/resources/counterparties.js +1 -3
  110. package/resources/counterparties.js.map +1 -1
  111. package/resources/counterparties.mjs +1 -3
  112. package/resources/counterparties.mjs.map +1 -1
  113. package/resources/customers.d.mts.map +1 -1
  114. package/resources/customers.d.ts.map +1 -1
  115. package/resources/customers.mjs.map +1 -1
  116. package/resources/delegations.d.mts.map +1 -1
  117. package/resources/delegations.d.ts.map +1 -1
  118. package/resources/delegations.mjs.map +1 -1
  119. package/resources/escalations.d.mts +1124 -0
  120. package/resources/escalations.d.mts.map +1 -0
  121. package/resources/escalations.d.ts +1124 -0
  122. package/resources/escalations.d.ts.map +1 -0
  123. package/resources/escalations.js +110 -0
  124. package/resources/escalations.js.map +1 -0
  125. package/resources/escalations.mjs +106 -0
  126. package/resources/escalations.mjs.map +1 -0
  127. package/resources/external-accounts.d.mts +239 -0
  128. package/resources/external-accounts.d.mts.map +1 -0
  129. package/resources/external-accounts.d.ts +239 -0
  130. package/resources/external-accounts.d.ts.map +1 -0
  131. package/resources/external-accounts.js +47 -0
  132. package/resources/external-accounts.js.map +1 -0
  133. package/resources/external-accounts.mjs +43 -0
  134. package/resources/external-accounts.mjs.map +1 -0
  135. package/resources/index.d.mts +8 -4
  136. package/resources/index.d.mts.map +1 -1
  137. package/resources/index.d.ts +8 -4
  138. package/resources/index.d.ts.map +1 -1
  139. package/resources/index.js +9 -1
  140. package/resources/index.js.map +1 -1
  141. package/resources/index.mjs +5 -1
  142. package/resources/index.mjs.map +1 -1
  143. package/resources/invitations.d.mts +17 -8
  144. package/resources/invitations.d.mts.map +1 -1
  145. package/resources/invitations.d.ts +17 -8
  146. package/resources/invitations.d.ts.map +1 -1
  147. package/resources/invitations.js +7 -5
  148. package/resources/invitations.js.map +1 -1
  149. package/resources/invitations.mjs +7 -5
  150. package/resources/invitations.mjs.map +1 -1
  151. package/resources/parties.d.mts +55 -28
  152. package/resources/parties.d.mts.map +1 -1
  153. package/resources/parties.d.ts +55 -28
  154. package/resources/parties.d.ts.map +1 -1
  155. package/resources/parties.js +30 -4
  156. package/resources/parties.js.map +1 -1
  157. package/resources/parties.mjs +30 -4
  158. package/resources/parties.mjs.map +1 -1
  159. package/resources/payment-requests.d.mts +751 -39
  160. package/resources/payment-requests.d.mts.map +1 -1
  161. package/resources/payment-requests.d.ts +751 -39
  162. package/resources/payment-requests.d.ts.map +1 -1
  163. package/resources/payment-requests.js +82 -2
  164. package/resources/payment-requests.js.map +1 -1
  165. package/resources/payment-requests.mjs +82 -2
  166. package/resources/payment-requests.mjs.map +1 -1
  167. package/resources/payments.d.mts +390 -24
  168. package/resources/payments.d.mts.map +1 -1
  169. package/resources/payments.d.ts +390 -24
  170. package/resources/payments.d.ts.map +1 -1
  171. package/resources/payments.js +53 -3
  172. package/resources/payments.js.map +1 -1
  173. package/resources/payments.mjs +53 -3
  174. package/resources/payments.mjs.map +1 -1
  175. package/resources/transactions.d.mts +53 -113
  176. package/resources/transactions.d.mts.map +1 -1
  177. package/resources/transactions.d.ts +53 -113
  178. package/resources/transactions.d.ts.map +1 -1
  179. package/resources/transactions.js +3 -3
  180. package/resources/transactions.mjs +3 -3
  181. package/resources/transactions.mjs.map +1 -1
  182. package/resources/transfers.d.mts +1030 -0
  183. package/resources/transfers.d.mts.map +1 -0
  184. package/resources/transfers.d.ts +1030 -0
  185. package/resources/transfers.d.ts.map +1 -0
  186. package/resources/transfers.js +114 -0
  187. package/resources/transfers.js.map +1 -0
  188. package/resources/transfers.mjs +110 -0
  189. package/resources/transfers.mjs.map +1 -0
  190. package/resources/wallet.d.mts +117 -437
  191. package/resources/wallet.d.mts.map +1 -1
  192. package/resources/wallet.d.ts +117 -437
  193. package/resources/wallet.d.ts.map +1 -1
  194. package/resources/wallet.js +9 -122
  195. package/resources/wallet.js.map +1 -1
  196. package/resources/wallet.mjs +9 -122
  197. package/resources/wallet.mjs.map +1 -1
  198. package/resources/webhooks.d.mts +775 -0
  199. package/resources/webhooks.d.mts.map +1 -0
  200. package/resources/webhooks.d.ts +775 -0
  201. package/resources/webhooks.d.ts.map +1 -0
  202. package/resources/webhooks.js +163 -0
  203. package/resources/webhooks.js.map +1 -0
  204. package/resources/webhooks.mjs +159 -0
  205. package/resources/webhooks.mjs.map +1 -0
  206. package/resources.d.mts.map +1 -1
  207. package/resources.d.ts.map +1 -1
  208. package/resources.mjs.map +1 -1
  209. package/src/client.ts +156 -32
  210. package/src/resources/agents.ts +5 -185
  211. package/src/resources/api-keys.ts +26 -4
  212. package/src/resources/counterparties.ts +5 -64
  213. package/src/resources/escalations.ts +1422 -0
  214. package/src/resources/external-accounts.ts +324 -0
  215. package/src/resources/index.ts +65 -13
  216. package/src/resources/invitations.ts +27 -11
  217. package/src/resources/parties.ts +88 -33
  218. package/src/resources/payment-requests.ts +945 -44
  219. package/src/resources/payments.ts +518 -23
  220. package/src/resources/transactions.ts +53 -129
  221. package/src/resources/transfers.ts +1338 -0
  222. package/src/resources/wallet.ts +133 -597
  223. package/src/resources/webhooks.ts +1232 -0
  224. package/src/version.ts +1 -1
  225. package/uploads.d.mts +1 -0
  226. package/uploads.d.mts.map +1 -1
  227. package/uploads.d.ts +1 -0
  228. package/uploads.d.ts.map +1 -1
  229. package/uploads.mjs +1 -0
  230. package/uploads.mjs.map +1 -1
  231. package/version.d.mts +1 -1
  232. package/version.d.ts +1 -1
  233. package/version.js +1 -1
  234. package/version.mjs +1 -1
@@ -12,8 +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: { kind: 'email', value: 'dev@stainless.com' },
16
- * walletId: 'wal_ecc2efdd09bd231a9ad9bd2aada37aa7',
15
+ * payer: { type: 'type', value: 'dev@stainless.com' },
17
16
  * 'Idempotency-Key': 'Idempotency-Key',
18
17
  * });
19
18
  * ```
@@ -28,6 +27,37 @@ export declare class PaymentRequests extends APIResource {
28
27
  * ```
29
28
  */
30
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>;
31
61
  /**
32
62
  * Get a single payment request visible to the authenticated requester party.
33
63
  *
@@ -39,6 +69,16 @@ export declare class PaymentRequests extends APIResource {
39
69
  * ```
40
70
  */
41
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>;
42
82
  }
43
83
  export interface PaymentRequestCreateResponse {
44
84
  data: PaymentRequestCreateResponse.Data;
@@ -53,6 +93,10 @@ export declare namespace PaymentRequestCreateResponse {
53
93
  * Resource attributes
54
94
  */
55
95
  attributes: Data.Attributes;
96
+ /**
97
+ * Resource relationships
98
+ */
99
+ relationships: Data.Relationships;
56
100
  /**
57
101
  * Resource type
58
102
  */
@@ -64,7 +108,7 @@ export declare namespace PaymentRequestCreateResponse {
64
108
  */
65
109
  interface Attributes {
66
110
  /**
67
- * Amount in minor units (cents for USD)
111
+ * Amount in cents
68
112
  */
69
113
  amount: number;
70
114
  /**
@@ -76,7 +120,7 @@ export declare namespace PaymentRequestCreateResponse {
76
120
  */
77
121
  currency: string;
78
122
  /**
79
- * Free-form description provided at creation
123
+ * Free-form description provided at creation. Maximum 500 characters.
80
124
  */
81
125
  description: string | null;
82
126
  /**
@@ -90,13 +134,13 @@ export declare namespace PaymentRequestCreateResponse {
90
134
  /**
91
135
  * Which identifier type was used to address the payer
92
136
  */
93
- payerIdentifierType: 'email' | 'phone' | 'party_id';
137
+ payerIdentifierType: 'email' | 'phone' | 'party_id' | 'agent_id';
94
138
  /**
95
139
  * Display name of the payer
96
140
  */
97
141
  payerName: string | null;
98
142
  /**
99
- * Natural party ID (pty\_\*) of the payer if addressed by party
143
+ * Natural party ID (pty\_\*) resolved for the payer, including agent owner parties
100
144
  */
101
145
  payerPartyId: string | null;
102
146
  /**
@@ -108,11 +152,11 @@ export declare namespace PaymentRequestCreateResponse {
108
152
  */
109
153
  paymentLinkUrl: string;
110
154
  /**
111
- * Email of the requester party
155
+ * Email of the party requesting payment
112
156
  */
113
157
  requesterEmail: string | null;
114
158
  /**
115
- * Display name of the requester party
159
+ * Display name of the party requesting payment
116
160
  */
117
161
  requesterName: string | null;
118
162
  /**
@@ -129,6 +173,63 @@ export declare namespace PaymentRequestCreateResponse {
129
173
  */
130
174
  updatedAt: string;
131
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
+ }
132
233
  }
133
234
  }
134
235
  export interface PaymentRequestListResponse {
@@ -145,6 +246,10 @@ export declare namespace PaymentRequestListResponse {
145
246
  * Resource attributes
146
247
  */
147
248
  attributes: Data.Attributes;
249
+ /**
250
+ * Resource relationships
251
+ */
252
+ relationships: Data.Relationships;
148
253
  /**
149
254
  * Resource type
150
255
  */
@@ -156,7 +261,7 @@ export declare namespace PaymentRequestListResponse {
156
261
  */
157
262
  interface Attributes {
158
263
  /**
159
- * Amount in minor units (cents for USD)
264
+ * Amount in cents
160
265
  */
161
266
  amount: number;
162
267
  /**
@@ -168,7 +273,7 @@ export declare namespace PaymentRequestListResponse {
168
273
  */
169
274
  currency: string;
170
275
  /**
171
- * Free-form description provided at creation
276
+ * Free-form description provided at creation. Maximum 500 characters.
172
277
  */
173
278
  description: string | null;
174
279
  /**
@@ -182,13 +287,13 @@ export declare namespace PaymentRequestListResponse {
182
287
  /**
183
288
  * Which identifier type was used to address the payer
184
289
  */
185
- payerIdentifierType: 'email' | 'phone' | 'party_id';
290
+ payerIdentifierType: 'email' | 'phone' | 'party_id' | 'agent_id';
186
291
  /**
187
292
  * Display name of the payer
188
293
  */
189
294
  payerName: string | null;
190
295
  /**
191
- * Natural party ID (pty\_\*) of the payer if addressed by party
296
+ * Natural party ID (pty\_\*) resolved for the payer, including agent owner parties
192
297
  */
193
298
  payerPartyId: string | null;
194
299
  /**
@@ -200,11 +305,11 @@ export declare namespace PaymentRequestListResponse {
200
305
  */
201
306
  paymentLinkUrl: string;
202
307
  /**
203
- * Email of the requester party
308
+ * Email of the party requesting payment
204
309
  */
205
310
  requesterEmail: string | null;
206
311
  /**
207
- * Display name of the requester party
312
+ * Display name of the party requesting payment
208
313
  */
209
314
  requesterName: string | null;
210
315
  /**
@@ -221,6 +326,88 @@ export declare namespace PaymentRequestListResponse {
221
326
  */
222
327
  updatedAt: string;
223
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
+ }
224
411
  }
225
412
  interface Meta {
226
413
  pagination: Meta.Pagination;
@@ -232,6 +419,198 @@ export declare namespace PaymentRequestListResponse {
232
419
  }
233
420
  }
234
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
+ }
235
614
  export interface PaymentRequestGetResponse {
236
615
  data: PaymentRequestGetResponse.Data;
237
616
  }
@@ -245,6 +624,10 @@ export declare namespace PaymentRequestGetResponse {
245
624
  * Resource attributes
246
625
  */
247
626
  attributes: Data.Attributes;
627
+ /**
628
+ * Resource relationships
629
+ */
630
+ relationships: Data.Relationships;
248
631
  /**
249
632
  * Resource type
250
633
  */
@@ -256,7 +639,7 @@ export declare namespace PaymentRequestGetResponse {
256
639
  */
257
640
  interface Attributes {
258
641
  /**
259
- * Amount in minor units (cents for USD)
642
+ * Amount in cents
260
643
  */
261
644
  amount: number;
262
645
  /**
@@ -268,7 +651,7 @@ export declare namespace PaymentRequestGetResponse {
268
651
  */
269
652
  currency: string;
270
653
  /**
271
- * Free-form description provided at creation
654
+ * Free-form description provided at creation. Maximum 500 characters.
272
655
  */
273
656
  description: string | null;
274
657
  /**
@@ -282,13 +665,13 @@ export declare namespace PaymentRequestGetResponse {
282
665
  /**
283
666
  * Which identifier type was used to address the payer
284
667
  */
285
- payerIdentifierType: 'email' | 'phone' | 'party_id';
668
+ payerIdentifierType: 'email' | 'phone' | 'party_id' | 'agent_id';
286
669
  /**
287
670
  * Display name of the payer
288
671
  */
289
672
  payerName: string | null;
290
673
  /**
291
- * Natural party ID (pty\_\*) of the payer if addressed by party
674
+ * Natural party ID (pty\_\*) resolved for the payer, including agent owner parties
292
675
  */
293
676
  payerPartyId: string | null;
294
677
  /**
@@ -300,11 +683,11 @@ export declare namespace PaymentRequestGetResponse {
300
683
  */
301
684
  paymentLinkUrl: string;
302
685
  /**
303
- * Email of the requester party
686
+ * Email of the party requesting payment
304
687
  */
305
688
  requesterEmail: string | null;
306
689
  /**
307
- * Display name of the requester party
690
+ * Display name of the party requesting payment
308
691
  */
309
692
  requesterName: string | null;
310
693
  /**
@@ -321,6 +704,275 @@ export declare namespace PaymentRequestGetResponse {
321
704
  */
322
705
  updatedAt: string;
323
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
+ }
324
976
  }
325
977
  }
326
978
  export interface PaymentRequestCreateParams {
@@ -329,13 +981,10 @@ export interface PaymentRequestCreateParams {
329
981
  */
330
982
  amount: number;
331
983
  /**
332
- * Body param: Who pays — exactly one of email, phone, or party.
333
- */
334
- payer: PaymentRequestCreateParams.UnionMember0 | PaymentRequestCreateParams.UnionMember1 | PaymentRequestCreateParams.UnionMember2;
335
- /**
336
- * Body param: Wallet that should receive the funds
984
+ * Body param: Who pays — exactly one typed email, phone, party ID, or agent ID
985
+ * value.
337
986
  */
338
- walletId: string;
987
+ payer: PaymentRequestCreateParams.UnionMember0 | PaymentRequestCreateParams.UnionMember1;
339
988
  /**
340
989
  * Header param: Unique key for idempotent request handling. If a request with the
341
990
  * same key was already processed, the original response is returned.
@@ -351,7 +1000,7 @@ export interface PaymentRequestCreateParams {
351
1000
  */
352
1001
  customerPartyId?: string;
353
1002
  /**
354
- * Body param: Free-form description shown to the payer
1003
+ * Body param: Free-form description shown to the payer. Maximum 500 characters.
355
1004
  */
356
1005
  description?: string;
357
1006
  /**
@@ -363,6 +1012,11 @@ export interface PaymentRequestCreateParams {
363
1012
  * the named channel
364
1013
  */
365
1014
  sendLink?: PaymentRequestCreateParams.SendLink;
1015
+ /**
1016
+ * Body param: Wallet that should receive the funds. Omit to use the requester
1017
+ * party's default wallet.
1018
+ */
1019
+ walletId?: string;
366
1020
  /**
367
1021
  * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
368
1022
  */
@@ -375,23 +1029,16 @@ export interface PaymentRequestCreateParams {
375
1029
  }
376
1030
  export declare namespace PaymentRequestCreateParams {
377
1031
  interface UnionMember0 {
378
- kind: 'email';
1032
+ type: string;
379
1033
  /**
380
- * Payer email address
1034
+ * Email address
381
1035
  */
382
1036
  value: string;
383
1037
  }
384
1038
  interface UnionMember1 {
385
- kind: 'phone';
386
- /**
387
- * Payer phone in E.164 format
388
- */
389
- value: string;
390
- }
391
- interface UnionMember2 {
392
- kind: 'party_id';
1039
+ type: string;
393
1040
  /**
394
- * Natural party ID (pty\_\*) of the payer
1041
+ * Phone number in E.164 format
395
1042
  */
396
1043
  value: string;
397
1044
  }
@@ -425,6 +1072,52 @@ export interface PaymentRequestListParams {
425
1072
  */
426
1073
  'X-Instance-ID'?: string;
427
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
+ }
428
1121
  export interface PaymentRequestGetParams {
429
1122
  /**
430
1123
  * Agent ID (agt_xxx) identifying which agent is making the request.
@@ -436,7 +1129,26 @@ export interface PaymentRequestGetParams {
436
1129
  */
437
1130
  'X-Instance-ID'?: string;
438
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
+ }
439
1151
  export declare namespace PaymentRequests {
440
- 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, };
441
1153
  }
442
1154
  //# sourceMappingURL=payment-requests.d.mts.map