Benbase

3. Sync Data

Receive deduction webhooks and report employment changes to keep Benbase in sync.

Sync Data

After providing census data, employees can enroll in benefits. You need to handle two things:

  1. Deduction webhooks — receive payroll deduction data as employees enroll
  2. Employment changes — report new hires, terminations, address changes, and compensation changes

Deduction Webhooks

When employees select their benefits, Benbase calculates the payroll deductions — how much the employee and employer each pay per period. You receive these as employee.deduction-updated webhooks.

Use upsert operations (update if exists, insert if not) — the same event type covers both new deductions and modifications.

Webhook payload

{
  "created_at": "2024-07-01T05:31:56Z",
  "data": {
    "id": "<deduction-id>",
    "employee_id": "<employee-id>",
    "line_of_coverage": "medical",
    "member_contribution": "150.00",
    "employer_contribution": "450.00",
    "period": "monthly",
    "taxability": "pre_tax",
    "coverage_type": "member_family",
    "description": "Blue Cross PPO",
    "effective_start": "2024-07-01T00:00:00Z",
    "effective_end": "2025-06-30T00:00:00Z"
  },
  "event_type": "employee.deduction-updated",
  "id": "<webhook-event-id>"
}

Webhook fields

FieldTypeDescription
created_atstringWhen the event was sent (ISO 8601)
event_typestringemployee.deduction-updated
idstringUnique webhook event ID

Deduction data fields

FieldTypeRequiredDescriptionPossible Values
idstringYesDeduction ID
employee_idstringYesEmployee ID
line_of_coveragestringYesBenefit typemedical, dental, vision, life, accident, accidental_death, cancer, hospital_indemnity, hsa, healthcare_fsa, dependent_care_fsa, limited_purpose_fsa, long_term_disability, short_term_disability, voluntary_critical_illness, voluntary_life, voluntary_accidental_death, voluntary_short_term_disability
member_contributionstringYesEmployee's contribution amount
employer_contributionstringYesEmployer's contribution amount
periodstringYesDeduction frequencyweekly, biweekly, semimonthly, monthly
taxabilitystringYesTax treatmentpre_tax, post_tax
coverage_typestringNoWho is coveredmember, member_spouse, member_child, member_children, member_family
descriptionstringNoPlan description
effective_startstringNoWhen deduction starts (ISO 8601)
effective_endstringNoWhen deduction ends (ISO 8601)

The employee.deduction-created event is deprecated. Use employee.deduction-updated for all deduction changes, including new deductions.


Employment Changes

Benbase needs to know when employees join, leave, move, or change compensation — these events affect benefits eligibility and rates. Report them as they happen using the endpoints below.

New Hire

POST /employee-changes/new-hire — Call when a new employee is added to an existing employer.

Required fields:

FieldTypeDescription
employer_idstringYour internal employer ID
employee_idstringYour internal employee ID
first_namestringMax 255 characters
last_namestringMax 255 characters
dobstringYYYY-MM-DD format
addressobjectSee Address fields
hire_datestringYYYY-MM-DD format
emailstringValid email, max 254 characters
hours_workedstringHours per week
pay_ratearraySee Pay Rate fields
employment_statusstringfull_time or part_time

Optional fields:

FieldTypeDescription
ssnstringSocial Security Number
phone_numberstringMax 10 characters
biological_sexstringmale or female
pay_frequencystringweekly, biweekly, semimonthly, or monthly
job_titlestringMax 255 characters

If you have a personal email address, use that one as benefits could continue after employment ends. If not, use work email instead.

curl -X POST https://embed-sandbox.benbase.com/api/employee-changes/new-hire \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "employer_id": "<employer-id>",
    "employee_id": "<employee-id>",
    "first_name": "<first-name>",
    "last_name": "<last-name>",
    "dob": "<YYYY-MM-DD>",
    "address": {
      "line1": "<address-line1>",
      "line2": "<address-line2>",
      "city": "<city>",
      "state": "<state-code>",
      "zip_code": "<zip-code>"
    },
    "hire_date": "<YYYY-MM-DD>",
    "email": "<employee-email>",
    "hours_worked": "<hours-per-week>",
    "pay_rate": [{
      "amount": "<amount>",
      "period": "annually",
      "effective_start": "<YYYY-MM-DD>"
    }],
    "employment_status": "full_time"
  }'

Termination

POST /employee-changes/termination — Call when an employee is leaving the company. Benbase handles all post-termination processes (COBRA, etc.) automatically.

FieldTypeRequiredDescription
employee_idstringYesEmployee ID
termination_datestringYesYYYY-MM-DD format
curl -X POST https://embed-sandbox.benbase.com/api/employee-changes/termination \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "employee_id": "<employee-id>",
    "termination_date": "<YYYY-MM-DD>"
  }'

Demographic Update (Address Change)

POST /employee-changes/demographic — Call when an employee moves to a different address or state. Address changes can affect benefits eligibility and rates.

FieldTypeRequiredDescription
employee_idstringYesEmployee ID
addressobjectYesSee Address fields
curl -X POST https://embed-sandbox.benbase.com/api/employee-changes/demographic \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "employee_id": "<employee-id>",
    "address": {
      "line1": "<address-line1>",
      "line2": "<address-line2>",
      "city": "<city>",
      "state": "<state-code>",
      "zip_code": "<zip-code>"
    }
  }'

Compensation Change

POST /employee-changes/compensation-change — Call when an employee's pay rate, pay frequency, or employment status changes. At least one field (besides employee_id) must be provided.

FieldTypeRequiredDescription
employee_idstringYesEmployee ID
pay_frequencystringNoweekly, biweekly, semimonthly, or monthly
pay_rateobjectNoSee Pay Rate fields
employment_statusstringNofull_time, part_time, or variable_hours
curl -X POST https://embed-sandbox.benbase.com/api/employee-changes/compensation-change \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "employee_id": "<employee-id>",
    "pay_frequency": "biweekly",
    "pay_rate": {
      "amount": "<amount>",
      "period": "annually",
      "effective_start": "<YYYY-MM-DD>"
    },
    "employment_status": "full_time"
  }'

Shared Field Definitions

Address fields

FieldTypeRequiredDescription
line1stringYesPrimary address line
line2stringNoApartment, suite, etc.
citystringYesCity name
statestringYesTwo-letter state code (e.g. NY, CA, TX)
zip_codestringYesZIP code

Pay Rate fields

FieldTypeRequiredDescription
amountstringYesPay amount, rounded to 2 decimal places (e.g. "75000.00")
periodstringYesannually or hourly
effective_startstringYesWhen the rate takes effect (YYYY-MM-DD)

Next step

Embed Employee Flow