Update Staff Leave Balance
Sets one staff member’s current leave balance, per leave type. Only the leave types sent change. Shared rules: see Writing data.
salarybox_idis an active staff member of the company.balanceshas at max 50 items, each leave type at most once.leave_typeis the exact leave type name (case-sensitive) fromGET /leave/balanceorGET /leave/policy; system leave types are refused.pending_leavesis the remaining balance, from -366 to 366 with up to 3 decimals. It replaces the current balance, it is not added to it. A negative balance is allowed.carry_forwarded_leavesis optional, 0-366 with up to 3 decimals. Left out, it stays as it is. Sending a non-zero value needs the Leave Carry Forward plan feature; balances alone work on every plan.- A leave type that already has a balance must have a leave policy first (
POST /leave/policy), otherwise400. A new balance row on a staff member with no policy gets an ANNUAL policy with 0 allotted. - Numbers must be JSON numbers, not strings. Repeating the request is safe: it sets the same values.
Authentication
AuthorizationApi-Key
Format: “Api-Key {api-key}”
Request
This endpoint expects an object.
salarybox_id
SalaryBox ID of an active staff member.
balances
One item per leave type, each leave type at most once.
Response
The leave balance was saved.
message
status
data
Errors
400
Bad Request Error
403
Forbidden Error
404
Not Found Error
