Generate Master Policy API
The master policy is a type of "Mother Policy" that includes a collection of "Child Policies" (general policies) that have the same Insurance type. For example, a firm makes a master policy to assure all the cars that the firm hold. In the same time, every car has his own insurance policy.
You can generate a masterpolicy using the generateMasterPolicy
API.
Example - Masterpolicy - generate with agent:
let p = {
contractorCode: '816',
quoteConfigId: '37584433-6116-4ad9-8b29-578a49ea40f6', //Quote config id
quoteConfigCode: 'HHI',
renewalType: 'No', //Renewal type(name)
agent: {
agentId: "Agent Test"
},
broker: {
brokerId: null
},
startDate: '2022-02-08', // YYYY-MM-DD
issuedDate: '2022-02-07',
validity: 12,
validityType: "Months",
currency: "EUR",
paymentFrequency: "monthly",
paymentType: "BrokerCollection",
quoteNo: "alina0113",
//'renewedMasterPolicyId': '', // FTOS_INS_MasterPolicyid
mentions: 'Mentions',
};
ebs.callActionByNameAsync("generateMasterPolicy", p)
.then(
function(e){
console.log(e.UIResult)
}
);
Example - Master Policy - generate with broker:
let p = {
contractorCode: '816',
quoteConfigId: '37584433-6116-4ad9-8b29-578a49ea40f6', //Quote config id
quoteConfigCode: 'HHI',
renewalType: 'No', //Renewal type(name)
agent: {
agentId: null
},
broker: {
brokerId: 'Broker1'
},
startDate: '2022-02-08', // YYYY-MM-DD
issuedDate: '2022-02-07',
validity: 12,
validityType: "Months",
currency: "EUR",
paymentFrequency: "monthly",
paymentType: "BrokerCollection",
quoteNo: "alina0113",
//'renewedMasterPolicyId': '', // FTOS_INS_MasterPolicyid
mentions: 'Mentions',
};
ebs.callActionByNameAsync("generateMasterPolicy", p)
.then(
function(e){
console.log(e.UIResult)
}
);
Here is the list of data parameters included in the request:
Parameter |
Description |
---|---|
contractorCode | CustomerInternalId from Account entity. |
quoteConfigId | The quote config ID. |
quoteConfigCode | The quote config code. |
renewalType | The renewal type (name, not display name). |
agent | Object containing the agent details. |
agentId |
Agent ID
The value from the agentId needs to be previously added in the Agent entity, if not, an error is received. |
type | Type of the agent issuing the policy (“Individual person” or “Legal person”). |
broker | Object containing broker details. |
brokerId | Broker ID. |
issuedDate | Date of issuance, basic format ISO 8601 YYYY-MM-DD. |
startDate | Policy begin date, basic format ISO 8601 YYYY-MM-DD. |
validity |
How many years/months/days we want this policy to be valid for.
12 value supported in the first version of the API. |
validityType |
Type of validity
Months value supported in the first version of the API |
currency | Currency |
paymentFrequency |
Payment Frequency
Values: full for Full(entire payment at once) annually for Annually semiAnnually for Semi-Annually quarterly for Quarterly monthly for Monthly. |
paymentType |
Payment type Values: OP for bank transfers PayU for PayU PayU-on time for PayOnTime brokerCollection for Broker Collection. |
quoteNo | Quote number. |
renewedMasterPolicyId | Old Master policy number, in case of renewal. |
mentions | Special mentions at Policy level. |
This is an example of a response:
{
"isSuccess": true,
"errorMessage": null,
"errorCode": null,
"result": {
"masterPolicyData": {
"masterPolicyId": "f57ea260-b442-4604-8cd8-84a6fa785363",
"masterPolicyNo": "MP000664",
"quoteNo": "Armand1001",
"masterPolicyStartDate": "2022-03-26",
"masterPolicyEndDate": "2023-03-25"
}
}
}
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 |
masterPolicyData | Array of details for each generated policy |
masterPolicyId | GUID identifying the policy in CORE |
masterPolicyNo | The master policy number |
quoteNo | The quote number |
masterPolicyStartDate | Master Policy Start Date |
masterPolicyEndDate | Master Policy End Date |
The following are the error messages that can be encountered during the Masterpolicy 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 identified. |
ERR.PA.50108 | Existing policy for the same quote and insurance type! | Another policy of the same insurance type is already registered. |
ERR.PA.50111 | Field is mandatory. Nothing was saved!' | Câmpul este obligatoriu. Datele nu au fost salvate! |
ERR.PA.50112 | Agent data cannot be identified! | Invalid Agent! |
ERR.PA.50137 | The quote config code and quote config id are invalid! | Quote config id-ul si quote config code sunt invalide! |
ERR.PA.50138 | Quote Config ID ore quote config code is mandatory for a Masterpolicy! | Quote Config ID sau quote config code este obigatoriu pentru Masterpolicy! |
ERR.PA.50139 | Invalid ContractorCode! | ContractorCode invalid! |
The endpoint is responsible for generating Masterpolicies in the Core system. When generating a Masterpolicy, some information should be sent in order for the action to be successful. You can generate a new Masterpolicy using the object above.