Accrual Policies (Early Access)

Learn how to create and assign workers to set accrual policies using Zeal's respective APIs.

Intro

Accrual Policies represent policies that can be accrued by and assigned to workers. Typical Accrual Policies include PTO and sick leave. However, Zeal offers the ability for custom Accrual Policies for specific use cases to be created and assigned to workers as well. These Accrual Policies, when attached to a worker, contain an accrual balance that is automatically tracked and updated by Zeal based on the worker's shifts as well as their specific Accrual Policy specifications.

Note: Accrual Policies is an early access feature.
Please contact your Zeal team for more information on this feature

In this guide

  • Which endpoints are needed to create and assign workers to Accrual Policies.
  • A step by step explanation on utilizing these endpoints.

Accrual Policies APIs

Accrual Policies are currently only available for integration via API.

The Accrual Policy Object

The Accrual Policy object outlines the fields that represent an Accrual Policy. Accrual Policies are created and assigned at the company level and rely on three main required attributes:

attributetypedescription
companyIDstringZeal Company ID
policy_codestringCustom code that can be assigned for the policy
policy_typebooleanType of the accrual policy (accepts: pto, sick_leave, or custom)

Other attributes can be passed to further configure the accrual policy such as a policy_effective_date, accrual_rate_hours. Please review the afore-linked Accrual Policy object reference for all accepted attributes and their respective details. Below is a JSON example of an Accrual Policy object:

{
  "companyID": "123er534efrerwwe3444e",
  "policy_code": "001",
  "policy_type": "pto",
  "policy_name": "test name",
  "policy_effective_date": "2023-03-01",
  "accrual_rate_hours": 10,
  "accrual_period_hours": 40,
  "immediate_balance": 0,
  "include_doubletime": true,
  "include_overtime": true,
  "accrual_waiting_period": 0,
  "accrual_cap": 40,
  "rollover_cap": 40,
  "rollover_date": "01-01",
  "policy_status": "live"
}

Creating an Accrual Policy

To create an Accrual Policy, utilize the Create Accrual Policy or POST /accrualPolicy endpoint. The endpoint requires the following body parameters:

  • companyID: Zeal Company ID
  • policy_code: Custom code that can be assigned for the policy
  • policy_type: Type of the accrual policy (accepts: pto, sickleave, or custom).
    _Note
    : The accrual policy type has no effects on other parameters other than classification of the accrual policy. Therefore, a pto policy type does not differ from a sick_leave type other than in classification.

Other parameters:

As mentioned in the Accrual Policy object reference, the POST endpoint accepts other body parameters to further specify the Accrual Policy being created:

attributetypedescription
policy_namestringCustom name that can be assigned for the policy
policy_effective_dateYYYY-MM-DDThe effective start date of the policy
accrual_rate_hoursfloatThe rate at which employees will accrue hours
accrual_period_hoursfloatThe number of hours employees need to work to accrue accrual_rate_hours
immediate_balancefloatThe immediate hour balance the employee would receive
include_doubletimebooleanInclude if double-time work is eligible for hour accrual
include_overtimebooleanInclude if overtime work is eligible for hour accrual
accrual_waiting_periodfloatThe number of hours the employees need to work before they are eligible to begin accruing time for policy
accrual_capfloatMax hours an employee can accrue in one year until the rollover date
rollover_capfloatMax hours an employee can rollover from one year to the next year, on a specified rollover date
rollover_datefloatRequired if the user passes a value for rollover_cap or accrual_cap

Below is the JSON response of a successful POST /accrualPolicy request specifically for a PTO policy_type:

{
  "success": true,
  "data": {
    "companyID": "123er534efrerwwe3444e",
    "policy_type": "pto",
    "policy_name": "test name",
    "policy_code": "001",
    "policy_effective_date": "2023-03-20",
    "accrual_rate_hours": 0.5,
    "accrual_period_hours": 10,
    "immediate_balance": 10,
    "include_doubletime": false,
    "include_overtime": false,
    "accrual_waiting_period": 28,
    "accrual_cap": 50,
    "rollover_cap": 20,
    "rollover_date": "05-01",
    "policy_status": "live"
  }
}

Updating or Fetching Accrual Policies

The accrual policy can be subsequently updated or fetched using the corresponding Update Accrual Policy or PATCH /accrualPolicy endpoint to update or the Get Accrual Policy GET /accrualPolicy endpoint to fetch a specific Accrual Policy by passing a companyID and an option policy_code or policy_status.

Adding/Removing Workers to/from Accrual Policies

In order to assign workers to an Accrual Policy, utilize the Add/Remove Employees to Accrual Policy or POST /accrualPolicyEmployees endpoint. To assign or remove workers to or from an Accrual Policy, the companyID and specific Accrual Policy policy_code need to be passed as required parameters. To add employee(s), the add_employees array of strings would be passed containing the specific employeeID(s) of the worker(s) to be added to the policy. Below is a JSON body example of a POST /accrualPolicyEmployees request adding workers to an Accrual Policy:

{
  "companyID": "cc3344747eee494857rrc9458nb3948",
  "policy_code": "001",
  "add_employees": [
    "3343eericree4394785ec3334cc",
    "322324eceree4394785ec3334cc"
  ]
}

After a successful request assigning worker(s) to an Accrual Policy, the worker(s) are now associated with the corresponding Accrual Policy object and its respective specifications.

Accrual Policy Balances

When creating an Accrual Policy, a balance such as a worker's starting PTO balance can initially be declared by the immediate_balance parameter. However, this balance can be updated or fetched at any time after Accrual Policy using creation by utilizing the respective Update Accrual Balance (PATCH /accrualBalance) or Get Accrual Balance(GET /accrualBalance) endpoints. Additionally, Zeal automatically tracks and updates balances based on attached workers' shifts and payroll. Below is a JSON body example of a PATCH /accrualBalance request:

{
  "companyID": "cc3344747eee494857rrc9458nb3948",
  "policy_code": "001",
  "employees": [
    {
      "employeeID": "3343eericree4394785ec3334cc",
      "accrual_balance": 40
    },
    {
      "employeeID": "322324eceree4394785ec3334cc",
      "accrual_balance": 35
    }
  ]
}

Recap

  • Accrual Policies are created via the API for specific use-cases (the most common being PTO and sick leave)
  • Workers can be assigned to or removed from specific Accrual Policies
  • Accrual Policy balances are automatically tracked and updated by Zeal yet can be updated as needed even via API after Accrual Policy creation