Create employee
employers.employees.create(employer_id, **kwargs) -> Employee { id, active, created_at, 7 more }
/v1/employers/{employer_id}/employees
Creates a new employee for a specific employer. Requires personal information (name, DOB, SSN) and employment details (start date). Note: SSN can only be specified at creation time and cannot be updated later. Returns the created employee with assigned ID.
Parameters
employer_id: String
date_of_birth: Date
Date of birth (YYYY-MM-DD)
formatdate
email: String
Email address
formatemail
first_name: String
Employee's legal first name
maxLength100
minLength1
last_name: String
Employee's legal last name
maxLength100
minLength1
ssn: String
Social Security Number (XXX-XX-XXXX or XXXXXXXXX). Only accepted on create.
maxLength11
minLength9
start_date: Date
Employment start/hire date
formatdate
gender: String
Gender identity
phone: String
Phone number
suffix: String
Name suffix (Jr., Sr., III)
maxLength10
Returns
Create employee
require "vitable_connect_api"
vitable_connect_api = VitableConnectAPI::Client.new(
api_key: "My API Key",
environment: "environment_1" # defaults to "production"
)
employee = vitable_connect_api.employers.employees.create(
"empr_abc123def456",
date_of_birth: "2019-12-27",
email: "dev@stainless.com",
first_name: "x",
last_name: "x",
sex: :Male,
ssn: "xxxxxxxxx",
start_date: "2019-12-27"
)
puts(employee)
{
"id": "id",
"active": true,
"created_at": "2019-12-27T18:11:19.117Z",
"employer_id": "employer_id",
"member": {
"id": "id",
"date_of_birth": "2019-12-27",
"first_name": "first_name",
"last_name": "last_name",
"sex": "Male",
"email": "dev@stainless.com",
"gender": "gender",
"phone": "phone",
"suffix": "suffix"
},
"start_date": "2019-12-27",
"updated_at": "2019-12-27T18:11:19.117Z",
"address": {
"city": "city",
"state": "state",
"street_1": "street_1",
"zip_code": "zip_code",
"country": "country",
"street_2": "street_2"
},
"employee_class": "Full Time",
"termination_date": "2019-12-27"
}
Returns Examples
{
"id": "id",
"active": true,
"created_at": "2019-12-27T18:11:19.117Z",
"employer_id": "employer_id",
"member": {
"id": "id",
"date_of_birth": "2019-12-27",
"first_name": "first_name",
"last_name": "last_name",
"sex": "Male",
"email": "dev@stainless.com",
"gender": "gender",
"phone": "phone",
"suffix": "suffix"
},
"start_date": "2019-12-27",
"updated_at": "2019-12-27T18:11:19.117Z",
"address": {
"city": "city",
"state": "state",
"street_1": "street_1",
"zip_code": "zip_code",
"country": "country",
"street_2": "street_2"
},
"employee_class": "Full Time",
"termination_date": "2019-12-27"
}