Edits history of script submission #15481 for ' Get additional information required to request employee termination (deel)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    /**
     * Get additional information required to request employee termination
     * This endpoint provides additional country-specific requirements for employee offboarding. It specifies any mandatory or optional questions that the client must answer and identifies required supporting documents that must be uploaded during the offboarding process. This ensures compliance with local regulations and streamlines the offboarding workflow.
     **Token scopes**: `contracts:read`
     */
    export async function main(auth: RT.Deel, contract_id: string) {
    	const url = new URL(
    		`https://api.letsdeel.com/rest/v2/eor/contracts/${contract_id}/offboarding/required-information`
    	)
    
    	const response = await fetch(url, {
    		method: 'GET',
    		headers: {
    			Authorization: 'Bearer ' + auth.apiKey
    		},
    		body: undefined
    	})
    	if (!response.ok) {
    		const text = await response.text()
    		throw new Error(`${response.status} ${text}`)
    	}
    	return await response.json()
    }
    

    Submitted by hugo697 235 days ago