Payroll Deductions
Vitable generates payroll deduction statements on a monthly schedule. On the 1st of each month, a scheduled process calculates deductions for all employers with active enrollments and fires employee.deduction_created webhook events. This page explains how to listen for that event, retrieve the deduction details from the employee resource, and apply them in your payroll system.
Quick Reference
Deduction Flow Overview
Flow summary:
- On the 1st of each month, Vitable runs a scheduled process that generates payroll deduction statements for all employers with active enrollments.
- For each employee with active coverage, Vitable calculates deduction amounts based on their enrolled benefits.
- Vitable delivers an
employee.deduction_createdwebhook per employee to your endpoint. - You use the
resource_idfrom the webhook payload to fetch the employee and read thedeductionsarray. - You apply those deductions to your payroll system for the new period.
Receiving Deduction Events
When Vitable delivers an employee.deduction_created event, the webhook payload follows the standard format:
The resource_id is the employee ID (prefixed with empl_), and the resource_type is employee.
The employee.deduction_created event does not fire immediately after enrollment confirmation. Deductions are generated by a monthly scheduled process that runs on the 1st of each month. The event fires once per employee per statement period for all employees with active enrollments.
Fetching Employee Deductions
Deductions are not a standalone API resource — they are a nested property on the employee resource. After receiving the webhook, fetch the employee using GET /v1/employees/{id} with the resource_id from the payload:
The employee response includes a deductions array with the current period’s payroll deduction details:
The deductions array reflects a snapshot of the current statement period. When a new deduction statement is generated, the previous period’s deductions are replaced. Always fetch fresh data after receiving the webhook rather than relying on cached values.
Handling Deductions in Your System
A typical integration flow looks like this:
- Receive the
employee.deduction_createdwebhook and respond with a2xxstatus code immediately. - Fetch the employee using the
resource_idto get the currentdeductionsarray. - Match the employee in your payroll system using the employee
idorreference_id. - Record each entry in the
deductionsarray as a payroll deduction, noting thetax_classificationandfrequency. - Apply the deductions for the period defined by
period_start_dateandperiod_end_date.
Always fetch the employee data after receiving the webhook rather than caching amounts from earlier API calls. Deduction amounts may change when a new statement period is generated.
Troubleshooting
Missed webhook events — If your endpoint was down when the event fired, Vitable retries delivery with exponential backoff for up to ~3.4 days. You can also query missed events using GET /v1/webhook-events to recover. See Reliability for full retry details.
Duplicate events — Your endpoint may receive the same employee.deduction_created event more than once. Use the event_id field to deduplicate and ensure you do not apply the same deduction twice.
Empty deductions array — In rare cases, the deductions may not be immediately available when you fetch the employee. If the deductions array is empty, implement a short retry with backoff before fetching again.
Use GET /v1/webhook-events/{event_id}/deliveries to check the delivery status of a specific event if you suspect your endpoint missed it.
Related Webhooks
For the full list of webhook events, see Webhook Events.
Related API Endpoints
GET /v1/employees/{id}— Retrieve employee details including thedeductionsarrayGET /v1/employees/{id}/enrollments— List all enrollments for an employeeGET /v1/webhook-events— Query webhook events to recover missed deliveriesGET /v1/webhook-events/{event_id}— Retrieve a specific webhook eventGET /v1/webhook-events/{event_id}/deliveries— Check delivery status for a webhook event

