@augustusbank/typescript-sdk 0.32.0 → 0.33.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 (76) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/client.d.mts +7 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/accounts.d.mts +24 -6
  12. package/resources/accounts.d.mts.map +1 -1
  13. package/resources/accounts.d.ts +24 -6
  14. package/resources/accounts.d.ts.map +1 -1
  15. package/resources/api-keys.d.mts +1 -1
  16. package/resources/api-keys.d.mts.map +1 -1
  17. package/resources/api-keys.d.ts +1 -1
  18. package/resources/api-keys.d.ts.map +1 -1
  19. package/resources/counterparties.d.mts +227 -12
  20. package/resources/counterparties.d.mts.map +1 -1
  21. package/resources/counterparties.d.ts +227 -12
  22. package/resources/counterparties.d.ts.map +1 -1
  23. package/resources/counterparties.js +16 -0
  24. package/resources/counterparties.js.map +1 -1
  25. package/resources/counterparties.mjs +16 -0
  26. package/resources/counterparties.mjs.map +1 -1
  27. package/resources/events.d.mts +3 -3
  28. package/resources/events.d.mts.map +1 -1
  29. package/resources/events.d.ts +3 -3
  30. package/resources/events.d.ts.map +1 -1
  31. package/resources/index.d.mts +3 -2
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +3 -2
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +3 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +1 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/payout-tracking-events.d.mts +358 -0
  40. package/resources/payout-tracking-events.d.mts.map +1 -0
  41. package/resources/payout-tracking-events.d.ts +358 -0
  42. package/resources/payout-tracking-events.d.ts.map +1 -0
  43. package/resources/payout-tracking-events.js +23 -0
  44. package/resources/payout-tracking-events.js.map +1 -0
  45. package/resources/payout-tracking-events.mjs +19 -0
  46. package/resources/payout-tracking-events.mjs.map +1 -0
  47. package/resources/scopes.d.mts +1 -1
  48. package/resources/scopes.d.mts.map +1 -1
  49. package/resources/scopes.d.ts +1 -1
  50. package/resources/scopes.d.ts.map +1 -1
  51. package/resources/transactions.d.mts +4 -4
  52. package/resources/transactions.d.ts +4 -4
  53. package/resources/webhook-subscriptions.d.mts +8 -8
  54. package/resources/webhook-subscriptions.d.mts.map +1 -1
  55. package/resources/webhook-subscriptions.d.ts +8 -8
  56. package/resources/webhook-subscriptions.d.ts.map +1 -1
  57. package/resources/webhooks.d.mts +196 -14
  58. package/resources/webhooks.d.mts.map +1 -1
  59. package/resources/webhooks.d.ts +196 -14
  60. package/resources/webhooks.d.ts.map +1 -1
  61. package/src/client.ts +21 -0
  62. package/src/resources/accounts.ts +24 -6
  63. package/src/resources/api-keys.ts +1 -0
  64. package/src/resources/counterparties.ts +536 -12
  65. package/src/resources/events.ts +3 -0
  66. package/src/resources/index.ts +9 -0
  67. package/src/resources/payout-tracking-events.ts +479 -0
  68. package/src/resources/scopes.ts +2 -1
  69. package/src/resources/transactions.ts +4 -4
  70. package/src/resources/webhook-subscriptions.ts +8 -0
  71. package/src/resources/webhooks.ts +241 -12
  72. package/src/version.ts +1 -1
  73. package/version.d.mts +1 -1
  74. package/version.d.ts +1 -1
  75. package/version.js +1 -1
  76. package/version.mjs +1 -1
@@ -0,0 +1,479 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class PayoutTrackingEvents extends APIResource {
10
+ /**
11
+ * Retrieves a payout tracking event by ID.
12
+ */
13
+ retrieve(id: string, options?: RequestOptions): APIPromise<PayoutTrackingEventRetrieveResponse> {
14
+ return this._client.get(path`/v1/payout_tracking_events/${id}`, options);
15
+ }
16
+
17
+ /**
18
+ * Returns a paginated list of payout tracking events, newest first.
19
+ */
20
+ list(
21
+ query: PayoutTrackingEventListParams | null | undefined = {},
22
+ options?: RequestOptions,
23
+ ): PagePromise<PayoutTrackingEventListResponsesCursorPage, PayoutTrackingEventListResponse> {
24
+ return this._client.getAPIList(
25
+ '/v1/payout_tracking_events',
26
+ CursorPage<PayoutTrackingEventListResponse>,
27
+ { query, ...options },
28
+ );
29
+ }
30
+ }
31
+
32
+ export type PayoutTrackingEventListResponsesCursorPage = CursorPage<PayoutTrackingEventListResponse>;
33
+
34
+ export interface PayoutTrackingEventRetrieveResponse {
35
+ /**
36
+ * Unique identifier of the tracking event.
37
+ */
38
+ id: string;
39
+
40
+ /**
41
+ * Amount credited to the beneficiary. Set only on a credited event, otherwise
42
+ * null.
43
+ */
44
+ beneficiary_amount: PayoutTrackingEventRetrieveResponse.BeneficiaryAmount | null;
45
+
46
+ /**
47
+ * ISO 8601 UTC timestamp when Augustus recorded the event.
48
+ */
49
+ created_at: string;
50
+
51
+ /**
52
+ * Fee deducted at this step. Null when none was reported.
53
+ */
54
+ fee: PayoutTrackingEventRetrieveResponse.Fee | null;
55
+
56
+ /**
57
+ * Institution that acted on or reported this step. Null when unknown.
58
+ */
59
+ institution: PayoutTrackingEventRetrieveResponse.Institution | null;
60
+
61
+ /**
62
+ * Whether Augustus considers delivery finished. A later event, such as returned,
63
+ * can still follow.
64
+ */
65
+ is_terminal: boolean;
66
+
67
+ /**
68
+ * Normalized point in the payout journey. New values may be added.
69
+ */
70
+ milestone:
71
+ | 'initiated'
72
+ | 'submitted'
73
+ | 'sent'
74
+ | 'failed'
75
+ | 'returned'
76
+ | 'accepted'
77
+ | 'settled'
78
+ | 'forwarded'
79
+ | 'credited'
80
+ | 'rejected'
81
+ | 'returning'
82
+ | 'visibility_lost'
83
+ | 'other';
84
+
85
+ /**
86
+ * Raw network status. Null when the step has none.
87
+ */
88
+ network_status: PayoutTrackingEventRetrieveResponse.NetworkStatus | null;
89
+
90
+ /**
91
+ * ISO 8601 UTC timestamp when the step happened. Null when the source has no
92
+ * timestamp. Can be out of order with sequence.
93
+ */
94
+ occurred_at: string | null;
95
+
96
+ /**
97
+ * ID of the payout this event belongs to.
98
+ */
99
+ payout_id: string;
100
+
101
+ /**
102
+ * How far Augustus can follow the payout: end_to_end when the rail confirms the
103
+ * beneficiary credit, network when it only confirms settlement. New values may be
104
+ * added.
105
+ */
106
+ scope: 'network' | 'end_to_end';
107
+
108
+ /**
109
+ * Gap-free counter per payout, in the order Augustus recorded the events. A gap
110
+ * means you missed a recorded event, such as a dropped webhook. A sequence without
111
+ * gaps does not mean every network step was observed.
112
+ */
113
+ sequence: number;
114
+
115
+ /**
116
+ * Where Augustus learned this step: augustus for steps Augustus records itself,
117
+ * swift_gpi for SWIFT gpi statuses, other for any other source. New values may be
118
+ * added.
119
+ */
120
+ source: 'augustus' | 'swift_gpi' | 'other';
121
+
122
+ /**
123
+ * Reason for the current state. Null when none applies.
124
+ */
125
+ status_reason: PayoutTrackingEventRetrieveResponse.StatusReason | null;
126
+
127
+ /**
128
+ * Resource type discriminator.
129
+ */
130
+ type: 'payout_tracking_event';
131
+ }
132
+
133
+ export namespace PayoutTrackingEventRetrieveResponse {
134
+ /**
135
+ * Amount credited to the beneficiary. Set only on a credited event, otherwise
136
+ * null.
137
+ */
138
+ export interface BeneficiaryAmount {
139
+ /**
140
+ * Credited amount as a string decimal (e.g. "100.50").
141
+ */
142
+ amount: string;
143
+
144
+ /**
145
+ * ISO 4217 currency code of the credited amount.
146
+ */
147
+ currency: string;
148
+ }
149
+
150
+ /**
151
+ * Fee deducted at this step. Null when none was reported.
152
+ */
153
+ export interface Fee {
154
+ /**
155
+ * Fee amount as a string decimal (e.g. "10.00").
156
+ */
157
+ amount: string;
158
+
159
+ /**
160
+ * Who bears the charges under the payment charge agreement: debtor (OUR), creditor
161
+ * (BEN), shared (SHA), or other for any other agreement. New values may be added.
162
+ */
163
+ borne_by: 'debtor' | 'creditor' | 'shared' | 'other';
164
+
165
+ /**
166
+ * ISO 4217 currency code of the fee.
167
+ */
168
+ currency: string;
169
+ }
170
+
171
+ /**
172
+ * Institution that acted on or reported this step. Null when unknown.
173
+ */
174
+ export interface Institution {
175
+ /**
176
+ * Identifier of the institution, typed by scheme.
177
+ */
178
+ identifier: Institution.Identifier;
179
+ }
180
+
181
+ export namespace Institution {
182
+ /**
183
+ * Identifier of the institution, typed by scheme.
184
+ */
185
+ export interface Identifier {
186
+ /**
187
+ * Identifier scheme. Only bic today.
188
+ */
189
+ type: 'bic';
190
+
191
+ /**
192
+ * ISO 9362 Bank Identifier Code (8 or 11 characters).
193
+ */
194
+ value: string;
195
+ }
196
+ }
197
+
198
+ /**
199
+ * Raw network status. Null when the step has none.
200
+ */
201
+ export interface NetworkStatus {
202
+ /**
203
+ * Status code reported by the network, such as ACSP, ACSC, ACCC or RJCT.
204
+ */
205
+ code: string;
206
+
207
+ /**
208
+ * Reason code for the status, such as G000. Null when the network reports none.
209
+ */
210
+ reason_code: string | null;
211
+ }
212
+
213
+ /**
214
+ * Reason for the current state. Null when none applies.
215
+ */
216
+ export interface StatusReason {
217
+ /**
218
+ * Normalized reason code assigned by Augustus. New codes may be added.
219
+ */
220
+ code: string;
221
+
222
+ /**
223
+ * Explanation of the reason code, written by Augustus.
224
+ */
225
+ description: string;
226
+ }
227
+ }
228
+
229
+ export interface PayoutTrackingEventListResponse {
230
+ /**
231
+ * Unique identifier of the tracking event.
232
+ */
233
+ id: string;
234
+
235
+ /**
236
+ * Amount credited to the beneficiary. Set only on a credited event, otherwise
237
+ * null.
238
+ */
239
+ beneficiary_amount: PayoutTrackingEventListResponse.BeneficiaryAmount | null;
240
+
241
+ /**
242
+ * ISO 8601 UTC timestamp when Augustus recorded the event.
243
+ */
244
+ created_at: string;
245
+
246
+ /**
247
+ * Fee deducted at this step. Null when none was reported.
248
+ */
249
+ fee: PayoutTrackingEventListResponse.Fee | null;
250
+
251
+ /**
252
+ * Institution that acted on or reported this step. Null when unknown.
253
+ */
254
+ institution: PayoutTrackingEventListResponse.Institution | null;
255
+
256
+ /**
257
+ * Whether Augustus considers delivery finished. A later event, such as returned,
258
+ * can still follow.
259
+ */
260
+ is_terminal: boolean;
261
+
262
+ /**
263
+ * Normalized point in the payout journey. New values may be added.
264
+ */
265
+ milestone:
266
+ | 'initiated'
267
+ | 'submitted'
268
+ | 'sent'
269
+ | 'failed'
270
+ | 'returned'
271
+ | 'accepted'
272
+ | 'settled'
273
+ | 'forwarded'
274
+ | 'credited'
275
+ | 'rejected'
276
+ | 'returning'
277
+ | 'visibility_lost'
278
+ | 'other';
279
+
280
+ /**
281
+ * Raw network status. Null when the step has none.
282
+ */
283
+ network_status: PayoutTrackingEventListResponse.NetworkStatus | null;
284
+
285
+ /**
286
+ * ISO 8601 UTC timestamp when the step happened. Null when the source has no
287
+ * timestamp. Can be out of order with sequence.
288
+ */
289
+ occurred_at: string | null;
290
+
291
+ /**
292
+ * ID of the payout this event belongs to.
293
+ */
294
+ payout_id: string;
295
+
296
+ /**
297
+ * How far Augustus can follow the payout: end_to_end when the rail confirms the
298
+ * beneficiary credit, network when it only confirms settlement. New values may be
299
+ * added.
300
+ */
301
+ scope: 'network' | 'end_to_end';
302
+
303
+ /**
304
+ * Gap-free counter per payout, in the order Augustus recorded the events. A gap
305
+ * means you missed a recorded event, such as a dropped webhook. A sequence without
306
+ * gaps does not mean every network step was observed.
307
+ */
308
+ sequence: number;
309
+
310
+ /**
311
+ * Where Augustus learned this step: augustus for steps Augustus records itself,
312
+ * swift_gpi for SWIFT gpi statuses, other for any other source. New values may be
313
+ * added.
314
+ */
315
+ source: 'augustus' | 'swift_gpi' | 'other';
316
+
317
+ /**
318
+ * Reason for the current state. Null when none applies.
319
+ */
320
+ status_reason: PayoutTrackingEventListResponse.StatusReason | null;
321
+
322
+ /**
323
+ * Resource type discriminator.
324
+ */
325
+ type: 'payout_tracking_event';
326
+ }
327
+
328
+ export namespace PayoutTrackingEventListResponse {
329
+ /**
330
+ * Amount credited to the beneficiary. Set only on a credited event, otherwise
331
+ * null.
332
+ */
333
+ export interface BeneficiaryAmount {
334
+ /**
335
+ * Credited amount as a string decimal (e.g. "100.50").
336
+ */
337
+ amount: string;
338
+
339
+ /**
340
+ * ISO 4217 currency code of the credited amount.
341
+ */
342
+ currency: string;
343
+ }
344
+
345
+ /**
346
+ * Fee deducted at this step. Null when none was reported.
347
+ */
348
+ export interface Fee {
349
+ /**
350
+ * Fee amount as a string decimal (e.g. "10.00").
351
+ */
352
+ amount: string;
353
+
354
+ /**
355
+ * Who bears the charges under the payment charge agreement: debtor (OUR), creditor
356
+ * (BEN), shared (SHA), or other for any other agreement. New values may be added.
357
+ */
358
+ borne_by: 'debtor' | 'creditor' | 'shared' | 'other';
359
+
360
+ /**
361
+ * ISO 4217 currency code of the fee.
362
+ */
363
+ currency: string;
364
+ }
365
+
366
+ /**
367
+ * Institution that acted on or reported this step. Null when unknown.
368
+ */
369
+ export interface Institution {
370
+ /**
371
+ * Identifier of the institution, typed by scheme.
372
+ */
373
+ identifier: Institution.Identifier;
374
+ }
375
+
376
+ export namespace Institution {
377
+ /**
378
+ * Identifier of the institution, typed by scheme.
379
+ */
380
+ export interface Identifier {
381
+ /**
382
+ * Identifier scheme. Only bic today.
383
+ */
384
+ type: 'bic';
385
+
386
+ /**
387
+ * ISO 9362 Bank Identifier Code (8 or 11 characters).
388
+ */
389
+ value: string;
390
+ }
391
+ }
392
+
393
+ /**
394
+ * Raw network status. Null when the step has none.
395
+ */
396
+ export interface NetworkStatus {
397
+ /**
398
+ * Status code reported by the network, such as ACSP, ACSC, ACCC or RJCT.
399
+ */
400
+ code: string;
401
+
402
+ /**
403
+ * Reason code for the status, such as G000. Null when the network reports none.
404
+ */
405
+ reason_code: string | null;
406
+ }
407
+
408
+ /**
409
+ * Reason for the current state. Null when none applies.
410
+ */
411
+ export interface StatusReason {
412
+ /**
413
+ * Normalized reason code assigned by Augustus. New codes may be added.
414
+ */
415
+ code: string;
416
+
417
+ /**
418
+ * Explanation of the reason code, written by Augustus.
419
+ */
420
+ description: string;
421
+ }
422
+ }
423
+
424
+ export interface PayoutTrackingEventListParams extends CursorPageParams {
425
+ created_at?: PayoutTrackingEventListParams.CreatedAt;
426
+
427
+ /**
428
+ * Filter by whether Augustus considers delivery finished.
429
+ */
430
+ is_terminal?: boolean;
431
+
432
+ /**
433
+ * Filter by milestone.
434
+ */
435
+ milestone?:
436
+ | 'initiated'
437
+ | 'submitted'
438
+ | 'sent'
439
+ | 'failed'
440
+ | 'returned'
441
+ | 'accepted'
442
+ | 'settled'
443
+ | 'forwarded'
444
+ | 'credited'
445
+ | 'rejected'
446
+ | 'returning'
447
+ | 'visibility_lost'
448
+ | 'other';
449
+
450
+ /**
451
+ * Filter tracking events belonging to this payout.
452
+ */
453
+ payout_id?: string;
454
+ }
455
+
456
+ export namespace PayoutTrackingEventListParams {
457
+ export interface CreatedAt {
458
+ /**
459
+ * Include tracking events whose created_at is greater than or equal to this ISO
460
+ * 8601 timestamp.
461
+ */
462
+ gte?: string;
463
+
464
+ /**
465
+ * Include tracking events whose created_at is less than or equal to this ISO 8601
466
+ * timestamp.
467
+ */
468
+ lte?: string;
469
+ }
470
+ }
471
+
472
+ export declare namespace PayoutTrackingEvents {
473
+ export {
474
+ type PayoutTrackingEventRetrieveResponse as PayoutTrackingEventRetrieveResponse,
475
+ type PayoutTrackingEventListResponse as PayoutTrackingEventListResponse,
476
+ type PayoutTrackingEventListResponsesCursorPage as PayoutTrackingEventListResponsesCursorPage,
477
+ type PayoutTrackingEventListParams as PayoutTrackingEventListParams,
478
+ };
479
+ }
@@ -54,7 +54,8 @@ export namespace ScopeListResponse {
54
54
  | 'webhook_deliveries:read'
55
55
  | 'webhook_deliveries:write'
56
56
  | 'transactions:read'
57
- | 'simulations:write';
57
+ | 'simulations:write'
58
+ | 'payout_tracking_events:read';
58
59
 
59
60
  /**
60
61
  * Action category.
@@ -107,8 +107,8 @@ export interface TransactionRetrieveResponse {
107
107
  status: 'booked';
108
108
 
109
109
  /**
110
- * Reference used to track the payment across the payment network, such as the UETR
111
- * for SWIFT payments.
110
+ * Network tracking identifier: UETR for SWIFT, IMAD for Fedwire, or the trace
111
+ * number for ACH. Null when unavailable.
112
112
  */
113
113
  tracking_reference: string | null;
114
114
 
@@ -666,8 +666,8 @@ export interface TransactionListResponse {
666
666
  status: 'booked';
667
667
 
668
668
  /**
669
- * Reference used to track the payment across the payment network, such as the UETR
670
- * for SWIFT payments.
669
+ * Network tracking identifier: UETR for SWIFT, IMAD for Fedwire, or the trace
670
+ * number for ACH. Null when unavailable.
671
671
  */
672
672
  tracking_reference: string | null;
673
673
 
@@ -155,6 +155,7 @@ export interface WebhookSubscriptionCreateResponse {
155
155
  | 'counterparty.blocked'
156
156
  | 'counterparty.unblocked'
157
157
  | 'counterparty.updated'
158
+ | 'payout_tracking_event.created'
158
159
  >;
159
160
 
160
161
  /**
@@ -217,6 +218,7 @@ export interface WebhookSubscriptionRetrieveResponse {
217
218
  | 'counterparty.blocked'
218
219
  | 'counterparty.unblocked'
219
220
  | 'counterparty.updated'
221
+ | 'payout_tracking_event.created'
220
222
  >;
221
223
 
222
224
  /**
@@ -279,6 +281,7 @@ export interface WebhookSubscriptionUpdateResponse {
279
281
  | 'counterparty.blocked'
280
282
  | 'counterparty.unblocked'
281
283
  | 'counterparty.updated'
284
+ | 'payout_tracking_event.created'
282
285
  >;
283
286
 
284
287
  /**
@@ -341,6 +344,7 @@ export interface WebhookSubscriptionListResponse {
341
344
  | 'counterparty.blocked'
342
345
  | 'counterparty.unblocked'
343
346
  | 'counterparty.updated'
347
+ | 'payout_tracking_event.created'
344
348
  >;
345
349
 
346
350
  /**
@@ -403,6 +407,7 @@ export interface WebhookSubscriptionDeleteResponse {
403
407
  | 'counterparty.blocked'
404
408
  | 'counterparty.unblocked'
405
409
  | 'counterparty.updated'
410
+ | 'payout_tracking_event.created'
406
411
  >;
407
412
 
408
413
  /**
@@ -477,6 +482,7 @@ export interface WebhookSubscriptionSendTestEventResponse {
477
482
  | 'counterparty.blocked'
478
483
  | 'counterparty.unblocked'
479
484
  | 'counterparty.updated'
485
+ | 'payout_tracking_event.created'
480
486
  | 'ping.test';
481
487
 
482
488
  /**
@@ -512,6 +518,7 @@ export interface WebhookSubscriptionCreateParams {
512
518
  | 'counterparty.blocked'
513
519
  | 'counterparty.unblocked'
514
520
  | 'counterparty.updated'
521
+ | 'payout_tracking_event.created'
515
522
  | '*'
516
523
  >;
517
524
 
@@ -556,6 +563,7 @@ export interface WebhookSubscriptionUpdateParams {
556
563
  | 'counterparty.blocked'
557
564
  | 'counterparty.unblocked'
558
565
  | 'counterparty.updated'
566
+ | 'payout_tracking_event.created'
559
567
  | '*'
560
568
  > | null;
561
569