The Business Problem
In many organizations, offer letters must present a full salary breakdown — Cost to Company (CTC), Basic salary, HRA, and Special Allowance — each derived from the gross CTC using pre-defined calculation logic. SmartRecruiter, as a standard product, does not natively support this on-the-fly salary computation. Recruiting stakeholders are left to manually populate individual salary components, which introduces risk of error and inconsistency.
The requirement is straightforward: when a recruiter enters the CTC for a candidate, the system should automatically calculate the salary components and pre-populate the offer fields — without any manual intervention and without a custom build inside SmartRecruiter.
Solution Overview
The solution leverages the Webhook capability native to SmartRecruiter and the orchestration power of SAP Integration Suite. The approach is event-driven: when a recruiter updates the CTC field (or moves a candidate to the next stage), a webhook fires and triggers an integration flow in CPI that performs the salary calculation and upserts the results back to SmartRecruiter via REST APIs.
Webhook Setup
Two webhook events are subscribed to in SmartRecruiter to cover both update scenarios:
- application.fields.updated — fires when a field value on an application is changed
- application.status.updated — fires when the candidate is moved to a new stage
Either event reliably signals that the CTC may have been updated and that the calculation should run. The webhook payload carries the candidate ID and job requisition ID, which are used as keys in subsequent API call
Step 1 — Configuration in SmartRecruiter
Custom Application Fields
CTC –
HRA –
Similarly define other pay components required for calculations –
CTC as application field.
Rest of pay components as offer fields.
For ex – Four custom fields are configured in SmartRecruiter to hold the salary components:
- CTC — Gross Cost to Company (input field; marked as mandatory for the recruiter to populate)
- HRA — House Rent Allowance (output; auto-populated via CPI)
- Basic — Basic Salary (output; auto-populated via CPI)
- Special Allowance — (output; auto-populated via CPI)
Since CTC is the trigger field, it is set as mandatory. The recruiting stakeholder is instructed to update CTC either at the application stage or when moving the candidate to the offer stage.
Recruiting stakeholder fills the value of CTC field –
Step 2 — Retrieving the CTC Value from SmartRecruiter
How Fields Are Stored in SmartRecruiter
In SmartRecruiter, custom fields are represented as candidate properties — effectively key-value pairs attached to the candidate entity. Each field has a unique Property ID (UUID) that is referenced in API calls.
Retrieving Candidate Properties
To retrieve all property values for a candidate, including the CTC field, the following GET request is used:
How to retrieve the CTC value –
Step 3 — Salary Calculation in SAP Integration Suite (CPI)
Once the webhook fires and the CPI iFlow is triggered, the integration flow performs the following sequence:
- Extracts the candidate ID and job requisition ID from the webhook payload
- Calls the SmartRecruiter properties API to fetch the current CTC value for the candidate
- Applies the pre-configured salary calculation logic within the Groovy script or message mapping step in CPI
- Derives HRA, Basic, and Special Allowance values from the CTC
- Prepares the upsert payload with the computed values
Integration Note
The calculation logic (e.g., percentage splits for HRA, Basic, Special Allowance) is externalized in CPI and can be adjusted without touching SmartRecruiter configuration. This keeps the business rules in a governed, version-controlled integration layer.
Step 4 — Upserting Calculated Values Back to SmartRecruiter
With the calculated salary components ready, CPI writes the values back to the SmartRecruiter candidate record using a PUT/PATCH call scoped to both the candidate and the specific job requisition:
The payload specifies each Property ID and its newly calculated value. All three output fields — HRA, Basic, and Special Allowance — are upserted in a single call.
Step 5 — Verifying the Results
After the upsert, a GET call to the candidate properties endpoint confirms that the calculated values are now stored correctly:
Step 6 — Creating the Offer in SmartRecruiter
Once the candidate properties are populated, the recruiter proceeds to create the formal offer letter inside SmartRecruiter. Because the salary components have already been written to the candidate record, the offer template picks them up automatically — the recruiter sees pre-populated values for all compensation fields, including Special Allowance, without any manual calculation.
Handling Renegotiation Scenarios
Real-world recruiting frequently involves renegotiation. If a candidate requests a revised offer, the flow handles this gracefully:
- The candidate is moved back to the Offered stage (this can be done programmatically via the SmartRecruiter API)
- The recruiting stakeholder updates the CTC value
- The stage change or field update automatically fires the webhook again
- CPI recalculates all salary components and upserts the new values to SmartRecruiter
- A new offer is created with the revised compensation breakdown
Key Benefit
The renegotiation cycle is entirely self-service for the recruiter — no integration team involvement is needed after the initial setup. Simply updating the CTC triggers the full recalculation automatically.
Conclusion
SmartRecruiter's gap in automated salary calculation for offer letters is fully addressable through a lightweight, event-driven integration pattern using SAP Integration Suite (CPI). The solution is non-invasive — it requires no customization of SmartRecruiter beyond standard field configuration and webhook setup — and it delivers a seamless recruiter experience.
Key takeaways from this implementation:
- SmartRecruiter Webhooks provide a reliable event trigger for real-time integration
- Candidate fields are accessible as properties via standard REST APIs
- SAP Integration Suite (CPI) serves as the calculation engine, keeping business rules externalized and maintainable
- The upsert API allows CPI to write back computed values directly to SmartRecruiter offer fields
- The pattern supports renegotiation cycles without manual intervention
Thanks
Kunal
Product Success
SAP RIG



