Get UW Rules Result API
Use this API to get underwriting (UW) decision results, such as:
-
underwriting decision results from the UW rules (formula) attached to an insurance product,
-
underwriting decision results from the UW rules (formula) attached to different insurance product items (coverages).
-
the UW result that was valid at a certain date, for a specified insurance product, or product item (coverage).
The FTOS_IP_GetUWRulesResultAPI endpoint runs the UW formulas assigned to each product, or product item (coverage), simulating the Test Scenario functionality - available for users in Innovation Studio.
The results are in line with the Underwriting Type set at the product level. An insurance product can have the underwriting type set either to
perProduct
or perCoverage
. For a valid API request, include all the formula Input Keys expected by the Business Formulas engine, for each underwriting Context Type (see below). When needed, use the Validity Date key to get the underwriting decision result that was valid at that date, for the specified product, or product item (coverage).
All the requests through this API and their responses can be saved into the FTOS_IP_ProductInterogationHistory entity. This action is available if the system parameter FTOS_IP_ProductInterogationHistory_Enablelog value is set to 1.
A user makes a call for the underwriting decision result for an insurance coverage, based on the code of the insurance product. The user wants the decision which was valid at a certain date - respectively, 2021-05-21.
let p = { "productCode": "HH01", "validityDate": "2021-05-21", "sourceRecordName": "P7856", "sourceRecordId": "0AFE8D0B-F423-44F4-9638-DEE696BF0B0E", "uwRulesDetails": [{ "contextType": "Underwriting", "itemCode":"HA01", // this key is not available for uw type = per product "details": { "resistanceStructure": "Metal", "usageType": "Main residence", "constructionYear": 2000, "coverage": "Content", "insuredAmount": 200000 } }]
}; ebs.callActionByNameAsync("FTOS_IP_GetUWRulesResultAPI", p).then(function(e) { console.log(e)
})
The following data parameters must be included in the request:
Parameter | Description |
---|---|
contextType | The context type object key needed to run the UW formula. (The context type defined for that UW formula - for example: underwriting, medical underwriting, pet underwriting etc.) |
details | An object containing different keys needed to run the UW formula. The object structure is used to test the UW formula. The structure can be different for each product, or product item (coverage), based on the formula configuration. |
itemCode | The item code - this key is not available for products that have perProduct UW type. |
productCode | The code of the Insurance Product. |
sourceRecordId | The Id of the record that the system is calculating the premium for. |
sourceRecordName | Text identifying the record that the system is calculating the premium for. |
uwRulesDetails | An array with object keys, described below. |
validityDate | The reference date, prior to the current date, for getting an earlier version of the formulas structure, for the specified product. This key is not mandatory. When it is not provided, the API calls the current version of the formula. Accepted formats are: yyyy-mm-dd, dd/mm/yyyy, dd-mm-yyyy, or dd.mm.yyyy. |
This is an example of a response:
{ "isSuccess": true, "errorMessage": null, "errorCode": null, "result": [ { "contexType": "Underwriting", "itemCode":"HA01", // this key is not available for uw type = per product, "finalDecision": "Passed" // result of the formula "decision": { "resistanceStructure": "Metal", "usageType": "Main residence", "constructionYear": 2000.0, "coverage": "Content", "insuredAmount": 200000.0, "uwBuildingSumInsured": "Passed", "uwConstructionYyear": "Passed", "uwResistanceStructure": "Passed", "uwUsageType": "Passed", "uwDecision": "Passed" } } ]
}
Key | Description |
---|---|
Error code | Error code. |
Error message | Error message. |
isSuccess | Marks whether the request was successful or not. |
result | Array of objects containing details about the UW decision results. |
contextType | The context type defined for that UW formula - for example: underwriting, medical underwriting, pet underwriting etc. |
itemCode | The item code - this key is not available for products that have perProduct UW type. |
finalDecision | Final result of the UW formula |
decision | The result details returned after running the UW formula. |
The following are the error messages that can be encountered while calling the Get UW Rules API:
Code | Text | Description |
---|---|---|
ERR.IP.50101 |
ERR.IP.50101 - Invalid validityDate format! Please use yyyy-mm-dd or dd/mm/yyyy or dd-mm-yyyy or dd.mm.yyyy! |
Invalid date format for validityDate input parameter. |
ERR.IP.50102 |
ERR.IP.50102 - Invalid validityDate! |
Invalid date for validityDate input parameter. |
ERR.IP.50103 |
ERR.IP.50103 - Invalid request!
|
Missing parameters in the request. |
ERR.IP.50104 |
ERR.IP.50104 - No active product identified! |
No active insurance product found. |
ERR.IP.50105 |
ERR.IP.50105 - Error! The {code of product} insurance product was not approved at the requested date! |
No active insurance product found at the date specified in validityDate input parameter. |
ERR.IP.50106 |
ERR.IP.50106 - Product doesn't have any product items* configured! |
The insurance product identified has no insurance items. |
ERR.IP.50107 |
ERR.IP.50107 - Invalid insurance item code. |
Invalid product item code. |
ERR.IP.50108 |
ERR.IP.50108 - sourceRecordName is mandatory for premium calculation! |
Source record name is mandatory. |
ERR.IP.50109 |
ERR.IP.50109 - sourceRecordId must be uniqueidentifier type! |
If transmitted, it has to be a GUID. |
*Product items are the product coverages.
The FTOS_IP_GetUWRulesResultAPI endpoint runs the UW formulas attached to the specified insurance product, or product items (coverages) and returns the underwriting decision results.
FTOS_IP_InsuranceProductAPIs
From this library, use the GetUWRulesResult function (described below). This function wraps all the functions necessary to validate and return the underwriting decision results.
This function validates the request fields.
Input parameters: inputData
- The object containing the keys needed to call the endpoint.
Output parameters: An object
containing the following keys to describe the result of the validation:
-
isSuccess
- true/ false - The boolean that shows whether the validation is successful. -
errorMessage
- A null value or an error message as described in the error messages list. -
errorCode
- A null value or an error code as described in the error messages list. -
result
= An empty array [] or an array with details about the UW formula input parameters, as described in the response description section.
This function executes the following:
-
Runs the underwriting (UW) formulas attached to the specified product, or product items - coverages identified by their item code, provided in the request).
-
Uses other helper functions, implemented in the same library, to get the details about the product, or coverages, and the attached UW formulas.
Input parameters: inputData
- The object containing the keys needed to call the function.
Output parameters: An array
containing objects with the following keys:
-
contextType
- The underwriting context type, set on the formula attached to the specified product. -
itemCode
- The code of the item - this key is not available for products that haveperProduct
UW type. -
finalDecision
- The final result of the UW formula. -
decision
- An object that contains the keys and values from the details input object and also the corresponding keys and values for the decision results.