1. Embed Employer Flow
Embed the Employer Flow iframe in your platform.
Embed Employer Flow
The Employer Flow is shown to the employer (your customer). It covers quoting, plan selection, and enrollment management.
Each time an employer needs to access their benefits dashboard, you generate a single-use iframe URL by calling the Benbase API. The URL contains a one-time token — generate a new one for each session.
curl -X POST https://embed-sandbox.benbase.com/api/flows/employer \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"employer_id": "<employer-id>",
"employer_name": "<employer-name>",
"employer_fein": "<employer-fein>"
}'Embed the returned URL in your app.
Required: Flow iframes emit benbase-embed.height-updated events via postMessage whenever their content height changes. Your parent page must listen for this event and resize the iframe accordingly — otherwise the iframe will scroll internally. All examples below include this listener.
<iframe id="benbase-employer" src="{{url}}" style="width:100%;border:none"></iframe>
<script>
window.addEventListener('message', function(event) {
var eventName = event.data.event;
var data = event.data.data;
if (eventName === 'benbase-embed.height-updated') {
document.getElementById('benbase-employer').style.height = data.height + 'px';
}
});
</script>Once rendered, Benbase uses the census data you provide to generate quotes for the employer. No action needed from you during this phase.