1 | |
2 | |
3 | * Add/Edit Bank Details |
4 | * Add/Edit Bank Details |
5 | **Token scopes**: `worker:read`, `worker:write` |
6 | */ |
7 | export async function main(auth: RT.Deel, body: Body) { |
8 | const url = new URL(`https://api.letsdeel.com/rest/v2/payouts/employees/methods`) |
9 |
|
10 | const response = await fetch(url, { |
11 | method: 'POST', |
12 | headers: { |
13 | 'Content-Type': 'application/json', |
14 | Authorization: 'Bearer ' + auth.apiKey |
15 | }, |
16 | body: JSON.stringify(body) |
17 | }) |
18 | if (!response.ok) { |
19 | const text = await response.text() |
20 | throw new Error(`${response.status} ${text}`) |
21 | } |
22 | return await response.json() |
23 | } |
24 |
|
25 | |
26 | |
27 | * This file was automatically generated by json-schema-to-typescript. |
28 | * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, |
29 | * and run json-schema-to-typescript to regenerate this file. |
30 | */ |
31 |
|
32 | export interface Body { |
33 | |
34 | * Request data |
35 | */ |
36 | data?: { |
37 | |
38 | * Unique identifier for the bank details |
39 | */ |
40 | id?: string |
41 | |
42 | * Payload containing bank details |
43 | */ |
44 | payload?: { |
45 | |
46 | * Name of the city |
47 | */ |
48 | city?: string |
49 | |
50 | * International Bank Account Number |
51 | */ |
52 | iban?: string |
53 | |
54 | * Postal code |
55 | */ |
56 | postal?: string |
57 | |
58 | * Name of the bank |
59 | */ |
60 | bank_name?: string |
61 | |
62 | * Full name of the account holder |
63 | */ |
64 | full_name?: string |
65 | |
66 | * SWIFT/BIC code |
67 | */ |
68 | swift_bic?: string |
69 | |
70 | * Country code |
71 | */ |
72 | country_code?: string |
73 | |
74 | * Address line 1 |
75 | */ |
76 | address_line1?: string |
77 | |
78 | * Original name of the account holder |
79 | */ |
80 | original_name?: string |
81 | |
82 | * Province or state |
83 | */ |
84 | province_state?: string |
85 | |
86 | * Country code of the bank |
87 | */ |
88 | bank_country_code?: string |
89 | [k: string]: unknown |
90 | } |
91 | [k: string]: unknown |
92 | } |
93 | [k: string]: unknown |
94 | } |
95 |
|