Benbase

Check

Handle the Check OAuth flow when the employer clicks "Import from Payroll".

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.

The flow

StepWhat HappensWho
1Your frontend passes organizationId to your backendYou
2Your backend calls Check API for a consent URLYou
3You redirect employer to Check consent screenYou
4Employer approvesEmployer
5Check sends OAuth callback directly to BenbaseCheck → Benbase
6Benbase syncs census and generates quotesBenbase
7Check redirects employer back to your redirect_urlCheck → 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 https://sandbox.checkhq.com/companies/{company_id}/components/integrations/authorize

Request body:

FieldValueDescription
integration_partnerint_DjupWSJkIYfQ2xfIB3sLBenbase integration ID
integration_permissionipe_keLxIxEPasWS9Za6UKCuBenbase 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/<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.

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.

Steps 4–7: Automatic sync

After the employer approves:

  1. Check sends the OAuth callback directly to Benbase
  2. Benbase syncs census data and re-generates quotes with real payroll data
  3. 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.

Next step

Embed Employee Flow