Actions
The ballerinax/sap.successfactors.ecemploymentinformation package exposes the following clients:
Available clients:
| Client | Purpose |
|---|---|
Client | Manages ecemploymentinformation objects: EmpBeneficiary, EmpEmployment, EmpEmploymentTermination, EmpPensionPayout, EmpWorkPermit, EmpJobRelationships, EmpJob, PersonEmpTerminationInfo…, over the SAP SuccessFactors OData v2 API. |
Client
You can use these APIs to access the employment related information, including job information, employment termination, and work permit.
Configuration
ConnectionConfig
Provides a set of configurations for controlling the behaviours when communicating with the SAP SuccessFactors OData endpoint. Passed as the argument to the client initializer.
| Field | Type | Default | Description |
|---|---|---|---|
auth | http:CredentialsConfig | Required | Configurations related to client authentication |
httpVersion | http:HttpVersion | See default | The HTTP version understood by the client |
http1Settings | http:ClientHttp1Settings | See default | Configurations related to HTTP/1.x protocol |
http2Settings | http:ClientHttp2Settings | See default | Configurations related to HTTP/2 protocol |
timeout | decimal | See default | The maximum time to wait (in seconds) for a response before closing the connection |
forwarded | string | See default | The choice of setting forwarded/x-forwarded header |
followRedirects | http:FollowRedirects | Optional | Configurations associated with Redirection |
poolConfig | http:PoolConfiguration | Optional | Configurations associated with request pooling |
cache | http:CacheConfig | See default | HTTP caching related configurations |
compression | http:Compression | See default | Specifies the way of handling compression (accept-encoding) header |
circuitBreaker | http:CircuitBreakerConfig | Optional | Configurations associated with the behaviour of the Circuit Breaker |
retryConfig | http:RetryConfig | Optional | Configurations associated with retrying |
cookieConfig | http:CookieConfig | Optional | Configurations associated with cookies |
responseLimits | http:ResponseLimitConfigs | See default | Configurations associated with inbound response size limits |
secureSocket | http:ClientSecureSocket | Optional | SSL/TLS-related options |
proxy | http:ProxyConfig | Optional | Proxy server related options |
socketConfig | http:ClientSocketConfig | See default | Provides settings related to client socket configuration |
validation | boolean | See default | Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default |
laxDataBinding | boolean | See default | Enables relaxed data binding on the client side. When enabled, nil values are treated as optional, and absent fields are handled as nilable types. Enabled by default. |
The client also accepts a hostname string parameter (the SAP SuccessFactors API server host) and an optional port (defaults to 443).
Initializing the client
import ballerinax/sap.successfactors.ecemploymentinformation;
configurable string hostname = ?;
configurable string username = ?;
configurable string password = ?;
ecemploymentinformation:Client client = check new (
{
auth: { username, password }
},
hostname
);
Operations
EmpBeneficiary
listEmpBeneficiaries
Queries the EmpBeneficiary collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListEmpBeneficiariesQueries | No | Queries to be sent with the request |
Returns: ListEmpBeneficiariesResponse|error
Sample code:
ListEmpBeneficiariesResponse result = check client->listEmpBeneficiaries();
Sample response:
{
"d": {
"results": [
{
"employmentNav": {},
"personIdExternal": "1000",
"userId": "1000"
}
]
}
}
getEmpBeneficiary
Retrieves a single EmpBeneficiary entity identified by its key property.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | key: userId |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetEmpBeneficiaryQueries | No | Queries to be sent with the request |
Returns: EmpBeneficiary_1|error
Sample code:
EmpBeneficiary_1 result = check client->getEmpBeneficiary(userId);
Sample response:
{
"d": {
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
},
"personIdExternal": "1000",
"userId": "1000"
}
}
EmpEmployment
listEmpEmployments
Queries the EmpEmployment collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListEmpEmploymentsQueries | No | Queries to be sent with the request |
Returns: ListEmpEmploymentsResponse|error
Sample code:
ListEmpEmploymentsResponse result = check client->listEmpEmployments();
Sample response:
{
"d": {
"results": [
{
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
}
]
}
}
getEmpEmployment
Retrieves a single EmpEmployment entity identified by its key properties.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
personIdExternal | string | Yes | key: personIdExternal |
userId | string | Yes | key: userId |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetEmpEmploymentQueries | No | Queries to be sent with the request |
Returns: EmpEmployment_1|error
Sample code:
EmpEmployment_1 result = check client->getEmpEmployment(personIdExternal, userId);
Sample response:
{
"d": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {
"employmentNav": {},
"personIdExternal": "1000",
"userId": "1000"
},
"empJobRelationshipNav": {
"results": []
},
"empPensionPayoutNav": {
"employmentNav": {},
"personIdExternal": "1000",
"userId": "1000"
},
"empWorkPermitNav": {
"results": []
},
"jobInfoNav": {
"results": []
}
}
}
EmpEmploymentTermination
listEmpEmploymentTerminations
Queries the EmpEmploymentTermination collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListEmpEmploymentTerminationsQueries | No | Queries to be sent with the request |
Returns: ListEmpEmploymentTerminationsResponse|error
Sample code:
ListEmpEmploymentTerminationsResponse result = check client->listEmpEmploymentTerminations();
Sample response:
{
"d": {
"results": [
{
"endDate": "2026-01-01",
"personIdExternal": "1000",
"userId": "1000",
"employmentNav": {},
"jobInfoNav": {}
}
]
}
}
getEmpEmploymentTermination
Retrieves a single EmpEmploymentTermination entity identified by its key properties.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
endDate | string | Yes | key: endDate |
personIdExternal | string | Yes | key: personIdExternal |
userId | string | Yes | key: userId |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetEmpEmploymentTerminationQueries | No | Queries to be sent with the request |
Returns: EmpEmploymentTermination_1|error
Sample code:
EmpEmploymentTermination_1 result = check client->getEmpEmploymentTermination(endDate, personIdExternal, userId);
Sample response:
{
"d": {
"endDate": "2026-01-01",
"personIdExternal": "1000",
"userId": "1000",
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
},
"jobInfoNav": {
"seqNumber": "string",
"startDate": "2026-01-01",
"userId": "1000",
"employmentNav": {},
"managerEmploymentNav": {}
}
}
}
EmpPensionPayout
listEmpPensionPayouts
Queries the EmpPensionPayout collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListEmpPensionPayoutsQueries | No | Queries to be sent with the request |
Returns: ListEmpPensionPayoutsResponse|error
Sample code:
ListEmpPensionPayoutsResponse result = check client->listEmpPensionPayouts();
Sample response:
{
"d": {
"results": [
{
"employmentNav": {},
"personIdExternal": "1000",
"userId": "1000"
}
]
}
}
getEmpPensionPayout
Retrieves a single EmpPensionPayout entity identified by its key property.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | key: userId |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetEmpPensionPayoutQueries | No | Queries to be sent with the request |
Returns: EmpPensionPayout_1|error
Sample code:
EmpPensionPayout_1 result = check client->getEmpPensionPayout(userId);
Sample response:
{
"d": {
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
},
"personIdExternal": "1000",
"userId": "1000"
}
}
EmpWorkPermit
listEmpWorkPermits
Queries the EmpWorkPermit collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListEmpWorkPermitsQueries | No | Queries to be sent with the request |
Returns: ListEmpWorkPermitsResponse|error
Sample code:
ListEmpWorkPermitsResponse result = check client->listEmpWorkPermits();
Sample response:
{
"d": {
"results": [
{
"country": "string",
"documentNumber": "string",
"documentType": "string",
"userId": "1000",
"employmentNav": {}
}
]
}
}
getEmpWorkPermit
Retrieves a single EmpWorkPermit entity identified by its key properties.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
country | string | Yes | key: country |
documentNumber | string | Yes | key: documentNumber |
documentType | string | Yes | key: documentType |
userId | string | Yes | key: userId |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetEmpWorkPermitQueries | No | Queries to be sent with the request |
Returns: EmpWorkPermit_1|error
Sample code:
EmpWorkPermit_1 result = check client->getEmpWorkPermit(country, documentNumber, documentType, userId);
Sample response:
{
"d": {
"country": "string",
"documentNumber": "string",
"documentType": "string",
"userId": "1000",
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
}
}
}
EmpJobRelationships
listEmpJobRelationshipss
Queries the EmpJobRelationships collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListEmpJobRelationshipssQueries | No | Queries to be sent with the request |
Returns: ListEmpJobRelationshipssResponse|error
Sample code:
ListEmpJobRelationshipssResponse result = check client->listEmpJobRelationshipss();
Sample response:
{
"d": {
"results": [
{
"relationshipType": "string",
"startDate": "2026-01-01",
"userId": "1000",
"employmentNav": {},
"relEmploymentNav": {}
}
]
}
}
getEmpJobRelationships
Retrieves a single EmpJobRelationships entity identified by its key properties.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
relationshipType | string | Yes | key: relationshipType |
startDate | string | Yes | key: startDate |
userId | string | Yes | key: userId |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetEmpJobRelationshipsQueries | No | Queries to be sent with the request |
Returns: EmpJobRelationships_1|error
Sample code:
EmpJobRelationships_1 result = check client->getEmpJobRelationships(relationshipType, startDate, userId);
Sample response:
{
"d": {
"relationshipType": "string",
"startDate": "2026-01-01",
"userId": "1000",
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
},
"relEmploymentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
}
}
}
EmpJob
listEmpJobs
Queries the EmpJob collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListEmpJobsQueries | No | Queries to be sent with the request |
Returns: ListEmpJobsResponse|error
Sample code:
ListEmpJobsResponse result = check client->listEmpJobs();
Sample response:
{
"d": {
"results": [
{
"seqNumber": "string",
"startDate": "2026-01-01",
"userId": "1000",
"employmentNav": {},
"managerEmploymentNav": {}
}
]
}
}
getEmpJob
Retrieves a single EmpJob entity identified by its key properties.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
seqNumber | int | Yes | key: seqNumber |
startDate | string | Yes | key: startDate |
userId | string | Yes | key: userId |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetEmpJobQueries | No | Queries to be sent with the request |
Returns: EmpJob_1|error
Sample code:
EmpJob_1 result = check client->getEmpJob(seqNumber, startDate, userId);
Sample response:
{
"d": {
"seqNumber": "string",
"startDate": "2026-01-01",
"userId": "1000",
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
},
"managerEmploymentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
}
}
}
PersonEmpTerminationInfo
listPersonEmpTerminationInfos
Queries the PersonEmpTerminationInfo collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListPersonEmpTerminationInfosQueries | No | Queries to be sent with the request |
Returns: ListPersonEmpTerminationInfosResponse|error
Sample code:
ListPersonEmpTerminationInfosResponse result = check client->listPersonEmpTerminationInfos();
Sample response:
{
"d": {
"results": [
{
"personIdExternal": "1000"
}
]
}
}
getPersonEmpTerminationInfo
Retrieves a single PersonEmpTerminationInfo entity identified by its key property.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
personIdExternal | string | Yes | key: personIdExternal |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetPersonEmpTerminationInfoQueries | No | Queries to be sent with the request |
Returns: PersonEmpTerminationInfo_1|error
Sample code:
PersonEmpTerminationInfo_1 result = check client->getPersonEmpTerminationInfo(personIdExternal);
Sample response:
{
"d": {
"personIdExternal": "1000"
}
}
HireDateChange
listHireDateChanges
Queries the HireDateChange collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListHireDateChangesQueries | No | Queries to be sent with the request |
Returns: ListHireDateChangesResponse|error
Sample code:
ListHireDateChangesResponse result = check client->listHireDateChanges();
Sample response:
{
"d": {
"results": [
{
"code": "1000"
}
]
}
}
createHireDateChange
Creates a new HireDateChange entity from the supplied payload.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | HireDateChange | Yes | New entity |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: CreatedHireDateChange|error
Sample code:
CreatedHireDateChange result = check client->createHireDateChange(payload);
Sample response:
{
"d": {
"code": "1000"
}
}
getHireDateChange
Retrieves a single HireDateChange entity identified by its key property.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | key: code |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetHireDateChangeQueries | No | Queries to be sent with the request |
Returns: HireDateChange_1|error
Sample code:
HireDateChange_1 result = check client->getHireDateChange(code);
Sample response:
{
"d": {
"code": "1000"
}
}
deleteHireDateChange
Deletes the HireDateChange identified by its key property.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | key: code |
headers | DeleteHireDateChangeHeaders | No | Headers to be sent with the request |
Returns: error?
Sample code:
check client->deleteHireDateChange(code);