Policy Generation API
The Policy Generation API is responsible for generating generic policies into the core system. Requests for policy generation can be received from various external systems. Once the integration with an external system is achieved, some information should be received from the external system in order for the action to be successful - namely, policies are generated into the core system according to the information received from the external system.
Starting with the 3.5.0 release, this API is compatible with the OpenAPI v3.0 standard.
Below you can find examples about generating a new policy by an insurance broker and by an insurance agent.
A Broker registers a new generic Policy into the system.
let pa = {
insuredObject: {
addressId: {
apartmentNo: null,
buildingNo: null,
city: "City",
subcity: "Subcity",
districtCode: "AG",
entrance: 1,
floorNo: 1,
postalCode: "1234",
street: "Street Name",
streetNo: 123,
streetType: null
}},
policyList: [
{
insuranceTypeName: "Personal Accidents",
productCode: "PA",
insuranceProductItemList: [{
code: "DPA",
insuredAmount: 50000.0,
finalPremiumAmount: 144.0
}, {
code: "ICPA",
insuredAmount: 25000.0,
finalPremiumAmount: 792.0
},
{
code: "PDA",
insuredAmount: 35000.0,
finalPremiumAmount: 1209.6
}, {
code: "MEACC",
insuredAmount: 20000.0,
finalPremiumAmount: 691.2
}],
issuedDate: "2022-06-22",
startDate: "2022-06-23",
renewedPolicyNo: null,
quoteNo: "AnaTest30",
totalIndemnityLimit: 1300000,
validityType: "Months",
validity: 12,
agent: {
agentId: null,
type: null
},
broker: {
brokerId: 'Broker1'
},
contractorCode: '816',
insuredCode: '815',
beneficiaryCode: '816',
currency: "RON",
paymentType: "BrokerCollection",
paymentFrequency: "monthly",
mentions: "Insert comment here",
renewType: "Manual",
cardId: "",
cardName: "PA-Card A",
dntResponses: [
{
questionCode: "EXP", // direct
answerValue: false
},
{
questionCode: "CMP", // online
answerValue: true
}
],
quoteConfigCode: 'PAQC'
},
],
masterPolicyNo: null
};
ebs.callActionByNameAsync("PolicyGenerationAPI", pa)
.then(
function(e){
console.log(e.UIResult.Data)
}
);
An Agent registers a new generic Policy into the system.
let pa = {
insuredObject: {
addressId: {
apartmentNo: null,
buildingNo: null,
city: "City",
subcity: "Subcity",
districtCode: "AG",
entrance: 1,
floorNo: 1,
postalCode: "1234",
street: "Street Name",
streetNo: 123,
streetType: null
}},
policyList: [
{
insuranceTypeName: "Personal Accidents",
productCode: "PA",
insuranceProductItemList: [{
code: "DPA",
insuredAmount: 50000.0,
finalPremiumAmount: 144.0
}, {
code: "ICPA",
insuredAmount: 25000.0,
finalPremiumAmount: 792.0
},
{
code: "PDA",
insuredAmount: 35000.0,
finalPremiumAmount: 1209.6
}, {
code: "MEACC",
insuredAmount: 20000.0,
finalPremiumAmount: 691.2
}],
issuedDate: "2022-06-22",
startDate: "2022-06-23",
renewedPolicyNo: null,
quoteNo: "AnaTest30",
totalIndemnityLimit: 1300000,
validityType: "Months",
validity: 12,
agent: {
agentId: "23435788",
type: "Individual person"
},
broker: {
brokerId: null
},
contractorCode: '816',
insuredCode: '815',
beneficiaryCode: '816',
currency: "RON",
paymentType: "BrokerCollection",
paymentFrequency: "monthly",
mentions: "Insert comment here",
renewType: "Manual",
cardId: "",
cardName: "PA-Card A",
dntResponses: [
{
questionCode: "EXP", // direct
answerValue: false
},
{
questionCode: "CMP", // online
answerValue: true
}
],
quoteConfigCode: 'PAQC'
},
],
masterPolicyNo: null
};
ebs.callActionByNameAsync("PolicyGenerationAPI", pa)
.then(
function(e){
console.log(e.UIResult.Data)
}
);
Here is the list of data parameters included in the request:
Parameter | Description |
---|---|
insuredObject |
Object containing keys to describe the insured object.* |
addressId* | Object describing address of the insured object. |
apartmentNo | Apartment number. |
buildingNo | Building number. |
city |
City name of a record from City entity or null.
City name value must exist in the city nomenclature. |
subcity | Subcity name. |
districtCode | District code of a record from District entity or null District code must exist in the district nomenclature. |
entrance | Entrance. |
floorNo | Floor. |
postalCode | Postal code. |
street | Street name. |
streetNo | Street number. |
streetType | Street type – one of the values existing in the StreetType entity. |
policyList | List of policies to generate; Multiple policies can be generated at once. |
insuranceTypeName | The name of an insurance type configured in the system, in the Insurance Type entity. |
productCode | Insurance product code. |
insuranceProductItemList | List of items to be included on the policy. |
code | Item code. |
insuredAmount | Item insured amount. |
finalPremiumAmount | Item premium amount. |
excessType | deductibles for coverages. |
excessValue | value of deductibles. |
issuedDate | Date of issuance, basic format ISO 8601 YYYY-MM-DD. |
startDate | Policy begin date, basic format ISO 8601 YYYY-MM-DD. |
renewedPolicyNo | Old policy number, in case of renewal. |
quoteNo | Quote number. |
totalIndemnityLimit | Total indemnity limit on the policy. |
validityType | Type of validity Months value supported in the first version of the API . |
cardId | Lookup to FTOS_IP_Card, not mandatory. |
cardCode | Code of Card (from Proposal Configurator FTOS_IP_Card), not mandatory, used only if cardId is null or undefined. |
validity |
How many years/months/days we want this policy to be valid for.
12 value supported in the first version of the API. |
agent | Object containing the agent details. |
agentId | Agent Id. |
type | Type of the agent issuing the policy (“Individual person” or “Legal person”). |
broker | Object containing broker details. |
brokerId | Broker ID. |
contractorCode | CustomerInternalId from the Account entity. |
insuredCode | CustomerInternalId from the Account entity. |
beneficiaryCode | CustomerInternalId from the Account entity. |
currency | Currency. |
paymentType |
Payment type
Values: OP for bank transfers PayU for PayU PayU-on time for PayOnTime brokerCollection for Broker Collection. |
paymentFrequency |
Payment Frequency
Values: full for Full (entire payment at once) annually for Annually semiAnnually for Semi-Annually quarterly for Quarterlymonthly for Monthly. |
mentions | Special mentions at Policy level. |
renewType: | The tipe of the renewal. It can be Manual or Automatic etc. |
dntResponses | Array with objects that contains question code and answer for DNT. |
masterPolicyNo | The number of Master Policy that you want to link on. |
*The keys present in the insuredObject object will change for each type of policy accordingly to the insured object type configurated at insurance product level(for each dimension present on the insured object type configuration there will be a corresponding key into the body, under the insuredObject key).
*The address is mandatory or not, depending on the insured object type’s setting for address. The addressId object structure is defined in the FTOS_INSQB_Address processor.
For other insured object types the insuredObject key follows the following structure:
insuredObject: {
addressId: {
apartmentNo: null,
buildingNo: null,
city: "ALBOTA",
subcity: "GURA VAII",
districtCode: "AG",
entrance: 1,
floorNo: 1,
postalCode: "1234",
street: "Splai Independentei",
streetNo: 123,
streetType: null
},
dimension1: value1
dimension2: value2,
...
dimensionN: valueN
}
This is an example of a response:
{
"errorMessage": null,
"errorCode": null,
"isSuccess": true,
"result": {
"policyData": [{
"policyBeginDate": "2021-07-17",
"policyEndDate": "2022-07-16",
"policyId": "8707f5a4-4fae-40b2-b899-e27735c5b98e",
"policyNumber": "80000480",
}]
}
}
Response description:
Key | Description |
---|---|
Error code | Error code. |
Error message | Error message. |
isSuccess | Marks if the request was successful or not. |
result | Array of objects containing details about the identified policies. |
policyData | Array of details for each generated policy. |
policyBeginDate | Policy Start Date. |
policyEndDate | Policy End Date. |
policyId | GUID identifying the policy inside the Core Insurance Master system. |
policyNumber | Policy Number. |
The following are the error messages that can be encountered during the policy generation process:
Code | Text | Description |
---|---|---|
ERR.PA.50101 | Broker data cannot be identified! | Broker does not exist |
ERR.PA.50102 | Invalid issued date! | Issue date value provided on issuedDate key is less than current date |
ERR.PA.50103 | Invalid start date! | Start date value provided on startDate key is less than or equal with issuedDate value |
ERR.PA.50104 | Invalid paymentType! | Value provided on paymentType key is not valid (not part of the accepted values) |
ERR.PA.50105 | Invalid currency! | Currency code provided on currency key is not identifed |
ERR.PA.50106 | Invalid Renew Type! | Renew type invalid |
ERR.PA.50107 | Quote Number missing! | Quote number is mandatory when creating new policies (but not for renewal) |
ERR.PA.50108 | Existing policy for the same quote and insurance type! | Another policy of the same insurance type is already registered |
ERR.PA.50109 | Invalid Excess Type! | Excess type invalid |
ERR.PA.50110 | Excess (deductibles) cannot have a negative value! | Negative Value for Excess |
ERR.PA.50111 | Card does not exist | No card with specified card id (available only for Policy Admin 3.4.0) |
ERR.PA.50112 | Card Name does not exist | No card with specified card name(available only for Policy Admin 3.4.0) |
ERR.PA.50113 | Card Id is invalid | Card Id is invalid (available only for Policy Admin 3.4.0) |
ERR.PA.50144 | Invalid ContractorCode! | ContractorCode invalid. |
ERR.PA.50145 | Invalid InsuredCode! | InsureCode invalid. |
ERR.PA.50146 | Invalid BeneficiaryCode! | BeneficiaryCode invalid. |
ERR.PA.50148 | Mandatory attribute <<attributeName>> is missing! | The mandatory attribute <<attributeName>> is missing. |
ERR.PA.50149 | Value passed by attribute <<attributeName>> does not exist! | The value passed by attribute <<attributeName>> does not exist. |
ERR.PA.50150 | Policy cannot be issued without an address! | The policy cannot be issued without an address. |
ERR.PA.50151 | Parent value for attribute <attribute name> is missing! | The parent value for attribute <attribute name> is missing. |
ERR.PA.50152 | The Insured Object Type configurations are missing on Insurance Product level! | The Insured Object Type configurations are missing on Insurance Product level. |
Endpoints
The endpoint is responsible for generating generic policies in the Core system. When generating a policy, some information should be sent in order for the action to be successful. This endpoint also aligns the policies payment schedule with the one from the associated Master Policy.
In the moment a new policy is added on the Master Policy (this happens when the policy is generated, meaning the policy is in the Proposal status), the payment schedule for that policy is set up taking into consideration the unpaid installments of the associated Master Policy. More precisely, the system verifies the Master Policy payment schedule and retrieves the number of unpaid installments of that Master Policy. The resulting numberis the number of the installments for that newly added policy.
Example:
Say the Master Policy Payment Frequency is set as Quarterly.
In the fourth month from the Begin Date of the Master Policy, a new policy is added, where the End Date of the policy is the same as the End Date of the Master Policy. In this moment, on the Master Policy, the system checks the number of unpaid installments for that Master Policy and finds that there are 2 unpaid installments.
-
The new policy is generated with 2 installments of the newly issued policy. These have the same due date as the 2 unpaid installments of the Master Policy.
-
The total premium amount of the policy is divided into 2.
-
The system updated the following elements of the Master Policy:
-
The Payment Schedule is updated by adding the 2 installment sums of the policy to those 2 unpaid installment sums of the Master Policy;
-
The Payment Amount is updated by adding to the old premium amount of the Master Policy the newly added policy premium amount;
-
The IPT Amount is updated by adding to the old IPT amount of the Master Policy the newly added policy IPT amount.
-
This is an example call request.
{
"policyList":[
{
"insuranceTypeName":"Personal Accidents",
"productCode":"PA",
"insuranceProductItemList":[
{
"code":"DPA",
"insuredAmount":50000.0,
"finalPremiumAmount":244.0,
"excessType":"percentageOfSumInsured",
"excessValue":"10"
},
{
"code":"PDA",
"insuredAmount":35000.0,
"finalPremiumAmount":1309.6,
"excessType":"percentageOfSumInsured",
"excessValue":"10"
},
{
"code":"PDA",
"insuredAmount":20000.0,
"finalPremiumAmount":541.0,
"excessType":"percentageOfSumInsured",
"excessValue":"10"
},
{
"code":"MEACC",
"insuredAmount":150000,
"finalPremiumAmount":154,
"excessType":"percentageOfSumInsured",
"excessValue":"10"
}
],
"issuedDate":"2022-08-24",
"startDate":"2022-08-25",
"renewedPolicyNo":"",
"quoteNo":"Armand22081202",
"totalIndemnityLimit":13000000,
"validityType":"Months",
"validity":12,
"agent":{
"agentId":"null",
"type":"null"
},
"broker":{
"brokerId":"Cel Mai Broker"
},
"contractorCode":"1",
"insuredCode":"1",
"beneficiaryCode":"1",
"currency":"RON",
"paymentType":"BrokerCollection",
"paymentFrequency":"semiAnnually",
"mentions":"Insert comment here",
"renewType":"Manual",
"cardId":"",
"cardName":"PA-Card A",
"dntResponses":[
{
"questionCode":"EXP",
"answerValue":true
},
{
"questionCode":"CMP",
"answerValue":true
}
],
"quoteConfigCode":"PAQC"
}
],
"insuredObject":{
"addressId":{
"apartmentNo":null,
"buildingNo":null,
"city":null,
"subcity":null,
"districtCode":null,
"entrance":null,
"floorNo":null,
"postalCode":null,
"street":null,
"streetNo":null,
"streetType":null,
"postTown":null,
"fullAddress":"Orasul Mare, Strada Principala, Bloc La Sosea"
},
"age":43,
"retirementAge":65,
"employmentStatusId":"Employed",
"hasMedicalConditions":false,
"maritalStatusId":"Married",
"noOfChildren":0,
"occupationId":"Engineer",
"personsInCare":false,
"annualSalary":150000
},
"masterPolicyNo":""
}
This is the response:
{
"isSuccess":true,
"errorCode":null,
"errorMessage":null,
"result":[
{
"policyData":[
{
"policyId":"17c343d5-cef7-4d22-91fe-831da10fc0a8",
"policyNumber":"80000472",
"productId":"5c4c6919-f013-4bf2-82c3-117f88fb4f2c",
"policyBeginDate":"2022-10-26",
"policyEndDate":"2023-10-25"
}
],
"insuredObjectData":{
"insuredObjectId":"2213e59a-5b20-4093-a774-7d3b97b5f510",
"addressId":"2efce2d1-2578-4d75-bccc-1d6e72db766b",
"insuredObjectDetailsId":"350568eb-9861-44e8-93bb-ec10ac4e3bf4"
}
}
The endpoint is used for selecting all the data for a module that has the Id matching to the one obtained from the context JSON object.
Function: getModuleData()
- The function contains a fluent query that returns the required attributes from the FTOS_INSPA_PolicyInsuranceItem entity for a module with a specific Id. After retrieving the results, the function calls the setData
method for passing the object to the result parameter of the client-side callback function.
Input parameters: N/A.
Output parameters: moduleList
- JSON object containing the module data.
The endpoint is used for selecting all the data for a policy covered risk that has the Id matching to the one obtained from the context JSON object. When calling the endpoint with the ebs.callActionByNameAsync
method, an object containing the formData.id
gets passed as a parameter.
Function: getCoveredRisk()
- The function contains a fluent query that returns the required attributes from the FTOS_INSPA_PolicyInsItemXCoveredRisk entity for a covered risk with a specific id. After retrieving the results the function calls the setData method for passing the object to the result parameter of the client-side callback function.
Input parameters: N/A.
Output parameters: coveredRiskList
- JSON object containing the covered risk data
This endpoint is used to generate a term life guaranteed/jet issue policy.
Input parameters:
-
insuranceTypeName: ''Term Life''
-
productCode: "TLF"
-
termLifeType: option set
-
insuranceProductItemList
-
code: "TLF0"
-
sumInsured: numeric
-
regularPremiumBase: numeric
-
annualizedPremiumBase: numeric (attribute to be added, numeric)
-
-
code: "CI0"
-
isCriticalIllnessIncluded: (attribute to be added, Boolean type)
-
regularPremiumCriticalIllness: numeric
-
annualizedPremiumCriticalIllness: numeric (attribute to be added)
-
-
regularPremiumTotal: numeric
-
annualizedPremiumTotal: numeric (attribute to be added)
-
policyFee: numeric
-
-
issuedDate ( invariant Date type)
-
startDate (invariant Date type)
-
renewedPolicyNo: null (text type)
-
renewTypeId: null (option set)
-
quoteNo: text
-
validityType: option set (days, months, years)
-
validity: numeric
-
policyTerm: numeric
-
frequency: option set
-
currency: currency code
-
paymentType: option set (FTOS_INSPA_PolicyPaymentType, with "directDebit" our only option here)
-
agent:
-
FTOS_INS_Agentid (lookup)
-
-
broker:
-
brokerId: null (attribute to be added, lookup)
-
-
contractor (policyholder):
-
Name
-
PIN
-
dateOfBirth
-
email
-
phone
-
-
insured:
-
Name
-
PIN
-
dateOfBirth
-
email
-
phone
-
Response:
-
policyBeginDate;
-
policyEndDate;
-
policyId;
-
policyNumber.
Validations:
-
If the issue date value provided on
issuedDate
is less than current date, the following error message is displayed:"Invalid issued date!"
; -
If the start date value provided on
startDate
is less than or equal withissuedDate
value, the following error message is displayed:"Invalid start date!"
; -
If the value provided on
paymentType
is not valid, not part of the accepted values, the following error message is displayed:"Invalid payment Type!"
; -
If the currency code provided on
currency
is not identified, the following error message is displayed:"Invalid currency!"
; -
If another policy of the same insurance type is already registered, the following error message is displayed:
"Existing policy for the same quote and insurance type!"
.