0

Create an EOR contract amendment

by
Published Oct 17, 2025

This endpoint allows you to create a new amendment for a EOR contract. Amendments may include changes to salary, currency, effective date, or other contract terms, and all requests are validated against business and regulatory rules. **Token scopes**: `contracts:write`

Script deel Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Create an EOR contract amendment
4
 * This endpoint allows you to create a new amendment for a EOR contract. Amendments may include changes to salary, currency, effective date, or other contract terms, and all requests are validated against business and regulatory rules.
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/contracts/${contract_id}/amendments`)
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
/* 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
		/**
35
		 * Scope of the amendment.
36
		 */
37
		scope?: string
38
		/**
39
		 * An optional array of custom objects.
40
		 */
41
		custom?: {
42
			/**
43
			 * An optional identifier for the custom object.
44
			 */
45
			id?: string
46
			/**
47
			 * The type of the custom object. Must be one of the valid custom types.
48
			 */
49
			type: string
50
			/**
51
			 * A required description for the custom object.
52
			 */
53
			description: string
54
			[k: string]: unknown
55
		}[]
56
		/**
57
		 * Salary for the amendment.
58
		 */
59
		salary?: number
60
		/**
61
		 * End date of the employment.
62
		 */
63
		end_date?: string
64
		/**
65
		 * Number of holidays.
66
		 */
67
		holidays?: number
68
		/**
69
		 * Job title associated with the amendment.
70
		 */
71
		job_title?: string
72
		/**
73
		 * Start date of the employment.
74
		 */
75
		start_date?: string
76
		/**
77
		 * Hourly rate of the amendment. The max value supported is 1e19
78
		 */
79
		hourly_rate?: number
80
		/**
81
		 * Seniority level identifier.
82
		 */
83
		seniority_id?: number
84
		/**
85
		 * Type of time off.
86
		 */
87
		time_off_type?: 'STANDARD' | 'SPECIFIC' | 'PRORATED'
88
		/**
89
		 * Effective date for the amendment.
90
		 */
91
		effective_date?: string
92
		/**
93
		 * The seniority date represents the employee’s original start date with a previous employer. It is used to preserve employment tenure when the employee transfers to this company. Can be null if not applicable.
94
		 */
95
		seniority_date?: string
96
		/**
97
		 * Additional metadata related to job validation and categorisation
98
		 */
99
		additional_info?: {
100
			/**
101
			 * Identifier or flag for AI scope validation check
102
			 */
103
			ai_scope_check_public_id?: string | boolean
104
			/**
105
			 * Identifier for job categorisation log
106
			 */
107
			job_categorization_log_id?: string
108
			[k: string]: unknown
109
		}
110
		/**
111
		 * Type of employment.
112
		 */
113
		employment_type?: 'FULL_TIME' | 'PART_TIME'
114
		/**
115
		 * State of employment.
116
		 */
117
		employment_state?: string
118
		/**
119
		 * Duration of the probation period.
120
		 */
121
		probation_period?: number
122
		/**
123
		 * Type of notice period.
124
		 */
125
		notice_period_type?: 'STANDARD' | 'CUSTOM'
126
		/**
127
		 * Number of work hours per week.
128
		 */
129
		work_hours_per_week?: number
130
		/**
131
		 * Notice period after probation.
132
		 */
133
		notice_period_after_probation?: number
134
		/**
135
		 * Notice period during probation.
136
		 */
137
		notice_period_during_probation?: number
138
		/**
139
		 * Type of probation period for definite contracts.
140
		 */
141
		probation_period_type_for_definite?: 'STANDARD' | 'CUSTOM'
142
		[k: string]: unknown
143
	}
144
	[k: string]: unknown
145
}
146