Actions
The ballerinax/sap.businessone.humanresources package exposes the following clients:
Available clients:
| Client | Purpose |
|---|---|
Client | Manage SAP Business One human resources objects — employee master data, positions, roles, statuses, transfers, teams, and HR reference data — through the Service Layer (OData). |
Client
The Client connects to the SAP Business One Service Layer and exposes CRUD and query operations for all human resources objects — employee master data, positions, roles, statuses, transfers, teams, and HR reference data.
Configuration
Session Configuration (businessone:SessionConfig) — required for every client instance; the client logs in with these credentials and manages the resulting session cookie automatically.
| Field | Type | Default | Description |
|---|---|---|---|
companyDb | string | Required | The SAP Business One company database name |
username | string | Required | The Service Layer user name |
password | string | Required | The Service Layer password |
Connection Configuration (ConnectionConfig) — optional HTTP behavior settings passed as the second argument to init.
| Field | Type | Default | Description |
|---|---|---|---|
httpVersion | http:HttpVersion | http:HTTP_2_0 | The HTTP version understood by the client |
http1Settings | http:ClientHttp1Settings | {} | Configurations related to HTTP/1.x protocol |
http2Settings | http:ClientHttp2Settings | {} | Configurations related to HTTP/2 protocol |
timeout | decimal | 30 | The maximum time to wait (in seconds) for a response before closing the connection |
forwarded | string | "disable" | The choice of setting forwarded/x-forwarded header |
followRedirects | http:FollowRedirects | - | Configurations associated with Redirection |
poolConfig | http:PoolConfiguration | - | Configurations associated with request pooling |
cache | http:CacheConfig | {} | HTTP caching related configurations |
compression | http:Compression | http:COMPRESSION_AUTO | Specifies the way of handling compression (accept-encoding) header |
circuitBreaker | http:CircuitBreakerConfig | - | Configurations associated with the behaviour of the Circuit Breaker |
retryConfig | http:RetryConfig | - | Configurations associated with retrying |
cookieConfig | http:CookieConfig | - | Configurations associated with cookies |
responseLimits | http:ResponseLimitConfigs | {} | Configurations associated with inbound response size limits |
secureSocket | http:ClientSecureSocket | - | SSL/TLS-related options |
proxy | http:ProxyConfig | - | Proxy server related options |
socketConfig | http:ClientSocketConfig | {} | Provides settings related to client socket configuration |
validation | boolean | true | Enables the inbound payload validation functionality which is provided by the constraint package |
laxDataBinding | boolean | true | Enables relaxed data binding on the client side, treating nil values as optional |
Initializing the client
import ballerinax/sap.businessone.humanresources;
humanresources:Client humanResourcesClient = check new (
{companyDb: "SBODemoUS", username: "manager", password: "<PASSWORD>"},
serviceUrl = "https://<host>:50000/b1s/v1"
);
Operations
Employees Info
listEmployeesInfo
Queries the EmployeesInfo collection of employee master data records, with support for OData paging, filtering, and expansion.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListEmployeesInfoHeaders | No | Headers to be sent with the request, e.g. Prefer for server paging |
queries | ListEmployeesInfoQueries | No | OData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: EmployeesInfoCollectionResponse|error
Sample code:
EmployeesInfoCollectionResponse response = check humanResourcesClient->listEmployeesInfo(
queries = {dollarTop: 10, dollarSelect: "EmployeeID,FirstName,LastName"}
);
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeesInfo",
"value": [
{
"EmployeeID": 101,
"FirstName": "Jane",
"LastName": "Doe"
}
]
}
createEmployeesInfo
Creates a new EmployeeInfo employee master data record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | EmployeeInfo | Yes | The employee record to create |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: EmployeeInfo|error
Sample code:
EmployeeInfo created = check humanResourcesClient->createEmployeesInfo({
FirstName: "Jane",
LastName: "Doe",
Gender: "gt_Female",
StartDate: "2026-07-13"
});
Sample response:
{
"EmployeeID": 101,
"FirstName": "Jane",
"LastName": "Doe",
"Gender": "gt_Female",
"StartDate": "2026-07-13"
}
getEmployeesInfo
Retrieves a single EmployeeInfo record by its EmployeeID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
employeeID | int:Signed32 | Yes | Key property 'EmployeeID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
queries | GetEmployeesInfoQueries | No | $expand and $select query options |
Returns: EmployeeInfo|error
Sample code:
EmployeeInfo employee = check humanResourcesClient->getEmployeesInfo(101);
Sample response:
{
"EmployeeID": 101,
"FirstName": "Jane",
"LastName": "Doe",
"Gender": "gt_Female",
"StartDate": "2026-07-13"
}
deleteEmployeesInfo
Deletes an EmployeeInfo record by its EmployeeID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
employeeID | int:Signed32 | Yes | Key property 'EmployeeID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->deleteEmployeesInfo(101);
updateEmployeesInfo
Partially updates an EmployeeInfo record (PATCH/MERGE semantics) by its EmployeeID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
employeeID | int:Signed32 | Yes | Key property 'EmployeeID' (Edm.Int32) |
payload | EmployeeInfo | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->updateEmployeesInfo(101, {JobTitle: "Senior Consultant"});
employeesInfoCancel
Invokes the bound action Cancel on an EmployeeInfo record, cancelling the employee record by its EmployeeID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
employeeID | int:Signed32 | Yes | Key property 'EmployeeID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->employeesInfoCancel(101);
employeesInfoClose
Invokes the bound action Close on an EmployeeInfo record, closing the employee record by its EmployeeID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
employeeID | int:Signed32 | Yes | Key property 'EmployeeID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->employeesInfoClose(101);
Employee Positions
listEmployeePosition
Queries the EmployeePosition collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListEmployeePositionHeaders | No | Headers to be sent with the request |
queries | ListEmployeePositionQueries | No | OData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: EmployeePositionCollectionResponse|error
Sample code:
EmployeePositionCollectionResponse response = check humanResourcesClient->listEmployeePosition();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeePosition",
"value": [
{
"PositionID": 1,
"Name": "Consultant",
"Description": "Consulting staff position"
}
]
}
createEmployeePosition
Creates a new EmployeePosition record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | EmployeePosition | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: EmployeePosition|error
Sample code:
EmployeePosition created = check humanResourcesClient->createEmployeePosition({
Name: "Consultant",
Description: "Consulting staff position"
});
Sample response:
{
"PositionID": 1,
"Name": "Consultant",
"Description": "Consulting staff position"
}
getEmployeePosition
Retrieves a single EmployeePosition record by its PositionID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
positionID | int:Signed32 | Yes | Key property 'PositionID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
queries | GetEmployeePositionQueries | No | $expand and $select query options |
Returns: EmployeePosition|error
Sample code:
EmployeePosition position = check humanResourcesClient->getEmployeePosition(1);
Sample response:
{
"PositionID": 1,
"Name": "Consultant",
"Description": "Consulting staff position"
}
deleteEmployeePosition
Deletes an EmployeePosition record by its PositionID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
positionID | int:Signed32 | Yes | Key property 'PositionID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->deleteEmployeePosition(1);
updateEmployeePosition
Partially updates an EmployeePosition record (PATCH/MERGE semantics) by its PositionID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
positionID | int:Signed32 | Yes | Key property 'PositionID' (Edm.Int32) |
payload | EmployeePosition | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->updateEmployeePosition(1, {Description: "Senior consulting staff position"});
employeePositionServiceGetList
Calls the EmployeePositionService_GetList function import to retrieve the lightweight list of employee positions.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: inline_response_200_1|error
Sample code:
inline_response_200_1 result = check humanResourcesClient->employeePositionServiceGetList();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeePositionService_GetList",
"value": [
{
"PositionID": 1,
"Name": "Consultant"
}
]
}
Employee Roles Setup
listEmployeeRolesSetup
Queries the EmployeeRolesSetup collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListEmployeeRolesSetupHeaders | No | Headers to be sent with the request |
queries | ListEmployeeRolesSetupQueries | No | OData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: EmployeeRolesSetupCollectionResponse|error
Sample code:
EmployeeRolesSetupCollectionResponse response = check humanResourcesClient->listEmployeeRolesSetup();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeeRolesSetup",
"value": [
{
"TypeID": 1,
"Name": "Approver",
"Description": "Approves employee requests"
}
]
}
createEmployeeRolesSetup
Creates a new EmployeeRoleSetup record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | EmployeeRoleSetup | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: EmployeeRoleSetup|error
Sample code:
EmployeeRoleSetup created = check humanResourcesClient->createEmployeeRolesSetup({
Name: "Approver",
Description: "Approves employee requests"
});
Sample response:
{
"TypeID": 1,
"Name": "Approver",
"Description": "Approves employee requests"
}
getEmployeeRolesSetup
Retrieves a single EmployeeRoleSetup record by its TypeID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
typeID | int:Signed32 | Yes | Key property 'TypeID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
queries | GetEmployeeRolesSetupQueries | No | $expand and $select query options |
Returns: EmployeeRoleSetup|error
Sample code:
EmployeeRoleSetup role = check humanResourcesClient->getEmployeeRolesSetup(1);
Sample response:
{
"TypeID": 1,
"Name": "Approver",
"Description": "Approves employee requests"
}
deleteEmployeeRolesSetup
Deletes an EmployeeRoleSetup record by its TypeID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
typeID | int:Signed32 | Yes | Key property 'TypeID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->deleteEmployeeRolesSetup(1);
updateEmployeeRolesSetup
Partially updates an EmployeeRoleSetup record (PATCH/MERGE semantics) by its TypeID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
typeID | int:Signed32 | Yes | Key property 'TypeID' (Edm.Int32) |
payload | EmployeeRoleSetup | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->updateEmployeeRolesSetup(1, {Description: "Approves and escalates employee requests"});
employeeRolesSetupServiceGetEmployeeRoleSetupList
Calls the EmployeeRolesSetupService_GetEmployeeRoleSetupList function import to retrieve the employee role setup list.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: inline_response_200_2|error
Sample code:
inline_response_200_2 result = check humanResourcesClient->employeeRolesSetupServiceGetEmployeeRoleSetupList();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeeRolesSetupService_GetEmployeeRoleSetupList",
"value": [
{
"TypeID": 1,
"Name": "Approver"
}
]
}
Employee Status
listEmployeeStatus
Queries the EmployeeStatus collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListEmployeeStatusHeaders | No | Headers to be sent with the request |
queries | ListEmployeeStatusQueries | No | OData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: EmployeeStatusCollectionResponse|error
Sample code:
EmployeeStatusCollectionResponse response = check humanResourcesClient->listEmployeeStatus();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeeStatus",
"value": [
{
"StatusId": 1,
"Name": "Active",
"Description": "Currently employed"
}
]
}
createEmployeeStatus
Creates a new EmployeeStatus record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | EmployeeStatus | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: EmployeeStatus|error
Sample code:
EmployeeStatus created = check humanResourcesClient->createEmployeeStatus({
Name: "Active",
Description: "Currently employed"
});
Sample response:
{
"StatusId": 1,
"Name": "Active",
"Description": "Currently employed"
}
getEmployeeStatus
Retrieves a single EmployeeStatus record by its StatusId key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
statusId | int:Signed32 | Yes | Key property 'StatusId' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
queries | GetEmployeeStatusQueries | No | $expand and $select query options |
Returns: EmployeeStatus|error
Sample code:
EmployeeStatus status = check humanResourcesClient->getEmployeeStatus(1);
Sample response:
{
"StatusId": 1,
"Name": "Active",
"Description": "Currently employed"
}
deleteEmployeeStatus
Deletes an EmployeeStatus record by its StatusId key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
statusId | int:Signed32 | Yes | Key property 'StatusId' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->deleteEmployeeStatus(1);
updateEmployeeStatus
Partially updates an EmployeeStatus record (PATCH/MERGE semantics) by its StatusId key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
statusId | int:Signed32 | Yes | Key property 'StatusId' (Edm.Int32) |
payload | EmployeeStatus | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->updateEmployeeStatus(1, {Description: "Currently employed, full-time"});
employeeStatusServiceGetList
Calls the EmployeeStatusService_GetList function import to retrieve the lightweight list of employee statuses.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: inline_response_200_3|error
Sample code:
inline_response_200_3 result = check humanResourcesClient->employeeStatusServiceGetList();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeeStatusService_GetList",
"value": [
{
"StatusId": 1,
"Name": "Active"
}
]
}
Employee Transfers
listEmployeeTransfers
Queries the EmployeeTransfers collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListEmployeeTransfersHeaders | No | Headers to be sent with the request |
queries | ListEmployeeTransfersQueries | No | OData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: EmployeeTransfersCollectionResponse|error
Sample code:
EmployeeTransfersCollectionResponse response = check humanResourcesClient->listEmployeeTransfers();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeeTransfers",
"value": [
{
"TransferID": 1,
"TransStartDate": "2026-07-01",
"TransEndDate": "2026-07-13",
"Status": "ets_New",
"Comment": "Department transfer"
}
]
}
createEmployeeTransfers
Creates a new EmployeeTransfer record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | EmployeeTransfer | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: EmployeeTransfer|error
Sample code:
EmployeeTransfer created = check humanResourcesClient->createEmployeeTransfers({
TransStartDate: "2026-07-01",
TransEndDate: "2026-07-13",
Status: "ets_New",
Comment: "Department transfer"
});
Sample response:
{
"TransferID": 1,
"TransStartDate": "2026-07-01",
"TransEndDate": "2026-07-13",
"Status": "ets_New",
"Comment": "Department transfer"
}
getEmployeeTransfers
Retrieves a single EmployeeTransfer record by its TransferID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
transferID | int:Signed32 | Yes | Key property 'TransferID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
queries | GetEmployeeTransfersQueries | No | $expand and $select query options |
Returns: EmployeeTransfer|error
Sample code:
EmployeeTransfer transfer = check humanResourcesClient->getEmployeeTransfers(1);
Sample response:
{
"TransferID": 1,
"TransStartDate": "2026-07-01",
"TransEndDate": "2026-07-13",
"Status": "ets_New",
"Comment": "Department transfer"
}
deleteEmployeeTransfers
Deletes an EmployeeTransfer record by its TransferID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
transferID | int:Signed32 | Yes | Key property 'TransferID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->deleteEmployeeTransfers(1);
updateEmployeeTransfers
Partially updates an EmployeeTransfer record (PATCH/MERGE semantics) by its TransferID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
transferID | int:Signed32 | Yes | Key property 'TransferID' (Edm.Int32) |
payload | EmployeeTransfer | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->updateEmployeeTransfers(1, {Status: "ets_Accepted"});
employeeTransfersServiceGetEmployeeTransferList
Calls the EmployeeTransfersService_GetEmployeeTransferList function import to retrieve the employee transfer list.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: inline_response_200_4|error
Sample code:
inline_response_200_4 result = check humanResourcesClient->employeeTransfersServiceGetEmployeeTransferList();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeeTransfersService_GetEmployeeTransferList",
"value": [
{
"TransferID": 1
}
]
}
Employment Categories
employmentCategoryServiceGetEmploymentCategoryList
Calls the EmploymentCategoryService_GetEmploymentCategoryList function import to retrieve the employment category list.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: inline_response_200_5|error
Sample code:
inline_response_200_5 result = check humanResourcesClient->employmentCategoryServiceGetEmploymentCategoryList();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmploymentCategoryService_GetEmploymentCategoryList",
"value": [
{
"Code": "FT"
}
]
}
listEmploymentCategorys
Queries the EmploymentCategorys collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListEmploymentCategorysHeaders | No | Headers to be sent with the request |
queries | ListEmploymentCategorysQueries | No | OData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: EmploymentCategorysCollectionResponse|error
Sample code:
EmploymentCategorysCollectionResponse response = check humanResourcesClient->listEmploymentCategorys();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmploymentCategorys",
"value": [
{
"Code": "FT",
"Description": "Full-time"
}
]
}
createEmploymentCategorys
Creates a new EmploymentCategory record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | EmploymentCategory | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: EmploymentCategory|error
Sample code:
EmploymentCategory created = check humanResourcesClient->createEmploymentCategorys({
Code: "FT",
Description: "Full-time"
});
Sample response:
{
"Code": "FT",
"Description": "Full-time"
}
getEmploymentCategorys
Retrieves a single EmploymentCategory record by its Code key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Key property 'Code' (Edm.String) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
queries | GetEmploymentCategorysQueries | No | $expand and $select query options |
Returns: EmploymentCategory|error
Sample code:
EmploymentCategory category = check humanResourcesClient->getEmploymentCategorys("FT");
Sample response:
{
"Code": "FT",
"Description": "Full-time"
}
deleteEmploymentCategorys
Deletes an EmploymentCategory record by its Code key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Key property 'Code' (Edm.String) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->deleteEmploymentCategorys("FT");
updateEmploymentCategorys
Partially updates an EmploymentCategory record (PATCH/MERGE semantics) by its Code key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Key property 'Code' (Edm.String) |
payload | EmploymentCategory | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->updateEmploymentCategorys("FT", {Description: "Full-time permanent"});
Employee ID Types
listEmployeeIDType
Queries the EmployeeIDType collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListEmployeeIDTypeHeaders | No | Headers to be sent with the request |
queries | ListEmployeeIDTypeQueries | No | OData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: EmployeeIDTypeCollectionResponse|error
Sample code:
EmployeeIDTypeCollectionResponse response = check humanResourcesClient->listEmployeeIDType();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeeIDType",
"value": [
{
"IDType": "national_id"
}
]
}
createEmployeeIDType
Creates a new EmployeeIDType record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | EmployeeIDType | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: EmployeeIDType|error
Sample code:
EmployeeIDType created = check humanResourcesClient->createEmployeeIDType({IDType: "national_id"});
Sample response:
{
"IDType": "national_id"
}
getEmployeeIDType
Retrieves a single EmployeeIDType record by its IDType key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
iDType | string | Yes | Key property 'IDType' (Edm.String) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
queries | GetEmployeeIDTypeQueries | No | $expand and $select query options |
Returns: EmployeeIDType|error
Sample code:
EmployeeIDType idType = check humanResourcesClient->getEmployeeIDType("national_id");
Sample response:
{
"IDType": "national_id"
}
deleteEmployeeIDType
Deletes an EmployeeIDType record by its IDType key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
iDType | string | Yes | Key property 'IDType' (Edm.String) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->deleteEmployeeIDType("national_id");
updateEmployeeIDType
Partially updates an EmployeeIDType record (PATCH/MERGE semantics) by its IDType key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
iDType | string | Yes | Key property 'IDType' (Edm.String) |
payload | EmployeeIDType | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->updateEmployeeIDType("national_id", {IDType: "national_identity_card"});
employeeIDTypeServiceGetList
Calls the EmployeeIDTypeService_GetList function import to retrieve the lightweight list of employee ID types.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: inline_response_200|error
Sample code:
inline_response_200 result = check humanResourcesClient->employeeIDTypeServiceGetList();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeeIDTypeService_GetList",
"value": [
{
"IDType": "national_id"
}
]
}
Employee Images
listEmployeeImages
Queries the EmployeeImages collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListEmployeeImagesHeaders | No | Headers to be sent with the request |
queries | ListEmployeeImagesQueries | No | OData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: EmployeeImagesCollectionResponse|error
Sample code:
EmployeeImagesCollectionResponse response = check humanResourcesClient->listEmployeeImages();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#EmployeeImages",
"value": [
{
"EmployeeNo": 101,
"Picture": 1
}
]
}
createEmployeeImages
Creates a new EmployeeImage record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | EmployeeImage | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: EmployeeImage|error
Sample code:
EmployeeImage created = check humanResourcesClient->createEmployeeImages({
EmployeeNo: 101,
Picture: 1
});
Sample response:
{
"EmployeeNo": 101,
"Picture": 1
}
getEmployeeImages
Retrieves a single EmployeeImage record by its EmployeeNo key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
employeeNo | int:Signed32 | Yes | Key property 'EmployeeNo' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
queries | GetEmployeeImagesQueries | No | $expand and $select query options |
Returns: EmployeeImage|error
Sample code:
EmployeeImage image = check humanResourcesClient->getEmployeeImages(101);
Sample response:
{
"EmployeeNo": 101,
"Picture": 1
}
deleteEmployeeImages
Deletes an EmployeeImage record by its EmployeeNo key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
employeeNo | int:Signed32 | Yes | Key property 'EmployeeNo' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->deleteEmployeeImages(101);
updateEmployeeImages
Partially updates an EmployeeImage record (PATCH/MERGE semantics) by its EmployeeNo key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
employeeNo | int:Signed32 | Yes | Key property 'EmployeeNo' (Edm.Int32) |
payload | EmployeeImage | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->updateEmployeeImages(101, {Picture: 2});
Teams
listTeams
Queries the Teams collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListTeamsHeaders | No | Headers to be sent with the request |
queries | ListTeamsQueries | No | OData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: TeamsCollectionResponse|error
Sample code:
TeamsCollectionResponse response = check humanResourcesClient->listTeams();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#Teams",
"value": [
{
"TeamID": 1,
"TeamName": "Consulting",
"Description": "Consulting delivery team",
"TeamMembers": [
{
"TeamID": 1,
"EmployeeID": 101,
"RoleInTeam": "borit_Leader"
}
]
}
]
}
createTeams
Creates a new Team record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | Team | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: Team|error
Sample code:
Team created = check humanResourcesClient->createTeams({
TeamName: "Consulting",
Description: "Consulting delivery team",
TeamMembers: [{EmployeeID: 101, RoleInTeam: "borit_Leader"}]
});
Sample response:
{
"TeamID": 1,
"TeamName": "Consulting",
"Description": "Consulting delivery team",
"TeamMembers": [
{
"TeamID": 1,
"EmployeeID": 101,
"RoleInTeam": "borit_Leader"
}
]
}
getTeams
Retrieves a single Team record by its TeamID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
teamID | int:Signed32 | Yes | Key property 'TeamID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
queries | GetTeamsQueries | No | $expand and $select query options |
Returns: Team|error
Sample code:
Team team = check humanResourcesClient->getTeams(1);
Sample response:
{
"TeamID": 1,
"TeamName": "Consulting",
"Description": "Consulting delivery team",
"TeamMembers": [
{
"TeamID": 1,
"EmployeeID": 101,
"RoleInTeam": "borit_Leader"
}
]
}
deleteTeams
Deletes a Team record by its TeamID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
teamID | int:Signed32 | Yes | Key property 'TeamID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->deleteTeams(1);
updateTeams
Partially updates a Team record (PATCH/MERGE semantics) by its TeamID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
teamID | int:Signed32 | Yes | Key property 'TeamID' (Edm.Int32) |
payload | Team | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->updateTeams(1, {Description: "Consulting delivery and support team"});
Genders
listGenders
Queries the Genders collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListGendersHeaders | No | Headers to be sent with the request |
queries | ListGendersQueries | No | OData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: GendersCollectionResponse|error
Sample code:
GendersCollectionResponse response = check humanResourcesClient->listGenders();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#Genders",
"value": [
{
"Code": "F",
"Description": "Female"
}
]
}
createGenders
Creates a new Gender record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | Gender | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: Gender|error
Sample code:
Gender created = check humanResourcesClient->createGenders({
Code: "F",
Description: "Female"
});
Sample response:
{
"Code": "F",
"Description": "Female"
}
getGenders
Retrieves a single Gender record by its Code key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Key property 'Code' (Edm.String) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
queries | GetGendersQueries | No | $expand and $select query options |
Returns: Gender|error
Sample code:
Gender gender = check humanResourcesClient->getGenders("F");
Sample response:
{
"Code": "F",
"Description": "Female"
}
deleteGenders
Deletes a Gender record by its Code key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Key property 'Code' (Edm.String) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->deleteGenders("F");
updateGenders
Partially updates a Gender record (PATCH/MERGE semantics) by its Code key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Key property 'Code' (Edm.String) |
payload | Gender | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->updateGenders("F", {Description: "Female employee"});
gendersServiceGetList
Calls the GendersService_GetList function import to retrieve the lightweight list of genders.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: inline_response_200_6|error
Sample code:
inline_response_200_6 result = check humanResourcesClient->gendersServiceGetList();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#GendersService_GetList",
"value": [
{
"Code": "F"
}
]
}
Termination Reasons
listTerminationReason
Queries the TerminationReason collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListTerminationReasonHeaders | No | Headers to be sent with the request |
queries | ListTerminationReasonQueries | No | OData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: TerminationReasonCollectionResponse|error
Sample code:
TerminationReasonCollectionResponse response = check humanResourcesClient->listTerminationReason();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#TerminationReason",
"value": [
{
"ReasonID": 1,
"Name": "Resignation",
"Description": "Employee resigned voluntarily"
}
]
}
createTerminationReason
Creates a new TerminationReason record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | TerminationReason | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: TerminationReason|error
Sample code:
TerminationReason created = check humanResourcesClient->createTerminationReason({
Name: "Resignation",
Description: "Employee resigned voluntarily"
});
Sample response:
{
"ReasonID": 1,
"Name": "Resignation",
"Description": "Employee resigned voluntarily"
}
getTerminationReason
Retrieves a single TerminationReason record by its ReasonID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
reasonID | int:Signed32 | Yes | Key property 'ReasonID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
queries | GetTerminationReasonQueries | No | $expand and $select query options |
Returns: TerminationReason|error
Sample code:
TerminationReason reason = check humanResourcesClient->getTerminationReason(1);
Sample response:
{
"ReasonID": 1,
"Name": "Resignation",
"Description": "Employee resigned voluntarily"
}
deleteTerminationReason
Deletes a TerminationReason record by its ReasonID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
reasonID | int:Signed32 | Yes | Key property 'ReasonID' (Edm.Int32) |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->deleteTerminationReason(1);
updateTerminationReason
Partially updates a TerminationReason record (PATCH/MERGE semantics) by its ReasonID key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
reasonID | int:Signed32 | Yes | Key property 'ReasonID' (Edm.Int32) |
payload | TerminationReason | Yes | Request payload |
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: error?
Sample code:
check humanResourcesClient->updateTerminationReason(1, {Description: "Voluntary resignation by employee"});
terminationReasonServiceGetList
Calls the TerminationReasonService_GetList function import to retrieve the lightweight list of termination reasons.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map|string|string[]|} | No | Headers to be sent with the request |
Returns: inline_response_200_7|error
Sample code:
inline_response_200_7 result = check humanResourcesClient->terminationReasonServiceGetList();
Sample response:
{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#TerminationReasonService_GetList",
"value": [
{
"ReasonID": 1,
"Name": "Resignation"
}
]
}
Session Management
logout
Ends the active SAP Business One Service Layer session, invalidating the B1SESSION cookie.
Parameters:
None.
Returns: error?
Sample code:
check humanResourcesClient->logout();