Represents employees (spr) in Business Central.
Methods
Method | Return Type | Description |
---|---|---|
GET sprEmployees | sprEmployees | Gets an employee object. |
DELETE sprEmployees | none | Deletes an employee object. |
POST sprEmployees | sprEmployees | Creates an employee object. |
PATCH sprEmployees | sprEmployees | Updates an employee object. |
Navigation
Navigation | Return Type | Description |
---|---|---|
sprGroundForTermination | sprGroundForTermination | Gets the ground for termination associated with the employee. |
sprDimensionSetLines | Collection(sprDimensionSetLine) | Gets the dimension set lines of the employee. |
sprEmplPersonalInformation | sprEmplPersonalInformation | Gets the personal information of the employee. |
sprContracts | Collection(sprContract) | Gets the contracts associated with the employee. |
sprRelatives | Collection(sprRelative) | Gets the relatives associated with the employee. |
sprPaymentLocations | Collection(sprPaymentLocation) | Gets the payment locations associated with the employee. |
Properties
Property | Type | Description | Relation to |
---|---|---|---|
id | Guid | Specifies the employee's ID. Non-editable. | |
number | String[20] | Specifies the employee's number. | |
firstName | String[30] | Specifies the employee's first name. | |
middleName | String[30] | Specifies the employee's middle name. | |
surname | String[30] | Specifies the employee's surname. | |
employmentDate | Date | Specifies the employment date. | |
terminationDate | Date | Specifies the termination date. | |
warningOfTerminationDate | Date | Specifies the warning of termination date. | |
personalEMail | String[80] | Specifies the personal email address. | |
companyEMail | String[80] | Specifies the company email address. | |
companyMobPhoneNo | String[30] | Specifies the company mobile phone number. | |
mobPhoneNo | String[30] | Specifies the mobile phone number. | |
groundsForTerminaCode | String[10] | Specifies the grounds for termination code. | sprGroundForTermination.code |
groundsForTerminaId | Guid | Specifies the order of termination id. | sprGroundForTermination.id |
orderOfTerminationNo | String[20] | Specifies the order of termination number. | |
lengthOfServFromDate | Date | Specifies the length of service from date. | |
skipSPREmplPersonalInfoAutoCreation | Boolean | Specifies if the employee personal info auto-creation should be skipped. Default = "false". Should be passed "true" if external system will create employee personal info. with "expand" or seperate POST call. | |
lastModifiedDateTime | DateTimeOffset | Specifies the employee's last modified date. Read-Only. |
Examples
Create sprEmployees
POST URI: /companies({id})/sprEmployees({id})/
Request (minimum)
{
"firstName": "API First Name",
"surname": "API Surname",
"employmentDate": "2023-05-01"
}
Response
{
"@odata.context": "http://bc220-2:7048/BC/api/softera/softeraPayroll/v1.0/$metadata#companies(fb9142f3-361f-ee11-a396-ce5b49aea574)/sprEmployees/$entity",
"@odata.etag": "W/\"JzE5OzI5ODg2MTAwMTk1Mjc0NTM3MDExOzAwOyc=\"",
"id": "26b91b4f-0d27-ee11-a395-fe66e2afdfa9",
"number": "D0016",
"firstName": "API First Name",
"middleName": "",
"surname": "API Surname",
"employmentDate": "2023-05-01",
"terminationDate": "0001-01-01",
"warningOfTerminationDate": "0001-01-01",
"personalEMail": "",
"companyEMail": "",
"companyMobPhoneNo": "",
"mobPhoneNo": "",
"groundsForTerminaCode": "",
"groundsForTerminaId": "00000000-0000-0000-0000-000000000000",
"orderOfTerminationNo": "",
"lengthOfServFromDate": "0001-01-01",
"skipSPREmplPersonalInfoAutoCreation": false,
"lastModifiedDateTime": "2023-07-20T14:54:22.05Z"
}
Create sprEmployees and sprEmplPersonalInformation at once
POST URI: /companies({{companyId}})/sprEmployees?$expand=sprEmplPersonalInformation
Request
{
"firstName": "API First Name",
"middleName": "",
"surname": "API Surname",
"employmentDate": "2023-05-01",
"terminationDate": "0001-01-01",
"warningOfTerminationDate": "0001-01-01",
"personalEMail": "aaa@ggg.com",
"companyEMail": "aaa@softera.lt",
"companyMobPhoneNo": "866612345",
"mobPhoneNo": "",
"groundsForTerminaCode": "",
"groundsForTerminaId": "00000000-0000-0000-0000-000000000000",
"orderOfTerminationNo": "",
"lengthOfServFromDate": "2020-06-01",
"skipSPREmplPersonalInfoAutoCreation": true,
"sprEmplPersonalInformation": {
"personalNo": "39101010123",
"foreignerCodeILTU": "",
"dateOfBirth": "0001-01-01",
"gender": " ",
"foreigner": false,
"nationalityCode": "",
"nationalityId": "00000000-0000-0000-0000-000000000000",
"maritalStatusCode": "",
"maritalStatusId": "00000000-0000-0000-0000-000000000000",
"retiredFrom": "0001-01-01",
"documentType": " ",
"documentNo": "",
"documentIssueAuthority": "",
"documentIssueDate": "0001-01-01",
"documentExpiryDate": "0001-01-01",
"socialInsuranceNo": "",
"temporaryResident": false,
"countryCode": "",
"city": "",
"postCode": "",
"address": "",
"address2": "",
"declaredCountryCode": "",
"declaredCity": "",
"declaredPostCode": "",
"declaredAddress": "",
"declaredAddress2": ""
}
}
Response
{
"@odata.context": "http://bc220-2:7048/BC/api/softera/softeraPayroll/v1.0/$metadata#companies(fb9142f3-361f-ee11-a396-ce5b49aea574)/sprEmployees/$entity",
"@odata.etag": "W/\"JzIwOzE0Mjc5OTc5MjA2NDI1Mzc2Nzg4MTswMDsn\"",
"id": "02fd7818-0e27-ee11-a395-fe66e2afdfa9",
"number": "D0018",
"firstName": "API First Name",
"middleName": "",
"surname": "API Surname",
"employmentDate": "2023-05-01",
"terminationDate": "0001-01-01",
"warningOfTerminationDate": "0001-01-01",
"personalEMail": "aaa@ggg.com",
"companyEMail": "aaa@softera.lt",
"companyMobPhoneNo": "866612345",
"mobPhoneNo": "",
"groundsForTerminaCode": "",
"groundsForTerminaId": "00000000-0000-0000-0000-000000000000",
"orderOfTerminationNo": "",
"lengthOfServFromDate": "2020-06-01",
"skipSPREmplPersonalInfoAutoCreation": true,
"lastModifiedDateTime": "2023-07-20T14:59:59.877Z",
"sprEmplPersonalInformation": {
"@odata.etag": "W/\"JzE5OzI0NjU5MzMwNzAyODkxNDcyMDkxOzAwOyc=\"",
"id": "04fd7818-0e27-ee11-a395-fe66e2afdfa9",
"employeeNumber": "D0018",
"employeeId": "02fd7818-0e27-ee11-a395-fe66e2afdfa9",
"personalNo": "",
"foreignerCodeILTU": "",
"dateOfBirth": "0001-01-01",
"gender": " ",
"foreigner": false,
"nationalityCode": "",
"nationalityId": "00000000-0000-0000-0000-000000000000",
"maritalStatusCode": "",
"maritalStatusId": "00000000-0000-0000-0000-000000000000",
"retiredFrom": "0001-01-01",
"documentType": " ",
"documentNo": "",
"documentIssueAuthority": "",
"documentIssueDate": "0001-01-01",
"documentExpiryDate": "0001-01-01",
"socialInsuranceNo": "",
"temporaryResident": false,
"countryCode": "",
"city": "",
"postCode": "",
"address": "",
"address2": "",
"declaredCountryCode": "",
"declaredCity": "",
"declaredPostCode": "",
"declaredAddress": "",
"declaredAddress2": "",
"lastModifiedDateTime": "2023-07-20T14:59:59.883Z"
}
}
Create sprEmployees and sprContracts at once
POST URI: /companies({{companyId}})/sprEmployees?$expand=sprContracts
Request
{
"firstName": "API First Name",
"middleName": "",
"surname": "API Surname",
"employmentDate": "2023-05-01",
"personalEMail": "aaa@ggg.com",
"companyEMail": "aaa@softera.lt",
"companyMobPhoneNo": "866612345",
"lengthOfServFromDate": "2020-06-01",
"sprContracts": [
{
"startDate": "2023-05-01",
"contractType": "Open-Ended",
"signDate": "2023-05-01",
"probationPeriodFrom": "2023-05-01",
"probationPeriod": "3M"
}
]
}
Response
{
"@odata.context": "http://bc220-2:7048/BC/api/softera/softeraPayroll/v1.0/$metadata#companies(fb9142f3-361f-ee11-a396-ce5b49aea574)/sprEmployees/$entity",
"@odata.etag": "W/\"JzE5OzQ1OTk5ODExMDY3NDYxNDg2NTUxOzAwOyc=\"",
"id": "a102cb47-1e27-ee11-a395-fe66e2afdfa9",
"number": "D0019",
"firstName": "API First Name",
"middleName": "",
"surname": "API Surname",
"employmentDate": "2023-05-01",
"terminationDate": "0001-01-01",
"warningOfTerminationDate": "0001-01-01",
"personalEMail": "aaa@ggg.com",
"companyEMail": "aaa@softera.lt",
"companyMobPhoneNo": "866612345",
"mobPhoneNo": "",
"groundsForTerminaCode": "",
"groundsForTerminaId": "00000000-0000-0000-0000-000000000000",
"orderOfTerminationNo": "",
"lengthOfServFromDate": "2020-06-01",
"skipSPREmplPersonalInfoAutoCreation": false,
"lastModifiedDateTime": "2023-07-20T16:55:51.217Z",
"sprContracts": [
{
"@odata.etag": "W/\"JzE5OzE0NDgxNjg2NzgyMzM1NTY2MzYxOzAwOyc=\"",
"id": "a302cb47-1e27-ee11-a395-fe66e2afdfa9",
"employeeNumber": "D0019",
"employeeId": "a102cb47-1e27-ee11-a395-fe66e2afdfa9",
"number": "S0006",
"extendsContractNo": "",
"externalContractNo": "S0006",
"mainContract": true,
"startDate": "2023-05-01",
"endDate": "0001-01-01",
"contractType": "Neterminuota",
"signDate": "2023-05-01",
"probationPeriodFrom": "2023-05-01",
"probationPeriod": "3M",
"probationPeriodUntil": "2023-07-31",
"lastModifiedDateTime": "2023-07-20T16:55:51.25Z"
}
]
}