0

Dynamic Requirements

by
Published Oct 17, 2025

Dynamic Requirements **Token scopes**: `worker:read`, `worker:write`

Script deel Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Dynamic Requirements
4
 * Dynamic Requirements
5
 **Token scopes**: `worker:read`, `worker:write`
6
 */
7
export async function main(auth: RT.Deel, body: Body) {
8
	const url = new URL(
9
		`https://api.letsdeel.com/rest/v2/payouts/employees/methods/bank_transfers/requirements`
10
	)
11

12
	const response = await fetch(url, {
13
		method: 'POST',
14
		headers: {
15
			'Content-Type': 'application/json',
16
			Authorization: 'Bearer ' + auth.apiKey
17
		},
18
		body: JSON.stringify(body)
19
	})
20
	if (!response.ok) {
21
		const text = await response.text()
22
		throw new Error(`${response.status} ${text}`)
23
	}
24
	return await response.json()
25
}
26

27
/* eslint-disable */
28
/**
29
 * This file was automatically generated by json-schema-to-typescript.
30
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
31
 * and run json-schema-to-typescript to regenerate this file.
32
 */
33

34
export interface Body {
35
	/**
36
	 * Request data
37
	 */
38
	data?: {
39
		/**
40
		 * Current state of the bank details
41
		 */
42
		current_state?: {
43
			/**
44
			 * Type of payment
45
			 */
46
			payment_type?: string
47
			/**
48
			 * Currency code
49
			 */
50
			currency_code?: string
51
			/**
52
			 * Country code of the bank
53
			 */
54
			bank_country_code?: string
55
			[k: string]: unknown
56
		}
57
		[k: string]: unknown
58
	}
59
	[k: string]: unknown
60
}
61