Skip to main content
A deduction is a standing instruction: withhold this much from this employee, and have the employer contribute this much, on every payday until told otherwise. Hammock creates one when an employee elects a benefit that runs through payroll, and updates it when the amounts change. You mirror it in your payroll engine.

Two ways to stay current

React to events. Subscribe to deduction.created, deduction.updated and deduction.ended, retrieve the deduction each time, and write it to your payroll engine. Read before each payroll. Ask for the deductions that apply to one payday. Hammock resolves upcoming_change and end dates for you, and leaves out anything that doesn’t apply that day.
We recommend both: events keep your product current between payrolls, and the read on the lock date is the final word on what to withhold. For a variable deduction the lock-date read is required.

When a change takes effect

A change takes effect on the payday of the first pay period that hasn’t locked. Until then it sits in upcoming_change. On the upcoming change’s effective_date, its amounts become the current ones and upcoming_change returns to null. A deduction has at most one upcoming change: a second change before it takes effect replaces it.

Variable deductions

Some employees set their HSA to reach the annual limit. Hammock then works out each paycheck’s amount from the limit, what has already gone in this year, and the paydays left. These deductions have "variable": true. Hammock publishes the amount for a payday before that pay period’s lock date, as an upcoming_change with a deduction.updated event. Read deductions with pay_date on the lock date and you always have the right figure. The last paycheck of the year is often smaller than the rest.

Employer contributions

employer_amount covers employer money that goes in with each paycheck: a fixed amount per pay period, or a match on what the employee contributes. Record it in payroll so year-end reporting is right. Some employers contribute once a year instead. Those never run through payroll and appear as employer contributions for you to record.

ICHRA premium deductions

When an employee picks a health plan that costs more than their ICHRA allowance, Hammock pays the full premium and the employee’s share comes out of their paycheck. That share is a deduction with "category": "premium" and no employer amount. These deductions exist only for employees who enroll in a plan through Hammock. Employees who bring their own plan have none. The money withheld stays with the employer: it repays what Hammock already pulled from the employer for the premium, so it never changes a pull.
Premium deductions are still in development and will arrive after the first release.

One-time employer contributions

An employer contribution made outside payroll, such as an annual HSA contribution funded at the start of the plan year, is an employer_contribution object. It never appears on a paycheck. Record it against the employee so their W-2 includes it.
You receive employer_contribution.posted when the money reaches the employee’s account, and employer_contribution.reversed if it’s later taken back.

When a deduction ends

A deduction ends when the employee is terminated, waives the benefit, or the plan year ends. It gets an end_date, and you receive deduction.ended. A new plan year brings a new election and a new deduction with its own ID.