Updating an employees leave balance
Please note if you are integrated with Deputy UK instances that this does not apply to your application.
Updating an employees leave balance is a destructive change. It is not an accumulated change and amounts overwritten will not be retained. This endpoint should only be used if your application is the source of truth for leave.
If you need to update an employees leave balance in Deputy use the following guide.
URL and Payload
curl --location --request POST 'https://{install}.{geo}.deputy.com/api/v1/resource/LeaveAccrual
Sample
{"Employee":6629,"LeaveRule":11,"TransactionDate":"now","Hours":400}
Reponse
{
"Id": 593,
"Employee": 6629,
"EmployeeHistory": 161290,
"TransactionDate": "2024-04-03T14:15:08+11:00",
"Type": 1,
"LeaveRule": 11,
"Hours": 400,
"Days": 0,
"Comment": null,
"FkId": null,
"BalanceCalculatedAt": null,
"Creator": 1,
"Created": null,
"Modified": "2024-04-03T14:15:09+11:00",
"_DPMetaData": {
"System": "LeaveAccrual",
"CreatorInfo": {
"Id": 1,
"DisplayName": "Simon Hutchinson",
"EmployeeProfile": 1,
"Employee": 1,
"Photo": "https://photo2.deputy.com/deputec_b220505063318_11516/-135x135_3ad576ba56df64c09cefdef831a3dc43.jpg?Expires=1712176847&Signature=VsYXT7xmiPqPY5gjIMxnuVsVbTCeHFuvbpZiGDupbI38XNRsSsmqf6JInUmOXWlmhkXwNh662X1Q9ecnG3YIBFut67YKZG0nY242n53JlG4oNi9KzUsOs-9Q3F4VNvfz070Xj205MXV90aUcL9VJfMbSQPT3IPQGiD4r-B86mN4_&Key-Pair-Id=APKAINP5UVPK4IGBHXOQ",
"Pronouns": 0,
"CustomPronouns": ""
}
}
}
Data Elements
Data Element | Mandatory | Info |
---|---|---|
Employee | Yes | This is the employee id from the Deputy install. It is not the payroll id |
LeaveRule | Yes | The id of the LeaveRule you are updating the leave balance for. You can retrieve the Leave Rules from the Deputy install using the resource API. |
TransactionDate | Yes | The date timestamp of when the balance should be applied. If you use "now" this will set the current timestamp/date. |
Hours | Yes | The new leave balance in hours. |
Updated 9 months ago