1. Home
  2. Docs
  3. Employee Sync
  4. Create Employee Data
  5. Creating Employees with Wage Data

Creating Employees with Wage Data

If the scope of your integration includes syncing wage data into 7shifts, the POST request described earlier can be extended to include wage data as well, so that the created employee will have wage data in 7shifts.

This is what an example POST request will look like for creating an employee with two assigned roles and the respective wage data:

Request URL

POST https://api.7shifts.com/v1/users

Request body

{
    "user": {
        "firstname": "Bertram",
	"lastname": "Gilfoyle",
	"email": "bertram.gilfoyle@piedpiper.com",
        "mobile_phone": 3065558888,
        "active": true,
        "user_type_id": 1
    },
    "role": [
        {
            "id": 135790
        },
        {
            "id": 864280
        }
    ],
    "department": [
        {
            "id": 98765
        }
    ],
    "location": [
        {
            "id": 12345
    	}
    ],
    "wages": [
	{
	     "role_id": 135790,
	     "wage_cents": 2300,
	     "effective_date": "2020-12-01",
	     "wage_type": "hourly",
	     "is_deleted": false
	},
	{
	     "role_id": 864280,
	     "wage_cents": 1700,
	     "effective_date": "2020-12-01",
	     "wage_type": "hourly",
	     "is_deleted": false
	}
    ]
}

Here’s a quick description of what each of the fields in the wages object array represents:

FieldTypeExplanation
role_idNumericID of the role that this wage is associated to
wage_centsNumericIn cents, the amount representing the wage
effective_dateDateThe date on which this wage goes into effect
wage_typeStringSet to weekly_salary for salaried users and hourly for hourly wage users
is_deletedFixedMandatory field that needs to be supplied in the body, always leave it set to false

A couple of things to note here:

  • If an employee is assigned a weekly salary instead of an hourly wage, set wage_type to weekly_salary. In this case, wage_cents must specify the total amount in cents that the user will be making in one week.
  • If your system doesn’t support effective future wage dates, you can always simply specify effective_date to be “today”/the date that the user is being created.

Role-Agnostic Wage

Does your system not support different wages for each role, i.e., do you only support one wage per user? If so, you can just specify one role-agnostic wage object in the body, and set the role_id to null.

Try to avoid this role-agnostic wages implementation to not limit certain functionality in 7shifts. If possible, please opt for the following ‘Per-Role Wage’ implementation.

Per-Role Wage

Does your system support per-role wages, i.e., a separate wage for each role? 7shifts does support this, and you can check whether the user has enabled this in their 7shifts account by making the following request and checking if the wage_based_roles is set to true:

GET https://api.7shifts.com/v1/companies

If wage_based_roles is returned as false, you can ask the administrator user to turn it on in 7shifts first. A 7shifts administrator can find this setting under Company Settings > Labor & Compliance > Wages & Pay > Wage-based Roles.

If wage_based_roles is returned as true and as long as the user about to be created is on hourly wages, you must specify a wage object in the body for each respective role specified in the role object array. Even if a wage doesn’t exist for one of the roles in your system, you must specify the object in the array, and set wage_cents to 0 for that role’s respective wage object in the request body.