//native
/**
* Retrieve payslip PDF download link
* Retrieve a URL to download a specific payslip PDF for a EoR worker. This endpoint is useful for accessing detailed payment records in a portable document format.
**Token scopes**: `payslips:read`
*/
export async function main(auth: RT.Deel, worker_id: string, payslip_id: string) {
const url = new URL(
`https://api.letsdeel.com/rest/v2/eor/workers/${worker_id}/payslips/${payslip_id}/download`
)
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