Skip to main content

Actions

The ballerinax/sap.businessone.humanresources package exposes the following clients:

Available clients:

ClientPurpose
ClientManage 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.

FieldTypeDefaultDescription
companyDbstringRequiredThe SAP Business One company database name
usernamestringRequiredThe Service Layer user name
passwordstringRequiredThe Service Layer password

Connection Configuration (ConnectionConfig) — optional HTTP behavior settings passed as the second argument to init.

FieldTypeDefaultDescription
httpVersionhttp:HttpVersionhttp:HTTP_2_0The HTTP version understood by the client
http1Settingshttp:ClientHttp1Settings{}Configurations related to HTTP/1.x protocol
http2Settingshttp:ClientHttp2Settings{}Configurations related to HTTP/2 protocol
timeoutdecimal30The maximum time to wait (in seconds) for a response before closing the connection
forwardedstring"disable"The choice of setting forwarded/x-forwarded header
followRedirectshttp:FollowRedirects-Configurations associated with Redirection
poolConfighttp:PoolConfiguration-Configurations associated with request pooling
cachehttp:CacheConfig{}HTTP caching related configurations
compressionhttp:Compressionhttp:COMPRESSION_AUTOSpecifies the way of handling compression (accept-encoding) header
circuitBreakerhttp:CircuitBreakerConfig-Configurations associated with the behaviour of the Circuit Breaker
retryConfighttp:RetryConfig-Configurations associated with retrying
cookieConfighttp:CookieConfig-Configurations associated with cookies
responseLimitshttp:ResponseLimitConfigs{}Configurations associated with inbound response size limits
secureSockethttp:ClientSecureSocket-SSL/TLS-related options
proxyhttp:ProxyConfig-Proxy server related options
socketConfighttp:ClientSocketConfig{}Provides settings related to client socket configuration
validationbooleantrueEnables the inbound payload validation functionality which is provided by the constraint package
laxDataBindingbooleantrueEnables 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:

NameTypeRequiredDescription
headersListEmployeesInfoHeadersNoHeaders to be sent with the request, e.g. Prefer for server paging
queriesListEmployeesInfoQueriesNoOData 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:

NameTypeRequiredDescription
payloadEmployeeInfoYesThe employee record to create
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
employeeIDint:Signed32YesKey property 'EmployeeID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders to be sent with the request
queriesGetEmployeesInfoQueriesNo$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:

NameTypeRequiredDescription
employeeIDint:Signed32YesKey property 'EmployeeID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
employeeIDint:Signed32YesKey property 'EmployeeID' (Edm.Int32)
payloadEmployeeInfoYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
employeeIDint:Signed32YesKey property 'EmployeeID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
employeeIDint:Signed32YesKey property 'EmployeeID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders to be sent with the request

Returns: error?

Sample code:

check humanResourcesClient->employeesInfoClose(101);

Employee Positions

listEmployeePosition

Queries the EmployeePosition collection.

Parameters:

NameTypeRequiredDescription
headersListEmployeePositionHeadersNoHeaders to be sent with the request
queriesListEmployeePositionQueriesNoOData 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:

NameTypeRequiredDescription
payloadEmployeePositionYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
positionIDint:Signed32YesKey property 'PositionID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders to be sent with the request
queriesGetEmployeePositionQueriesNo$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:

NameTypeRequiredDescription
positionIDint:Signed32YesKey property 'PositionID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
positionIDint:Signed32YesKey property 'PositionID' (Edm.Int32)
payloadEmployeePositionYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersListEmployeeRolesSetupHeadersNoHeaders to be sent with the request
queriesListEmployeeRolesSetupQueriesNoOData 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:

NameTypeRequiredDescription
payloadEmployeeRoleSetupYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
typeIDint:Signed32YesKey property 'TypeID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders to be sent with the request
queriesGetEmployeeRolesSetupQueriesNo$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:

NameTypeRequiredDescription
typeIDint:Signed32YesKey property 'TypeID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
typeIDint:Signed32YesKey property 'TypeID' (Edm.Int32)
payloadEmployeeRoleSetupYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersListEmployeeStatusHeadersNoHeaders to be sent with the request
queriesListEmployeeStatusQueriesNoOData 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:

NameTypeRequiredDescription
payloadEmployeeStatusYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
statusIdint:Signed32YesKey property 'StatusId' (Edm.Int32)
headersmap|string|string[]|}NoHeaders to be sent with the request
queriesGetEmployeeStatusQueriesNo$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:

NameTypeRequiredDescription
statusIdint:Signed32YesKey property 'StatusId' (Edm.Int32)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
statusIdint:Signed32YesKey property 'StatusId' (Edm.Int32)
payloadEmployeeStatusYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersListEmployeeTransfersHeadersNoHeaders to be sent with the request
queriesListEmployeeTransfersQueriesNoOData 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:

NameTypeRequiredDescription
payloadEmployeeTransferYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
transferIDint:Signed32YesKey property 'TransferID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders to be sent with the request
queriesGetEmployeeTransfersQueriesNo$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:

NameTypeRequiredDescription
transferIDint:Signed32YesKey property 'TransferID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
transferIDint:Signed32YesKey property 'TransferID' (Edm.Int32)
payloadEmployeeTransferYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersListEmploymentCategorysHeadersNoHeaders to be sent with the request
queriesListEmploymentCategorysQueriesNoOData 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:

NameTypeRequiredDescription
payloadEmploymentCategoryYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
headersmap|string|string[]|}NoHeaders to be sent with the request
queriesGetEmploymentCategorysQueriesNo$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:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
payloadEmploymentCategoryYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersListEmployeeIDTypeHeadersNoHeaders to be sent with the request
queriesListEmployeeIDTypeQueriesNoOData 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:

NameTypeRequiredDescription
payloadEmployeeIDTypeYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
iDTypestringYesKey property 'IDType' (Edm.String)
headersmap|string|string[]|}NoHeaders to be sent with the request
queriesGetEmployeeIDTypeQueriesNo$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:

NameTypeRequiredDescription
iDTypestringYesKey property 'IDType' (Edm.String)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
iDTypestringYesKey property 'IDType' (Edm.String)
payloadEmployeeIDTypeYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersListEmployeeImagesHeadersNoHeaders to be sent with the request
queriesListEmployeeImagesQueriesNoOData 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:

NameTypeRequiredDescription
payloadEmployeeImageYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
employeeNoint:Signed32YesKey property 'EmployeeNo' (Edm.Int32)
headersmap|string|string[]|}NoHeaders to be sent with the request
queriesGetEmployeeImagesQueriesNo$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:

NameTypeRequiredDescription
employeeNoint:Signed32YesKey property 'EmployeeNo' (Edm.Int32)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
employeeNoint:Signed32YesKey property 'EmployeeNo' (Edm.Int32)
payloadEmployeeImageYesRequest payload
headersmap|string|string[]|}NoHeaders to be sent with the request

Returns: error?

Sample code:

check humanResourcesClient->updateEmployeeImages(101, {Picture: 2});

Teams

listTeams

Queries the Teams collection.

Parameters:

NameTypeRequiredDescription
headersListTeamsHeadersNoHeaders to be sent with the request
queriesListTeamsQueriesNoOData 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:

NameTypeRequiredDescription
payloadTeamYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
teamIDint:Signed32YesKey property 'TeamID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders to be sent with the request
queriesGetTeamsQueriesNo$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:

NameTypeRequiredDescription
teamIDint:Signed32YesKey property 'TeamID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
teamIDint:Signed32YesKey property 'TeamID' (Edm.Int32)
payloadTeamYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersListGendersHeadersNoHeaders to be sent with the request
queriesListGendersQueriesNoOData 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:

NameTypeRequiredDescription
payloadGenderYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
headersmap|string|string[]|}NoHeaders to be sent with the request
queriesGetGendersQueriesNo$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:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
payloadGenderYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersListTerminationReasonHeadersNoHeaders to be sent with the request
queriesListTerminationReasonQueriesNoOData 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:

NameTypeRequiredDescription
payloadTerminationReasonYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
reasonIDint:Signed32YesKey property 'ReasonID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders to be sent with the request
queriesGetTerminationReasonQueriesNo$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:

NameTypeRequiredDescription
reasonIDint:Signed32YesKey property 'ReasonID' (Edm.Int32)
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
reasonIDint:Signed32YesKey property 'ReasonID' (Edm.Int32)
payloadTerminationReasonYesRequest payload
headersmap|string|string[]|}NoHeaders 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:

NameTypeRequiredDescription
headersmap|string|string[]|}NoHeaders 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();