Module sap.successfactors.ecadvances
ballerinax/sap.successfactors.ecadvances Ballerina library
Overview
SAP SuccessFactors Employee Central is a comprehensive human capital management solution that helps organizations manage their workforce effectively. It provides a unified platform for HR processes including employee data management, organizational structures, and employment lifecycle management.
WSO2 SAP Successfactors Advances provides a way to interact with the SAP SuccessFactors Employee Central APIs.
Key Features
- Manage employee salary advance requests and eligibility
- Track advance accumulation and repayment schedules
- Query installment plans and advance history
Setup guide
This connector supports two authentication methods: Basic Authentication and OAuth 2.0 SAML Bearer.
Method 1: Basic Authentication
If you already have a username and password for this integration to work, you can use those directly. If you'd rather create a new account with narrowed scope for this integration, follow these steps:
- Sign in to your SAP SuccessFactors instance as an administrator.
- Navigate to Admin Center > Add New Employee and create a new user account for this integration.
- Navigate to Admin Center > Manage Permission Roles, create a role scoped to only the permissions this integration needs, and grant it to the new user.
- Navigate to Admin Center > Reset User Password and set a password for the new user account.
In either case, you will also need the API server hostname for your SuccessFactors region, for example,
api12.successfactors.eu. The complete list of API server hostnames by region is available in the
SAP SuccessFactors API documentation.
Method 2: OAuth 2.0 SAML Bearer
Step 1: Generate a key pair and certificate
-
Generate an RSA key pair and a matching X.509 certificate. If you don't already have one, generate a self-signed pair with OpenSSL:
openssl req -x509 -newkey rsa:2048 -keyout private_key.pem -out certificate.pem -days 365 -nodes -subj "/CN=YourAppName"private_key.pemis secret - it never leaves your machine or gets uploaded anywhere. Onlycertificate.pemis registered with SAP.
Step 2: Register an OAuth2 client application
-
Sign in to your SAP SuccessFactors instance as an administrator.
-
Search for Manage OAuth2 Client Applications in Admin Center's action search, or navigate to it directly under Admin Center > Company Settings.

-
Choose Register Client Application and provide the following information:
Field Description Application Name A name to identify this integration Description An optional description X.509 Certificate The contents of certificate.pemas a single continuous base64 string, with the-----BEGIN CERTIFICATE-----/-----END CERTIFICATE-----lines and line breaks removed. Produce this withawk '/BEGIN CERTIFICATE/{flag=1;next}/END CERTIFICATE/{flag=0}flag' certificate.pem | tr -d '\n'and paste the single line of output it prints. -
Choose Register to save the application.
Step 3: Note your credentials
After registering, open the application (choose View from the application list) to find the Company ID and the API Key SAP assigned to it.

You now have everything sap:SamlBearerAuthConfig needs:
- apiKey - the API Key from the application you just registered
- companyId - the Company ID shown on the same screen
- username - the SAP user to authenticate as
- privateKey - the path to your
private_key.pemfile - certificate - the path to your
certificate.pemfile, or its content - tokenUrl - your Admin Center's OAuth2 token endpoint, typically
https://<admin-center-host>/oauth/token
Quickstart
To use the sap.successfactors.ecadvances connector in your Ballerina application, modify the .bal file as follows:
Step 1: Import the module
Import the sap.successfactors.ecadvances module.
import ballerinax/sap.successfactors.ecadvances as advances;
Step 2: Instantiate a new connector
Use the hostname and credentials to initiate a client.
configurable string hostname = ?; configurable string username = ?; configurable string password = ?; advances:Client advancesClient = check new ( { auth: { username, password } }, hostname );
Step 3: Invoke the connector operation
Now, utilize the available connector operations.
advances:AdvancesInstallmentsWrapper result = check advancesClient->listAdvancesInstallmentss();
Step 4: Run the Ballerina application
bal run
Examples
The SAP SuccessFactors Employee Central Ballerina connectors provide practical examples illustrating usage in various scenarios. Explore these examples, covering use cases like syncing employee data and sending notifications.
-
Google Sheets to SuccessFactors - Read employee records from a Google Sheets roster and create Personal Information records in SuccessFactors.
-
SuccessFactors to Slack - Poll SuccessFactors for newly onboarded employees and send welcome notifications to a Slack channel.