1. Home
  2. Docs
  3. Employee Sync
  4. Read Employee Wage Data
  5. Finding the Current Wage Data

Finding the Current Wage Data

The /wages response may often return multiple wage objects. In order to determine which one(s) represent the most current wage data, you’ll have to follow some validation steps. Here’s a higher-level view of the logic:

Here are the detailed steps on determining the most current wage data:

1. Weekly Salary or Hourly Wage?

Let’s look at Example Response 1 first — notice that there are multiple wage objects in the response.

The first thing you need to check for is whether the user in question has been assigned a weekly salary or an hourly wage. The way to check this is to look for the wage object in the current array with the most recent effective_date, and looking at the wage_type field.

If wage_type is set to weekly_salary, then you can assume that this user has a weekly salary in 7shifts. This means that regardless of a user being scheduled for a shift or having a time punch in 7shifts, they will be getting paid this amount (in cents) for the current week.

Please note that running the Worked Hours & Wages report in 7shifts splits the wage_cents amount for wage_type = weekly_salary between every assigned department, and then splits it into 7 equal parts for each day.

For example, John Smith is assigned to Front of House & Back of House departments, and has a weekly salary of $1400. If you were to run the report for Front of House with just a one-day time range, the report would show the labor cost as $1400/2 depts/7 days = $100.

If wage_type is set to hourly for the most recent effective_date wage object, go on to step 2.

2. Role-Agnostic Wage or Per-Role Wages?

You can make the following request on the /companies endpoint, and look at the boolean wage_based_roles field to find out whether the account has wage-based roles enabled or not:

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

If wage_based_roles is set to false, it means that there’s just one wage for the user, regardless of what role the user is assigned to. In that case, you should look for the wage object in the /wages response with the most recent effective_date that has the role_id as null (like the first wage object in Example Response 2).

3. Get Wage for each Role

If wage_based_roles is set to true, it means there’s a different wage for each role that the user is assigned to. In that case, look for the most recent effective_date field and read the wage_cents field in each of the role_ids that the user is assigned to (like the second & third wage objects in Example Response 2).

Please note that the /wages response may contain objects for wages that are for roles that the user is no longer assigned to or for different 7shifts accounts. You do not need to worry about these, as long as the above logic is being followed.