The Insurance Policy Renewal API takes a JSON input that contains the insurance policy ID that must be renewed along with the fieldValueMap details. The API submits the request to a queue, creates a policy, along with child records by using the context definition selected in setup. The service also overrides the fieldValueMap in the new policy for the policy ID passed in the request. Users receive success and failure notifications on request completion.
Keep these considerations in mind when you use this method.
The RenewedFromPolicyId value of the new policy is set to the current policy ID and IsRenewedPolicy field of the new policy is set to true.
The fieldValueMap expects the keys to be API name and is case-sensitive.
Example
The Apex example shows how to use the ConnectApi.InsuranceBrokerageFamily.renewInsurancePolicy() method to reinstate a previously canceled insurance policy.
Class Definition
This Apex example shows how to renew an insurance policy.
1global class RenewConnectDriver{23 global static void callRenewConnectAPI(){4 Map<String, Object>input = new Map<String, Object>();5 input.put('policyId', '0YTxx000000001dGAA');67 ConnectApi.InsurancePolicyRenewInputRepresentation policyInput = new ConnectApi.InsurancePolicyRenewInputRepresentation();8 Map<String, Object>fields = new Map<String, Object>();9 fields.put('Name', 'Test Apex Renew');10 policyInput.fieldValueMap = fields;11 policyInput.sameCarrier = true;1213 input.put('policyInput', policyInput);1415 Map<String, Object>output = new Map<String, Object>();16 Map<String, Object>args = new Map<String, Object>();17 args.put('input', input);18 args.put('output', output);1920 RenewTestConnectAPI callable = new RenewTestConnectAPI();21 Object result = callable.call('renew', args);2223 ConnectApi.InsurancePolicyProcessOutputRepresentation policyData =24(ConnectApi.InsurancePolicyProcessOutputRepresentation)result;25 System.debug('Renew Policy Data: ' + JSON.serializePretty(policyData));2627 if(output.containsKey('error')){28 System.debug('Error: ' + output.get('error'));29}30}31}
Usage Example
Use the RenewTestConnectAPI class to execute the renew action and process the result.