0

Modify bank account

by
Published Oct 17, 2025

Modify bank account for an employee. **Token scopes**: `people:write`

Script deel Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Modify bank account
4
 * Modify bank account for an employee.
5
 **Token scopes**: `people:write`
6
 */
7
export async function main(auth: RT.Deel, worker_id: string, bank_id: string, body: Body) {
8
	const url = new URL(`https://api.letsdeel.com/rest/v2/gp/workers/${worker_id}/banks/${bank_id}`)
9

10
	const response = await fetch(url, {
11
		method: 'PATCH',
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
/* eslint-disable */
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
	 * The city of the user's address.
35
	 */
36
	city?: string
37
	/**
38
	 * The International Bank Account Number (IBAN).
39
	 */
40
	iban?: string
41
	/**
42
	 * The user's email address.
43
	 */
44
	email?: string
45
	/**
46
	 * The user's phone number.
47
	 */
48
	phone?: string
49
	/**
50
	 * The user's postal or ZIP code.
51
	 */
52
	postal?: string
53
	/**
54
	 * The user's tax identification number.
55
	 */
56
	tax_id?: string
57
	/**
58
	 * The bank code.
59
	 */
60
	bank_code?: string
61
	/**
62
	 * Name of the user's bank.
63
	 */
64
	bank_name?: string
65
	/**
66
	 * Full name of the user.
67
	 */
68
	full_name?: string
69
	/**
70
	 * SWIFT/BIC code for the bank.
71
	 */
72
	swift_bic?: string
73
	/**
74
	 * The RIB (Relevé d'Identité Bancaire).
75
	 */
76
	rib_number?: string
77
	/**
78
	 * The branch code of the user's bank.
79
	 */
80
	branch_code?: string
81
	/**
82
	 * Bank account type.
83
	 */
84
	account_type?: string
85
	/**
86
	 * The country code of the user's address.
87
	 */
88
	country_code?: string
89
	/**
90
	 * The primary address line.
91
	 */
92
	address_line1?: string
93
	/**
94
	 * The secondary address line.
95
	 */
96
	address_line2?: string
97
	/**
98
	 * The currency code for transactions.
99
	 */
100
	currency_code?: string
101
	/**
102
	 * The original name of the user.
103
	 */
104
	original_name?: string
105
	/**
106
	 * The user's bank account number.
107
	 */
108
	account_number?: string
109
	/**
110
	 * The state or province of the user's address.
111
	 */
112
	province_state?: string
113
	/**
114
	 * The name of the user's bank branch.
115
	 */
116
	bank_branch_name?: string
117
	/**
118
	 * The country code where the bank is located.
119
	 */
120
	bank_country_code?: string
121
	/**
122
	 * The ACH (Automated Clearing House) Routing Number.
123
	 */
124
	ach_routing_number?: string
125
	[k: string]: unknown
126
}
127