QHR Developers

Preview an employee's leave settlement on leaving

GET/employees/{id}/time_off/offboarding
Read token is enoughView others' time off time_off/view_othersRequires feature time_offAvailable in Claudetime_off.offboarding_preview

Works out, in days, the leave an employee would be paid out if they left on a given last working day: carry-over plus this year's entitlement earned to that day, minus approved leave taken, for each encashable policy (annual leave that is fully paid); other policies are listed under excluded with the reason. It also lists the requests that outlive that day and what starting the offboarding does to each: cancel (starts after it) or needs_review (straddles it).

Once an offboarding has started, the last working day is the one it was started with; once it is finalised, this returns the settlement frozen at that moment. Figures are days, not money: the end-of-service amount is worked out by the termination package.

When to use: before time_off.start_offboarding, to show HR the settlement and which leave will be cancelled, and afterwards to read where the offboarding stands.

Prerequisites: the employee's id from employees.list. Needs "View others' time off".

Side effects: none.

Before you call this

You will need ids that come from these operations:

Parameters

NameInTypeDescriptionExample
idRequiredpathintegerEmployee id, from employees.list, employees.search or hr_leaves.employees.1203
last_working_dayquerystring (date)The last working day to work it out for, before an offboarding has started. 30 days from today when omitted; ignored once one has started.2026-12-31
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Response

200 The settlement and the leave it affects.

FieldTypeDescription
carryovernumberDays carried over from earlier years.
pro_ratednumberThis year's entitlement earned up to the last working day.
usednumberDays of approved leave this year, up to the last working day.
to_encashnumberDays to be paid out: carryover + pro_rated − used.
policiesarray<object>The encashable policies (annual leave, fully paid), one row each; rows add up to the totals.
policies[].carryovernumberDays carried over from earlier years.
policies[].pro_ratednumberThis year's entitlement earned up to the last working day.
policies[].usednumberDays of approved leave this year, up to the last working day.
policies[].to_encashnumberDays to be paid out: carryover + pro_rated − used.
policies[].leave_policy_idintegerLeave policy id.
policies[].namestringLeave policy name.
excludedarray<object>Policies the employee holds that are not paid out, and why.
excluded[].leave_policy_idintegerLeave policy id.
excluded[].namestringLeave policy name.
excluded[].reasonstringnot_accrued_per_year, category_not_encashable or policy_not_fully_paid.
last_working_daystring (date)The last working day the settlement is worked out for.
affected_leave_requestsarray<object>Requests that outlive the last working day and what starting the offboarding does to each. Empty once it is finalised.
affected_leave_requests[].idintegerLeave request id.
affected_leave_requests[].leave_policy_idintegerLeave policy id.
affected_leave_requests[].leave_type_namestringPolicy name.
affected_leave_requests[].start_datestring (date)First day.
affected_leave_requests[].end_datestring (date)Last day.
affected_leave_requests[].balancenumberWorking days.
affected_leave_requests[].statusstringpending or approved.
affected_leave_requests[].actionstringcancel (starts after the last day; cancelled for good when the offboarding starts) or needs_review (straddles it; left as is for HR to cancel and re-file shorter).
Allowed values: cancel, needs_review
cancellation_warningstringWhat HR must know before starting: the cancellations are permanent, and (for unpaid or partly paid leave) they change payroll. Null when nothing is cancelled.

Errors

HTTPCodeMeaningHow to fix
401token_missingNo Authorization: Bearer … header, or it is malformed.Send Authorization: Bearer qhr_… with the full token.
401token_invalidThe token is unknown or wrong, or its owner's account is locked.Check the token was copied in full, or create a new one in QHR › Settings › API & Integrations.
401token_expiredThe token is past its expiry date.Create a new token.
401token_revokedThe token was revoked by its owner or an admin, or the owner was removed from the company (which revokes all their tokens).Create a new token, or ask your admin. If the owner was removed, they must be re-invited to the company first.
401tenant_inactiveThe company account is suspended.Contact QHR support.
403forbiddenThe token owner's role lacks the permission this operation needs.Ask an admin to grant the permission shown on this operation (x-permission).
403employee_inactiveThe token owner's employee record is not active.HR must reactivate the employee record.
403tenant_access_revokedThe token's owner is no longer an active member of this company. Rare: removing a member normally revokes their tokens, which answers 401 token_revoked instead.The owner must be re-invited to the company, then create a new token. If the owner is still a member, contact QHR support.
404not_foundThe record does not exist, or you cannot see it.Check the id. List the records first to get a valid one.
This endpoint can also return the errors that can happen on any endpoint →402 / 412 / 425 entitlement_blocked · 429 rate_limited · 500 internal_error

See the full error catalogue →