Payroll Deductions
How to receive employee deduction events and fetch deduction data for payroll integration.
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
Section titled “Quick Reference”| Event | What It Means | Your Action | Endpoint |
|---|---|---|---|
employee.deduction_created | Deductions were generated during the monthly statement cycle | Fetch the employee to get deduction details | GET /v1/employees/{id} |
Deduction Flow Overview
Section titled “Deduction Flow Overview”sequenceDiagram
participant V as Vitable API
participant P as Partner
Note over V: 1st of each month — scheduled deduction generation
Note over V: Deductions calculated for all active enrollments
V--)P: webhook: employee.deduction_created (per employee)
P->>V: GET /v1/employees/{id}
V-->>P: 200 Employee with deductions
Note over P: Apply deductions to payroll
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
Section titled “Receiving Deduction Events”When Vitable delivers an employee.deduction_created event, the webhook payload follows the standard format:
{ "event_id": "wevt_550e8400-e29b-41d4-a716-446655440000", "organization_id": "org_xyz789", "event_name": "employee.deduction_created", "resource_type": "employee", "resource_id": "empl_7c9e6679-7425-40de-944b-e07fc1f90ae7", "created_at": "2026-01-23T14:30:00+00:00"}The resource_id is the employee ID (prefixed with empl_), and the resource_type is employee.
Fetching Employee Deductions
Section titled “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:
curl -X GET https://api.vitablehealth.com/v1/employees/empl_7c9e6679-7425-40de-944b-e07fc1f90ae7 \ -H "Authorization: Bearer $VITABLE_API_KEY" \ -H "Content-Type: application/json"The employee response includes a deductions array with the current period’s payroll deduction details:
| Field | Description |
|---|---|
deduction_amount_in_cents | The amount to deduct from the employee’s paycheck, in cents |
tax_classification | Tax treatment: Pre-tax, Post-tax, or Unknown |
frequency | Deduction frequency (e.g., monthly) |
benefit_name | The name of the benefit plan this deduction is for |
deduction_category | Deduction category (reserved for future use) |
period_start_date | Start date of the deduction period (YYYY-MM-DD) |
period_end_date | End date of the deduction period (YYYY-MM-DD) |
Handling Deductions in Your System
Section titled “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.
Troubleshooting
Section titled “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.
Related Webhooks
Section titled “Related Webhooks”| Event | Description |
|---|---|
employee.deduction_created | Payroll deductions have been generated for an employee. |
enrollment.accepted | An enrollment has been accepted and is now active. Learn more |
enrollment.granted | An enrollment has been granted. Learn more |
enrollment.terminated | An enrollment has been terminated and coverage has ended. Learn more |
For the full list of webhook events, see Webhook Events.
Related API Endpoints
Section titled “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