1. Home
  2. Docs
  3. Employee Sync
  4. Update Employee Data
  5. PUT Structure for Updating LDR and Wage Assignments

PUT Structure for Updating LDR and Wage Assignments

This particular PUT request structure may only be used when any of the following assignments have been updated for a user in your system. Also, the user must have already been synced/mapped into 7shifts and all the required roles, departments & locations have been mapped:

  • Roles
  • Departments
  • Locations
  • Wages

Keeping the field values from the POST example in mind, here’s an example PUT request to the assign the existing user to yet another role with the ID 55555 which exists under department ID 33333 at location 11111, which is another location under the same company, for a $15 wage:

Request URL

PUT https://api.7shifts.com/v1/users/5252552

Request body

{
    "user": {
        "firstname": "Bertram",
        "lastname": "Gilfoyle"
    },
    "role": [
        {
            "id": 135790
        },
        {
            "id": 864280
        },
        {
            "id": 55555
        }
    ],
    "department": [
        {
            "id": 98765
        },
        {
            "id": 33333
        }
    ],
    "location": [
        {
            "id": 12345
        },
        {
            "id": 11111
        }
    ],
    "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
	},
	{
	     "role_id": 55555,
	     "wage_cents": 1500,
	     "effective_date": "2020-12-15",
	     "wage_type": "hourly",
	     "is_deleted": false
	}
    ]
}

Please note the following about the above request:

  • The request URL must specify the user.id of the 7shifts user to be updated
  • This request may be used if the user’s role, department, location or wage assignment has changed. If just basic info has changed, you can use the other simpler PUT request.
  • You must specify the user object in the request body, and provide at least one field such as firstname therein, even if the user’s basic info didn’t change
  • You must provide the existing roles, departments, locations & wages that the user is already assigned to as well, and not just the new roles, departments & locations that the user got assigned to. Not doing so will result in the user’s previous assignments, including wage data, being deleted
  • If any other basic info fields got updated along with the assignments as well, such as phone number, then you may include those fields in the user object within the request body as well

Switching Wage Type

Did an employee just switch from being on an hourly wage to a weekly salary? When updating the user, just specify one wage object representing the new salary with wage_type = weekly_salary. Ensure that the other existing wage objects aren’t being re-specified to change the wage type unambiguously.

Did an employee just switch from weekly salary to hourly wage? Just specify the new wage object(s) representing the new wage(s) to be assigned to the user, with each object’s wage_type field set to hourly.

Essentially, whatever previously assigned wage/location/department/role object you don’t specify in the PUT request gets removed from the list of assignments for the user, and only the new ones specified in the request get assigned.