How to Embed Payroll in Your Product

Short answer: To embed payroll in your product, choose an integration path, get API access, create a company for your customer, and then build payroll on your chosen path. Test everything in the sandbox first. This page walks through those steps for Worklio Embedded Payroll (WEP).

For what embedded payroll is and how the three integration paths compare, see What is embedded payroll.

Step 1: Choose your integration path

WEP offers three paths: the API, a component library, and iFrames. Pick one before you build. What is embedded payroll compares them and says when to choose each.

Step 2: Register and test in the sandbox

Register a developer account, then sign in to the sandbox dashboard. The dashboard lists the companies attached to your developer account. It is empty until you create one in step 4.

Step 3: Get API access

Every path starts here. Every request to the WEP API needs a bearer access token. Request one with:

POST https://api.worklio.com/connect/token

The token is valid for 24 hours, so request a new one each day. See How to get API access for the parameters and code examples.

Step 4: Create a company

A company represents one of your customers. Create it with:

POST https://api.worklio.com/wep/companies

The request needs the company's name, EIN, company type, and address. The response returns the company id, which you use in every later call. See Create a company.

Step 5: Build payroll on your chosen path

If you chose the API

Use the company id as CLIENT_ID in these calls.

  1. Add employees. Create employees under the company. See Create an employee.

  2. Run payroll. Run payroll with three calls: start the run, advance it, and finalize it.

    POST https://api.worklio.com/wep/companies/{CLIENT_ID}/payroll
    POST https://api.worklio.com/wep/companies/{CLIENT_ID}/payroll/{runId}/next
    POST https://api.worklio.com/wep/companies/{CLIENT_ID}/payroll/{runId}/finalize

    Finalizing returns 204 with no body. See run payroll.

  3. Stay in sync with webhooks. Register a webhook and Worklio calls your URL when a matching event occurs, for example when an employee is created. You don't need to poll the API. You can register a webhook for one company or for every company your access token can reach. Each delivery is signed, so you can verify it came from Worklio. See webhooks​.

If you chose the component library

The library supports Vue and React. Access is by request: contact our support team to request it. You assemble your UI from Worklio's components and connect your data through the API, so the API steps above still apply for your data.

If you chose iFrames

You embed Worklio's application in your product instead of building the payroll screens. See iFrames. To embed Worklio admin screens for System Admin and Client Admin users, see Admin Portal iFrames.

Step 6: Book a demo

When you've tested the flow, book a demo to talk through your product and which integration path fits.


Did this page help you?