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
| 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 https://sandbox.checkhq.com/companies/{company_id}/components/integrations/authorize
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/<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.
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.
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.