@augustusbank/typescript-sdk 0.22.0 → 0.22.2

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 (164) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/client.d.mts +8 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/account-programs.d.mts +21 -16
  10. package/resources/account-programs.d.mts.map +1 -1
  11. package/resources/account-programs.d.ts +21 -16
  12. package/resources/account-programs.d.ts.map +1 -1
  13. package/resources/account-programs.js +2 -2
  14. package/resources/account-programs.js.map +1 -1
  15. package/resources/account-programs.mjs +2 -2
  16. package/resources/account-programs.mjs.map +1 -1
  17. package/resources/accounts.d.mts +21 -6
  18. package/resources/accounts.d.mts.map +1 -1
  19. package/resources/accounts.d.ts +21 -6
  20. package/resources/accounts.d.ts.map +1 -1
  21. package/resources/accounts.js +2 -2
  22. package/resources/accounts.js.map +1 -1
  23. package/resources/accounts.mjs +2 -2
  24. package/resources/accounts.mjs.map +1 -1
  25. package/resources/counterparties.d.mts +16 -16
  26. package/resources/counterparties.d.mts.map +1 -1
  27. package/resources/counterparties.d.ts +16 -16
  28. package/resources/counterparties.d.ts.map +1 -1
  29. package/resources/deposits.d.mts +10 -0
  30. package/resources/deposits.d.mts.map +1 -1
  31. package/resources/deposits.d.ts +10 -0
  32. package/resources/deposits.d.ts.map +1 -1
  33. package/resources/events.d.mts +3 -3
  34. package/resources/events.d.mts.map +1 -1
  35. package/resources/events.d.ts +3 -3
  36. package/resources/events.d.ts.map +1 -1
  37. package/resources/index.d.mts +4 -4
  38. package/resources/index.d.mts.map +1 -1
  39. package/resources/index.d.ts +4 -4
  40. package/resources/index.d.ts.map +1 -1
  41. package/resources/index.js.map +1 -1
  42. package/resources/index.mjs.map +1 -1
  43. package/resources/payouts.d.mts +22 -406
  44. package/resources/payouts.d.mts.map +1 -1
  45. package/resources/payouts.d.ts +22 -406
  46. package/resources/payouts.d.ts.map +1 -1
  47. package/resources/payouts.js +2 -4
  48. package/resources/payouts.js.map +1 -1
  49. package/resources/payouts.mjs +2 -4
  50. package/resources/payouts.mjs.map +1 -1
  51. package/resources/quotes/index.d.mts +1 -1
  52. package/resources/quotes/index.d.mts.map +1 -1
  53. package/resources/quotes/index.d.ts +1 -1
  54. package/resources/quotes/index.d.ts.map +1 -1
  55. package/resources/quotes/index.js.map +1 -1
  56. package/resources/quotes/index.mjs.map +1 -1
  57. package/resources/quotes/quotes.d.mts +0 -57
  58. package/resources/quotes/quotes.d.mts.map +1 -1
  59. package/resources/quotes/quotes.d.ts +0 -57
  60. package/resources/quotes/quotes.d.ts.map +1 -1
  61. package/resources/quotes/quotes.js +0 -7
  62. package/resources/quotes/quotes.js.map +1 -1
  63. package/resources/quotes/quotes.mjs +0 -7
  64. package/resources/quotes/quotes.mjs.map +1 -1
  65. package/resources/simulations/account-programs.d.mts +11 -72
  66. package/resources/simulations/account-programs.d.mts.map +1 -1
  67. package/resources/simulations/account-programs.d.ts +11 -72
  68. package/resources/simulations/account-programs.d.ts.map +1 -1
  69. package/resources/simulations/account-programs.js +1 -2
  70. package/resources/simulations/account-programs.js.map +1 -1
  71. package/resources/simulations/account-programs.mjs +1 -2
  72. package/resources/simulations/account-programs.mjs.map +1 -1
  73. package/resources/simulations/accounts.d.mts +16 -72
  74. package/resources/simulations/accounts.d.mts.map +1 -1
  75. package/resources/simulations/accounts.d.ts +16 -72
  76. package/resources/simulations/accounts.d.ts.map +1 -1
  77. package/resources/simulations/accounts.js +3 -3
  78. package/resources/simulations/accounts.js.map +1 -1
  79. package/resources/simulations/accounts.mjs +3 -3
  80. package/resources/simulations/accounts.mjs.map +1 -1
  81. package/resources/simulations/conversions.d.mts +54 -0
  82. package/resources/simulations/conversions.d.mts.map +1 -0
  83. package/resources/simulations/conversions.d.ts +54 -0
  84. package/resources/simulations/conversions.d.ts.map +1 -0
  85. package/resources/simulations/conversions.js +39 -0
  86. package/resources/simulations/conversions.js.map +1 -0
  87. package/resources/simulations/conversions.mjs +35 -0
  88. package/resources/simulations/conversions.mjs.map +1 -0
  89. package/resources/simulations/deposits.d.mts +14 -30
  90. package/resources/simulations/deposits.d.mts.map +1 -1
  91. package/resources/simulations/deposits.d.ts +14 -30
  92. package/resources/simulations/deposits.d.ts.map +1 -1
  93. package/resources/simulations/index.d.mts +3 -1
  94. package/resources/simulations/index.d.mts.map +1 -1
  95. package/resources/simulations/index.d.ts +3 -1
  96. package/resources/simulations/index.d.ts.map +1 -1
  97. package/resources/simulations/index.js +5 -1
  98. package/resources/simulations/index.js.map +1 -1
  99. package/resources/simulations/index.mjs +2 -0
  100. package/resources/simulations/index.mjs.map +1 -1
  101. package/resources/simulations/payouts.d.mts +33 -17
  102. package/resources/simulations/payouts.d.mts.map +1 -1
  103. package/resources/simulations/payouts.d.ts +33 -17
  104. package/resources/simulations/payouts.d.ts.map +1 -1
  105. package/resources/simulations/payouts.js +16 -0
  106. package/resources/simulations/payouts.js.map +1 -1
  107. package/resources/simulations/payouts.mjs +16 -0
  108. package/resources/simulations/payouts.mjs.map +1 -1
  109. package/resources/simulations/returns.d.mts +92 -0
  110. package/resources/simulations/returns.d.mts.map +1 -0
  111. package/resources/simulations/returns.d.ts +92 -0
  112. package/resources/simulations/returns.d.ts.map +1 -0
  113. package/resources/simulations/returns.js +55 -0
  114. package/resources/simulations/returns.js.map +1 -0
  115. package/resources/simulations/returns.mjs +51 -0
  116. package/resources/simulations/returns.mjs.map +1 -0
  117. package/resources/simulations/simulations.d.mts +10 -2
  118. package/resources/simulations/simulations.d.mts.map +1 -1
  119. package/resources/simulations/simulations.d.ts +10 -2
  120. package/resources/simulations/simulations.d.ts.map +1 -1
  121. package/resources/simulations/simulations.js +8 -0
  122. package/resources/simulations/simulations.js.map +1 -1
  123. package/resources/simulations/simulations.mjs +9 -1
  124. package/resources/simulations/simulations.mjs.map +1 -1
  125. package/resources/transactions.d.mts +60 -0
  126. package/resources/transactions.d.mts.map +1 -1
  127. package/resources/transactions.d.ts +60 -0
  128. package/resources/transactions.d.ts.map +1 -1
  129. package/resources/webhook-subscriptions.d.mts +9 -9
  130. package/resources/webhook-subscriptions.d.mts.map +1 -1
  131. package/resources/webhook-subscriptions.d.ts +9 -9
  132. package/resources/webhook-subscriptions.d.ts.map +1 -1
  133. package/resources/webhook-subscriptions.js +1 -1
  134. package/resources/webhook-subscriptions.mjs +1 -1
  135. package/resources/webhooks.d.mts +245 -30
  136. package/resources/webhooks.d.mts.map +1 -1
  137. package/resources/webhooks.d.ts +245 -30
  138. package/resources/webhooks.d.ts.map +1 -1
  139. package/src/client.ts +18 -10
  140. package/src/resources/account-programs.ts +29 -18
  141. package/src/resources/accounts.ts +29 -6
  142. package/src/resources/counterparties.ts +16 -16
  143. package/src/resources/deposits.ts +12 -0
  144. package/src/resources/events.ts +18 -12
  145. package/src/resources/index.ts +9 -5
  146. package/src/resources/payouts.ts +36 -1993
  147. package/src/resources/quotes/index.ts +1 -1
  148. package/src/resources/quotes/quotes.ts +0 -84
  149. package/src/resources/simulations/account-programs.ts +12 -87
  150. package/src/resources/simulations/accounts.ts +18 -87
  151. package/src/resources/simulations/conversions.ts +70 -0
  152. package/src/resources/simulations/deposits.ts +27 -35
  153. package/src/resources/simulations/index.ts +11 -0
  154. package/src/resources/simulations/payouts.ts +43 -18
  155. package/src/resources/simulations/returns.ts +123 -0
  156. package/src/resources/simulations/simulations.ts +40 -1
  157. package/src/resources/transactions.ts +70 -0
  158. package/src/resources/webhook-subscriptions.ts +49 -33
  159. package/src/resources/webhooks.ts +360 -36
  160. package/src/version.ts +1 -1
  161. package/version.d.mts +1 -1
  162. package/version.d.ts +1 -1
  163. package/version.js +1 -1
  164. package/version.mjs +1 -1
@@ -22,6 +22,23 @@ export class Payouts extends APIResource {
22
22
  return this._client.post(path`/v1/simulations/payouts/${id}/reject`, { body, ...options });
23
23
  }
24
24
 
25
+ /**
26
+ * Submits an inbound return for a settled payout through the sandbox provider
27
+ * pipeline. The return is linked to the payout and the payout is exposed as
28
+ * returned. This endpoint is unavailable in live production.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const response = await client.simulations.payouts.return(
33
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
34
+ * { reason: 'account_closed' },
35
+ * );
36
+ * ```
37
+ */
38
+ return(id: string, body: PayoutReturnParams, options?: RequestOptions): APIPromise<PayoutReturnResponse> {
39
+ return this._client.post(path`/v1/simulations/payouts/${id}/return`, { body, ...options });
40
+ }
41
+
25
42
  /**
26
43
  * Submits a successful send event for an existing payout through the sandbox
27
44
  * provider pipeline. This endpoint is unavailable in live production.
@@ -40,19 +57,21 @@ export class Payouts extends APIResource {
40
57
 
41
58
  export interface PayoutRejectResponse {
42
59
  /**
43
- * Payout lifecycle event submitted to the sandbox provider.
60
+ * Payout whose lifecycle is being simulated.
44
61
  */
45
- event: 'send' | 'reject' | 'return';
62
+ payout_id: string;
46
63
 
47
64
  /**
48
- * Payout whose lifecycle is being simulated.
65
+ * Resource type discriminator.
49
66
  */
50
- payout_id: string;
67
+ type: 'payout_simulation';
68
+ }
51
69
 
70
+ export interface PayoutReturnResponse {
52
71
  /**
53
- * Whether the simulation submission was successful.
72
+ * Payout whose lifecycle is being simulated.
54
73
  */
55
- success: boolean;
74
+ payout_id: string;
56
75
 
57
76
  /**
58
77
  * Resource type discriminator.
@@ -61,21 +80,11 @@ export interface PayoutRejectResponse {
61
80
  }
62
81
 
63
82
  export interface PayoutSendResponse {
64
- /**
65
- * Payout lifecycle event submitted to the sandbox provider.
66
- */
67
- event: 'send' | 'reject' | 'return';
68
-
69
83
  /**
70
84
  * Payout whose lifecycle is being simulated.
71
85
  */
72
86
  payout_id: string;
73
87
 
74
- /**
75
- * Whether the simulation submission was successful.
76
- */
77
- success: boolean;
78
-
79
88
  /**
80
89
  * Resource type discriminator.
81
90
  */
@@ -84,15 +93,31 @@ export interface PayoutSendResponse {
84
93
 
85
94
  export interface PayoutRejectParams {
86
95
  /**
87
- * Reason the sandbox provider rejects the payout.
96
+ * Reason the sandbox provider rejects the payout. Use `invalid_routing_number` for
97
+ * domestic rails and `invalid_account_format` for a SWIFT correspondent rejecting
98
+ * on the beneficiary details.
99
+ */
100
+ reason: 'invalid_routing_number' | 'invalid_account_format';
101
+ }
102
+
103
+ export interface PayoutReturnParams {
104
+ /**
105
+ * Reason the receiving bank returns the settled payout.
88
106
  */
89
- reason: 'invalid_routing_number';
107
+ reason:
108
+ | 'account_closed'
109
+ | 'invalid_account_format'
110
+ | 'invalid_routing_number'
111
+ | 'account_blocked'
112
+ | 'unknown';
90
113
  }
91
114
 
92
115
  export declare namespace Payouts {
93
116
  export {
94
117
  type PayoutRejectResponse as PayoutRejectResponse,
118
+ type PayoutReturnResponse as PayoutReturnResponse,
95
119
  type PayoutSendResponse as PayoutSendResponse,
96
120
  type PayoutRejectParams as PayoutRejectParams,
121
+ type PayoutReturnParams as PayoutReturnParams,
97
122
  };
98
123
  }
@@ -0,0 +1,123 @@
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 { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ export class Returns extends APIResource {
9
+ /**
10
+ * Submits a network rejection for an existing return through the sandbox provider
11
+ * pipeline. This endpoint is unavailable in live production.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const response = await client.simulations.returns.reject(
16
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
17
+ * { reason: 'invalid_routing_number' },
18
+ * );
19
+ * ```
20
+ */
21
+ reject(id: string, body: ReturnRejectParams, options?: RequestOptions): APIPromise<ReturnRejectResponse> {
22
+ return this._client.post(path`/v1/simulations/returns/${id}/reject`, { body, ...options });
23
+ }
24
+
25
+ /**
26
+ * Submits an inbound return for a sent return through the sandbox provider
27
+ * pipeline. The funds are credited back to the original deposit and the return
28
+ * moves to `returned`. This endpoint is unavailable in live production.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const response = await client.simulations.returns.return(
33
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
34
+ * { reason: 'account_closed' },
35
+ * );
36
+ * ```
37
+ */
38
+ return(id: string, body: ReturnReturnParams, options?: RequestOptions): APIPromise<ReturnReturnResponse> {
39
+ return this._client.post(path`/v1/simulations/returns/${id}/return`, { body, ...options });
40
+ }
41
+
42
+ /**
43
+ * Submits a successful send event for an existing return through the sandbox
44
+ * provider pipeline. This endpoint is unavailable in live production.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const response = await client.simulations.returns.send(
49
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
50
+ * );
51
+ * ```
52
+ */
53
+ send(id: string, options?: RequestOptions): APIPromise<ReturnSendResponse> {
54
+ return this._client.post(path`/v1/simulations/returns/${id}/send`, options);
55
+ }
56
+ }
57
+
58
+ export interface ReturnRejectResponse {
59
+ /**
60
+ * Return whose lifecycle is being simulated.
61
+ */
62
+ return_id: string;
63
+
64
+ /**
65
+ * Resource type discriminator.
66
+ */
67
+ type: 'return_simulation';
68
+ }
69
+
70
+ export interface ReturnReturnResponse {
71
+ /**
72
+ * Return whose lifecycle is being simulated.
73
+ */
74
+ return_id: string;
75
+
76
+ /**
77
+ * Resource type discriminator.
78
+ */
79
+ type: 'return_simulation';
80
+ }
81
+
82
+ export interface ReturnSendResponse {
83
+ /**
84
+ * Return whose lifecycle is being simulated.
85
+ */
86
+ return_id: string;
87
+
88
+ /**
89
+ * Resource type discriminator.
90
+ */
91
+ type: 'return_simulation';
92
+ }
93
+
94
+ export interface ReturnRejectParams {
95
+ /**
96
+ * Reason the sandbox provider rejects the return. Use `invalid_routing_number` for
97
+ * domestic rails and `invalid_account_format` for a SWIFT correspondent rejecting
98
+ * on the beneficiary details.
99
+ */
100
+ reason: 'invalid_routing_number' | 'invalid_account_format';
101
+ }
102
+
103
+ export interface ReturnReturnParams {
104
+ /**
105
+ * Reason the receiving bank returns the sent return.
106
+ */
107
+ reason:
108
+ | 'account_closed'
109
+ | 'invalid_account_format'
110
+ | 'invalid_routing_number'
111
+ | 'account_blocked'
112
+ | 'unknown';
113
+ }
114
+
115
+ export declare namespace Returns {
116
+ export {
117
+ type ReturnRejectResponse as ReturnRejectResponse,
118
+ type ReturnReturnResponse as ReturnReturnResponse,
119
+ type ReturnSendResponse as ReturnSendResponse,
120
+ type ReturnRejectParams as ReturnRejectParams,
121
+ type ReturnReturnParams as ReturnReturnParams,
122
+ };
123
+ }
@@ -25,20 +25,42 @@ import {
25
25
  AccountUnfreezeResponse,
26
26
  Accounts,
27
27
  } from './accounts';
28
+ import * as ConversionsAPI from './conversions';
29
+ import { ConversionCompleteResponse, ConversionFailResponse, Conversions } from './conversions';
28
30
  import * as DepositsAPI from './deposits';
29
31
  import { DepositCreateParams, DepositCreateResponse, Deposits } from './deposits';
30
32
  import * as PayoutsAPI from './payouts';
31
- import { PayoutRejectParams, PayoutRejectResponse, PayoutSendResponse, Payouts } from './payouts';
33
+ import {
34
+ PayoutRejectParams,
35
+ PayoutRejectResponse,
36
+ PayoutReturnParams,
37
+ PayoutReturnResponse,
38
+ PayoutSendResponse,
39
+ Payouts,
40
+ } from './payouts';
41
+ import * as ReturnsAPI from './returns';
42
+ import {
43
+ ReturnRejectParams,
44
+ ReturnRejectResponse,
45
+ ReturnReturnParams,
46
+ ReturnReturnResponse,
47
+ ReturnSendResponse,
48
+ Returns,
49
+ } from './returns';
32
50
 
33
51
  export class Simulations extends APIResource {
34
52
  deposits: DepositsAPI.Deposits = new DepositsAPI.Deposits(this._client);
53
+ conversions: ConversionsAPI.Conversions = new ConversionsAPI.Conversions(this._client);
35
54
  payouts: PayoutsAPI.Payouts = new PayoutsAPI.Payouts(this._client);
55
+ returns: ReturnsAPI.Returns = new ReturnsAPI.Returns(this._client);
36
56
  accountPrograms: AccountProgramsAPI.AccountPrograms = new AccountProgramsAPI.AccountPrograms(this._client);
37
57
  accounts: AccountsAPI.Accounts = new AccountsAPI.Accounts(this._client);
38
58
  }
39
59
 
40
60
  Simulations.Deposits = Deposits;
61
+ Simulations.Conversions = Conversions;
41
62
  Simulations.Payouts = Payouts;
63
+ Simulations.Returns = Returns;
42
64
  Simulations.AccountPrograms = AccountPrograms;
43
65
  Simulations.Accounts = Accounts;
44
66
 
@@ -49,11 +71,28 @@ export declare namespace Simulations {
49
71
  type DepositCreateParams as DepositCreateParams,
50
72
  };
51
73
 
74
+ export {
75
+ Conversions as Conversions,
76
+ type ConversionCompleteResponse as ConversionCompleteResponse,
77
+ type ConversionFailResponse as ConversionFailResponse,
78
+ };
79
+
52
80
  export {
53
81
  Payouts as Payouts,
54
82
  type PayoutRejectResponse as PayoutRejectResponse,
83
+ type PayoutReturnResponse as PayoutReturnResponse,
55
84
  type PayoutSendResponse as PayoutSendResponse,
56
85
  type PayoutRejectParams as PayoutRejectParams,
86
+ type PayoutReturnParams as PayoutReturnParams,
87
+ };
88
+
89
+ export {
90
+ Returns as Returns,
91
+ type ReturnRejectResponse as ReturnRejectResponse,
92
+ type ReturnReturnResponse as ReturnReturnResponse,
93
+ type ReturnSendResponse as ReturnSendResponse,
94
+ type ReturnRejectParams as ReturnRejectParams,
95
+ type ReturnReturnParams as ReturnReturnParams,
57
96
  };
58
97
 
59
98
  export {
@@ -56,6 +56,13 @@ export interface TransactionRetrieveResponse {
56
56
  */
57
57
  counterparty: TransactionRetrieveResponse.Counterparty | null;
58
58
 
59
+ /**
60
+ * ID of the counterparty this transaction is associated with, or null when none
61
+ * was resolved. Correlates with the counterparties API and a payout's
62
+ * counterparty_id.
63
+ */
64
+ counterparty_id: string | null;
65
+
59
66
  /**
60
67
  * Currency code (ISO 4217 or crypto).
61
68
  */
@@ -88,11 +95,23 @@ export interface TransactionRetrieveResponse {
88
95
  */
89
96
  side: 'credit' | 'debit';
90
97
 
98
+ /**
99
+ * The resource that originated this transaction, or null when it does not map to a
100
+ * retrievable resource.
101
+ */
102
+ source: TransactionRetrieveResponse.Source | null;
103
+
91
104
  /**
92
105
  * State of the transaction. Transactions are by definition booked.
93
106
  */
94
107
  status: 'booked';
95
108
 
109
+ /**
110
+ * Reference used to track the payment across the payment network, such as the UETR
111
+ * for SWIFT payments.
112
+ */
113
+ tracking_reference: string | null;
114
+
96
115
  /**
97
116
  * Transaction hash for crypto transactions, or null when not known. Only
98
117
  * blockchain rails support this field.
@@ -537,6 +556,22 @@ export namespace TransactionRetrieveResponse {
537
556
  state: string | null;
538
557
  }
539
558
  }
559
+
560
+ /**
561
+ * The resource that originated this transaction, or null when it does not map to a
562
+ * retrievable resource.
563
+ */
564
+ export interface Source {
565
+ /**
566
+ * Identifier of the originating resource, retrievable on its own endpoint.
567
+ */
568
+ id: string;
569
+
570
+ /**
571
+ * Type of the resource that originated this transaction.
572
+ */
573
+ type: 'deposit' | 'payout' | 'return';
574
+ }
540
575
  }
541
576
 
542
577
  export interface TransactionListResponse {
@@ -565,6 +600,13 @@ export interface TransactionListResponse {
565
600
  */
566
601
  counterparty: TransactionListResponse.Counterparty | null;
567
602
 
603
+ /**
604
+ * ID of the counterparty this transaction is associated with, or null when none
605
+ * was resolved. Correlates with the counterparties API and a payout's
606
+ * counterparty_id.
607
+ */
608
+ counterparty_id: string | null;
609
+
568
610
  /**
569
611
  * Currency code (ISO 4217 or crypto).
570
612
  */
@@ -597,11 +639,23 @@ export interface TransactionListResponse {
597
639
  */
598
640
  side: 'credit' | 'debit';
599
641
 
642
+ /**
643
+ * The resource that originated this transaction, or null when it does not map to a
644
+ * retrievable resource.
645
+ */
646
+ source: TransactionListResponse.Source | null;
647
+
600
648
  /**
601
649
  * State of the transaction. Transactions are by definition booked.
602
650
  */
603
651
  status: 'booked';
604
652
 
653
+ /**
654
+ * Reference used to track the payment across the payment network, such as the UETR
655
+ * for SWIFT payments.
656
+ */
657
+ tracking_reference: string | null;
658
+
605
659
  /**
606
660
  * Transaction hash for crypto transactions, or null when not known. Only
607
661
  * blockchain rails support this field.
@@ -1046,6 +1100,22 @@ export namespace TransactionListResponse {
1046
1100
  state: string | null;
1047
1101
  }
1048
1102
  }
1103
+
1104
+ /**
1105
+ * The resource that originated this transaction, or null when it does not map to a
1106
+ * retrievable resource.
1107
+ */
1108
+ export interface Source {
1109
+ /**
1110
+ * Identifier of the originating resource, retrievable on its own endpoint.
1111
+ */
1112
+ id: string;
1113
+
1114
+ /**
1115
+ * Type of the resource that originated this transaction.
1116
+ */
1117
+ type: 'deposit' | 'payout' | 'return';
1118
+ }
1049
1119
  }
1050
1120
 
1051
1121
  export interface TransactionListParams extends CursorPageParams {
@@ -14,7 +14,7 @@ export class WebhookSubscriptions extends APIResource {
14
14
  * ```ts
15
15
  * const webhookSubscription =
16
16
  * await client.webhookSubscriptions.create({
17
- * events: ['payout.paid'],
17
+ * events: ['payout.sent'],
18
18
  * url: 'https://sandbox.example.com/webhooks/augustus',
19
19
  * });
20
20
  * ```
@@ -133,15 +133,17 @@ export interface WebhookSubscriptionCreateResponse {
133
133
  * Event types this subscription receives.
134
134
  */
135
135
  events: Array<
136
- | 'payout.created'
137
136
  | 'payout.initiated'
138
- | 'payout.paid'
137
+ | 'payout.submitted'
138
+ | 'payout.sent'
139
139
  | 'payout.failed'
140
+ | 'payout.returned'
140
141
  | 'return.initiated'
141
- | 'return.paid'
142
+ | 'return.submitted'
143
+ | 'return.sent'
142
144
  | 'return.failed'
143
145
  | 'return.returned'
144
- | 'deposit.received'
146
+ | 'deposit.settled'
145
147
  | 'conversion.created'
146
148
  | 'conversion.completed'
147
149
  | 'conversion.failed'
@@ -180,15 +182,17 @@ export interface WebhookSubscriptionRetrieveResponse {
180
182
  * Event types this subscription receives.
181
183
  */
182
184
  events: Array<
183
- | 'payout.created'
184
185
  | 'payout.initiated'
185
- | 'payout.paid'
186
+ | 'payout.submitted'
187
+ | 'payout.sent'
186
188
  | 'payout.failed'
189
+ | 'payout.returned'
187
190
  | 'return.initiated'
188
- | 'return.paid'
191
+ | 'return.submitted'
192
+ | 'return.sent'
189
193
  | 'return.failed'
190
194
  | 'return.returned'
191
- | 'deposit.received'
195
+ | 'deposit.settled'
192
196
  | 'conversion.created'
193
197
  | 'conversion.completed'
194
198
  | 'conversion.failed'
@@ -227,15 +231,17 @@ export interface WebhookSubscriptionUpdateResponse {
227
231
  * Event types this subscription receives.
228
232
  */
229
233
  events: Array<
230
- | 'payout.created'
231
234
  | 'payout.initiated'
232
- | 'payout.paid'
235
+ | 'payout.submitted'
236
+ | 'payout.sent'
233
237
  | 'payout.failed'
238
+ | 'payout.returned'
234
239
  | 'return.initiated'
235
- | 'return.paid'
240
+ | 'return.submitted'
241
+ | 'return.sent'
236
242
  | 'return.failed'
237
243
  | 'return.returned'
238
- | 'deposit.received'
244
+ | 'deposit.settled'
239
245
  | 'conversion.created'
240
246
  | 'conversion.completed'
241
247
  | 'conversion.failed'
@@ -274,15 +280,17 @@ export interface WebhookSubscriptionListResponse {
274
280
  * Event types this subscription receives.
275
281
  */
276
282
  events: Array<
277
- | 'payout.created'
278
283
  | 'payout.initiated'
279
- | 'payout.paid'
284
+ | 'payout.submitted'
285
+ | 'payout.sent'
280
286
  | 'payout.failed'
287
+ | 'payout.returned'
281
288
  | 'return.initiated'
282
- | 'return.paid'
289
+ | 'return.submitted'
290
+ | 'return.sent'
283
291
  | 'return.failed'
284
292
  | 'return.returned'
285
- | 'deposit.received'
293
+ | 'deposit.settled'
286
294
  | 'conversion.created'
287
295
  | 'conversion.completed'
288
296
  | 'conversion.failed'
@@ -321,15 +329,17 @@ export interface WebhookSubscriptionDeleteResponse {
321
329
  * Event types this subscription receives.
322
330
  */
323
331
  events: Array<
324
- | 'payout.created'
325
332
  | 'payout.initiated'
326
- | 'payout.paid'
333
+ | 'payout.submitted'
334
+ | 'payout.sent'
327
335
  | 'payout.failed'
336
+ | 'payout.returned'
328
337
  | 'return.initiated'
329
- | 'return.paid'
338
+ | 'return.submitted'
339
+ | 'return.sent'
330
340
  | 'return.failed'
331
341
  | 'return.returned'
332
- | 'deposit.received'
342
+ | 'deposit.settled'
333
343
  | 'conversion.created'
334
344
  | 'conversion.completed'
335
345
  | 'conversion.failed'
@@ -380,15 +390,17 @@ export interface WebhookSubscriptionSendTestEventResponse {
380
390
  * Event type.
381
391
  */
382
392
  event_type:
383
- | 'payout.created'
384
393
  | 'payout.initiated'
385
- | 'payout.paid'
394
+ | 'payout.submitted'
395
+ | 'payout.sent'
386
396
  | 'payout.failed'
397
+ | 'payout.returned'
387
398
  | 'return.initiated'
388
- | 'return.paid'
399
+ | 'return.submitted'
400
+ | 'return.sent'
389
401
  | 'return.failed'
390
402
  | 'return.returned'
391
- | 'deposit.received'
403
+ | 'deposit.settled'
392
404
  | 'conversion.created'
393
405
  | 'conversion.completed'
394
406
  | 'conversion.failed'
@@ -407,15 +419,17 @@ export interface WebhookSubscriptionCreateParams {
407
419
  * Event types to subscribe to. Use ["*"] for all events.
408
420
  */
409
421
  events: Array<
410
- | 'payout.created'
411
422
  | 'payout.initiated'
412
- | 'payout.paid'
423
+ | 'payout.submitted'
424
+ | 'payout.sent'
413
425
  | 'payout.failed'
426
+ | 'payout.returned'
414
427
  | 'return.initiated'
415
- | 'return.paid'
428
+ | 'return.submitted'
429
+ | 'return.sent'
416
430
  | 'return.failed'
417
431
  | 'return.returned'
418
- | 'deposit.received'
432
+ | 'deposit.settled'
419
433
  | 'conversion.created'
420
434
  | 'conversion.completed'
421
435
  | 'conversion.failed'
@@ -436,15 +450,17 @@ export interface WebhookSubscriptionUpdateParams {
436
450
  * events.
437
451
  */
438
452
  events?: Array<
439
- | 'payout.created'
440
453
  | 'payout.initiated'
441
- | 'payout.paid'
454
+ | 'payout.submitted'
455
+ | 'payout.sent'
442
456
  | 'payout.failed'
457
+ | 'payout.returned'
443
458
  | 'return.initiated'
444
- | 'return.paid'
459
+ | 'return.submitted'
460
+ | 'return.sent'
445
461
  | 'return.failed'
446
462
  | 'return.returned'
447
- | 'deposit.received'
463
+ | 'deposit.settled'
448
464
  | 'conversion.created'
449
465
  | 'conversion.completed'
450
466
  | 'conversion.failed'