Skip to main content
POST
Create a new allowance rule

Autorisierungen

X-API-KEY
string
header
erforderlich

Pfadparameter

allowance_type_id
string<uuid>
erforderlich
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$

Body

application/json
name
string
erforderlich
Minimum string length: 1
accrual_month
integer
erforderlich

0 = January, 11 = December

Erforderlicher Bereich: 0 <= x <= 11
rule_amount
number
erforderlich

Allowance amount per accrual cycle, must be greater than 0. For day-based allowance types the value is in days; for hour-based allowance types the value is in MINUTES (e.g. 480 = 8 hours). A 0-amount (manual) rule is created by assigning a member to manage manually, not through this endpoint.

Erforderlicher Bereich: x <= 100000
accrual_cycle
enum<string>
erforderlich
Verfügbare Optionen:
month,
year,
biweek
accrual_anchor_date
string | null

Bi-weekly cycle anchor (YYYY-MM-DD); null = count from each member's start date

Pattern: ^\d{4}-\d{2}-\d{2}$
cycle_on_employment_start
boolean
Standard:false

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_duration
integer | null

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

Erforderlicher Bereich: 1 <= x <= 1200
upfront_allocation
boolean
Standard:true

If true, full allowance is granted at start of cycle

proration_basis
enum<string>
Standard:month

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. Defaults to month.

Verfügbare Optionen:
month,
day,
full_month,
none
max_carry_forward
number | null

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.

Erforderlicher Bereich: 0 <= x <= 100000
carry_forward_expiry_months
integer | null

How long carried-forward allowance stays usable in the new fiscal year. null = it never expires; N (>= 1) = usable until the last day of the Nth month after the fiscal year end, then forfeited (except carry_forward_kept_after_expiry).

Erforderlicher Bereich: 1 <= x <= 1200
carry_forward_kept_after_expiry
number | null

Amount of the carried-forward allowance that survives permanently after the expiry deadline. Only allowed when carry_forward_expiry_months is set; must be lower than max_carry_forward when both are set. null/0 = nothing survives. For hour-based allowance types the value is in MINUTES.

Erforderlicher Bereich: 0 <= x <= 100000
part_time_basis
enum<string>
Standard:none

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.

Verfügbare Optionen:
none,
workdays,
hours
part_time_reference
number | null

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.

Erforderlicher Bereich: 0 < x <= 168
part_time_from
string | null

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.

Pattern: ^\d{4}-\d{2}-\d{2}$

Antwort

Successful response

id
string
erforderlich