modern-treasury 0.0.1
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.
- package/.eslintrc.js +10 -0
- package/.prettierrc +6 -0
- package/LICENSE +7 -0
- package/README.md +198 -0
- package/build +10 -0
- package/core.ts +746 -0
- package/dist/cjs/core.d.ts +215 -0
- package/dist/cjs/core.js +815 -0
- package/dist/cjs/core.js.map +1 -0
- package/dist/cjs/index.d.ts +118 -0
- package/dist/cjs/index.js +128 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/pagination.d.ts +14 -0
- package/dist/cjs/pagination.js +22 -0
- package/dist/cjs/pagination.js.map +1 -0
- package/dist/cjs/resource.d.ts +11 -0
- package/dist/cjs/resource.js +16 -0
- package/dist/cjs/resource.js.map +1 -0
- package/dist/cjs/resources/counterparties.d.ts +500 -0
- package/dist/cjs/resources/counterparties.js +57 -0
- package/dist/cjs/resources/counterparties.js.map +1 -0
- package/dist/cjs/resources/documents.d.ts +66 -0
- package/dist/cjs/resources/documents.js +23 -0
- package/dist/cjs/resources/documents.js.map +1 -0
- package/dist/cjs/resources/events.d.ts +53 -0
- package/dist/cjs/resources/events.js +22 -0
- package/dist/cjs/resources/events.js.map +1 -0
- package/dist/cjs/resources/expected-payments.d.ts +928 -0
- package/dist/cjs/resources/expected-payments.js +31 -0
- package/dist/cjs/resources/expected-payments.js.map +1 -0
- package/dist/cjs/resources/external-accounts.d.ts +597 -0
- package/dist/cjs/resources/external-accounts.js +51 -0
- package/dist/cjs/resources/external-accounts.js.map +1 -0
- package/dist/cjs/resources/incoming-payment-details.d.ts +487 -0
- package/dist/cjs/resources/incoming-payment-details.js +35 -0
- package/dist/cjs/resources/incoming-payment-details.js.map +1 -0
- package/dist/cjs/resources/index.d.ts +15 -0
- package/dist/cjs/resources/index.js +46 -0
- package/dist/cjs/resources/index.js.map +1 -0
- package/dist/cjs/resources/internal-accounts.d.ts +666 -0
- package/dist/cjs/resources/internal-accounts.js +31 -0
- package/dist/cjs/resources/internal-accounts.js.map +1 -0
- package/dist/cjs/resources/line-items.d.ts +90 -0
- package/dist/cjs/resources/line-items.js +38 -0
- package/dist/cjs/resources/line-items.js.map +1 -0
- package/dist/cjs/resources/paper-items.d.ts +279 -0
- package/dist/cjs/resources/paper-items.js +25 -0
- package/dist/cjs/resources/paper-items.js.map +1 -0
- package/dist/cjs/resources/payment-orders/index.d.ts +2 -0
- package/dist/cjs/resources/payment-orders/index.js +33 -0
- package/dist/cjs/resources/payment-orders/index.js.map +1 -0
- package/dist/cjs/resources/payment-orders/payment-orders.d.ts +2180 -0
- package/dist/cjs/resources/payment-orders/payment-orders.js +56 -0
- package/dist/cjs/resources/payment-orders/payment-orders.js.map +1 -0
- package/dist/cjs/resources/payment-orders/reversals.d.ts +46 -0
- package/dist/cjs/resources/payment-orders/reversals.js +23 -0
- package/dist/cjs/resources/payment-orders/reversals.js.map +1 -0
- package/dist/cjs/resources/returns.d.ts +487 -0
- package/dist/cjs/resources/returns.js +31 -0
- package/dist/cjs/resources/returns.js.map +1 -0
- package/dist/cjs/resources/top-level.d.ts +3 -0
- package/dist/cjs/resources/top-level.js +4 -0
- package/dist/cjs/resources/top-level.js.map +1 -0
- package/dist/cjs/resources/transactions.d.ts +377 -0
- package/dist/cjs/resources/transactions.js +31 -0
- package/dist/cjs/resources/transactions.js.map +1 -0
- package/dist/cjs/resources/validations.d.ts +97 -0
- package/dist/cjs/resources/validations.js +16 -0
- package/dist/cjs/resources/validations.js.map +1 -0
- package/dist/cjs/resources/webhooks.d.ts +31 -0
- package/dist/cjs/resources/webhooks.js +44 -0
- package/dist/cjs/resources/webhooks.js.map +1 -0
- package/dist/cjs/tests/api-resources/counterparties.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/counterparties.test.js +275 -0
- package/dist/cjs/tests/api-resources/counterparties.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/documents.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/documents.test.js +78 -0
- package/dist/cjs/tests/api-resources/documents.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/events.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/events.test.js +100 -0
- package/dist/cjs/tests/api-resources/events.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.js +176 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.js +248 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.js +130 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.js +144 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/line-items.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/line-items.test.js +123 -0
- package/dist/cjs/tests/api-resources/line-items.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/paper-items.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/paper-items.test.js +96 -0
- package/dist/cjs/tests/api-resources/paper-items.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js +77 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/returns.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/returns.test.js +116 -0
- package/dist/cjs/tests/api-resources/returns.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/top-level.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/top-level.test.js +59 -0
- package/dist/cjs/tests/api-resources/top-level.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/transactions.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/transactions.test.js +134 -0
- package/dist/cjs/tests/api-resources/transactions.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/validations.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/validations.test.js +62 -0
- package/dist/cjs/tests/api-resources/validations.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/webhooks.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/webhooks.test.js +100 -0
- package/dist/cjs/tests/api-resources/webhooks.test.js.map +1 -0
- package/dist/cjs/tests/form.test.d.ts +1 -0
- package/dist/cjs/tests/form.test.js +61 -0
- package/dist/cjs/tests/form.test.js.map +1 -0
- package/dist/cjs/tests/index.test.d.ts +1 -0
- package/dist/cjs/tests/index.test.js +57 -0
- package/dist/cjs/tests/index.test.js.map +1 -0
- package/dist/cjs/tests/responses.test.d.ts +1 -0
- package/dist/cjs/tests/responses.test.js +60 -0
- package/dist/cjs/tests/responses.test.js.map +1 -0
- package/index.ts +175 -0
- package/jest.config.js +8 -0
- package/package.json +47 -0
- package/pagination.ts +36 -0
- package/resource.ts +22 -0
- package/resources/counterparties.ts +666 -0
- package/resources/documents.ts +97 -0
- package/resources/events.ts +86 -0
- package/resources/expected-payments.ts +1016 -0
- package/resources/external-accounts.ts +762 -0
- package/resources/incoming-payment-details.ts +592 -0
- package/resources/index.ts +16 -0
- package/resources/internal-accounts.ts +774 -0
- package/resources/line-items.ts +138 -0
- package/resources/paper-items.ts +317 -0
- package/resources/payment-orders/index.ts +3 -0
- package/resources/payment-orders/payment-orders.ts +2486 -0
- package/resources/payment-orders/reversals.ts +72 -0
- package/resources/returns.ts +545 -0
- package/resources/top-level.ts +5 -0
- package/resources/transactions.ts +441 -0
- package/resources/validations.ts +115 -0
- package/resources/webhooks.ts +48 -0
- package/tests/api-resources/counterparties.test.ts +237 -0
- package/tests/api-resources/documents.test.ts +40 -0
- package/tests/api-resources/events.test.ts +62 -0
- package/tests/api-resources/expected-payments.test.ts +138 -0
- package/tests/api-resources/external-accounts.test.ts +210 -0
- package/tests/api-resources/incoming-payment-details.test.ts +92 -0
- package/tests/api-resources/internal-accounts.test.ts +103 -0
- package/tests/api-resources/line-items.test.ts +85 -0
- package/tests/api-resources/paper-items.test.ts +58 -0
- package/tests/api-resources/payment-orders/payment-orders.test.ts +39 -0
- package/tests/api-resources/returns.test.ts +78 -0
- package/tests/api-resources/top-level.test.ts +21 -0
- package/tests/api-resources/transactions.test.ts +96 -0
- package/tests/api-resources/validations.test.ts +24 -0
- package/tests/api-resources/webhooks.test.ts +102 -0
- package/tests/form.test.ts +27 -0
- package/tests/index.test.ts +62 -0
- package/tests/responses.test.ts +25 -0
- package/tsconfig.cjs.json +8 -0
- package/tsconfig.json +36 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import * as Core from '~/core';
|
|
4
|
+
import { APIResource } from '~/resource';
|
|
5
|
+
import { isRequestOptions } from '~/core';
|
|
6
|
+
import { Page, PageParams } from '~/pagination';
|
|
7
|
+
|
|
8
|
+
export class Reversals extends APIResource {
|
|
9
|
+
list(
|
|
10
|
+
id: string,
|
|
11
|
+
query?: ReversalListParams,
|
|
12
|
+
options?: Core.RequestOptions,
|
|
13
|
+
): Core.PagePromise<ReversalsPage>;
|
|
14
|
+
list(id: string, options?: Core.RequestOptions): Core.PagePromise<ReversalsPage>;
|
|
15
|
+
list(
|
|
16
|
+
id: string,
|
|
17
|
+
query: ReversalListParams | Core.RequestOptions = {},
|
|
18
|
+
options?: Core.RequestOptions,
|
|
19
|
+
): Core.PagePromise<ReversalsPage> {
|
|
20
|
+
if (isRequestOptions(query)) {
|
|
21
|
+
return this.list(id, {}, query);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return this.getAPIList(`/api/payment_orders/${id}/reversals`, ReversalsPage, { query, ...options });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class ReversalsPage extends Page<Reversal> {}
|
|
29
|
+
|
|
30
|
+
export interface Reversal {
|
|
31
|
+
created_at?: string;
|
|
32
|
+
|
|
33
|
+
id?: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* This field will be true if this object exists in the live environment or false
|
|
37
|
+
* if it exists in the test environment.
|
|
38
|
+
*/
|
|
39
|
+
live_mode?: boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
43
|
+
* strings.
|
|
44
|
+
*/
|
|
45
|
+
metadata?: Record<string, string>;
|
|
46
|
+
|
|
47
|
+
object?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The ID of the relevant Payment Order.
|
|
51
|
+
*/
|
|
52
|
+
payment_order_id?: string | null;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The reason for the reversal.
|
|
56
|
+
*/
|
|
57
|
+
reason?:
|
|
58
|
+
| 'duplicate'
|
|
59
|
+
| 'incorrect_amount'
|
|
60
|
+
| 'incorrect_receiving_account'
|
|
61
|
+
| 'date_earlier_than_intended'
|
|
62
|
+
| 'date_later_than_intended';
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The current status of the reversal.
|
|
66
|
+
*/
|
|
67
|
+
status?: 'completed' | 'failed' | 'pending' | 'processing' | 'returned' | 'sent';
|
|
68
|
+
|
|
69
|
+
updated_at?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface ReversalListParams extends PageParams {}
|
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import * as Core from '~/core';
|
|
4
|
+
import { APIResource } from '~/resource';
|
|
5
|
+
import { isRequestOptions } from '~/core';
|
|
6
|
+
import { Page, PageParams } from '~/pagination';
|
|
7
|
+
|
|
8
|
+
export class Returns extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create a return.
|
|
11
|
+
*/
|
|
12
|
+
create(body: ReturnCreateParams, options?: Core.RequestOptions): Promise<Core.APIResponse<ReturnObject>> {
|
|
13
|
+
return this.post('/api/returns', { body, ...options });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Get a single return.
|
|
18
|
+
*/
|
|
19
|
+
retrieve(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<ReturnObject>> {
|
|
20
|
+
return this.get(`/api/returns/${id}`, options);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get a list of returns.
|
|
25
|
+
*/
|
|
26
|
+
list(query?: ReturnListParams, options?: Core.RequestOptions): Core.PagePromise<ReturnObjectsPage>;
|
|
27
|
+
list(options?: Core.RequestOptions): Core.PagePromise<ReturnObjectsPage>;
|
|
28
|
+
list(
|
|
29
|
+
query: ReturnListParams | Core.RequestOptions = {},
|
|
30
|
+
options?: Core.RequestOptions,
|
|
31
|
+
): Core.PagePromise<ReturnObjectsPage> {
|
|
32
|
+
if (isRequestOptions(query)) {
|
|
33
|
+
return this.list({}, query);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return this.getAPIList('/api/returns', ReturnObjectsPage, { query, ...options });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class ReturnObjectsPage extends Page<ReturnObject> {}
|
|
41
|
+
|
|
42
|
+
export interface ReturnObject {
|
|
43
|
+
/**
|
|
44
|
+
* Some returns may include additional information from the bank. In these cases,
|
|
45
|
+
* this string will be present.
|
|
46
|
+
*/
|
|
47
|
+
additional_information?: string | null;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Value in specified currency's smallest unit. e.g. $10 would be represented
|
|
51
|
+
* as 1000.
|
|
52
|
+
*/
|
|
53
|
+
amount?: number;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The return code. For ACH returns, this is the required ACH return code.
|
|
57
|
+
*/
|
|
58
|
+
code?:
|
|
59
|
+
| '901'
|
|
60
|
+
| '902'
|
|
61
|
+
| '903'
|
|
62
|
+
| '904'
|
|
63
|
+
| '905'
|
|
64
|
+
| '907'
|
|
65
|
+
| '908'
|
|
66
|
+
| '909'
|
|
67
|
+
| '910'
|
|
68
|
+
| '911'
|
|
69
|
+
| '912'
|
|
70
|
+
| '914'
|
|
71
|
+
| 'R01'
|
|
72
|
+
| 'R02'
|
|
73
|
+
| 'R03'
|
|
74
|
+
| 'R04'
|
|
75
|
+
| 'R05'
|
|
76
|
+
| 'R06'
|
|
77
|
+
| 'R07'
|
|
78
|
+
| 'R08'
|
|
79
|
+
| 'R09'
|
|
80
|
+
| 'R10'
|
|
81
|
+
| 'R11'
|
|
82
|
+
| 'R12'
|
|
83
|
+
| 'R14'
|
|
84
|
+
| 'R15'
|
|
85
|
+
| 'R16'
|
|
86
|
+
| 'R17'
|
|
87
|
+
| 'R20'
|
|
88
|
+
| 'R21'
|
|
89
|
+
| 'R22'
|
|
90
|
+
| 'R23'
|
|
91
|
+
| 'R24'
|
|
92
|
+
| 'R29'
|
|
93
|
+
| 'R31'
|
|
94
|
+
| 'R33'
|
|
95
|
+
| 'R37'
|
|
96
|
+
| 'R38'
|
|
97
|
+
| 'R39'
|
|
98
|
+
| 'R51'
|
|
99
|
+
| 'R52'
|
|
100
|
+
| 'R53'
|
|
101
|
+
| 'currencycloud'
|
|
102
|
+
| null;
|
|
103
|
+
|
|
104
|
+
created_at?: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Currency that this transaction is denominated in.
|
|
108
|
+
*/
|
|
109
|
+
currency?:
|
|
110
|
+
| 'AED'
|
|
111
|
+
| 'AFN'
|
|
112
|
+
| 'ALL'
|
|
113
|
+
| 'AMD'
|
|
114
|
+
| 'ANG'
|
|
115
|
+
| 'AOA'
|
|
116
|
+
| 'ARS'
|
|
117
|
+
| 'AUD'
|
|
118
|
+
| 'AWG'
|
|
119
|
+
| 'AZN'
|
|
120
|
+
| 'BAM'
|
|
121
|
+
| 'BBD'
|
|
122
|
+
| 'BCH'
|
|
123
|
+
| 'BDT'
|
|
124
|
+
| 'BGN'
|
|
125
|
+
| 'BHD'
|
|
126
|
+
| 'BIF'
|
|
127
|
+
| 'BMD'
|
|
128
|
+
| 'BND'
|
|
129
|
+
| 'BOB'
|
|
130
|
+
| 'BRL'
|
|
131
|
+
| 'BSD'
|
|
132
|
+
| 'BTC'
|
|
133
|
+
| 'BTN'
|
|
134
|
+
| 'BWP'
|
|
135
|
+
| 'BYN'
|
|
136
|
+
| 'BYR'
|
|
137
|
+
| 'BZD'
|
|
138
|
+
| 'CAD'
|
|
139
|
+
| 'CDF'
|
|
140
|
+
| 'CHF'
|
|
141
|
+
| 'CLF'
|
|
142
|
+
| 'CLP'
|
|
143
|
+
| 'CNH'
|
|
144
|
+
| 'CNY'
|
|
145
|
+
| 'COP'
|
|
146
|
+
| 'CRC'
|
|
147
|
+
| 'CUC'
|
|
148
|
+
| 'CUP'
|
|
149
|
+
| 'CVE'
|
|
150
|
+
| 'CZK'
|
|
151
|
+
| 'DJF'
|
|
152
|
+
| 'DKK'
|
|
153
|
+
| 'DOP'
|
|
154
|
+
| 'DZD'
|
|
155
|
+
| 'EEK'
|
|
156
|
+
| 'EGP'
|
|
157
|
+
| 'ERN'
|
|
158
|
+
| 'ETB'
|
|
159
|
+
| 'EUR'
|
|
160
|
+
| 'FJD'
|
|
161
|
+
| 'FKP'
|
|
162
|
+
| 'GBP'
|
|
163
|
+
| 'GBX'
|
|
164
|
+
| 'GEL'
|
|
165
|
+
| 'GGP'
|
|
166
|
+
| 'GHS'
|
|
167
|
+
| 'GIP'
|
|
168
|
+
| 'GMD'
|
|
169
|
+
| 'GNF'
|
|
170
|
+
| 'GTQ'
|
|
171
|
+
| 'GYD'
|
|
172
|
+
| 'HKD'
|
|
173
|
+
| 'HNL'
|
|
174
|
+
| 'HRK'
|
|
175
|
+
| 'HTG'
|
|
176
|
+
| 'HUF'
|
|
177
|
+
| 'IDR'
|
|
178
|
+
| 'ILS'
|
|
179
|
+
| 'IMP'
|
|
180
|
+
| 'INR'
|
|
181
|
+
| 'IQD'
|
|
182
|
+
| 'IRR'
|
|
183
|
+
| 'ISK'
|
|
184
|
+
| 'JEP'
|
|
185
|
+
| 'JMD'
|
|
186
|
+
| 'JOD'
|
|
187
|
+
| 'JPY'
|
|
188
|
+
| 'KES'
|
|
189
|
+
| 'KGS'
|
|
190
|
+
| 'KHR'
|
|
191
|
+
| 'KMF'
|
|
192
|
+
| 'KPW'
|
|
193
|
+
| 'KRW'
|
|
194
|
+
| 'KWD'
|
|
195
|
+
| 'KYD'
|
|
196
|
+
| 'KZT'
|
|
197
|
+
| 'LAK'
|
|
198
|
+
| 'LBP'
|
|
199
|
+
| 'LKR'
|
|
200
|
+
| 'LRD'
|
|
201
|
+
| 'LSL'
|
|
202
|
+
| 'LTL'
|
|
203
|
+
| 'LVL'
|
|
204
|
+
| 'LYD'
|
|
205
|
+
| 'MAD'
|
|
206
|
+
| 'MDL'
|
|
207
|
+
| 'MGA'
|
|
208
|
+
| 'MKD'
|
|
209
|
+
| 'MMK'
|
|
210
|
+
| 'MNT'
|
|
211
|
+
| 'MOP'
|
|
212
|
+
| 'MRO'
|
|
213
|
+
| 'MRU'
|
|
214
|
+
| 'MTL'
|
|
215
|
+
| 'MUR'
|
|
216
|
+
| 'MVR'
|
|
217
|
+
| 'MWK'
|
|
218
|
+
| 'MXN'
|
|
219
|
+
| 'MYR'
|
|
220
|
+
| 'MZN'
|
|
221
|
+
| 'NAD'
|
|
222
|
+
| 'NGN'
|
|
223
|
+
| 'NIO'
|
|
224
|
+
| 'NOK'
|
|
225
|
+
| 'NPR'
|
|
226
|
+
| 'NZD'
|
|
227
|
+
| 'OMR'
|
|
228
|
+
| 'PAB'
|
|
229
|
+
| 'PEN'
|
|
230
|
+
| 'PGK'
|
|
231
|
+
| 'PHP'
|
|
232
|
+
| 'PKR'
|
|
233
|
+
| 'PLN'
|
|
234
|
+
| 'PYG'
|
|
235
|
+
| 'QAR'
|
|
236
|
+
| 'RON'
|
|
237
|
+
| 'RSD'
|
|
238
|
+
| 'RUB'
|
|
239
|
+
| 'RWF'
|
|
240
|
+
| 'SAR'
|
|
241
|
+
| 'SBD'
|
|
242
|
+
| 'SCR'
|
|
243
|
+
| 'SDG'
|
|
244
|
+
| 'SEK'
|
|
245
|
+
| 'SGD'
|
|
246
|
+
| 'SHP'
|
|
247
|
+
| 'SKK'
|
|
248
|
+
| 'SLL'
|
|
249
|
+
| 'SOS'
|
|
250
|
+
| 'SRD'
|
|
251
|
+
| 'SSP'
|
|
252
|
+
| 'STD'
|
|
253
|
+
| 'SVC'
|
|
254
|
+
| 'SYP'
|
|
255
|
+
| 'SZL'
|
|
256
|
+
| 'THB'
|
|
257
|
+
| 'TJS'
|
|
258
|
+
| 'TMM'
|
|
259
|
+
| 'TMT'
|
|
260
|
+
| 'TND'
|
|
261
|
+
| 'TOP'
|
|
262
|
+
| 'TRY'
|
|
263
|
+
| 'TTD'
|
|
264
|
+
| 'TWD'
|
|
265
|
+
| 'TZS'
|
|
266
|
+
| 'UAH'
|
|
267
|
+
| 'UGX'
|
|
268
|
+
| 'USD'
|
|
269
|
+
| 'UYU'
|
|
270
|
+
| 'UZS'
|
|
271
|
+
| 'VEF'
|
|
272
|
+
| 'VES'
|
|
273
|
+
| 'VND'
|
|
274
|
+
| 'VUV'
|
|
275
|
+
| 'WST'
|
|
276
|
+
| 'XAF'
|
|
277
|
+
| 'XAG'
|
|
278
|
+
| 'XAU'
|
|
279
|
+
| 'XBA'
|
|
280
|
+
| 'XBB'
|
|
281
|
+
| 'XBC'
|
|
282
|
+
| 'XBD'
|
|
283
|
+
| 'XCD'
|
|
284
|
+
| 'XDR'
|
|
285
|
+
| 'XFU'
|
|
286
|
+
| 'XOF'
|
|
287
|
+
| 'XPD'
|
|
288
|
+
| 'XPF'
|
|
289
|
+
| 'XPT'
|
|
290
|
+
| 'XTS'
|
|
291
|
+
| 'YER'
|
|
292
|
+
| 'ZAR'
|
|
293
|
+
| 'ZMK'
|
|
294
|
+
| 'ZMW'
|
|
295
|
+
| 'ZWD'
|
|
296
|
+
| 'ZWL'
|
|
297
|
+
| 'ZWN'
|
|
298
|
+
| 'ZWR';
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* If the return code is `R14` or `R15` this is the date the deceased counterparty
|
|
302
|
+
* passed away.
|
|
303
|
+
*/
|
|
304
|
+
date_of_death?: string | null;
|
|
305
|
+
|
|
306
|
+
id?: string;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* The ID of the relevant Internal Account.
|
|
310
|
+
*/
|
|
311
|
+
internal_account_id?: string | null;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* This field will be true if this object exists in the live environment or false
|
|
315
|
+
* if it exists in the test environment.
|
|
316
|
+
*/
|
|
317
|
+
live_mode?: boolean;
|
|
318
|
+
|
|
319
|
+
object?: string;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Often the bank will provide an explanation for the return, which is a short
|
|
323
|
+
* human readable string.
|
|
324
|
+
*/
|
|
325
|
+
reason?: string | null;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* An array of Payment Reference objects.
|
|
329
|
+
*/
|
|
330
|
+
reference_numbers?: Array<ReturnObject.ReferenceNumbers>;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* The ID of the object being returned or `null`.
|
|
334
|
+
*/
|
|
335
|
+
returnable_id?: string | null;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* The type of object being returned or `null`.
|
|
339
|
+
*/
|
|
340
|
+
returnable_type?: 'incoming_payment_detail' | 'paper_item' | 'payment_order' | 'reversal' | null;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* The role of the return, can be `originating` or `receiving`.
|
|
344
|
+
*/
|
|
345
|
+
role?: 'originating' | 'receiving';
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* The current status of the return.
|
|
349
|
+
*/
|
|
350
|
+
status?: 'completed' | 'failed' | 'pending' | 'processing' | 'sent';
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* The ID of the relevant Transaction or `null`.
|
|
354
|
+
*/
|
|
355
|
+
transaction_id?: string | null;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* The ID of the relevant Transaction Line Item or `null`.
|
|
359
|
+
*/
|
|
360
|
+
transaction_line_item_id?: string | null;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* The type of return. Can be one of: `ach`, `paper_item`, `eft`, `wire`.
|
|
364
|
+
*/
|
|
365
|
+
type?: 'ach' | 'ach_noc' | 'au_becs' | 'bacs' | 'eft' | 'manual' | 'paper_item' | 'wire';
|
|
366
|
+
|
|
367
|
+
updated_at?: string;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export namespace ReturnObject {
|
|
371
|
+
export interface ReferenceNumbers {
|
|
372
|
+
created_at?: string;
|
|
373
|
+
|
|
374
|
+
id?: string;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* This field will be true if this object exists in the live environment or false
|
|
378
|
+
* if it exists in the test environment.
|
|
379
|
+
*/
|
|
380
|
+
live_mode?: boolean;
|
|
381
|
+
|
|
382
|
+
object?: string;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* The vendor reference number.
|
|
386
|
+
*/
|
|
387
|
+
reference_number?: string;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* The type of the reference number. Referring to the vendor payment id.
|
|
391
|
+
*/
|
|
392
|
+
reference_number_type?:
|
|
393
|
+
| 'ach_original_trace_number'
|
|
394
|
+
| 'ach_trace_number'
|
|
395
|
+
| 'bankprov_payment_id'
|
|
396
|
+
| 'bnk_dev_prenotification_id'
|
|
397
|
+
| 'bnk_dev_transfer_id'
|
|
398
|
+
| 'bofa_end_to_end_id'
|
|
399
|
+
| 'bofa_transaction_id'
|
|
400
|
+
| 'check_number'
|
|
401
|
+
| 'cross_river_payment_id'
|
|
402
|
+
| 'cross_river_transaction_id'
|
|
403
|
+
| 'currencycloud_conversion_id'
|
|
404
|
+
| 'currencycloud_payment_id'
|
|
405
|
+
| 'dwolla_transaction_id'
|
|
406
|
+
| 'eft_trace_number'
|
|
407
|
+
| 'fedwire_imad'
|
|
408
|
+
| 'fedwire_omad'
|
|
409
|
+
| 'first_republic_internal_id'
|
|
410
|
+
| 'goldman_sachs_collection_request_id'
|
|
411
|
+
| 'goldman_sachs_end_to_end_id'
|
|
412
|
+
| 'goldman_sachs_payment_request_id'
|
|
413
|
+
| 'goldman_sachs_request_id'
|
|
414
|
+
| 'goldman_sachs_unique_payment_id'
|
|
415
|
+
| 'jpmc_ccn'
|
|
416
|
+
| 'jpmc_end_to_end_id'
|
|
417
|
+
| 'jpmc_firm_root_id'
|
|
418
|
+
| 'jpmc_p3_id'
|
|
419
|
+
| 'jpmc_payment_information_id'
|
|
420
|
+
| 'lob_check_id'
|
|
421
|
+
| 'other'
|
|
422
|
+
| 'partial_swift_mir'
|
|
423
|
+
| 'pnc_clearing_reference'
|
|
424
|
+
| 'pnc_instruction_id'
|
|
425
|
+
| 'pnc_multipayment_id'
|
|
426
|
+
| 'pnc_payment_trace_id'
|
|
427
|
+
| 'rtp_instruction_id'
|
|
428
|
+
| 'signet_api_reference_id'
|
|
429
|
+
| 'signet_confirmation_id'
|
|
430
|
+
| 'signet_request_id'
|
|
431
|
+
| 'silvergate_payment_id'
|
|
432
|
+
| 'swift_mir'
|
|
433
|
+
| 'swift_uetr'
|
|
434
|
+
| 'usbank_transaction_id'
|
|
435
|
+
| 'wells_fargo_payment_id'
|
|
436
|
+
| 'wells_fargo_trace_number';
|
|
437
|
+
|
|
438
|
+
updated_at?: string;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export interface ReturnCreateParams {
|
|
443
|
+
/**
|
|
444
|
+
* The ID of the object being returned or `null`.
|
|
445
|
+
*/
|
|
446
|
+
returnable_id: string | null;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* The type of object being returned. Currently, this may only be
|
|
450
|
+
* incoming_payment_detail.
|
|
451
|
+
*/
|
|
452
|
+
returnable_type: 'incoming_payment_detail';
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Some returns may include additional information from the bank. In these cases,
|
|
456
|
+
* this string will be present.
|
|
457
|
+
*/
|
|
458
|
+
additional_information?: string | null;
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* The return code. For ACH returns, this is the required ACH return code.
|
|
462
|
+
*/
|
|
463
|
+
code?:
|
|
464
|
+
| '901'
|
|
465
|
+
| '902'
|
|
466
|
+
| '903'
|
|
467
|
+
| '904'
|
|
468
|
+
| '905'
|
|
469
|
+
| '907'
|
|
470
|
+
| '908'
|
|
471
|
+
| '909'
|
|
472
|
+
| '910'
|
|
473
|
+
| '911'
|
|
474
|
+
| '912'
|
|
475
|
+
| '914'
|
|
476
|
+
| 'R01'
|
|
477
|
+
| 'R02'
|
|
478
|
+
| 'R03'
|
|
479
|
+
| 'R04'
|
|
480
|
+
| 'R05'
|
|
481
|
+
| 'R06'
|
|
482
|
+
| 'R07'
|
|
483
|
+
| 'R08'
|
|
484
|
+
| 'R09'
|
|
485
|
+
| 'R10'
|
|
486
|
+
| 'R11'
|
|
487
|
+
| 'R12'
|
|
488
|
+
| 'R14'
|
|
489
|
+
| 'R15'
|
|
490
|
+
| 'R16'
|
|
491
|
+
| 'R17'
|
|
492
|
+
| 'R20'
|
|
493
|
+
| 'R21'
|
|
494
|
+
| 'R22'
|
|
495
|
+
| 'R23'
|
|
496
|
+
| 'R24'
|
|
497
|
+
| 'R29'
|
|
498
|
+
| 'R31'
|
|
499
|
+
| 'R33'
|
|
500
|
+
| 'R37'
|
|
501
|
+
| 'R38'
|
|
502
|
+
| 'R39'
|
|
503
|
+
| 'R51'
|
|
504
|
+
| 'R52'
|
|
505
|
+
| 'R53'
|
|
506
|
+
| 'currencycloud'
|
|
507
|
+
| null;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* If the return code is `R14` or `R15` this is the date the deceased counterparty
|
|
511
|
+
* passed away.
|
|
512
|
+
*/
|
|
513
|
+
date_of_death?: string | null;
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* An optional description of the reason for the return. This is for internal usage
|
|
517
|
+
* and will not be transmitted to the bank.”
|
|
518
|
+
*/
|
|
519
|
+
reason?: string | null;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
export interface ReturnListParams extends PageParams {
|
|
523
|
+
/**
|
|
524
|
+
* Specify `counterparty_id` if you wish to see returns that occurred with a
|
|
525
|
+
* specific counterparty.
|
|
526
|
+
*/
|
|
527
|
+
counterparty_id?: string;
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Specify `internal_account_id` if you wish to see returns to/from a specific
|
|
531
|
+
* account.
|
|
532
|
+
*/
|
|
533
|
+
internal_account_id?: string;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* The ID of a valid returnable. Must be accompanied by `returnable_type`.
|
|
537
|
+
*/
|
|
538
|
+
returnable_id?: string;
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* One of `payment_order`, `paper_item`, `reversal`, or `incoming_payment_detail`.
|
|
542
|
+
* Must be accompanied by `returnable_id`.
|
|
543
|
+
*/
|
|
544
|
+
returnable_type?: 'incoming_payment_detail' | 'paper_item' | 'payment_order' | 'reversal';
|
|
545
|
+
}
|