Allowance Management

Update an allowance rule

Changed on

Updates an existing allowance rule. Only provide the fields you want to change. Changes are applied to all members subscribed to this rule.

patch/rules/{id}

Request

  • Base URL
    https://api.absentify.com/api/v1
  • URL
    https://api.absentify.com/api/v1/rules/{id}
  • Auth
    API key in header X-API-KEY

Path parameters

idstring uuid required

Request body

namestring
accrual_monthinteger
rule_amountnumber

Allowance amount per accrual cycle, must be greater than 0. For hour-based allowance types the value is in MINUTES (e.g. 480 = 8 hours). Omit to leave a stored 0-amount (manual) rule unchanged.

accrual_cycle'month' | 'year' | 'biweek'
accrual_anchor_datestring nullable
cycle_on_employment_startboolean

Starts each allowance year on the member's employment start date instead of accrual_month. Yearly rules only: a monthly or bi-weekly rule with true is rejected, so a PATCH that moves a rule with true away from accrual_cycle year must also send false.

rule_durationinteger nullable

Per-accrual rolling expiry in months (each accrual valid this many months from its accrual date). Min 1; null = off. Cannot be combined with any carry-forward setting, and is not allowed on a 0-amount (manual) rule.

upfront_allocationboolean
proration_basis'month' | 'day' | 'full_month' | 'none'

How partial yearly rules are prorated. month = whole months count fully, the partial start or end month is prorated by day; day = calendar-day exact; full_month = only whole months count 1/12 each, a started month counts nothing; none = a rule year in which employment starts or ends grants the full yearly amount; every other partial year, such as a switch to another rule or an assignment that starts or ends during the year while employed, counts its months. Ignored for monthly and biweekly cycles.

max_carry_forwardnumber nullable

Hard cap on the amount carried into the next fiscal year, applied at the year boundary. null = unlimited (everything carries), 0 = nothing carries. For hour-based allowance types the value is in MINUTES.

carry_forward_expiry_monthsinteger nullable

How long carried-forward allowance stays usable in the new fiscal year. null = it never expires; N (>= 1) = months after fiscal year end.

carry_forward_kept_after_expirynumber nullable

Amount surviving permanently after the expiry deadline. Requires carry_forward_expiry_months; must be lower than max_carry_forward when both are set.

carry_negative_balanceboolean

false stops carrying a negative balance into the next year, from the next year change on; earlier year changes stay as they are. true carries it again. Omit to leave the setting unchanged. Not allowed together with rule_duration, and a rule that was switched back to true cannot be switched off again: create a new rule instead.

part_time_basis'none' | 'workdays' | 'hours'

Scales every grant of this rule to the member's own working week. none = off; workdays = by the days worked per week; hours = by the hours worked per week. A member with no schedule of their own counts as full time.

part_time_referencenumber nullable

Days (workdays) or hours (hours) per week that count as full time. Required and greater than 0 when part_time_basis is not none; stored as null when it is none.

part_time_fromstring nullable

First day (inclusive, YYYY-MM-DD) the scaling applies to. A grant for a year, month or two weeks that started earlier is not scaled. A new date must not be before the first day of the current fiscal year. Without a date (null included), a new or newly scaling rule starts on that day and a rule that already scales keeps its stored date. Stored as null when part_time_basis is none.

reasonstring

Why this rule is being changed — stored in the rule audit log.

Response

Successful response

countnumber required

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property