Skip to main content

Actions

The ballerinax/sap.successfactors.ecpayrolltimesheets package exposes the following clients:

Available clients:

ClientPurpose
ClientManages ecpayrolltimesheets objects: EmployeeTimeSheet, ExternalAllowance, TimeCollector, ExternalTimeRecord, ExternalTimeData, DataReplicationProxy, EmployeeTimeSheetEntry, EmployeeTimeValuationResult…, over the SAP SuccessFactors OData v2 API.

Client​

API to record employee attendances, overtime, on-call times, and allowances

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.

FieldTypeDefaultDescription
authhttp:CredentialsConfigRequiredConfigurations related to client authentication
httpVersionhttp:HttpVersionSee defaultThe HTTP version understood by the client
http1Settingshttp:ClientHttp1SettingsSee defaultConfigurations related to HTTP/1.x protocol
http2Settingshttp:ClientHttp2SettingsSee defaultConfigurations related to HTTP/2 protocol
timeoutdecimalSee defaultThe maximum time to wait (in seconds) for a response before closing the connection
forwardedstringSee defaultThe choice of setting forwarded/x-forwarded header
followRedirectshttp:FollowRedirectsOptionalConfigurations associated with Redirection
poolConfighttp:PoolConfigurationOptionalConfigurations associated with request pooling
cachehttp:CacheConfigSee defaultHTTP caching related configurations
compressionhttp:CompressionSee defaultSpecifies the way of handling compression (accept-encoding) header
circuitBreakerhttp:CircuitBreakerConfigOptionalConfigurations associated with the behaviour of the Circuit Breaker
retryConfighttp:RetryConfigOptionalConfigurations associated with retrying
cookieConfighttp:CookieConfigOptionalConfigurations associated with cookies
responseLimitshttp:ResponseLimitConfigsSee defaultConfigurations associated with inbound response size limits
secureSockethttp:ClientSecureSocketOptionalSSL/TLS-related options
proxyhttp:ProxyConfigOptionalProxy server related options
socketConfighttp:ClientSocketConfigSee defaultProvides settings related to client socket configuration
validationbooleanSee defaultEnables the inbound payload validation functionality which provided by the constraint package. Enabled by default
laxDataBindingbooleanSee defaultEnables 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.ecpayrolltimesheets;

configurable string hostname = ?;
configurable string username = ?;
configurable string password = ?;

ecpayrolltimesheets:Client client = check new (
{
auth: { username, password }
},
hostname
);

Operations​

EmployeeTimeSheet​

listEmployeeTimeSheets

Queries the EmployeeTimeSheet collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmployeeTimeSheetsQueriesNoQueries to be sent with the request

Returns: ListEmployeeTimeSheetsResponse&#124;error

Sample code:

ListEmployeeTimeSheetsResponse result = check client->listEmployeeTimeSheets();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000",
"allowance": {},
"employeeTimeSheetEntry": {},
"employeeTimeValuationResult": {},
"replacedByNav": {},
"replacesNav": {}
}
]
}
}
getEmployeeTimeSheet

Retrieves a single EmployeeTimeSheet entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmployeeTimeSheetQueriesNoQueries to be sent with the request

Returns: EmployeeTimeSheet_1&#124;error

Sample code:

EmployeeTimeSheet_1 result = check client->getEmployeeTimeSheet(externalCode);

Sample response:

{
"d": {
"externalCode": "1000",
"allowance": {
"results": []
},
"employeeTimeSheetEntry": {
"results": []
},
"employeeTimeValuationResult": {
"results": []
},
"replacedByNav": {},
"replacesNav": {}
}
}

ExternalAllowance​

listExternalAllowances

Queries the ExternalAllowance collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListExternalAllowancesQueriesNoQueries to be sent with the request

Returns: ListExternalAllowancesResponse&#124;error

Sample code:

ListExternalAllowancesResponse result = check client->listExternalAllowances();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000"
}
]
}
}
createExternalAllowance

Creates a new ExternalAllowance entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
payloadExternalAllowanceYesNew entity
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CreatedExternalAllowance&#124;error

Sample code:

CreatedExternalAllowance result = check client->createExternalAllowance(payload);

Sample response:

{
"d": {
"externalCode": "1000"
}
}
getExternalAllowance

Retrieves a single ExternalAllowance entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetExternalAllowanceQueriesNoQueries to be sent with the request

Returns: ExternalAllowance_1&#124;error

Sample code:

ExternalAllowance_1 result = check client->getExternalAllowance(externalCode);

Sample response:

{
"d": {
"externalCode": "1000"
}
}
updateExternalAllowance

Updates the ExternalAllowance identified by its key property with the supplied payload.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
payloadModifiedExternalAllowanceYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateExternalAllowance(externalCode, payload);
deleteExternalAllowance

Deletes the ExternalAllowance identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersDeleteExternalAllowanceHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteExternalAllowance(externalCode);

TimeCollector​

listTimeCollectors

Queries the TimeCollector collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListTimeCollectorsQueriesNoQueries to be sent with the request

Returns: ListTimeCollectorsResponse&#124;error

Sample code:

ListTimeCollectorsResponse result = check client->listTimeCollectors();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000"
}
]
}
}
getTimeCollector

Retrieves a single TimeCollector entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetTimeCollectorQueriesNoQueries to be sent with the request

Returns: TimeCollector_1&#124;error

Sample code:

TimeCollector_1 result = check client->getTimeCollector(externalCode);

Sample response:

{
"d": {
"externalCode": "1000"
}
}

ExternalTimeRecord​

listExternalTimeRecords

Queries the ExternalTimeRecord collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListExternalTimeRecordsQueriesNoQueries to be sent with the request

Returns: ListExternalTimeRecordsResponse&#124;error

Sample code:

ListExternalTimeRecordsResponse result = check client->listExternalTimeRecords();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000",
"externalTimeSegments": {}
}
]
}
}
createExternalTimeRecord

Creates a new ExternalTimeRecord entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
payloadExternalTimeRecordYesNew entity
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CreatedExternalTimeRecord&#124;error

Sample code:

CreatedExternalTimeRecord result = check client->createExternalTimeRecord(payload);

Sample response:

{
"d": {
"externalCode": "1000",
"externalTimeSegments": {
"results": []
}
}
}
getExternalTimeRecord

Retrieves a single ExternalTimeRecord entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetExternalTimeRecordQueriesNoQueries to be sent with the request

Returns: ExternalTimeRecord_1&#124;error

Sample code:

ExternalTimeRecord_1 result = check client->getExternalTimeRecord(externalCode);

Sample response:

{
"d": {
"externalCode": "1000",
"externalTimeSegments": {
"results": []
}
}
}
updateExternalTimeRecord

Updates the ExternalTimeRecord identified by its key property with the supplied payload.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
payloadModifiedExternalTimeRecordYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateExternalTimeRecord(externalCode, payload);
deleteExternalTimeRecord

Deletes the ExternalTimeRecord identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersDeleteExternalTimeRecordHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteExternalTimeRecord(externalCode);

ExternalTimeData​

listExternalTimeData

Queries the ExternalTimeData collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListExternalTimeDataQueriesNoQueries to be sent with the request

Returns: ListExternalTimeDataResponse&#124;error

Sample code:

ListExternalTimeDataResponse result = check client->listExternalTimeData();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000"
}
]
}
}
createExternalTimeData

Creates a new ExternalTimeData entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
payloadExternalTimeDataYesNew entity
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CreatedExternalTimeData&#124;error

Sample code:

CreatedExternalTimeData result = check client->createExternalTimeData(payload);

Sample response:

{
"d": {
"externalCode": "1000"
}
}
getExternalTimeData

Retrieves a single ExternalTimeData entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetExternalTimeDataQueriesNoQueries to be sent with the request

Returns: ExternalTimeData_1&#124;error

Sample code:

ExternalTimeData_1 result = check client->getExternalTimeData(externalCode);

Sample response:

{
"d": {
"externalCode": "1000"
}
}
updateExternalTimeData

Updates the ExternalTimeData identified by its key property with the supplied payload.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
payloadModifiedExternalTimeDataYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateExternalTimeData(externalCode, payload);
deleteExternalTimeData

Deletes the ExternalTimeData identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersDeleteExternalTimeDataHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteExternalTimeData(externalCode);

DataReplicationProxy​

listDataReplicationProxies

Queries the DataReplicationProxy collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListDataReplicationProxiesQueriesNoQueries to be sent with the request

Returns: ListDataReplicationProxiesResponse&#124;error

Sample code:

ListDataReplicationProxiesResponse result = check client->listDataReplicationProxies();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000",
"employeeTimeValuationResultNav": {}
}
]
}
}
getDataReplicationProxy

Retrieves a single DataReplicationProxy entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetDataReplicationProxyQueriesNoQueries to be sent with the request

Returns: DataReplicationProxy_1&#124;error

Sample code:

DataReplicationProxy_1 result = check client->getDataReplicationProxy(externalCode);

Sample response:

{
"d": {
"externalCode": "1000",
"employeeTimeValuationResultNav": {
"EmployeeTimeSheet_externalCode": "1000",
"externalCode": "1000"
}
}
}

EmployeeTimeSheetEntry​

listEmployeeTimeSheetEntries

Queries the EmployeeTimeSheetEntry collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmployeeTimeSheetEntriesQueriesNoQueries to be sent with the request

Returns: ListEmployeeTimeSheetEntriesResponse&#124;error

Sample code:

ListEmployeeTimeSheetEntriesResponse result = check client->listEmployeeTimeSheetEntries();

Sample response:

{
"d": {
"results": [
{
"EmployeeTimeSheet_externalCode": "1000",
"externalCode": "1000"
}
]
}
}
getEmployeeTimeSheetEntry

Retrieves a single EmployeeTimeSheetEntry entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
EmployeeTimeSheet_externalCodestringYeskey: EmployeeTimeSheet_externalCode
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmployeeTimeSheetEntryQueriesNoQueries to be sent with the request

Returns: EmployeeTimeSheetEntry_1&#124;error

Sample code:

EmployeeTimeSheetEntry_1 result = check client->getEmployeeTimeSheetEntry(EmployeeTimeSheet_externalCode, externalCode);

Sample response:

{
"d": {
"EmployeeTimeSheet_externalCode": "1000",
"externalCode": "1000"
}
}

EmployeeTimeValuationResult​

listEmployeeTimeValuationResults

Queries the EmployeeTimeValuationResult collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmployeeTimeValuationResultsQueriesNoQueries to be sent with the request

Returns: ListEmployeeTimeValuationResultsResponse&#124;error

Sample code:

ListEmployeeTimeValuationResultsResponse result = check client->listEmployeeTimeValuationResults();

Sample response:

{
"d": {
"results": [
{
"EmployeeTimeSheet_externalCode": "1000",
"externalCode": "1000"
}
]
}
}
getEmployeeTimeValuationResult

Retrieves a single EmployeeTimeValuationResult entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
EmployeeTimeSheet_externalCodestringYeskey: EmployeeTimeSheet_externalCode
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmployeeTimeValuationResultQueriesNoQueries to be sent with the request

Returns: EmployeeTimeValuationResult_1&#124;error

Sample code:

EmployeeTimeValuationResult_1 result = check client->getEmployeeTimeValuationResult(EmployeeTimeSheet_externalCode, externalCode);

Sample response:

{
"d": {
"EmployeeTimeSheet_externalCode": "1000",
"externalCode": "1000"
}
}

AllowanceRecording​

listAllowanceRecordings

Queries the AllowanceRecording collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListAllowanceRecordingsQueriesNoQueries to be sent with the request

Returns: ListAllowanceRecordingsResponse&#124;error

Sample code:

ListAllowanceRecordingsResponse result = check client->listAllowanceRecordings();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000"
}
]
}
}
getAllowanceRecording

Retrieves a single AllowanceRecording entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetAllowanceRecordingQueriesNoQueries to be sent with the request

Returns: AllowanceRecording_1&#124;error

Sample code:

AllowanceRecording_1 result = check client->getAllowanceRecording(externalCode);

Sample response:

{
"d": {
"externalCode": "1000"
}
}

AvailableAllowanceType​

listAvailableAllowanceTypes

Queries the AvailableAllowanceType collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListAvailableAllowanceTypesQueriesNoQueries to be sent with the request

Returns: ListAvailableAllowanceTypesResponse&#124;error

Sample code:

ListAvailableAllowanceTypesResponse result = check client->listAvailableAllowanceTypes();

Sample response:

{
"d": {
"results": [
{
"TimeTypeProfile_externalCode": "1000",
"TimeTypeProfile_mdfSystemEffectiveStartDate": "2026-01-01",
"externalCode": "1000"
}
]
}
}
getAvailableAllowanceType

Retrieves a single AvailableAllowanceType entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
TimeTypeProfile_externalCodestringYeskey: TimeTypeProfile_externalCode
TimeTypeProfile_mdfSystemEffectiveStartDatestringYeskey: TimeTypeProfile_mdfSystemEffectiveStartDate
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetAvailableAllowanceTypeQueriesNoQueries to be sent with the request

Returns: AvailableAllowanceType&#124;error

Sample code:

AvailableAllowanceType result = check client->getAvailableAllowanceType(TimeTypeProfile_externalCode, TimeTypeProfile_mdfSystemEffectiveStartDate, externalCode);

Sample response:

{
"d": {
"TimeTypeProfile_externalCode": "1000",
"TimeTypeProfile_mdfSystemEffectiveStartDate": "2026-01-01",
"externalCode": "1000"
}
}

ExternalTimeSegment​

listExternalTimeSegments

Queries the ExternalTimeSegment collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListExternalTimeSegmentsQueriesNoQueries to be sent with the request

Returns: ListExternalTimeSegmentsResponse&#124;error

Sample code:

ListExternalTimeSegmentsResponse result = check client->listExternalTimeSegments();

Sample response:

{
"d": {
"results": [
{
"ExternalTimeRecord_externalCode": "1000",
"externalCode": "1000"
}
]
}
}
createExternalTimeSegment

Creates a new ExternalTimeSegment entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
payloadExternalTimeSegmentYesNew entity
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CreatedExternalTimeSegment&#124;error

Sample code:

CreatedExternalTimeSegment result = check client->createExternalTimeSegment(payload);

Sample response:

{
"d": {
"ExternalTimeRecord_externalCode": "1000",
"externalCode": "1000"
}
}
getExternalTimeSegment

Retrieves a single ExternalTimeSegment entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
ExternalTimeRecord_externalCodestringYeskey: ExternalTimeRecord_externalCode
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetExternalTimeSegmentQueriesNoQueries to be sent with the request

Returns: ExternalTimeSegment_1&#124;error

Sample code:

ExternalTimeSegment_1 result = check client->getExternalTimeSegment(ExternalTimeRecord_externalCode, externalCode);

Sample response:

{
"d": {
"ExternalTimeRecord_externalCode": "1000",
"externalCode": "1000"
}
}
updateExternalTimeSegment

Updates the ExternalTimeSegment identified by its key properties with the supplied payload.

Parameters:

NameTypeRequiredDescription
ExternalTimeRecord_externalCodestringYeskey: ExternalTimeRecord_externalCode
externalCodestringYeskey: externalCode
payloadModifiedExternalTimeSegmentYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateExternalTimeSegment(ExternalTimeRecord_externalCode, externalCode, payload);
deleteExternalTimeSegment

Deletes the ExternalTimeSegment identified by its key properties.

Parameters:

NameTypeRequiredDescription
ExternalTimeRecord_externalCodestringYeskey: ExternalTimeRecord_externalCode
externalCodestringYeskey: externalCode
headersDeleteExternalTimeSegmentHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteExternalTimeSegment(ExternalTimeRecord_externalCode, externalCode);

TimeRecording​

listTimeRecordings

Queries the TimeRecording collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListTimeRecordingsQueriesNoQueries to be sent with the request

Returns: ListTimeRecordingsResponse&#124;error

Sample code:

ListTimeRecordingsResponse result = check client->listTimeRecordings();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000"
}
]
}
}
getTimeRecording

Retrieves a single TimeRecording entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetTimeRecordingQueriesNoQueries to be sent with the request

Returns: TimeRecording_1&#124;error

Sample code:

TimeRecording_1 result = check client->getTimeRecording(externalCode);

Sample response:

{
"d": {
"externalCode": "1000"
}
}

Allowance​

listAllowances

Queries the Allowance collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListAllowancesQueriesNoQueries to be sent with the request

Returns: ListAllowancesResponse&#124;error

Sample code:

ListAllowancesResponse result = check client->listAllowances();

Sample response:

{
"d": {
"results": [
{
"EmployeeTimeSheet_externalCode": "1000",
"externalCode": "1000"
}
]
}
}
getAllowance

Retrieves a single Allowance entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
EmployeeTimeSheet_externalCodestringYeskey: EmployeeTimeSheet_externalCode
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetAllowanceQueriesNoQueries to be sent with the request

Returns: Allowance_1&#124;error

Sample code:

Allowance_1 result = check client->getAllowance(EmployeeTimeSheet_externalCode, externalCode);

Sample response:

{
"d": {
"EmployeeTimeSheet_externalCode": "1000",
"externalCode": "1000"
}
}