@naturalpay/sdk 0.2.1 → 0.3.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 (210) hide show
  1. package/CHANGELOG.md +29 -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 +17 -5
  10. package/client.d.mts.map +1 -1
  11. package/client.d.ts +17 -5
  12. package/client.d.ts.map +1 -1
  13. package/client.js +16 -4
  14. package/client.js.map +1 -1
  15. package/client.mjs +16 -4
  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.map +1 -1
  98. package/resources/api-keys.d.ts.map +1 -1
  99. package/resources/api-keys.js +1 -1
  100. package/resources/api-keys.js.map +1 -1
  101. package/resources/api-keys.mjs +1 -1
  102. package/resources/api-keys.mjs.map +1 -1
  103. package/resources/counterparties.d.mts +5 -55
  104. package/resources/counterparties.d.mts.map +1 -1
  105. package/resources/counterparties.d.ts +5 -55
  106. package/resources/counterparties.d.ts.map +1 -1
  107. package/resources/counterparties.js +1 -3
  108. package/resources/counterparties.js.map +1 -1
  109. package/resources/counterparties.mjs +1 -3
  110. package/resources/counterparties.mjs.map +1 -1
  111. package/resources/customers.d.mts.map +1 -1
  112. package/resources/customers.d.ts.map +1 -1
  113. package/resources/customers.mjs.map +1 -1
  114. package/resources/delegations.d.mts.map +1 -1
  115. package/resources/delegations.d.ts.map +1 -1
  116. package/resources/delegations.mjs.map +1 -1
  117. package/resources/external-accounts.d.mts +239 -0
  118. package/resources/external-accounts.d.mts.map +1 -0
  119. package/resources/external-accounts.d.ts +239 -0
  120. package/resources/external-accounts.d.ts.map +1 -0
  121. package/resources/external-accounts.js +47 -0
  122. package/resources/external-accounts.js.map +1 -0
  123. package/resources/external-accounts.mjs +43 -0
  124. package/resources/external-accounts.mjs.map +1 -0
  125. package/resources/index.d.mts +3 -1
  126. package/resources/index.d.mts.map +1 -1
  127. package/resources/index.d.ts +3 -1
  128. package/resources/index.d.ts.map +1 -1
  129. package/resources/index.js +5 -1
  130. package/resources/index.js.map +1 -1
  131. package/resources/index.mjs +2 -0
  132. package/resources/index.mjs.map +1 -1
  133. package/resources/invitations.d.mts +1 -1
  134. package/resources/invitations.d.mts.map +1 -1
  135. package/resources/invitations.d.ts +1 -1
  136. package/resources/invitations.d.ts.map +1 -1
  137. package/resources/invitations.js +1 -1
  138. package/resources/invitations.mjs +1 -1
  139. package/resources/invitations.mjs.map +1 -1
  140. package/resources/parties.d.mts +2 -2
  141. package/resources/parties.d.mts.map +1 -1
  142. package/resources/parties.d.ts +2 -2
  143. package/resources/parties.d.ts.map +1 -1
  144. package/resources/parties.js +3 -3
  145. package/resources/parties.js.map +1 -1
  146. package/resources/parties.mjs +3 -3
  147. package/resources/parties.mjs.map +1 -1
  148. package/resources/payment-requests.d.mts +24 -17
  149. package/resources/payment-requests.d.mts.map +1 -1
  150. package/resources/payment-requests.d.ts +24 -17
  151. package/resources/payment-requests.d.ts.map +1 -1
  152. package/resources/payment-requests.js +0 -1
  153. package/resources/payment-requests.js.map +1 -1
  154. package/resources/payment-requests.mjs +0 -1
  155. package/resources/payment-requests.mjs.map +1 -1
  156. package/resources/payments.d.mts +1 -1
  157. package/resources/payments.d.mts.map +1 -1
  158. package/resources/payments.d.ts +1 -1
  159. package/resources/payments.d.ts.map +1 -1
  160. package/resources/payments.mjs.map +1 -1
  161. package/resources/transactions.d.mts +18 -10
  162. package/resources/transactions.d.mts.map +1 -1
  163. package/resources/transactions.d.ts +18 -10
  164. package/resources/transactions.d.ts.map +1 -1
  165. package/resources/transactions.js +2 -2
  166. package/resources/transactions.mjs +2 -2
  167. package/resources/transactions.mjs.map +1 -1
  168. package/resources/wallet.d.mts +196 -328
  169. package/resources/wallet.d.mts.map +1 -1
  170. package/resources/wallet.d.ts +196 -328
  171. package/resources/wallet.d.ts.map +1 -1
  172. package/resources/wallet.js +16 -63
  173. package/resources/wallet.js.map +1 -1
  174. package/resources/wallet.mjs +16 -63
  175. package/resources/wallet.mjs.map +1 -1
  176. package/resources/webhooks.d.mts +775 -0
  177. package/resources/webhooks.d.mts.map +1 -0
  178. package/resources/webhooks.d.ts +775 -0
  179. package/resources/webhooks.d.ts.map +1 -0
  180. package/resources/webhooks.js +163 -0
  181. package/resources/webhooks.js.map +1 -0
  182. package/resources/webhooks.mjs +159 -0
  183. package/resources/webhooks.mjs.map +1 -0
  184. package/resources.d.mts.map +1 -1
  185. package/resources.d.ts.map +1 -1
  186. package/resources.mjs.map +1 -1
  187. package/src/client.ts +69 -21
  188. package/src/resources/agents.ts +5 -185
  189. package/src/resources/api-keys.ts +1 -1
  190. package/src/resources/counterparties.ts +5 -64
  191. package/src/resources/external-accounts.ts +324 -0
  192. package/src/resources/index.ts +26 -8
  193. package/src/resources/invitations.ts +1 -1
  194. package/src/resources/parties.ts +3 -3
  195. package/src/resources/payment-requests.ts +28 -18
  196. package/src/resources/payments.ts +1 -1
  197. package/src/resources/transactions.ts +20 -10
  198. package/src/resources/wallet.ts +223 -419
  199. package/src/resources/webhooks.ts +1225 -0
  200. package/src/version.ts +1 -1
  201. package/uploads.d.mts +1 -0
  202. package/uploads.d.mts.map +1 -1
  203. package/uploads.d.ts +1 -0
  204. package/uploads.d.ts.map +1 -1
  205. package/uploads.mjs +1 -0
  206. package/uploads.mjs.map +1 -1
  207. package/version.d.mts +1 -1
  208. package/version.d.ts +1 -1
  209. package/version.js +1 -1
  210. package/version.mjs +1 -1
@@ -7,24 +7,24 @@ import { RequestOptions } from '../internal/request-options';
7
7
  import { path } from '../internal/utils/path';
8
8
 
9
9
  /**
10
- * Wallet balance, deposits, withdrawals, and external funding sources
10
+ * Wallet balance, deposits, withdrawals, and external accounts
11
11
  */
12
12
  export class Wallet extends APIResource {
13
13
  /**
14
- * Get spendable and total wallet ledger balance.
14
+ * List wallets for the authenticated party, including balance and ACH deposit
15
+ * instructions when available. Currently returns at most one wallet.
15
16
  *
16
17
  * @example
17
18
  * ```ts
18
- * const response = await client.wallet.getBalance();
19
+ * const wallets = await client.wallet.list();
19
20
  * ```
20
21
  */
21
- getBalance(
22
- params: WalletGetBalanceParams | null | undefined = {},
22
+ list(
23
+ params: WalletListParams | null | undefined = {},
23
24
  options?: RequestOptions,
24
- ): APIPromise<WalletGetBalanceResponse> {
25
- const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
26
- return this._client.get('/wallet/balance', {
27
- query,
25
+ ): APIPromise<WalletListResponse> {
26
+ const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params ?? {};
27
+ return this._client.get('/wallets', {
28
28
  ...options,
29
29
  headers: buildHeaders([
30
30
  {
@@ -37,20 +37,23 @@ export class Wallet extends APIResource {
37
37
  }
38
38
 
39
39
  /**
40
- * Get account and routing numbers for ACH deposits.
40
+ * Get a wallet visible to the authenticated party, including balance and ACH
41
+ * deposit instructions when available.
41
42
  *
42
43
  * @example
43
44
  * ```ts
44
- * const response =
45
- * await client.wallet.getDepositInstructions();
45
+ * const wallet = await client.wallet.get(
46
+ * 'wal_ecc2efdd09bd231a9ad9bd2aada37aa7',
47
+ * );
46
48
  * ```
47
49
  */
48
- getDepositInstructions(
49
- params: WalletGetDepositInstructionsParams | null | undefined = {},
50
+ get(
51
+ walletID: string,
52
+ params: WalletGetParams | null | undefined = {},
50
53
  options?: RequestOptions,
51
- ): APIPromise<WalletGetDepositInstructionsResponse> {
54
+ ): APIPromise<WalletGetResponse> {
52
55
  const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params ?? {};
53
- return this._client.get('/wallet/deposit-instructions', {
56
+ return this._client.get(path`/wallets/${walletID}`, {
54
57
  ...options,
55
58
  headers: buildHeaders([
56
59
  {
@@ -69,8 +72,7 @@ export class Wallet extends APIResource {
69
72
  * ```ts
70
73
  * const response = await client.wallet.initiateDeposit({
71
74
  * amount: 1,
72
- * externalFundingSourceId:
73
- * 'efs_ecc2efdd09bd231a9ad9bd2aada37aa7',
75
+ * externalAccountId: 'ea_ecc2efdd09bd231a9ad9bd2aada37aa7',
74
76
  * 'Idempotency-Key': 'Idempotency-Key',
75
77
  * });
76
78
  * ```
@@ -106,8 +108,7 @@ export class Wallet extends APIResource {
106
108
  * ```ts
107
109
  * const response = await client.wallet.initiateWithdrawal({
108
110
  * amount: 1,
109
- * externalFundingSourceId:
110
- * 'efs_ecc2efdd09bd231a9ad9bd2aada37aa7',
111
+ * externalAccountId: 'ea_ecc2efdd09bd231a9ad9bd2aada37aa7',
111
112
  * 'Idempotency-Key': 'Idempotency-Key',
112
113
  * });
113
114
  * ```
@@ -135,69 +136,15 @@ export class Wallet extends APIResource {
135
136
  ]),
136
137
  });
137
138
  }
138
-
139
- /**
140
- * List linked external funding sources with cursor pagination.
141
- *
142
- * @example
143
- * ```ts
144
- * const response =
145
- * await client.wallet.listPaymentInstruments();
146
- * ```
147
- */
148
- listPaymentInstruments(
149
- params: WalletListPaymentInstrumentsParams | null | undefined = {},
150
- options?: RequestOptions,
151
- ): APIPromise<WalletListPaymentInstrumentsResponse> {
152
- const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
153
- return this._client.get('/wallet/external-funding-sources', {
154
- query,
155
- ...options,
156
- headers: buildHeaders([
157
- {
158
- ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
159
- ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
160
- },
161
- options?.headers,
162
- ]),
163
- });
164
- }
165
-
166
- /**
167
- * Remove (unlink) a bank account.
168
- *
169
- * @example
170
- * ```ts
171
- * const response =
172
- * await client.wallet.removePaymentInstrument(
173
- * 'efs_ecc2efdd09bd231a9ad9bd2aada37aa7',
174
- * );
175
- * ```
176
- */
177
- removePaymentInstrument(
178
- externalFundingSourceID: string,
179
- params: WalletRemovePaymentInstrumentParams | null | undefined = {},
180
- options?: RequestOptions,
181
- ): APIPromise<WalletRemovePaymentInstrumentResponse> {
182
- const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params ?? {};
183
- return this._client.delete(path`/wallet/external-funding-sources/${externalFundingSourceID}`, {
184
- ...options,
185
- headers: buildHeaders([
186
- {
187
- ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
188
- ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
189
- },
190
- options?.headers,
191
- ]),
192
- });
193
- }
194
139
  }
195
140
 
196
- export interface WalletGetBalanceResponse {
197
- data: WalletGetBalanceResponse.Data;
141
+ export interface WalletListResponse {
142
+ data: Array<WalletListResponse.Data>;
143
+
144
+ meta: WalletListResponse.Meta;
198
145
  }
199
146
 
200
- export namespace WalletGetBalanceResponse {
147
+ export namespace WalletListResponse {
201
148
  export interface Data {
202
149
  /**
203
150
  * Resource ID
@@ -226,19 +173,81 @@ export namespace WalletGetBalanceResponse {
226
173
  */
227
174
  export interface Attributes {
228
175
  /**
229
- * Amount currently available to spend or withdraw (cents)
176
+ * Wallet ledger balance
230
177
  */
231
- availableAmountMinor: number;
178
+ balance: Attributes.Balance;
232
179
 
233
180
  /**
234
- * Currency code
181
+ * Claimable payment totals
182
+ */
183
+ claims: Attributes.Claims;
184
+
185
+ /**
186
+ * ACH deposit instructions for this wallet, when available
235
187
  */
236
- currency: 'USD';
188
+ depositInstructions: Attributes.DepositInstructions | null;
237
189
 
238
190
  /**
239
- * Total wallet ledger balance (cents)
191
+ * Wallet readiness status
240
192
  */
241
- totalAmountMinor: number;
193
+ status: 'active';
194
+ }
195
+
196
+ export namespace Attributes {
197
+ /**
198
+ * Wallet ledger balance
199
+ */
200
+ export interface Balance {
201
+ /**
202
+ * Amount currently available to spend or withdraw (cents)
203
+ */
204
+ available: number;
205
+
206
+ /**
207
+ * Currency code
208
+ */
209
+ currency: 'USD';
210
+
211
+ /**
212
+ * Total wallet ledger balance (cents)
213
+ */
214
+ total: number;
215
+ }
216
+
217
+ /**
218
+ * Claimable payment totals
219
+ */
220
+ export interface Claims {
221
+ /**
222
+ * Total unclaimed product-payment amount (cents)
223
+ */
224
+ amount: number;
225
+
226
+ /**
227
+ * Number of unclaimed product payments
228
+ */
229
+ count: number;
230
+ }
231
+
232
+ /**
233
+ * ACH deposit instructions for this wallet, when available
234
+ */
235
+ export interface DepositInstructions {
236
+ /**
237
+ * Account number for ACH deposits
238
+ */
239
+ accountNumber: string;
240
+
241
+ /**
242
+ * Name of the receiving bank
243
+ */
244
+ bankName: string;
245
+
246
+ /**
247
+ * Bank routing number for ACH deposits
248
+ */
249
+ routingNumber: string;
250
+ }
242
251
  }
243
252
 
244
253
  /**
@@ -277,62 +286,28 @@ export namespace WalletGetBalanceResponse {
277
286
  }
278
287
  }
279
288
  }
280
- }
281
-
282
- export interface WalletGetDepositInstructionsResponse {
283
- data: WalletGetDepositInstructionsResponse.Data;
284
- }
285
289
 
286
- export namespace WalletGetDepositInstructionsResponse {
287
- export interface Data {
288
- /**
289
- * Resource ID (the wallet handle)
290
- */
291
- id: string;
292
-
293
- /**
294
- * Resource attributes
295
- */
296
- attributes: Data.Attributes;
297
-
298
- /**
299
- * Resource type
300
- */
301
- type: string;
290
+ export interface Meta {
291
+ pagination: Meta.Pagination;
302
292
  }
303
293
 
304
- export namespace Data {
305
- /**
306
- * Resource attributes
307
- */
308
- export interface Attributes {
309
- /**
310
- * Account number for ACH deposits
311
- */
312
- accountNumber: string;
313
-
314
- /**
315
- * Name of the receiving bank
316
- */
317
- bankName: string;
294
+ export namespace Meta {
295
+ export interface Pagination {
296
+ hasMore: boolean;
318
297
 
319
- /**
320
- * Bank routing number for ACH deposits
321
- */
322
- routingNumber: string;
298
+ nextCursor: string | null;
323
299
  }
324
300
  }
325
301
  }
326
302
 
327
- export interface WalletInitiateDepositResponse {
328
- data: WalletInitiateDepositResponse.Data;
303
+ export interface WalletGetResponse {
304
+ data: WalletGetResponse.Data;
329
305
  }
330
306
 
331
- export namespace WalletInitiateDepositResponse {
307
+ export namespace WalletGetResponse {
332
308
  export interface Data {
333
309
  /**
334
- * Transaction handle (txn_xxx). Empty when the operation failed before a
335
- * transaction was created.
310
+ * Resource ID
336
311
  */
337
312
  id: string;
338
313
 
@@ -342,65 +317,9 @@ export namespace WalletInitiateDepositResponse {
342
317
  attributes: Data.Attributes;
343
318
 
344
319
  /**
345
- * Resource type
346
- */
347
- type: string;
348
- }
349
-
350
- export namespace Data {
351
- /**
352
- * Resource attributes
353
- */
354
- export interface Attributes {
355
- /**
356
- * Amount in cents
357
- */
358
- amount: number;
359
-
360
- /**
361
- * Currency code
362
- */
363
- currency: string;
364
-
365
- /**
366
- * Error message if failed
367
- */
368
- error: string | null;
369
-
370
- /**
371
- * Detailed error information
372
- */
373
- errorDetails: string | null;
374
-
375
- /**
376
- * Estimated settlement time
377
- */
378
- estimatedSettlement: string | null;
379
-
380
- /**
381
- * Operation status
382
- */
383
- status: 'PROCESSING' | 'IN_REVIEW' | 'COMPLETED' | 'FAILED' | 'RETURNED';
384
- }
385
- }
386
- }
387
-
388
- export interface WalletInitiateWithdrawalResponse {
389
- data: WalletInitiateWithdrawalResponse.Data;
390
- }
391
-
392
- export namespace WalletInitiateWithdrawalResponse {
393
- export interface Data {
394
- /**
395
- * Transaction handle (txn_xxx). Empty when the operation failed before a
396
- * transaction was created.
397
- */
398
- id: string;
399
-
400
- /**
401
- * Resource attributes
320
+ * Resource relationships
402
321
  */
403
- attributes: Data.Attributes;
322
+ relationships: Data.Relationships;
404
323
 
405
324
  /**
406
325
  * Resource type
@@ -414,126 +333,81 @@ export namespace WalletInitiateWithdrawalResponse {
414
333
  */
415
334
  export interface Attributes {
416
335
  /**
417
- * Amount in cents
418
- */
419
- amount: number;
420
-
421
- /**
422
- * Currency code
336
+ * Wallet ledger balance
423
337
  */
424
- currency: string;
338
+ balance: Attributes.Balance;
425
339
 
426
340
  /**
427
- * Error message if failed
341
+ * Claimable payment totals
428
342
  */
429
- error: string | null;
343
+ claims: Attributes.Claims;
430
344
 
431
345
  /**
432
- * Detailed error information
346
+ * ACH deposit instructions for this wallet, when available
433
347
  */
434
- errorDetails: string | null;
348
+ depositInstructions: Attributes.DepositInstructions | null;
435
349
 
436
350
  /**
437
- * Estimated settlement time
351
+ * Wallet readiness status
438
352
  */
439
- estimatedSettlement: string | null;
440
-
441
- /**
442
- * Payment instruction ID
443
- */
444
- instructionId: string | null;
445
-
446
- /**
447
- * MFA challenge ID
448
- */
449
- mfaChallengeId: string | null;
450
-
451
- /**
452
- * MFA challenge expiration
453
- */
454
- mfaExpiresAt: string | null;
455
-
456
- /**
457
- * Whether MFA is required
458
- */
459
- mfaRequired: boolean;
460
-
461
- /**
462
- * Operation status
463
- */
464
- status: 'PROCESSING' | 'IN_REVIEW' | 'COMPLETED' | 'FAILED' | 'RETURNED';
353
+ status: 'active';
465
354
  }
466
- }
467
- }
468
-
469
- export interface WalletListPaymentInstrumentsResponse {
470
- data: Array<WalletListPaymentInstrumentsResponse.Data>;
471
355
 
472
- meta: WalletListPaymentInstrumentsResponse.Meta;
473
- }
474
-
475
- export namespace WalletListPaymentInstrumentsResponse {
476
- export interface Data {
477
- /**
478
- * Resource ID
479
- */
480
- id: string;
481
-
482
- /**
483
- * Resource attributes
484
- */
485
- attributes: Data.Attributes;
486
-
487
- /**
488
- * Resource relationships
489
- */
490
- relationships: Data.Relationships;
491
-
492
- /**
493
- * Resource type
494
- */
495
- type: string;
496
- }
497
-
498
- export namespace Data {
499
- /**
500
- * Resource attributes
501
- */
502
- export interface Attributes {
356
+ export namespace Attributes {
503
357
  /**
504
- * Account display name
358
+ * Wallet ledger balance
505
359
  */
506
- accountName: string | null;
360
+ export interface Balance {
361
+ /**
362
+ * Amount currently available to spend or withdraw (cents)
363
+ */
364
+ available: number;
507
365
 
508
- /**
509
- * Account type (checking, savings)
510
- */
511
- accountType: 'checking' | 'savings' | 'unknown' | null;
366
+ /**
367
+ * Currency code
368
+ */
369
+ currency: 'USD';
512
370
 
513
- /**
514
- * Bank institution name
515
- */
516
- bankName: string | null;
371
+ /**
372
+ * Total wallet ledger balance (cents)
373
+ */
374
+ total: number;
375
+ }
517
376
 
518
377
  /**
519
- * When the funding source was linked
378
+ * Claimable payment totals
520
379
  */
521
- createdAt: string;
380
+ export interface Claims {
381
+ /**
382
+ * Total unclaimed product-payment amount (cents)
383
+ */
384
+ amount: number;
522
385
 
523
- /**
524
- * Last 4 digits of account
525
- */
526
- lastFour: string;
386
+ /**
387
+ * Number of unclaimed product payments
388
+ */
389
+ count: number;
390
+ }
527
391
 
528
392
  /**
529
- * Status (new, active, disabled)
393
+ * ACH deposit instructions for this wallet, when available
530
394
  */
531
- status: 'new' | 'active' | 'disabled' | 'deleted' | 'unknown';
395
+ export interface DepositInstructions {
396
+ /**
397
+ * Account number for ACH deposits
398
+ */
399
+ accountNumber: string;
532
400
 
533
- /**
534
- * Verification state
535
- */
536
- verificationState: string | null;
401
+ /**
402
+ * Name of the receiving bank
403
+ */
404
+ bankName: string;
405
+
406
+ /**
407
+ * Bank routing number for ACH deposits
408
+ */
409
+ routingNumber: string;
410
+ }
537
411
  }
538
412
 
539
413
  /**
@@ -541,14 +415,14 @@ export namespace WalletListPaymentInstrumentsResponse {
541
415
  */
542
416
  export interface Relationships {
543
417
  /**
544
- * Party that owns the funding source
418
+ * Party that owns the wallet
545
419
  */
546
420
  party: Relationships.Party;
547
421
  }
548
422
 
549
423
  export namespace Relationships {
550
424
  /**
551
- * Party that owns the funding source
425
+ * Party that owns the wallet
552
426
  */
553
427
  export interface Party {
554
428
  /**
@@ -572,30 +446,17 @@ export namespace WalletListPaymentInstrumentsResponse {
572
446
  }
573
447
  }
574
448
  }
575
-
576
- export interface Meta {
577
- pagination: Meta.Pagination;
578
- }
579
-
580
- export namespace Meta {
581
- export interface Pagination {
582
- hasMore: boolean;
583
-
584
- nextCursor: string | null;
585
- }
586
- }
587
449
  }
588
450
 
589
- export interface WalletRemovePaymentInstrumentResponse {
590
- data: WalletRemovePaymentInstrumentResponse.Data;
591
-
592
- meta: WalletRemovePaymentInstrumentResponse.Meta;
451
+ export interface WalletInitiateDepositResponse {
452
+ data: WalletInitiateDepositResponse.Data;
593
453
  }
594
454
 
595
- export namespace WalletRemovePaymentInstrumentResponse {
455
+ export namespace WalletInitiateDepositResponse {
596
456
  export interface Data {
597
457
  /**
598
- * Resource ID
458
+ * Transaction handle (txn_xxx). Empty when the operation failed before a
459
+ * transaction was created.
599
460
  */
600
461
  id: string;
601
462
 
@@ -604,11 +465,6 @@ export namespace WalletRemovePaymentInstrumentResponse {
604
465
  */
605
466
  attributes: Data.Attributes;
606
467
 
607
- /**
608
- * Resource relationships
609
- */
610
- relationships: Data.Relationships;
611
-
612
468
  /**
613
469
  * Resource type
614
470
  */
@@ -621,105 +477,93 @@ export namespace WalletRemovePaymentInstrumentResponse {
621
477
  */
622
478
  export interface Attributes {
623
479
  /**
624
- * Account display name
480
+ * Amount in cents
625
481
  */
626
- accountName: string | null;
482
+ amount: number;
627
483
 
628
484
  /**
629
- * Account type (checking, savings)
485
+ * Currency code
630
486
  */
631
- accountType: 'checking' | 'savings' | 'unknown' | null;
487
+ currency: string;
632
488
 
633
489
  /**
634
- * Bank institution name
490
+ * Estimated settlement time
635
491
  */
636
- bankName: string | null;
492
+ estimatedSettlement: string | null;
637
493
 
638
494
  /**
639
- * When the funding source was linked
495
+ * Operation status
640
496
  */
641
- createdAt: string;
497
+ status: 'PROCESSING' | 'IN_REVIEW' | 'AWAITING_APPROVAL' | 'COMPLETED' | 'FAILED' | 'RETURNED';
498
+ }
499
+ }
500
+ }
642
501
 
643
- /**
644
- * Last 4 digits of account
645
- */
646
- lastFour: string;
502
+ export interface WalletInitiateWithdrawalResponse {
503
+ data: WalletInitiateWithdrawalResponse.Data;
504
+ }
647
505
 
648
- /**
649
- * Status (new, active, disabled)
650
- */
651
- status: 'new' | 'active' | 'disabled' | 'deleted' | 'unknown';
506
+ export namespace WalletInitiateWithdrawalResponse {
507
+ export interface Data {
508
+ /**
509
+ * Transaction handle (txn_xxx). Empty when the operation failed before a
510
+ * transaction was created.
511
+ */
512
+ id: string;
652
513
 
653
- /**
654
- * Verification state
655
- */
656
- verificationState: string | null;
657
- }
514
+ /**
515
+ * Resource attributes
516
+ */
517
+ attributes: Data.Attributes;
658
518
 
659
519
  /**
660
- * Resource relationships
520
+ * Resource type
661
521
  */
662
- export interface Relationships {
522
+ type: string;
523
+ }
524
+
525
+ export namespace Data {
526
+ /**
527
+ * Resource attributes
528
+ */
529
+ export interface Attributes {
663
530
  /**
664
- * Party that owns the funding source
531
+ * Amount in cents
665
532
  */
666
- party: Relationships.Party;
667
- }
533
+ amount: number;
668
534
 
669
- export namespace Relationships {
670
535
  /**
671
- * Party that owns the funding source
536
+ * Currency code
672
537
  */
673
- export interface Party {
674
- /**
675
- * Related resource identifier
676
- */
677
- data: Party.Data;
678
- }
538
+ currency: string;
679
539
 
680
- export namespace Party {
681
- /**
682
- * Related resource identifier
683
- */
684
- export interface Data {
685
- id: string;
540
+ /**
541
+ * Estimated settlement time
542
+ */
543
+ estimatedSettlement: string | null;
686
544
 
687
- /**
688
- * Resource type
689
- */
690
- type: string;
691
- }
692
- }
545
+ /**
546
+ * Operation status
547
+ */
548
+ status: 'PROCESSING' | 'IN_REVIEW' | 'AWAITING_APPROVAL' | 'COMPLETED' | 'FAILED' | 'RETURNED';
693
549
  }
694
550
  }
695
-
696
- export interface Meta {
697
- /**
698
- * Indicates the resource was deleted
699
- */
700
- deleted: true;
701
- }
702
551
  }
703
552
 
704
- export interface WalletGetBalanceParams {
553
+ export interface WalletListParams {
705
554
  /**
706
- * Query param
707
- */
708
- partyId?: string;
709
-
710
- /**
711
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
555
+ * Agent ID (agt_xxx) identifying which agent is making the request.
712
556
  */
713
557
  'X-Agent-ID'?: string;
714
558
 
715
559
  /**
716
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
717
- * for agent observability.
560
+ * Required when X-Agent-ID is present. Session or conversation ID for agent
561
+ * observability.
718
562
  */
719
563
  'X-Instance-ID'?: string;
720
564
  }
721
565
 
722
- export interface WalletGetDepositInstructionsParams {
566
+ export interface WalletGetParams {
723
567
  /**
724
568
  * Agent ID (agt_xxx) identifying which agent is making the request.
725
569
  */
@@ -739,9 +583,9 @@ export interface WalletInitiateDepositParams {
739
583
  amount: number;
740
584
 
741
585
  /**
742
- * Body param: External funding source ID (efs\_\*)
586
+ * Body param: External account ID (ea\_\*)
743
587
  */
744
- externalFundingSourceId: string;
588
+ externalAccountId: string;
745
589
 
746
590
  /**
747
591
  * Header param: Unique key for idempotent request handling. If a request with the
@@ -778,9 +622,9 @@ export interface WalletInitiateWithdrawalParams {
778
622
  amount: number;
779
623
 
780
624
  /**
781
- * Body param: External funding source ID (efs\_\*)
625
+ * Body param: External account ID (ea\_\*)
782
626
  */
783
- externalFundingSourceId: string;
627
+ externalAccountId: string;
784
628
 
785
629
  /**
786
630
  * Header param: Unique key for idempotent request handling. If a request with the
@@ -810,55 +654,15 @@ export interface WalletInitiateWithdrawalParams {
810
654
  'X-Instance-ID'?: string;
811
655
  }
812
656
 
813
- export interface WalletListPaymentInstrumentsParams {
814
- /**
815
- * Query param
816
- */
817
- cursor?: string;
818
-
819
- /**
820
- * Query param
821
- */
822
- limit?: number;
823
-
824
- /**
825
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
826
- */
827
- 'X-Agent-ID'?: string;
828
-
829
- /**
830
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
831
- * for agent observability.
832
- */
833
- 'X-Instance-ID'?: string;
834
- }
835
-
836
- export interface WalletRemovePaymentInstrumentParams {
837
- /**
838
- * Agent ID (agt_xxx) identifying which agent is making the request.
839
- */
840
- 'X-Agent-ID'?: string;
841
-
842
- /**
843
- * Required when X-Agent-ID is present. Session or conversation ID for agent
844
- * observability.
845
- */
846
- 'X-Instance-ID'?: string;
847
- }
848
-
849
657
  export declare namespace Wallet {
850
658
  export {
851
- type WalletGetBalanceResponse as WalletGetBalanceResponse,
852
- type WalletGetDepositInstructionsResponse as WalletGetDepositInstructionsResponse,
659
+ type WalletListResponse as WalletListResponse,
660
+ type WalletGetResponse as WalletGetResponse,
853
661
  type WalletInitiateDepositResponse as WalletInitiateDepositResponse,
854
662
  type WalletInitiateWithdrawalResponse as WalletInitiateWithdrawalResponse,
855
- type WalletListPaymentInstrumentsResponse as WalletListPaymentInstrumentsResponse,
856
- type WalletRemovePaymentInstrumentResponse as WalletRemovePaymentInstrumentResponse,
857
- type WalletGetBalanceParams as WalletGetBalanceParams,
858
- type WalletGetDepositInstructionsParams as WalletGetDepositInstructionsParams,
663
+ type WalletListParams as WalletListParams,
664
+ type WalletGetParams as WalletGetParams,
859
665
  type WalletInitiateDepositParams as WalletInitiateDepositParams,
860
666
  type WalletInitiateWithdrawalParams as WalletInitiateWithdrawalParams,
861
- type WalletListPaymentInstrumentsParams as WalletListPaymentInstrumentsParams,
862
- type WalletRemovePaymentInstrumentParams as WalletRemovePaymentInstrumentParams,
863
667
  };
864
668
  }