0

Update EOR Contract

by
Published Oct 17, 2025

This endpoint is used to modify mutable fields of an EOR contract, such as salary, job title, or benefits. It supports partial updates—only include fields that should be updated. Required fields must still be present for validation. **Token scopes**: `contracts:write`

Script deel Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Update EOR Contract
4
 * This endpoint is used to modify mutable fields of an EOR contract, such as salary, job title, or benefits. It supports partial updates—only include fields that should be updated. Required fields must still be present for validation.
5
 **Token scopes**: `contracts:write`
6
 */
7
export async function main(auth: RT.Deel, contract_id: string, body: Body) {
8
	const url = new URL(`https://api.letsdeel.com/rest/v2/eor/contract/${contract_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
	data: {
34
		scope?:
35
			| string
36
			| {
37
					/**
38
					 * Scope template UUID.
39
					 */
40
					scope_template_id?: string
41
					/**
42
					 * Scope validation UUID.
43
					 */
44
					scope_validation_id?: string
45
					[k: string]: unknown
46
			  }
47
		/**
48
		 * Annual salary amount
49
		 */
50
		salary: number
51
		/**
52
		 * Array of employee benefits
53
		 */
54
		benefits?: {
55
			/**
56
			 * Benefit plan ID
57
			 */
58
			plan_id?: string
59
			/**
60
			 * Indicates if benefit covers all
61
			 */
62
			cover_all?: boolean
63
			/**
64
			 * Benefit provider ID
65
			 */
66
			provider_id?: string
67
			/**
68
			 * Contribution amount
69
			 */
70
			contribution?: number
71
			/**
72
			 * Indicates if benefit covers dependents
73
			 */
74
			cover_dependents?: boolean
75
			[k: string]: unknown
76
		}[]
77
		/**
78
		 * Currency code for salary and benefits
79
		 */
80
		currency?: string
81
		/**
82
		 * Employment end date
83
		 */
84
		end_date?: string
85
		/**
86
		 * Number of holiday days per year
87
		 */
88
		holidays?: number
89
		/**
90
		 * Indicates if compensation is hourly
91
		 */
92
		is_hourly?: boolean
93
		/**
94
		 * Job title (cannot be C-level position)
95
		 */
96
		job_title: string
97
		/**
98
		 * Indicates if work visa is required
99
		 */
100
		work_visa?: boolean
101
		/**
102
		 * Employment start date
103
		 */
104
		start_date: string
105
		/**
106
		 * Employee's unique identifier
107
		 */
108
		employee_id?: string
109
		/**
110
		 * Hourly rate (required if is_hourly is true)
111
		 */
112
		hourly_rate?: number
113
		/**
114
		 * Indicates if this is a resubmission
115
		 */
116
		is_resubmit?: boolean
117
		/**
118
		 * Unique identifier for the employee's work schedule
119
		 */
120
		schedule_id?: string
121
		/**
122
		 * Seniority level identifier
123
		 */
124
		seniority_id?: number
125
		/**
126
		 * Indicates if work pension is included
127
		 */
128
		work_pension?: boolean
129
		/**
130
		 * Signing bonus amount
131
		 */
132
		signing_bonus?: number
133
		/**
134
		 * Type of time off
135
		 */
136
		time_off_type?: 'STANDARD' | 'SPECIFIC' | 'PRORATED'
137
		/**
138
		 * Employee's email address
139
		 */
140
		employee_email: string
141
		/**
142
		 * Employee seniority date
143
		 */
144
		seniority_date?: string
145
		/**
146
		 * Type of employment
147
		 */
148
		employment_type: 'Full-time' | 'Part-time'
149
		/**
150
		 * Number of sick leave days per year
151
		 */
152
		sick_leave_days?: number
153
		/**
154
		 * Employee's address information
155
		 */
156
		employee_address?: {
157
			/**
158
			 * ZIP/Postal code
159
			 */
160
			zip?: string
161
			/**
162
			 * City of residence
163
			 */
164
			city: string
165
			/**
166
			 * Phone number
167
			 */
168
			phone?: string
169
			/**
170
			 * State of residence
171
			 */
172
			state?: string
173
			/**
174
			 * Street address
175
			 */
176
			street: string
177
			/**
178
			 * Country of residence (can be country code or name)
179
			 */
180
			country: string
181
			/**
182
			 * Province of residence
183
			 */
184
			province?: string
185
			/**
186
			 * Country calling code
187
			 */
188
			calling_code?: string
189
			[k: string]: unknown
190
		}
191
		/**
192
		 * State/Province of employment
193
		 */
194
		employment_state?: string
195
		/**
196
		 * Objective for hiring
197
		 */
198
		hiring_objective?:
199
			| 'EXPANDING_TO_NEW_COUNTRY'
200
			| 'TEMP_EOR_OPENING_ENTITY'
201
			| 'ONE_OFF_HIRE'
202
			| 'CONVERTING_CONTRACTOR'
203
			| 'OTHER'
204
		/**
205
		 * Probation period duration
206
		 */
207
		probation_period?: number
208
		/**
209
		 * Work arrangement type
210
		 */
211
		work_arrangement?: 'REMOTE' | 'ON_SITE_OR_HYBRID'
212
		/**
213
		 * Work eligibility documentation
214
		 */
215
		work_eligibility?: {
216
			/**
217
			 * Unique identifier for the work eligibility document
218
			 */
219
			key: string
220
			/**
221
			 * Name of the work eligibility document file
222
			 */
223
			file_name: string
224
			[k: string]: unknown
225
		}
226
		/**
227
		 * Medical insurance coverage
228
		 */
229
		medical_insurance?: boolean
230
		/**
231
		 * Type of contract term
232
		 */
233
		contract_term_type?: 'DEFINITE' | 'INDEFINITE'
234
		/**
235
		 * Employee's last name
236
		 */
237
		employee_last_name: string
238
		/**
239
		 * Country of employment
240
		 */
241
		employment_country: string
242
		/**
243
		 * Type of notice period
244
		 */
245
		notice_period_type?: 'STANDARD' | 'CUSTOM'
246
		/**
247
		 * Employee's first name
248
		 */
249
		employee_first_name: string
250
		/**
251
		 * Working hours per week
252
		 */
253
		work_hours_per_week?: number
254
		/**
255
		 * Employee's nationality
256
		 */
257
		employee_nationality?: string
258
		/**
259
		 * Reason for fixed-term contract
260
		 */
261
		reason_for_fixed_term?:
262
			| 'SEASONAL_OR_TEMPORARY_WORK'
263
			| 'PROJECT_BASED_EMPLOYMENT'
264
			| 'REPLACEMENT_FOR_PERMANENT_STAFF'
265
			| 'TRIAL_PERIODS_FOR_NEW_ROLES_OR_BUSINESSES'
266
		/**
267
		 * Additional quote-specific information
268
		 */
269
		quote_additional_fields?: {
270
			/**
271
			 * Type of employee
272
			 */
273
			employee_type?: 'Employee' | 'Manager'
274
			/**
275
			 * Required qualifications
276
			 */
277
			qualifications?: string
278
			/**
279
			 * German translation of scope
280
			 */
281
			scope_german_translation?: string
282
			/**
283
			 * German translation of qualifications
284
			 */
285
			qualifications_german_translation?: string
286
			[k: string]: unknown
287
		}
288
		/**
289
		 * Determines when the signing bonus will be paid out
290
		 */
291
		signing_bonus_payout_type?:
292
			| 'FIRST_CYCLE'
293
			| 'AFTER_PROBATION'
294
			| 'AFTER_FIRST_CONTRACT_ANNIVERSARY'
295
		/**
296
		 * Additional information about hiring objective
297
		 */
298
		hiring_objective_extra_info?: string
299
		/**
300
		 * Notice period after probation (days)
301
		 */
302
		notice_period_after_probation?: number
303
		/**
304
		 * Notice period during probation (days)
305
		 */
306
		notice_period_during_probation?: number
307
		/**
308
		 * Auto quote validation status
309
		 */
310
		is_auto_quote_validation_passed?: boolean
311
		/**
312
		 * Unit of time for probation period
313
		 */
314
		probation_period_type_for_definite?: 'CUSTOM' | 'STANDARD'
315
		/**
316
		 * Allow equipment reimbursement for consultants
317
		 */
318
		allow_consultant_equipment_reimbursement?: boolean
319
		[k: string]: unknown
320
	}
321
	[k: string]: unknown
322
}
323