0

Update Employee Information for EOR Contract

by
Published Oct 17, 2025

Updates employee information related to an EOR Contract. This endpoint supports partial updates. Attempting to update any undocumented fields will result in a validation error. This endpoint will only work for contracts with status `new`, `under_review`, `waiting_for_client_sign`, `waiting_for_eor_sign`, `waiting_for_employee_contract`, `waiting_for_employee_sign`, `awaiting_deposit_payment`, or `rejected`. **Token scopes**: `contracts:write`

Script deel Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Update Employee Information for EOR Contract
4
 * Updates employee information related to an EOR Contract. This endpoint supports partial updates. Attempting to update any undocumented fields will result in a validation error. This endpoint will only work for contracts with status `new`, `under_review`, `waiting_for_client_sign`, `waiting_for_eor_sign`, `waiting_for_employee_contract`, `waiting_for_employee_sign`, `awaiting_deposit_payment`, or `rejected`.
5
 **Token scopes**: `contracts:write`
6
 */
7
export async function main(auth: RT.Deel, contract_id: string, body: Body) {
8
	const url = new URL(
9
		`https://api.letsdeel.com/rest/v2/eor/contracts/${contract_id}/employee-information`
10
	)
11

12
	const response = await fetch(url, {
13
		method: 'PATCH',
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
	data?: {
36
		/**
37
		 * The last name of the employee.
38
		 */
39
		employee_last_name?: string
40
		/**
41
		 * The first name of the employee.
42
		 */
43
		employee_first_name?: string
44
		[k: string]: unknown
45
	}
46
	[k: string]: unknown
47
}
48