Check
Handle the Check OAuth flow when the employer clicks Import from Payroll, and set the employee metadata that Benbase reads.
Connect Payroll — Check
After the employer clicks "Import from Payroll" and your frontend receives the authorize-start event (see Connect Payroll), you handle the Check OAuth flow so Benbase can sync census data directly from Check.
Use Check IDs throughout. Because this is a Check integration, the Check company ID (com_XXXXX) is the same value you pass to Benbase as employer_id when embedding the Employer Flow, and the Check employee IDs (emp_XXXXX) are what you pass as employee_id for the Employee Flow.
The flow
| Step | What Happens | Who |
|---|---|---|
| 1 | Your frontend passes organizationId to your backend | You |
| 2 | Your backend calls Check API for a consent URL | You |
| 3 | You redirect employer to Check consent screen | You |
| 4 | Employer approves | Employer |
| 5 | Check sends OAuth callback directly to Benbase | Check → Benbase |
| 6 | Benbase syncs census and generates quotes | Benbase |
| 7 | Check redirects employer back to your redirect_url | Check → You |
You do not handle the OAuth callback. Benbase receives it directly from Check.
Step 1: Call your backend
Pass the organizationId from the authorize-start event to your backend to keep your Check API key server-side:
async function initiatePayrollAuthorization(companyId) {
const { url } = await fetch('/api/check/authorize', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ companyId }),
}).then(r => r.json());
// Step 3: redirect the employer to Check consent
window.location.href = url;
}Step 2: Your backend calls Check API
Your backend calls Check's authorization component endpoint to get a consent screen URL.
Endpoint: POST /companies/{company_id}/components/integrations/authorize on the Check host: https://sandbox.checkhq.com in the sandbox, and https://api.checkhq.com in production.
Request body:
| Field | Value | Description |
|---|---|---|
integration_partner | int_DjupWSJkIYfQ2xfIB3sL | Benbase integration ID |
integration_permission | ipe_keLxIxEPasWS9Za6UKCu | Benbase permission ID |
email | <employer-email> | Contact email for the employer |
redirect_url | <your-redirect-url> | Where to send the employer after approval |
curl -X POST https://sandbox.checkhq.com/companies/<check_company_id>/components/integrations/authorize \
-H "Authorization: Bearer <your-check-api-key>" \
-H "Content-Type: application/json" \
-d '{
"integration_partner": "int_DjupWSJkIYfQ2xfIB3sL",
"integration_permission": "ipe_keLxIxEPasWS9Za6UKCu",
"email": "<employer-email>",
"redirect_url": "<your-redirect-url>"
}'curl -X POST https://api.checkhq.com/companies/<check_company_id>/components/integrations/authorize \
-H "Authorization: Bearer <your-check-api-key>" \
-H "Content-Type: application/json" \
-d '{
"integration_partner": "int_DjupWSJkIYfQ2xfIB3sL",
"integration_permission": "ipe_keLxIxEPasWS9Za6UKCu",
"email": "<employer-email>",
"redirect_url": "<your-redirect-url>"
}'Response:
{
"url": "https://component.checkhq.com/..."
}For production, replace https://sandbox.checkhq.com with https://api.checkhq.com.
Troubleshooting: un-connected integration
Check hasn't enabled the Benbase integration for your account yet. If this call fails with an error like:
{
"error": "Cannot generate component for un-connected integration 13"
}Fix: contact Benbase. We'll ask Check to enable the integration for your partner account. Once Check confirms, retry this call and the OAuth flow will work as documented below.
Step 3: Redirect to Check consent
Your frontend redirects the employer to the URL returned by Check. The employer sees a consent screen showing what payroll data they're sharing with Benbase.
Does not work on localhost. Check's authorization component only renders and redirects correctly when it is requested from a connected, publicly-reachable domain. Testing the authorize step from http://localhost will fail — deploy to a connected domain (e.g. a staging host) to exercise the full OAuth flow.
Steps 4–7: Automatic sync
After the employer approves:
- Check sends the OAuth callback directly to Benbase
- Benbase syncs census data and re-generates quotes with real payroll data
- Check redirects the employer back to your
redirect_url— this is the URL you specified when calling the Check API in step 2
The next time the employer loads the employer iframe, they'll see real data. From here, census sync, quoting, and deduction syncing all happen automatically through Check.
Tell Benbase which employees can get benefits
Benbase decides benefits eligibility from the employment status and the scheduled weekly hours of each employee. Check has no field for them. So you must add them to your product, and write them to Check.
Update your product so that the HR admins of your employers can set both values:
- When they add a new hire.
- For each existing employee, and each time that the status or the schedule of the employee changes. For example, an intern becomes a full-time hire, or a part-time employee goes full time.
Write both keys on each employee's metadata field. The metadata of a Check employee is a set of key-value pairs, and each value is a string. The census sync reads the two keys below.
| Key | Values | Default for a new hire with no key |
|---|---|---|
employment_status | "full_time", "part_time" or "temporary" | "full_time" |
scheduled_hours_per_week | A number in a string, for example "40" or "37.5" | "40" for full time and temporary, and "20" for part time |
If you do not set these keys for a new hire, Benbase treats the employee as full-time at 40 hours a week, and they will most likely be offered benefits.
scheduled_hours_per_weekis the average hours a week that the employee is scheduled to work. Benbase accepts only a number in a string, for example"37.5".- Use the values exactly as the table shows them. Benbase reads a value that it does not know, such as
"intern"or"20 hrs", as a missing key. - Use
"temporary"for an intern or another short-term hire who is not benefits-eligible. - A contractor needs no keys. Check keeps contractors in a different object.
Keep the keys current
When the status or the schedule of an employee changes, update both keys in one request. Write the new value of each key.
Benbase uses the defaults only when it adds a new hire. For an employee that Benbase already has, a missing key changes nothing. Benbase keeps the status and the hours that it has. So do not remove a key to change a value.
Check adds each key that you send to the metadata of the employee, or changes its value when the key is there. All other keys stay. Do not send an empty metadata object ({}). Check then removes all the keys of the employee.
Example
This request sets an employee to part time at 20 hours a week. Use the Check employee ID (emp_XXXXX).
Endpoint: PATCH /employees/{employee_id} on the same Check host as in step 2.
curl -X PATCH https://sandbox.checkhq.com/employees/<check_employee_id> \
-H "Authorization: Bearer <your-check-api-key>" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"employment_status": "part_time",
"scheduled_hours_per_week": "20"
}
}'curl -X PATCH https://api.checkhq.com/employees/<check_employee_id> \
-H "Authorization: Bearer <your-check-api-key>" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"employment_status": "part_time",
"scheduled_hours_per_week": "20"
}
}'Tell Benbase which earning rate is the base pay rate
Benbase sends one pay rate for each employee to the benefits administrator. Some benefits, such as life and disability insurance, calculate from it. An employee can have more than one active earning rate in Check, for example an overtime rate. Check sets the period of a rate (hourly, annually or piece), but no field that tells what the rate pays. So write that in the metadata of each earning rate.
| Key | Value | What Benbase does |
|---|---|---|
primary | "true" | Sends this rate as the pay rate. Mark one active rate for each employee. |
type | "overtime" or "double_overtime" | Never sends this rate as the pay rate. |
If an employee has more than one active hourly rate and no rate holds primary: "true", Benbase sends no earning rate. It then uses the employee's most recent pay stub, or sends no pay rate. An annual rate is never overtime, so Benbase takes an annual rate when there is one.
- Use fixed values. Benbase matches each value exactly, with no regard to case. It does not read words in a value or a name.
- Mark exactly one active rate for each employee. With two rates that hold
primary: "true", Benbase takes the annual rate, then the highest amount. - Each metadata value is a string. Write
"true", nottrue. - Already tell your rates apart another way? For example with your own key, or with fixed rate names such as
"Regular"and"Overtime", tell your Benbase contact. Benbase can map each of your exact values or names instead. Do not put a person's name in a rate name.
Example
This request creates an hourly base rate. Use the Check employee ID (<check_employee_id>).
Endpoint: POST /earning_rates on the same Check host as in step 2.
curl -X POST https://sandbox.checkhq.com/earning_rates \
-H "Authorization: Bearer <your-check-api-key>" \
-H "Content-Type: application/json" \
-d '{
"employee": "<check_employee_id>",
"amount": "25.00",
"period": "hourly",
"name": "Regular",
"metadata": { "primary": "true" }
}'curl -X POST https://api.checkhq.com/earning_rates \
-H "Authorization: Bearer <your-check-api-key>" \
-H "Content-Type: application/json" \
-d '{
"employee": "<check_employee_id>",
"amount": "25.00",
"period": "hourly",
"name": "Regular",
"metadata": { "primary": "true" }
}'An overtime rate for the same employee holds "metadata": { "type": "overtime", "primary": "false" }.