> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Accrual Policy

> Create a new PTO, sick leave, or custom accrual policy for a company.



## OpenAPI

````yaml openapi/zeal-api.json post /accrualPolicy
openapi: 3.1.0
info:
  title: zeal-api
  version: '1.0'
servers:
  - url: https://api.zeal.com
security:
  - sec0: []
paths:
  /accrualPolicy:
    post:
      summary: Create Accrual Policy
      operationId: create-accrual-policy
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - companyID
                - policy_code
                - policy_type
                - accrual_rate_hours
                - accrual_period_hours
                - include_doubletime
                - include_overtime
              properties:
                companyID:
                  type: string
                  description: ID of the company
                policy_code:
                  type: string
                  description: Unique code to assign to this policy
                policy_type:
                  type: string
                  description: >-
                    Type of the accrual policy (accepts: pto, sick_leave, or
                    custom)
                policy_name:
                  type: string
                  description: Custom name that can be assigned for the policy
                policy_effective_date:
                  type: string
                  description: The effective start date of the policy
                  format: date
                accrual_rate_hours:
                  type: number
                  description: The rate at which employees will accrue hours
                  format: float
                accrual_period_hours:
                  type: number
                  description: >-
                    The number of hours employees need to work to accrue
                    accrual_rate_hours
                  format: float
                immediate_balance:
                  type: number
                  description: The initial or immediate hour balance of policy
                  format: float
                include_doubletime:
                  type: boolean
                  description: Include if doubletime work is eligible for hour accrual
                include_overtime:
                  type: boolean
                  description: Include if overtime work is eligible for hour accrual
                accrual_waiting_period:
                  type: number
                  description: >-
                    The number of hours the employees need to work before they
                    are eligible to begin accruing time for policy
                  format: float
                accrual_cap:
                  type: number
                  description: >-
                    The maximum number of hours an employee can accrue within a
                    policy year. Once this limit is reached, no additional hours
                    will accrue until the next accrual period or
                    `rollover_date`.
                  format: float
                rollover_cap:
                  type: number
                  description: >-
                    The maximum number of unused hours an employee is allowed to
                    carry over from one policy year to the next on the specified
                    rollover date.
                  format: float
                rollover_date:
                  type: string
                  description: >-
                    Required if user passes a value for `rollover_cap` or
                    `accrual_cap`
                  format: date
                balance_cap:
                  type: number
                  description: >-
                    The maximum balance an employee is allowed to hold under
                    this policy
                  format: float
            examples:
              Request Example:
                value:
                  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
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    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
                      balance_cap: 50
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                    default: true
                  data:
                    type: object
                    properties:
                      companyID:
                        type: string
                        example: 123er534efrerwwe3444e
                      policy_type:
                        type: string
                        example: pto
                      policy_name:
                        type: string
                        example: test name
                      policy_code:
                        type: string
                        example: '001'
                      policy_effective_date:
                        type: string
                        example: '2023-03-20'
                      accrual_rate_hours:
                        type: number
                        example: 0.5
                        default: 0
                      accrual_period_hours:
                        type: integer
                        example: 10
                        default: 0
                      immediate_balance:
                        type: integer
                        example: 10
                        default: 0
                      include_doubletime:
                        type: boolean
                        example: false
                        default: true
                      include_overtime:
                        type: boolean
                        example: false
                        default: true
                      accrual_waiting_period:
                        type: integer
                        example: 28
                        default: 0
                      accrual_cap:
                        type: integer
                        example: 50
                        default: 0
                      rollover_cap:
                        type: integer
                        example: 20
                        default: 0
                      rollover_date:
                        type: string
                        example: 05-01
                      policy_status:
                        type: string
                        example: live
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value:
                    success: false
                    error: true
                    message: No company with this companyID exists.
                    timestamp: '2023-03-21T19:13:18Z'
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                    default: true
                  error:
                    type: boolean
                    example: true
                    default: true
                  message:
                    type: string
                    example: No company with this companyID exists.
                  timestamp:
                    type: string
                    example: '2023-03-21T19:13:18Z'
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer

````