forked from Increase/increase-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwire-drawdown-requests.ts
More file actions
291 lines (249 loc) · 8.33 KB
/
wire-drawdown-requests.ts
File metadata and controls
291 lines (249 loc) · 8.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as WireDrawdownRequestsAPI from './wire-drawdown-requests';
import { Page, type PageParams } from '../pagination';
export class WireDrawdownRequests extends APIResource {
/**
* Create a Wire Drawdown Request
*/
create(
body: WireDrawdownRequestCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<WireDrawdownRequest> {
return this._client.post('/wire_drawdown_requests', { body, ...options });
}
/**
* Retrieve a Wire Drawdown Request
*/
retrieve(
wireDrawdownRequestId: string,
options?: Core.RequestOptions,
): Core.APIPromise<WireDrawdownRequest> {
return this._client.get(`/wire_drawdown_requests/${wireDrawdownRequestId}`, options);
}
/**
* List Wire Drawdown Requests
*/
list(
query?: WireDrawdownRequestListParams,
options?: Core.RequestOptions,
): Core.PagePromise<WireDrawdownRequestsPage, WireDrawdownRequest>;
list(options?: Core.RequestOptions): Core.PagePromise<WireDrawdownRequestsPage, WireDrawdownRequest>;
list(
query: WireDrawdownRequestListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<WireDrawdownRequestsPage, WireDrawdownRequest> {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/wire_drawdown_requests', WireDrawdownRequestsPage, {
query,
...options,
});
}
}
export class WireDrawdownRequestsPage extends Page<WireDrawdownRequest> {}
/**
* Wire drawdown requests enable you to request that someone else send you a wire.
* This feature is in beta; reach out to
* [support@increase.com](mailto:support@increase.com) to learn more.
*/
export interface WireDrawdownRequest {
/**
* The Wire drawdown request identifier.
*/
id: string;
/**
* The Account Number to which the recipient of this request is being requested to
* send funds.
*/
account_number_id: string;
/**
* The amount being requested in cents.
*/
amount: number;
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the amount being
* requested. Will always be "USD".
*/
currency: string;
/**
* If the recipient fulfills the drawdown request by sending funds, then this will
* be the identifier of the corresponding Transaction.
*/
fulfillment_inbound_wire_transfer_id: string | null;
/**
* The idempotency key you chose for this object. This value is unique across
* Increase and is used to ensure that a request is only processed once. Learn more
* about [idempotency](https://increase.com/documentation/idempotency-keys).
*/
idempotency_key: string | null;
/**
* The message the recipient will see as part of the drawdown request.
*/
message_to_recipient: string;
/**
* The originator's address line 1.
*/
originator_address_line1: string | null;
/**
* The originator's address line 2.
*/
originator_address_line2: string | null;
/**
* The originator's address line 3.
*/
originator_address_line3: string | null;
/**
* The originator's name.
*/
originator_name: string | null;
/**
* The drawdown request's recipient's account number.
*/
recipient_account_number: string;
/**
* Line 1 of the drawdown request's recipient's address.
*/
recipient_address_line1: string | null;
/**
* Line 2 of the drawdown request's recipient's address.
*/
recipient_address_line2: string | null;
/**
* Line 3 of the drawdown request's recipient's address.
*/
recipient_address_line3: string | null;
/**
* The drawdown request's recipient's name.
*/
recipient_name: string | null;
/**
* The drawdown request's recipient's routing number.
*/
recipient_routing_number: string;
/**
* The lifecycle status of the drawdown request.
*
* - `pending_submission` - The drawdown request is queued to be submitted to
* Fedwire.
* - `pending_response` - The drawdown request has been sent and the recipient
* should respond in some way.
* - `fulfilled` - The drawdown request has been fulfilled by the recipient.
* - `refused` - The drawdown request has been refused by the recipient.
*/
status: 'pending_submission' | 'pending_response' | 'fulfilled' | 'refused';
/**
* After the drawdown request is submitted to Fedwire, this will contain
* supplemental details.
*/
submission: WireDrawdownRequest.Submission | null;
/**
* A constant representing the object's type. For this resource it will always be
* `wire_drawdown_request`.
*/
type: 'wire_drawdown_request';
}
export namespace WireDrawdownRequest {
/**
* After the drawdown request is submitted to Fedwire, this will contain
* supplemental details.
*/
export interface Submission {
/**
* The input message accountability data (IMAD) uniquely identifying the submission
* with Fedwire.
*/
input_message_accountability_data: string;
}
}
export interface WireDrawdownRequestCreateParams {
/**
* The Account Number to which the recipient should send funds.
*/
account_number_id: string;
/**
* The amount requested from the recipient, in USD cents.
*/
amount: number;
/**
* A message the recipient will see as part of the request.
*/
message_to_recipient: string;
/**
* The drawdown request's recipient's account number.
*/
recipient_account_number: string;
/**
* The drawdown request's recipient's name.
*/
recipient_name: string;
/**
* The drawdown request's recipient's routing number.
*/
recipient_routing_number: string;
/**
* The drawdown request originator's address line 1. This is only necessary if
* you're requesting a payment to a commingled account. Otherwise, we'll use the
* associated entity's details.
*/
originator_address_line1?: string;
/**
* The drawdown request originator's address line 2. This is only necessary if
* you're requesting a payment to a commingled account. Otherwise, we'll use the
* associated entity's details.
*/
originator_address_line2?: string;
/**
* The drawdown request originator's address line 3. This is only necessary if
* you're requesting a payment to a commingled account. Otherwise, we'll use the
* associated entity's details.
*/
originator_address_line3?: string;
/**
* The drawdown request originator's name. This is only necessary if you're
* requesting a payment to a commingled account. Otherwise, we'll use the
* associated entity's details.
*/
originator_name?: string;
/**
* Line 1 of the drawdown request's recipient's address.
*/
recipient_address_line1?: string;
/**
* Line 2 of the drawdown request's recipient's address.
*/
recipient_address_line2?: string;
/**
* Line 3 of the drawdown request's recipient's address.
*/
recipient_address_line3?: string;
}
export interface WireDrawdownRequestListParams extends PageParams {
/**
* Filter records to the one with the specified `idempotency_key` you chose for
* that object. This value is unique across Increase and is used to ensure that a
* request is only processed once. Learn more about
* [idempotency](https://increase.com/documentation/idempotency-keys).
*/
idempotency_key?: string;
/**
* Filter Wire Drawdown Requests for those with the specified status.
*
* - `pending_submission` - The drawdown request is queued to be submitted to
* Fedwire.
* - `pending_response` - The drawdown request has been sent and the recipient
* should respond in some way.
* - `fulfilled` - The drawdown request has been fulfilled by the recipient.
* - `refused` - The drawdown request has been refused by the recipient.
*/
status?: 'pending_submission' | 'pending_response' | 'fulfilled' | 'refused';
}
export namespace WireDrawdownRequests {
export import WireDrawdownRequest = WireDrawdownRequestsAPI.WireDrawdownRequest;
export import WireDrawdownRequestsPage = WireDrawdownRequestsAPI.WireDrawdownRequestsPage;
export import WireDrawdownRequestCreateParams = WireDrawdownRequestsAPI.WireDrawdownRequestCreateParams;
export import WireDrawdownRequestListParams = WireDrawdownRequestsAPI.WireDrawdownRequestListParams;
}