Create a manager
This topic explains how to construct requests for creating a person with the manager role using the Create Person operation.
Example requests are POSTed to the Create Person URL:
https://<<hostName>>/api/v1/commons/persons
The Create Person (POST /v1/commons/persons
) and Create Persons (POST /v1/commons/persons/multi_create
) operations allow you to create new people entries in the system and to pass information that corresponds to the options in the Maintenance > People Information > Employee section of the user interface.
By following this example, you will be able to create managers who can perform basic necessary actions, such as:
- Log in to the UI
- Access all of the same functions as employees
- View and edit employee timecards
- View and edit employee schedules
- Approve time off requests
Example request
In this example, the request:
- creates a new, active manager named "Earl Grey"
- defines Earl's user name, password, authentication type, and work email address
- assigns Earl a job, a base wage, basic licenses, a labor account, a display profile, and a generic data access profile (GDAP)
{
"personInformation": {
"accessAssignment": {
"accessProfileName": "Retail Manager",
"managerPayCodeName": "Retail Pay Codes",
"managerViewPayCodeName": "Retail Pay Codes",
"managerWorkRuleName": "Retail Work Rules",
"notificationProfileName": "All",
"preferenceProfileName": "Retail DP",
"professionalPayCodeName": "Retail Pay Codes",
"professionalWorkRuleName": "Retail Work Rules",
"shiftCodeName": "Retail Templates"
},
"emailAddresses": [
{
"address": "[email protected]",
"contactTypeName": "Work",
"hasEmailNotificationDelivery": true
}
],
"employmentStatusList": [
{
"effectiveDate": "2019-08-13",
"employmentStatusName": "Active",
"expirationDate": "3000-01-01"
}
],
"person": {
"birthDate": "1986-02-04",
"firstName": "Earl",
"lastName": "Grey",
"fullName": "Grey, Earl",
"hireDate": "2016-08-13",
"personNumber": "2001",
"shortName": "EGrey"
},
"personAuthenticationTypes": [
{
"activeFlag": true,
"authenticationTypeName": "Basic"
}
],
"personLicenseTypes": [
{
"activeFlag": true,
"licenseTypeName": "Employee"
},
{
"activeFlag": true,
"licenseTypeName": "Manager"
},
{
"activeFlag": true,
"licenseTypeName": "Absence"
},
{
"activeFlag": true,
"licenseTypeName": "Workforce MobileManager"
},
{
"activeFlag": true,
"licenseTypeName": "Workforce TabletManager"
},
{
"activeFlag": true,
"licenseTypeName": "Hourly Timekeeping"
},
{
"activeFlag": true,
"licenseTypeName": "Scheduling"
}
],
"userAccountStatusList": [
{
"effectiveDate": "2016-08-13",
"expirationDate": "3000-01-01",
"userAccountStatusName": "Active"
}
]
},
"jobAssignment": {
"baseWageRates": [
{
"effectiveDate": "1753-01-01",
"expirationDate": "3000-01-01",
"hourlyRate": 42.15
}
],
"jobAssignmentDetails": {
"payRuleName": "USNY-RT-FT",
"timeZoneName": "(GMT -05:00) Eastern Time"
},
"primaryLaborAccounts": [
{
"effectiveDate": "2019-08-13",
"expirationDate": "3000-01-01",
"organizationPath": "Organization/United States/Metropolitan Store/California/Example Mart/Admin/Store Manager"
}
]
},
"user": {
"userAccount": {
"userName": "EarlGrey",
"userPassword": "3x@mplE1"
}
},
"gdapAssignments": [
{
"defaultSwitch": true,
"effectiveDate": "2019-08-15",
"expirationDate": "3000-01-01",
"role": "MANAGER_ROLE",
"gdapName": "Retail Manager GDAP"
}
]
}
Notes of interest
- The organization path of your manager's primary labor account must be a job in your organization's business structure.
- For date properties, the values for the earliest possible date (also known as the "beginning of time") and the latest possible date (also known as the "end of time") are 1900-01-01 and 3000-01-01, respectively.
- Note that employees and managers have a different
licenseTypeName
that defines their roles - Refer to the Resource Details of the Create Person GET
/v1/commons/persons
or Create Persons POST/v1/commons/persons/multi_create
operation for descriptions of each object, array, and property. - You cannot assign a supervisor to an employee or manager unless that supervisor already exists in the system or is specified first in a multi-create request payload.
Example response
The response adds the personIdentity
array containing one property: a system-generated ID, known as a person key or employee ID. The response otherwise mimics the successful request body.
{
"personIdentity": {
"personKey": 50800
},
"personInformation": {
"accessAssignment": {
"accessProfileName": "Retail Manager",
"managerPayCodeName": "Retail Pay Codes",
"managerViewPayCodeName": "Retail Pay Codes",
"managerWorkRuleName": "Retail Work Rules",
"notificationProfileName": "All",
"preferenceProfileName": "Retail DP",
"professionalPayCodeName": "Retail Pay Codes",
"professionalWorkRuleName": "Retail Work Rules",
"shiftCodeName": "Retail Templates"
},
"emailAddresses": [
{
"address": "[email protected]",
"contactTypeName": "Work",
"hasEmailNotificationDelivery": true
}
],
"employmentStatusList": [
{
"effectiveDate": "2019-08-13",
"employmentStatusName": "Active",
"expirationDate": "3000-01-01"
}
],
"person": {
"birthDate": "1986-02-04",
"firstName": "Earl",
"lastName": "Grey",
"fullName": "Grey, Earl",
"hireDate": "2016-08-13",
"personNumber": "2001",
"shortName": "EGrey"
},
"personAuthenticationTypes": [
{
"activeFlag": true,
"authenticationTypeName": "Basic"
}
],
"personLicenseTypes": [
{
"activeFlag": true,
"licenseTypeName": "Employee"
},
{
"activeFlag": true,
"licenseTypeName": "Manager"
},
{
"activeFlag": true,
"licenseTypeName": "Absence"
},
{
"activeFlag": true,
"licenseTypeName": "Workforce MobileManager"
},
{
"activeFlag": true,
"licenseTypeName": "Workforce TabletManager"
},
{
"activeFlag": true,
"licenseTypeName": "Hourly Timekeeping"
},
{
"activeFlag": true,
"licenseTypeName": "Scheduling"
}
],
"userAccountStatusList": [
{
"effectiveDate": "2016-08-13",
"expirationDate": "3000-01-01",
"userAccountStatusName": "Active"
}
]
},
"jobAssignment": {
"baseWageRates": [
{
"effectiveDate": "1753-01-01",
"expirationDate": "3000-01-01",
"hourlyRate": 42.15
}
],
"jobAssignmentDetails": {
"payRuleName": "USNY-RT-FT",
"timeZoneName": "(GMT -05:00) Eastern Time"
},
"primaryLaborAccounts": [
{
"effectiveDate": "2019-08-13",
"expirationDate": "3000-01-01",
"organizationPath": "Organization/United States/Metropolitan Store/California/Example Mart/Admin/Store Manager"
}
]
},
"user": {
"userAccount": {
"userName": "EarlGrey",
"userPassword": "3x@mplE1"
}
},
"gdapAssignments": [
{
"defaultSwitch": true,
"effectiveDate": "2019-08-15",
"expirationDate": "3000-01-01",
"role": "MANAGER_ROLE",
"gdapName": "Retail Manager GDAP"
}
]
}
Next steps
To learn about creating multiple person records in a single API call, proceed to the Create multiple person records topic.
Updated over 1 year ago