Overview
Based on our configuration capabilities, we expose a set of different rule APIs for policy transactions.
By utilizing them, insurance entities can streamline your rating processes, improve operational efficiency, and provide a better customer experience through faster and more accurate policy pricing.
You can refer to this chapter to learn more about the typical API for this part.
Underwriting API
Underwriting - Business Usage
- Check policy against underwriting rules based on configuration
- Give underwriting messages and various variables
Underwriting - API Path
- {{server}}/quotation/core/quotation/v1/autoUnderwriting - Not depending on persisted quotation and default not to persist uw history
- {{server}}/proposal/core/proposal/v1/autoUnderwriting - Not depending on persisted proposal and default not to persist uw history
- {{server}}/endo/core/endo/v1/autoUnderwritingEx - Depending on persisted endorsement and default not to persist uw history
- {{server}}/endo/core/endo/v1/autoUnderwritingWithoutDbEx - Not depending on persisted endorsement and default not to persist uw history
Please map the target rules to the rule groups, and the groups to events. The default event is UnderwritingRuleCheck for both new business and endorsement and user doesn’t need to specify it. If user want to extend, user can create a new event and pass the event code as the request parameter.
Underwriting - What I Can Extend
- Configure and add new underwriting rules via rule configuration.
- Underwriting rules can specify the underwriting level and provide underwriting messages.
Underwriting - Configuration Rule and Message
For example, consider the cases of AutoTest_Preset_Rule_003 and AutoTest_Preset_Rule_004 :
- AutoTest_Preset_Rule_003
if(CustomerName.val =="AutoTest"){
// return uwResultWithUwLevel("TenantCode-PA-Validation-B3103","U1", ["AutoTest","UWResult"] as Object[])
return uwResultWithUwLevel("TenantCode-PA-UW-BPRESETUWCODE001","U1")
}
- AutoTest_Preset_Rule_004
if(RiskName.val =="AutoTest"){
return uwResult("TenantCode-PA-UW-BPRESETUWCODE002",[RiskName.val,DateOfBirth.val] as Object[]).addProperty("Test001", "The Uw added Property")
}
The message content for this rule requires variables. The message code is set with parameters as shown below:
For more details on how to configure rules, see Rule Configuration Guide.
Additional Auto UW Rule Factor
If you need to pass some information that is not in the policy object, such as user information, you can use the AdditionalAutoUWRuleFactor object under the policy object to pass parameters. This section will be used as context parameter when execute underwriting rules.
For example, the following sample passed a field “UserType” in AdditionalAutoUWRuleFactor.
PolicyData:
{
"BusinessCateCode": "1",
"BusinessObjectId": 3517051304219,
"EffectiveDate": "2022-04-22",
"ExpiryDate": "2022-04-24T23:59:59",
"AdditionalAutoUWRuleFactor":{
"UserType":”Employee”
},
"PolicyCustomerList": [
{
"BusinessObjectId": 1000000290,
"CustomerName": "AutoTest",
"DateOfBirth": "1988-10-01",
…
}
],
....
"ProductCode": "TBTI",
"ProductId": 351925022,
"ProductVersion": "1.0",
"ProposalDate": "2022-04-22",
"ProposalNo": "PABTBTI0001383761",
"ProposalStatus": "1",
"QuotationDate": "2025-07-29T11:29:08",
"SchemaVersion": 2,
}If you use V2 version Rule, you need an additional step to register the context parameters in RuleDomain definition
Obtain the data from additialAutoUWRuleFactor in the Rule using the following script
def userTypeTemp = UserType;Underwriting - API Sample
{{server}}/proposal/core/proposal/v1/autoUnderwriting
- Sample Request
{
"AdjustedPremium": 5.58,
"AnnualPremium": 630,
"BeforeVatPremium": 5.17,
"BusinessCateCode": "1",
"BusinessObjectId": 3517051304219,
"Commission": 0.52,
"CommissionRate": 0.1,
"DuePremium": 5.58,
"EffectiveDate": "2022-04-22",
"ExpiryDate": "2022-04-24T23:59:59",
"FirstDataEntryDate": "2024-02-04T10:53:48",
"GrossPremium": 5.58,
"IsPremiumCalcSuccess": "Y",
"IsRenewable": "Y",
"IsTakeUpPolicy": "N",
"OrgCode": "-1",
"POIRate": 1,
"PolicyElementId": 894429002,
"PolicyId": 894429002,
"PolicyLobList": [
{
"AdjustedPremium": 5.58,
"BeforeVatPremium": 5.17,
"BusinessObjectId": 351861068,
"DuePremium": 5.58,
"GrossPremium": 5.58,
"ParentElementType": "POLICY",
"ParentPolicyElementId": 894429002,
"PolicyElementId": 894429006,
"PolicyId": 894429002,
"PolicyRiskList": [
{
"AdjustedPremium": 5.58,
"Age": 33,
"BeforeVatPremium": 5.17,
"BusinessObjectId": 351861075,
"CustomerName": "Customer",
"DateOfBirth": "1988-10-01",
"DetachedProductId": 351925022,
"DuePremium": 5.58,
"GenderCode": "F",
"GrossPremium": 5.58,
"IdNo": "IdNo",
"IdType": "1",
"ParentElementType": "POLICY_LOB",
"ParentPolicyElementId": 894429006,
"PolicyCoverageList": [
{
"AdjustedPremium": 5.32,
"AnnualPremium": 600,
"BeforeVatPremium": 4.93,
"BusinessObjectId": 351861078,
"CoverageName": "Accident Death & Dismemberment",
"DuePremium": 5.32,
"GrossPremium": 5.32,
"IsFinalLevelCt": "Y",
"ParentElementType": "INSURED",
"ParentPolicyElementId": 894429008,
"PolicyElementId": 894429010,
"PolicyId": 894429002,
"PolicyStatus": 2,
"ProductElementCode": "C100416",
"ProductElementId": 351926024,
"SequenceNumber": 1,
"SumInsured": 300000,
"Vat": 0.39
},
.....skip....
],
"PolicyElementId": 894429008,
"PolicyId": 894429002,
"PolicyStatus": 2,
"ProductElementCode": "R10007",
"ProductElementId": 351926021,
"RiskName": "AutoTest",
"SequenceNumber": 1,
"SumInsured": 900000,
"TempData": {},
"Vat": 0.41
}
],
"PolicyStatus": 2,
"ProductCode": "TBTI",
"ProductElementCode": "TBTI",
"ProductElementId": 351925023,
"ProductId": 351925022,
"ProductLobId": 351925023,
"SequenceNumber": 1,
"SumInsured": 900000,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"TotalInsuredCount": 1,
"Vat": 0.41
}
],
"PolicyStatus": 1,
"PolicyType": "1",
"PremCalcFactorHash": "20240204_105355_201,VS6XeIghdqeYZ2ub6a+giP4wC5sShjpdZzCXn2pRPC4=",
"PremCalcResultHash": "20240204_105355_204,y9A9Niy0kjI8l/XlbJKNAGRRNH31KS6wREeZx/T26Hc=",
"ProductCode": "TBTI",
"ProductId": 351925022,
"ProductVersion": "1.0",
"ProposalDate": "2022-04-22",
"ProposalNo": "PABTBTI0000001788",
"ProposalStatus": "1",
"SchemaVersion": 2,
"SumInsured": 900000,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"Vat": 0.41,
"VatRate": 0.08,
"VersionSeq": 2
}- Sample Response with underwriting message list and policy object
{
"MessageList": [
{
"Code": "TenantCode-PA-UW-BPRESETUWCODE001",
"Message": "Preset UW Code 001",
"RuleName": "AutoTest_Preset_Rule_003",
"UwLevelCode": "U1"
},
{
"Code": "TenantCode-PA-UW-BPRESETUWCODE002",
"Message": "Preset UW Code 002",
"Params": [
"AutoTest",
"1988-10-01"
],
"RuleName": "AutoTest_Preset_Rule_004",
"Test001": "The Uw added Property"
}
],
"Model": {
"AdjustedPremium": 5.58,
"AnnualPremium": 630,
"AutoUwResultCode": "2",
"BeforeVatPremium": 5.17,
"BusinessCateCode": "1",
"BusinessObjectId": 3517051304219,
"Commission": 0.52,
"CommissionRate": 0.1,
"DuePremium": 5.58,
"EffectiveDate": "2022-04-22",
"ExpiryDate": "2022-04-24T23:59:59",
"FirstDataEntryDate": "2024-02-04T10:53:48",
"GrossPremium": 5.58,
"IsPremiumCalcSuccess": "Y",
"IsRenewable": "Y",
"IsTakeUpPolicy": "N",
"MaxUwLevelCode": "0",
"OrgCode": "-1",
"POIRate": 1,
"PolicyElementId": 894429002,
"PolicyId": 894429002,
"PolicyLobList": [
{
"AdjustedPremium": 5.58,
"BeforeVatPremium": 5.17,
"BusinessObjectId": 351861068,
"DuePremium": 5.58,
"GrossPremium": 5.58,
"ParentElementType": "POLICY",
"ParentPolicyElementId": 894429002,
"PolicyElementId": 894429006,
"PolicyId": 894429002,
"PolicyRiskList": [
{
"AdjustedPremium": 5.58,
"Age": 33,
"BeforeVatPremium": 5.17,
"BusinessObjectId": 351861075,
"CustomerName": "Customer",
"DateOfBirth": "1988-10-01",
"DetachedProductId": 351925022,
"DuePremium": 5.58,
"GenderCode": "F",
"GrossPremium": 5.58,
"IdNo": "IdNo",
"IdType": "1",
"ParentElementType": "POLICY_LOB",
"ParentPolicyElementId": 894429006,
"PolicyCoverageList": [
{
"AdjustedPremium": 5.32,
"AnnualPremium": 600,
"BeforeVatPremium": 4.93,
"BusinessObjectId": 351861078,
"CoverageName": "Accident Death & Dismemberment",
"DuePremium": 5.32,
"GrossPremium": 5.32,
"IsFinalLevelCt": "Y",
"ParentElementType": "INSURED",
"ParentPolicyElementId": 894429008,
"PolicyElementId": 894429010,
"PolicyId": 894429002,
"PolicyStatus": 2,
"ProductElementCode": "C100416",
"ProductElementId": 351926024,
"SequenceNumber": 1,
"SumInsured": 300000,
"Vat": 0.39
},
.....skip....
],
"PolicyElementId": 894429008,
"PolicyId": 894429002,
"PolicyStatus": 2,
"ProductElementCode": "R10007",
"ProductElementId": 351926021,
"RiskName": "AutoTest",
"SequenceNumber": 1,
"SumInsured": 900000,
"TempData": {},
"Vat": 0.41
}
],
"PolicyStatus": 2,
"ProductCode": "TBTI",
"ProductElementCode": "TBTI",
"ProductElementId": 351925023,
"ProductId": 351925022,
"ProductLobId": 351925023,
"SequenceNumber": 1,
"SumInsured": 900000,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"TotalInsuredCount": 1,
"Vat": 0.41
}
],
"PolicyStatus": 1,
"PolicyType": "1",
"PremCalcFactorHash": "20240204_105355_201,VS6XeIghdqeYZ2ub6a+giP4wC5sShjpdZzCXn2pRPC4=",
"PremCalcResultHash": "20240204_105355_204,y9A9Niy0kjI8l/XlbJKNAGRRNH31KS6wREeZx/T26Hc=",
"ProductCode": "TBTI",
"ProductId": 351925022,
"ProductVersion": "1.0",
"ProposalDate": "2022-04-22",
"ProposalNo": "PABTBTI0000001788",
"ProposalStatus": "1",
"SchemaVersion": 2,
"SumInsured": 900000,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"Vat": 0.41,
"VatRate": 0.08,
"VersionSeq": 3
},
"Status": "Fail"
}/endo/core/endo/v1/autoUnderwritingWithoutDbEx
- Sample Request
{
"EndoEffectiveDate": "{{PolicyEffDate}}",
"EndoType": 1,
"EndoStatus": 120,
"SubEndoType": "12",
"NewPolicy": {{newpolicy}},
"OldPolicy": {{OldPolicy}},
"PolicyNo": "{{PolicyNo}}",
"PolicyId": "{{PolicyId}}",
"ProductCode": "TBTI",
"ProductId": 351925022,
"EndorsementPaymentInfoList": [
{
"PayModeCode": "30",
"IsInstallment": "Y",
"InstallmentType": "1"
}
],
"IsAdminChange": "N"
}- Sample Respone
AutoUnderwritingResult is returned as the api process result.
{
"@type": "Endorsement-BasicInfoEndorsement",
"AutoUnderwritingResult": {
"@type": "AutoUnderwriting-AutoUnderwriting",
"BusinessObjectId": 370103370,
"PolicyId": "11383530746,242AEA57BB4C7E53F3B372AF5F288709",
"ProcessType": "1",
"UwResultCode": "2",
"UwTime": "2025-06-13T12:15:27"
},
"AutoUwResultCode": "1",
"BusinessObjectId": 300243915,
"EndoEffectiveDate": "2022-04-22",
"EndoStatus": "120",
"EndoType": "1",
"EndorsementPaymentInfoList": [
{
"@type": "EndorsementPaymentInfo-EndorsementPaymentInfo",
"BusinessObjectId": 590876,
"InstallmentType": "1",
"IsInstallment": "Y",
"PayModeCode": "30",
"PayRate": 1,
"SequenceNumber": 1
}
],
"IsLockedByRi": "N",
"NewPolicy": { },
"OldPolicy": { },
"PolicyId": "11383530746,242AEA57BB4C7E53F3B372AF5F288709",
"PolicyNo": "POTBTI01278425",
"ProductCode": "TBTI",
"ProductId": 351925022,
"VersionSeq": 0,
"IsAdminChange": "N",
"SubEndoType": "12"
}AutoUnderwritingResult with UnderwritingMessageList
{
"@type": "Endorsement-BasicInfoEndorsement",
"AutoUnderwritingResult": {
"@type": "AutoUnderwriting-AutoUnderwriting",
"BusinessObjectId": 370103370,
"PolicyId": "11383530746,242AEA57BB4C7E53F3B372AF5F288709",
"ProcessType": "1",
"UnderwritingMessageList": [
{
"@type": "AutoUnderwritingMessage-AutoUnderwritingMessage",
"BusinessObjectId": 370103607,
"MessageCode": "TenantCode-PA-UW-BPRESETUWCODE002",
"MessageDetail": "Preset UW Code 002 with param1-false and param2-ABC.",
"MessageParams": "[\"false\",\"ABC\"]",
"PolicyId": "11383530746,242AEA57BB4C7E53F3B372AF5F288709",
"RuleName": "TestRule-1747724892681",
"UwLevelCode": "1"
},
{
"@type": "AutoUnderwritingMessage-AutoUnderwritingMessage",
"BusinessObjectId": 370103607,
"MessageCode": "TenantCode-PA-UW-BPRESETUWCODE002",
"MessageDetail": "Preset UW Code 002 with param1-false and param2-ABC.",
"MessageParams": "[\"false\",\"ABC\"]",
"PolicyId": "11383530746,242AEA57BB4C7E53F3B372AF5F288709",
"RuleName": "TestRule-1747897107272",
"UwLevelCode": "1"
}
],
"UwLevelCode": "1",
"UwResultCode": "1",
"UwTime": "2025-06-13T14:30:09"
},
"AutoUwResultCode": "2",
"BusinessObjectId": 300243915,
"EndoEffectiveDate": "2022-04-22",
"EndoStatus": "120",
"EndoType": "1",
"EndorsementPaymentInfoList": [
{
"@type": "EndorsementPaymentInfo-EndorsementPaymentInfo",
"BusinessObjectId": 590876,
"InstallmentType": "1",
"IsInstallment": "Y",
"PayModeCode": "30",
"PayRate": 1,
"SequenceNumber": 1
}
],
"IsLockedByRi": "N",
"NewPolicy": {},
"OldPolicy": {},
"PolicyId": "11383530746,242AEA57BB4C7E53F3B372AF5F288709",
"PolicyNo": "POTBTI01278425",
"ProductCode": "TBTI",
"ProductId": 351925022,
"VersionSeq": 0,
"IsAdminChange": "N",
"SubEndoType": "12"
}Validation API
- Check policy against validation rules based on configuration
- Compare data with market product structures and technical product DD, fields and code table
- Throw business exception for validation error
Validation - API Path
- {{server}}/quotation/core/quotation/v1/validate
- {{server}}/proposal/core/proposal/v1/validate
- {{server}}/endo/core/endo/v1/validateEx
- Set the parameter langId in URL param, then the returned message can be the target language. Also, if you only wana set the target language in request header, then set the header x-mo-lang-id.
- Please map the target rules to the rule groups, and the groups to events. The default event is PolicyValidationCheck for new business and EndoValidationCheck for endorsement and user doesn’t need to specify it. If user want to extend, user can create a new event and pass the event code as the request parameter.
Warn:
In addition to rule validation, we also validate other points based on data dictionary definition:
- The value of the field does not match the defined “Field Type”.
- The field “Is Mandatory” defined as “Y”, but the mandatory field is not input with a value.
- The field value is larger than the defined “Max Value”.
- The length of the value is larger than the defined “Max Length”.
- The value is not present in the defined “Code Table” (id column). If the field’s value is not provided, you can either leave it as null or remove the field from the JSON request instead of using an empty value ("") .
- The structure does not comply with the market product. For example, the benefit is assigned to an incorrect coverage or it is not defined in the market product.
- The rule is mandatory as per the system requirements. For example, PolicyLob is a required field and Risk should be under the PolicyLob.
Validation - What I Can Extend
- Configure and add new validation rules through rule configuration.
- Validation rules can include validation messages.
Validation - Configuration Rule and Message or Code Table and Data Table and Field Binding
For detailed information on rule configuration, see rule engine.
Rule DSL Sample:
return messageWithParams("TenantCode-PA-Validation-WPRESETCODE001", [2,20,60] as Object[])Code Table/Data Table/Field Binding:
Taking ProposalStatus as an example, you need to create a code table and bind it to the field in the data dictionary.
For more details on how to configure the data dictionary, see Data Dictionary Guide.
The messages for data dictionary-related validation are configured as follows:
The system allows overriding the content and translation of the codes. If the message’s content/translation contains variables, ensure that the variables are hardcoded in the system and do not change the sequence of the parameters. Taking TenantCode-PA-Validation-B4002 as an example, if the platform overrides it as follows:
Model is {}, Code is {}, field {} is mandatory, value is null
tenant override it to be,
Under "{}-{}", field "{}" is mandatory. Please input the field with proper value.
Validation - API Sample
-
Sample Request
- {{server}}/proposal/core/proposal/v1/validate?eventCode=AutoTest_Preset_Event
- {{server}}/proposal/core/proposal/v1/validate?eventCode=AutoTest_Preset_Event&langId=zh_CN
{
"BeforeVatPremium": 121.5,
"BusinessCateCode": "1",
"Commission": 6.075,
"DuePremium": 130,
"EffectiveDate": "2019-04-22",
"ExpiryDate": "2019-04-24T23:59:59",
"IsPremiumCalcSuccess": "Y",
"PolicyLobList": [
{
"PolicyRiskList": [
{
"CustomerName": "Customer",
"DateOfBirth": "1988-10-01",
"IdNo": "IdNo",
"IdType": "1",
"PolicyCoverageList": [
{
"DuePremium": 100,
"ProductElementCode": "C100416",
"SumInsured": 300000,
"VersionSeq": 1
},
.....skip....
],
"ProductElementCode": "R10007",
"RiskName": "InsuredName",
"VersionSeq": 1
}
],
"ProductCode": "TBTI",
"ProductElementCode": "TBTI",
"ProductId": 351925022,
"ProductLobId": 351925023,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"TotalInsuredCount": 1,
"VersionSeq": 1
}
],
"PolicyType": "1",
"ProductCode": "TBTI",
"ProductId": 351925022,
"ProductVersion": "1.0",
"ProposalDate": "2019-04-22",
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"Vat": 8.5,
"VersionSeq": 1
}- Sample Response with business exception list
{
"timestamp": "2024-01-29T17:56:38",
"timestampServer": "2024-01-29T09:56:38",
"status": 422,
"error": "Internal Server Error",
"path": "/v1/validate",
"traceId": "XXXXX004bcaXXXXX",
"traceIdContainer": null,
"messages": [
{
"code": "TenantCode-PA-Validation-WPRESETCODE001",
"message": "The policy is not applicable for the Insureds'-(2) age is not in the age from 20 to 60."
}
],
"code": "MO-PLATFORM-Rule-B4000",
"exception": "...platform.foundation.exception.MultipleBusinessException",
"message": "validation failed"
}zh_CN:
{
"timestamp": "2024-01-29T17:57:44",
"timestampServer": "2024-01-29T09:57:44",
"status": 422,
"error": "Internal Server Error",
"path": "/v1/validate",
"traceId": "XXXXXb864aaXXXX",
"traceIdContainer": null,
"messages": [
{
"code": "TenantCode-PA-Validation-WPRESETCODE001",
"message": "The policy is not applicable for the Insureds'-(2) age is not in the age from 20 to 60."
}
],
"code": "MO-PLATFORM-Rule-B4000",
"exception": "...platform.foundation.exception.MultipleBusinessException",
"message": "validation failed"
}Validation - DD related validation response
The content of all the following messages has been overridden within the tenant, which serves as an example.
{
"timestamp": "2024-02-01T10:07:44",
"timestampServer": "2024-02-01T02:07:44",
"status": 422,
"error": "Internal Server Error",
"path": "/v1/validate",
"traceId": "XXXXX72888fdXXXXX61279f8e31XXXXX",
"traceIdContainer": null,
"messages": [
{
"code": "TenantCode-PA-Validation-B4002",
"message": "Under \"Policy-POLICY\", field \"EffectiveDate\" is mandatory. Please input the field with proper value."
},
{
"code": "TenantCode-PA-Validation-B4003",
"message": "Under \"PolicyCustomer-PolicyCustomer\", field \"IsInsured\" is mapped with the code table \"YesNo\", the value \"No\" is not in the code table value range."
},
{
"code": "TenantCode-PA-Validation-B4005",
"message": "Under \"PolicyCustomer-PolicyCustomer\", field \"IsInsured\" , value \"No\", the length \"2\" of the value is larger than the definition max length \"1\"."
}
],
"code": "MO-PA-Validation-B4000",
"exception": "...platform.foundation.exception.MultipleBusinessException",
"message": "Policy Validation Error"
}
Form Clause or Element Attachment API
- Attach different clauses according to different rule conditions
Form Clause or Element Attachment - API Path
- {{server}}/quotation/core/quotation/v1/attachElement?eventCode={{}}
- {{server}}/proposal/core/proposal/v1/attachElement?eventCode={{}}
- {{server}}/endo/core/endo/v1/attachElement?eventCode={{}}
-
Default event means if the event code is not input, the system will call the default one. For example, if you call “{{server}}/quotation/core/quotation/v1/attachElement”, then the system will call as “{{server}}/quotation/core/quotation/v1/attachElement?eventCode=AttachElement4Quotation”.
For more information about the default event code set by the system, see default event.
-
The attach Element API backend logic is as below,
- Attach elements based on the rule event. Only attach elements for existing models in the request.
- Attach elements according to the product element Reference Relationship ”A Bring out B Always Automatically in API“.
Form Clause or Element Attachment - What I Can Extend
- Attach additional clauses forms or coverages based on certain policy value inputs.
Form Clause or Element Attachment - Configuration Rule and Product
Take rule AutoTest_Preset_Rule_AutoAttach_001 and AutoTest_Preset_Rule_AutoAttach_002 as examples:
AutoTest_Preset_Rule_AutoAttach_001
//attachElement
if(PolicyRisk().RiskName.val == "AutoTest"){
def ct097 = attachElement(PolicyRisk().currentModel,"C101097")
def cf001=attachElement(PolicyLob().currentModel,"CF001")
def c101077=attachElement(cf001,"C101077")
def bt00251=attachElement(c101077,"B00251")
}AutoTest_Preset_Rule_AutoAttach_002
//attachElement
if(ProductElementCode.val =="C101077") return// paret is clause
if(PolicyRisk().RiskName.val == "AutoTest"){
//def ctList = PolicyCoverages()
// for(ct in ctList){
if(ProductElementCode.val =="C101097"){
//attachElement(PolicyCoverage().currentModel,"B00029")
attachElement(PolicyRisk().currentModel,"S00001") //Add "schedule" to the risk.
}else if(ProductElementCode.val =="C100416"){
attachElement(PolicyCoverage().currentModel,"L100301")
}
//}
}
{{server}}/quotation/core/quotation/v1/attachElement?eventCode=AutoTest_Preset_AttachElement_Event
For more details on how to configure rules, see Rule Configuration Guide.
Form Clause or Element Attachment - API Sample
- Sample Request
{
"BeforeVatPremium": 121.5,
"BusinessCateCode": "1",
"Commission": 6.075,
"DuePremium": 130,
"EffectiveDate": "2019-04-22",
"ExpiryDate": "2019-04-24T23:59:59",
"IsPremiumCalcSuccess": "Y",
"PolicyLobList": [
{
"PolicyRiskList": [
{
"CustomerName": "Customer",
"DateOfBirth": "1988-10-01",
"IdNo": "IdNo",
"GenderCode": "F",
"IdType": "1",
"PolicyCoverageList": [
{
"DuePremium": 100,
"ProductElementCode": "C100416",
"SumInsured": 300000,
"VersionSeq": 1
},
.....skip....
],
"ProductElementCode": "R10007",
"RiskName": "AutoTest",
"VersionSeq": 1
}
],
"ProductCode": "TBTI",
"ProductElementCode": "TBTI",
"ProductId": 351925022,
"ProductLobId": 351925023,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"TotalInsuredCount": 1,
"VersionSeq": 1
}
],
"PolicyType": "1",
"ProductCode": "TBTI",
"ProductId": 351925022,
"ProductVersion": "1.0",
"ProposalDate": "2019-04-22",
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"Vat": 8.5,
"VersionSeq": 1
}- Sample Response with policy object and element attached
{
"BeforeVatPremium": 121.5,
"BusinessCateCode": "1",
"BusinessObjectId": 3517051304219,
"Commission": 6.075,
"DuePremium": 130,
"EffectiveDate": "2019-04-22",
"ExpiryDate": "2019-04-24T23:59:59",
"IsPremiumCalcSuccess": "Y",
"PolicyLobList": [
{
"BusinessObjectId": 351861068,
"PolicyCoverageFormList": [
{
"BusinessObjectId": 522513564,
"IsAutoAttachedForm": "Y",
"PolicyCoverageList": [
{
"BusinessObjectId": 528044248,
"IsAutoAttachedForm": "Y",
"PolicyBenefitList": [
{
"BusinessObjectId": 528055840,
"IsAutoAttachedForm": "Y",
"PolicyStatus": 2,
"ProductElementCode": "B00251",
"ProductElementId": 522479615,
"SequenceNumber": 1
}
],
"PolicyStatus": 2,
"ProductElementCode": "C101077",
"ProductElementId": 522479613,
"SequenceNumber": 1
}
],
"PolicyStatus": 2,
"ProductElementCode": "CF001",
"ProductElementId": 522479611,
"SequenceNumber": 1
}
],
"PolicyRiskList": [
{
"BusinessObjectId": 351861075,
"CustomerName": "Customer",
"DateOfBirth": "1988-10-01",
"GenderCode": "F",
"IdNo": "IdNo",
"IdType": "1",
"PolicyCoverageList": [
{
"BusinessObjectId": 351861078,
"DuePremium": 100,
"PolicyBenefitList": [
{
"BusinessObjectId": 528044218,
"IsAutoAttachedForm": "Y",
"PolicyStatus": 2,
"ProductElementCode": "B00248",
"ProductElementId": 522209920,
"SequenceNumber": 1
}
],
"PolicyStatus": 2,
"ProductElementCode": "C100416",
"ProductElementId": 351926024,
"SequenceNumber": 1,
"SumInsured": 300000
},
{
"BusinessObjectId": 351861078,
"DuePremium": 10,
"PolicyStatus": 2,
"ProductElementCode": "C100692",
"ProductElementId": 351926030,
"SequenceNumber": 2,
"SumInsured": 300000
}
],
"PolicyStatus": 2,
"ProductElementCode": "R10007",
"ProductElementId": 351926021,
"RiskName": "AutoTest",
"SequenceNumber": 1
}
],
"PolicyStatus": 2,
"ProductCode": "TBTI",
"ProductElementCode": "TBTI",
"ProductElementId": 351925023,
"ProductId": 351925022,
"ProductLobId": 351925023,
"SequenceNumber": 1,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"TotalInsuredCount": 1
}
],
"PolicyType": "1",
"ProductCode": "TBTI",
"ProductId": 351925022,
"ProductVersion": "1.0",
"ProposalDate": "2019-04-22",
"SchemaVersion": 2,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"Vat": 8.5,
"VersionSeq": 1
}Form Clause Content API
Form Clause Content - Business Usage
- Generate Clause content based on configuration
Form Clause Content - API Path
{{server}}/proposal/core/proposal/v1/generateClauseContent{{server}}/endo/core/endo/v1/generateClauseContent
Currently, this API only works for Non-Coverage Clause/Form, and does not work for Coverage Clause/Form.
Form Clause Content - What I Can Extend
- Refresh clause-related fields based on product parameters.
- Refresh clause content fields with dynamic parameters determined by the rule engine.
Form Clause Content - Configuration Rule and Product
Clause Field mapping with PolicyForm field
- Name: CustomFormTitle
- Filling NO: CustomFormNo
- Content: CustomFormContentAuto
Form Clause Content - API Sample
- Sample Request
{
"AdjustedPremium": 680.4,
"AgentCode": "XXXXX0000524XXXXX",
"AnnualPremium": 630,
"BeforeVatPremium": 630,
"BookCurrencyCode": "USD",
"BusinessCateCode": "1",
"BusinessObjectId": 3517051304219,
"Commission": 63,
"CommissionRate": 0.1,
"DuePremium": 680.4,
"EffectiveDate": "2021-04-22",
"ExpiryDate": "2022-04-21T23:59:59",
"FirstDataEntryDate": "2024-01-29T14:28:22",
"GrossPremium": 680.4,
"InterestRate": 0.05,
"IsPremiumCalcSuccess": "Y",
"IsRenewable": "Y",
"IsTakeUpPolicy": "N",
"IssueDate": "2024-01-29T14:28:56",
"IssueUserId": XXXXX387,
"IssueUserRealName": "ADMIN",
"LocalCurrencyCode": "USD",
"OrgCode": "10002",
"POIRate": 1,
.....skip....
"PolicyElementId": 9935650020,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyLobList": [
{
"AdjustedPremium": 680.4,
"BeforeVatPremium": 630,
"BusinessObjectId": 351861068,
"DuePremium": 680.4,
"GrossPremium": 680.4,
"ParentElementType": "POLICY",
"ParentPolicyElementId": 9935650020,
"PolicyElementId": 9935650026,
"PolicyFormList": [
{
"BusinessObjectId": 545421343,
"IsFinalLevelCt": "Y",
"ParentElementType": "POLICY_LOB",
"ParentPolicyElementId": 9935650026,
"PolicyElementId": 9935650028,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyStatus": 2,
"ProductElementCode": "F2201716",
"ProductElementId": 545420181,
"SequenceNumber": 1
},
{
"BusinessObjectId": 545421343,
"IsFinalLevelCt": "Y",
"ParentElementType": "POLICY_LOB",
"ParentPolicyElementId": 9935650026,
"PolicyElementId": 9935650029,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyStatus": 2,
"ProductElementCode": "F0000015",
"ProductElementId": 545425117,
"SequenceNumber": 2
}
],
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyRiskList": [
{
"AdjustedPremium": 680.4,
"Age": 32,
"BeforeVatPremium": 630,
"BusinessObjectId": 351861075,
"CustomerName": "Customer",
"DateOfBirth": "1988-10-01",
"DetachedProductId": 351925022,
"DuePremium": 680.4,
"GrossPremium": 680.4,
"IdNo": "IdNo",
"IdType": "1",
"ParentElementType": "POLICY_LOB",
"ParentPolicyElementId": 9935650026,
"PolicyCoverageList": [
{
"AdjustedPremium": 648,
"AnnualPremium": 600,
"BeforeVatPremium": 600,
"BusinessObjectId": 351861078,
"CoverageName": "Accident Death & Dismemberment",
"DuePremium": 648,
"GrossPremium": 648,
"IsFinalLevelCt": "N",
"ParentElementType": "INSURED",
"ParentPolicyElementId": 9935650031,
"PolicyBenefitList": [
{
"BusinessObjectId": 528044218,
"CoverageName": "Permanent Total Disability",
"IsAutoAttachedForm": "Y",
"IsFinalLevelCt": "Y",
"ParentElementType": "POLICY_COVERAGE",
"ParentPolicyElementId": 9935650033,
"PolicyElementId": 9935640059,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyStatus": 2,
"ProductElementCode": "B00248",
"ProductElementId": 522209920,
"SequenceNumber": 1
}
],
"PolicyElementId": 9935650033,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyStatus": 2,
"ProductElementCode": "C100416",
"ProductElementId": 351926024,
"SequenceNumber": 1,
"SumInsured": 300000,
"Vat": 48
},
.....skip....
],
"PolicyElementId": 9935650031,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyStatus": 2,
"ProductElementCode": "R10007",
"ProductElementId": 351926021,
"RiskName": "InsuredName",
"SequenceNumber": 1,
"SumInsured": 900000,
"TempData": {
"Mask-IdNo": "Jmf1vghdrScrTdpdeyKu7w==",
"IdNo": "Jmf1vghdrScrTdpdeyKu7w==",
"MaskAfter-IdNo": "IdNo"
},
"Vat": 50.4
}
],
"PolicyStatus": 2,
"ProductCode": "TBTI",
"ProductElementCode": "TBTI",
"ProductElementId": 351925023,
"ProductId": 351925022,
"ProductLobId": 351925023,
"SequenceNumber": 1,
"SumInsured": 900000,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"TotalInsuredCount": 1,
"Vat": 50.4
}
],
"PolicyNo": "POTBTI01230814",
"PolicyStatus": 2,
"PolicyType": "1",
"PremCalcFactorHash": "20240129_142830_957,VNURUANnzmZKJm1S481nlIXJwwaiEPFUwtYWYUS+drk=",
"PremCalcResultHash": "20240129_142830_976,MYUh+nmdRHMQGrRA4Sw7kPmgeosjC2tS15/VNf+qpNs=",
"PremiumBookExchangeRate": 1,
"PremiumCurrencyCode": "USD",
"PremiumInterest": 31.5,
"PremiumLocalExchangeRate": 1,
"ProductCode": "TBTI",
"ProductId": 351925022,
"ProductVersion": "1.0",
"ProposalDate": "2021-04-22",
"ProposalNo": "PABTBTI0001300037",
"ProposalStatus": "3",
"SchemaVersion": 2,
"SumInsured": 900000,
"TaxInterest": 2.52,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"TotalInterest": 34.02,
"TotalPremium": 714.42,
"Vat": 50.4,
"VatRate": 0.08,
"VersionSeq": 3
}- Sample Response with clause content field update
{
"AdjustedPremium": 680.4,
"AgentCode": "XXXXX0000524XXXXX",
"AnnualPremium": 630,
"BeforeVatPremium": 630,
"BookCurrencyCode": "USD",
"BusinessCateCode": "1",
"BusinessObjectId": 3517051304219,
"Commission": 63,
"CommissionRate": 0.1,
"DuePremium": 680.4,
"EffectiveDate": "2021-04-22",
"ExpiryDate": "2022-04-21T23:59:59",
"FirstDataEntryDate": "2024-01-29T14:28:22",
"GrossPremium": 680.4,
"InterestRate": 0.05,
"IsPremiumCalcSuccess": "Y",
"IsRenewable": "Y",
"IsTakeUpPolicy": "N",
"IssueDate": "2024-01-29T14:28:56",
"IssueUserId": XXXXX387,
"IssueUserRealName": "ADMIN",
"LocalCurrencyCode": "USD",
"OrgCode": "10002",
"POIRate": 1,
..........
"PolicyElementId": 9935650020,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyLobList": [
{
"AdjustedPremium": 680.4,
"BeforeVatPremium": 630,
"BusinessObjectId": 351861068,
"DuePremium": 680.4,
"GrossPremium": 680.4,
"ParentElementType": "POLICY",
"ParentPolicyElementId": 9935650020,
"PolicyElementId": 9935650026,
"PolicyFormList": [
{
"BusinessObjectId": 545421343,
"CustomFormContentAuto": "Policy holder is subject to 300000 amount of sum Insured.",
"CustomFormNo": "F2201716-2023",
"CustomFormTitle": "Delay Clause",
"IsCustomForm": "N",
"IsFinalLevelCt": "Y",
"ParentElementType": "POLICY_LOB",
"ParentPolicyElementId": 9935650026,
"PolicyElementId": 9935650028,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyStatus": 2,
"ProductElementCode": "F2201716",
"ProductElementId": 545420181,
"SequenceNumber": 1
},
{
"BusinessObjectId": 545421343,
"CustomFormContentAuto": "Health Declaration Clause",
"CustomFormNo": "F0000015-2023",
"CustomFormTitle": "Health Declaration Clause",
"IsCustomForm": "N",
"IsFinalLevelCt": "Y",
"ParentElementType": "POLICY_LOB",
"ParentPolicyElementId": 9935650026,
"PolicyElementId": 9935650029,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyStatus": 2,
"ProductElementCode": "F0000015",
"ProductElementId": 545425117,
"SequenceNumber": 2
}
],
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyRiskList": [
{
"AdjustedPremium": 680.4,
"Age": 32,
"BeforeVatPremium": 630,
"BusinessObjectId": 351861075,
"CustomerName": "Customer",
"DateOfBirth": "1988-10-01",
"DetachedProductId": 351925022,
"DuePremium": 680.4,
"GrossPremium": 680.4,
"IdNo": "IdNo",
"IdType": "1",
"ParentElementType": "POLICY_LOB",
"ParentPolicyElementId": 9935650026,
"PolicyCoverageList": [
{
"AdjustedPremium": 648,
"AnnualPremium": 600,
"BeforeVatPremium": 600,
"BusinessObjectId": 351861078,
"CoverageName": "Accident Death & Dismemberment",
"DuePremium": 648,
"GrossPremium": 648,
"IsFinalLevelCt": "N",
"ParentElementType": "INSURED",
"ParentPolicyElementId": 9935650031,
"PolicyBenefitList": [
{
"BusinessObjectId": 528044218,
"CoverageName": "Permanent Total Disability",
"IsAutoAttachedForm": "Y",
"IsFinalLevelCt": "Y",
"ParentElementType": "POLICY_COVERAGE",
"ParentPolicyElementId": 9935650033,
"PolicyElementId": 9935640059,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyStatus": 2,
"ProductElementCode": "B00248",
"ProductElementId": 522209920,
"SequenceNumber": 1
}
],
"PolicyElementId": 9935650033,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyStatus": 2,
"ProductElementCode": "C100416",
"ProductElementId": 351926024,
"SequenceNumber": 1,
"SumInsured": 300000,
"Vat": 48
},
.....skip....
],
"PolicyElementId": 9935650031,
"PolicyId": "9935650020,C467077CF7DA1C2AAC5A87E24D48635C",
"PolicyStatus": 2,
"ProductElementCode": "R10007",
"ProductElementId": 351926021,
"RiskName": "InsuredName",
"SequenceNumber": 1,
"SumInsured": 900000,
"TempData": {
"Mask-IdNo": "Jmf1vghdrScrTdpdeyKu7w==",
"IdNo": "Jmf1vghdrScrTdpdeyKu7w==",
"MaskAfter-IdNo": "IdNo"
},
"Vat": 50.4
}
],
"PolicyStatus": 2,
"ProductCode": "TBTI",
"ProductElementCode": "TBTI",
"ProductElementId": 351925023,
"ProductId": 351925022,
"ProductLobId": 351925023,
"SequenceNumber": 1,
"SumInsured": 900000,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"TotalInsuredCount": 1,
"Vat": 50.4
}
],
"PolicyNo": "POTBTI01230814",
"PolicyStatus": 2,
"PolicyType": "1",
"PremCalcFactorHash": "20240129_142830_957,VNURUANnzmZKJm1S481nlIXJwwaiEPFUwtYWYUS+drk=",
"PremCalcResultHash": "20240129_142830_976,MYUh+nmdRHMQGrRA4Sw7kPmgeosjC2tS15/VNf+qpNs=",
"PremiumBookExchangeRate": 1,
"PremiumCurrencyCode": "USD",
"PremiumInterest": 31.5,
"PremiumLocalExchangeRate": 1,
"ProductCode": "TBTI",
"ProductId": 351925022,
"ProductVersion": "1.0",
"ProposalDate": "2021-04-22",
"ProposalNo": "PABTBTI0001300037",
"ProposalStatus": "3",
"SchemaVersion": 2,
"SumInsured": 900000,
"TaxInterest": 2.52,
"TechProductCode": "TR_POC",
"TechProductId": 3516410623456,
"TotalInterest": 34.02,
"TotalPremium": 714.42,
"Vat": 50.4,
"VatRate": 0.08,
"VersionSeq": 3
}Endorsement Content API
Endorsement Content - Business Usage
- Generate Endorsement content based on configuration
Endorsement Content - API Path
- /endo/core/endo/v1/generateContent?endoId={{EndoId}} - GET
Endorsement Content - What I Can Extend
- Refresh the endorsement content field by comparing the differences between different policy versions.
Endorsement Content - Configuration Rule
Take tenant rule “EndorsementContentRule” as an example,
if (Endorsement().EndoType.val != "3") {
return
}
def endoEffectiveDate = Endorsement().EndoEffectiveDate.val;
def endoEffectiveDateTxt = getYear(endoEffectiveDate) + "year" + getMonth(endoEffectiveDate) + "month" + getDayOfMonth(endoEffectiveDate) + "day";
def licenseNoText = "";
def Content_eng = "Now as policyholder's apllication, we cancelled the policy with policy no-" + Policy().PolicyNo.val + ", from " + endoEffectiveDate + ". "
addContent(1,Content)
addContent(2,Content_eng)
addContent(3,"Preset Test Data for Endo Content. Please do not update.")Endorsement Content - API Sample
- Sample Request
{
"AgentCode": "XXXXX0000524XXXXX",
"ApplyDate": "2024-01-29T14:52:31",
"BeforeRevisionId": 9935720089,
"BusinessObjectId": 300224988,
"DataEntryUserId": XXXXX387,
"DataEntryUserRealName": "ADMIN",
"EndoEffectiveDate": "2024-01-29",
"EndoId": "9935600027,F5E86D2B6DFD25EEB54D8C29CA09995C",
"EndoNo": "POTBTI01230805-001",
"EndoStatus": "120",
"EndoType": "3",
"EntryOperId": XXXXX387,
"IndexNumber": 0,
"IsLockedByRi": "N",
"NewPolicy": {
........
},
"OldPolicy": {
........
},
"PolicyId": "9935720064,F836CE9077FEAE388B6F890D518BAFB9",
"PolicyNo": "POTBTI01230805",
"ProductCode": "TBTI",
"ProductId": 351925022,
"SubEndoType": "32",
"VersionSeq": 1
}- Sample Response with endorsement content field update
{
"AgentCode": "XXXXX0000524XXXXX",
"ApplyDate": "2024-01-29T14:52:31",
"BeforeRevisionId": 9935720089,
"BusinessObjectId": 300224988,
// highlight-next-line
"Content": "Now as policyholder's apllication, we cancelled the policy with policy no-POTBTI01230805, from 2024-01-29T00:00. Preset Test Data for Endo Content. Please do not update.",
"DataEntryUserId": XXXXX387,
"DataEntryUserRealName": "ADMIN",
"EndoEffectiveDate": "2024-01-29",
"EndoId": "9935600027,F5E86D2B6DFD25EEB54D8C29CA09995C",
"EndoNo": "POTBTI01230805-001",
"EndoStatus": "120",
"EndoType": "3",
"EntryOperId": XXXXX387,
"IndexNumber": 0,
"IsLockedByRi": "N",
"NewPolicy": {
........
},
"OldPolicy": {
........
},
"PolicyId": "9935720064,F836CE9077FEAE388B6F890D518BAFB9",
"PolicyNo": "POTBTI01230805",
"ProductCode": "TBTI",
"ProductId": 351925022,
"SubEndoType": "32",
"VersionSeq": 1
}Numbering API
Numbering - Business Usage
- Generate all kinds of quotation/proposal/policy/endorsement number
Numbering - API Path
- /proposal/core/proposal/v1/generatePolicyNo
- /proposal/core/proposal/v1/generateProposalNo
- /platform-pub/public/numbering/v1/generateByTypeAndNumberFactors?numberingType={{}} - This API is for common usage to extend more types of numbering.
Numbering - What I Can Extend
- Customize quotation/proposal/policy/endorsement numbering logic, for example, adding product code or year into the numbering generation.
Numbering - Configuration Numbering Template
For more details about how to configure numbering template, see Numbering Template Guide.
For example, about the default event for number factors, see numbering apis. Or if any rule is required to customize more complicated logic to generate the number, see proposal no generated with rule.
Numbering - API Sample
- Sample Request
Take PROPOSAL_NUMBER as an example,
{{server}}/platform-pub/public/numbering/v1/generateByTypeAndNumberFactors?numberingType=PROPOSAL_NUMBER
{
"SequenceFactors": {
"PRODUCT_CODE": "TBTI"
},
"OtherFactors": {}
}- Sample Response - returned with error message
{
"timestamp": "2024-01-29T15:36:48",
"timestampServer": "2024-01-29T07:36:48",
"status": 422,
"error": "Internal Server Error",
"path": "/public/numbering/v1/generateByTypeAndNumberFactors",
"traceId": "XXXXXee9d675495XXXXX89370f2XXXXX",
"traceIdContainer": null,
"code": "MO-PLATFORM-NUMBERING-B0002",
"exception": "...platform.foundation.exception.BusinessException",
"message": "Number[P{A}{B}TBTI0000000001] Factor Replace Not Complete,numberingType:PROPOSAL_NUMBER,numberingTemplate:P{A}{B}{PRODUCT_CODE}10{SEQUENCE},sequenceFactors:{PRODUCT_CODE=TBTI},otherFactors:{}"
}- Sample Request
{
"SequenceFactors": {
"PRODUCT_CODE": "TBTI",
"A":"2024",
"B": "DEMO"
},
"OtherFactors": {}
}- Sample Response - returned with proposal number
"P2024DEMOTBTI0000000001"