---
schema_version: "1"
id: d2f618f27b8bb91cfa9344ff483b51c77c18b8ef1c3ece0389d6d672615e49d0
title: |-
  postInsuranceGroupRenewal(censusId,
        insuranceGroupRenewalInputRepresentation)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsuranceGroupBenefitsFamily_postInsuranceGroupRenewal.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsuranceGroupBenefitsFamily_postInsuranceGroupRenewal.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 317fedd7dcd827b0e355df114006141d7b2f7c1487a96c4a776d119b6b883dea
description: Renew insurance policies of group census members for a contract renewal. Use this method to create insurance policies under the renewed contract for each primary census member, link the new policies to their previous policies, and record renewal transactions.
---
# postInsuranceGroupRenewal(censusId, insuranceGroupRenewalInputRepresentation)

Renew insurance policies of group census members for a contract renewal. Use this method to create insurance policies under the renewed contract for each primary census member, link the new policies to their previous policies, and record renewal transactions.

## API Version

68.0

## Requires Chatter

No

## Signature

public static ConnectApi.InsuranceGroupRenewalRepresentation postInsuranceGroupRenewal(String censusId, ConnectApi.InsuranceGroupRenewalInputRepresentation insuranceGroupRenewalInputRepresentation)

## Parameters

**censusId**

- Type: String
- ID of the group census whose primary members' policies must be renewed.

**insuranceGroupRenewalInputRepresentation**

- Type: [ConnectApi.InsuranceGroupRenewalInputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_input_insurance_group_renewal.htm "Input representation of the optional flow and repricing settings used to renew member policies for a group census.")
- Optional flow and repricing settings that are used to renew member policies.

## Return Value

Type: [ConnectApi.InsuranceGroupRenewalRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_insurance_group_renewal.htm "Output representation that's returned after a request to renew member policies is accepted. The response includes the asynchronous request ID and any errors that occurred while validating or scheduling the job.")

## Usage

Use this method to renew insurance policies of group census members for a contract renewal. Specify a group census whose type is Renewal in censusId. All properties on the input representation are optional.

To use a custom flow, set flowName to the flow's API name. If you omit flowName, the method uses the default RenewMemberPolicies flow. Set shouldReprice to false to keep the premiums from the existing GroupCensusMemberPlan records instead of recalculating them. The default value is true.

The method runs asynchronously. It creates insurance policies under the renewed contract for each primary census member, links the new policies to their previous policies, and records renewal transactions. Use the requestId in the response to track the job. Errors that occur while validating or scheduling the job are in the errors property.

## Example

This example renews member policies for a group census whose type is Renewal. It uses the RenewMemberPolicies flow and reuses existing GroupCensusMemberPlan premiums instead of recalculating them. Provide only the input properties that you want to override.

// Renew member policies for a contract renewal.
// The group census type must be Renewal.

final String CENSUS\_ID = '0rfxx000000022IAAQ';
final String RENEWAL\_FLOW = 'RenewMemberPolicies';   // optional; default flow when omitted

ConnectApi.InsuranceGroupRenewalInputRepresentation input =
    new ConnectApi.InsuranceGroupRenewalInputRepresentation();
input.flowName = RENEWAL\_FLOW;   // optional — omit to use the default RenewMemberPolicies flow
input.shouldReprice = false;     // optional — default true; false reuses existing GCMP premiums

try {
    ConnectApi.InsuranceGroupRenewalRepresentation result =
        ConnectApi.GroupBenefitsApi.postInsuranceGroupRenewal(CENSUS\_ID, input);

    System.debug('requestId: ' + result.requestId);
    System.debug('errors: ' + result.errors);
} catch (Exception e) {
    System.debug('Error while renewing member policies: ' + e.getMessage());
}

This example renews with the default RenewMemberPolicies flow and repricing on (shouldReprice is true). The entire input is optional in this example.

// Renew member policies with defaults: RenewMemberPolicies flow, shouldReprice = true.

final String CENSUS\_ID = '0rfxx000000022IAAQ';

ConnectApi.InsuranceGroupRenewalInputRepresentation input =
    new ConnectApi.InsuranceGroupRenewalInputRepresentation();

try {
    ConnectApi.InsuranceGroupRenewalRepresentation result =
        ConnectApi.GroupBenefitsApi.postInsuranceGroupRenewal(CENSUS\_ID, input);

    System.debug('requestId: ' + result.requestId);
    System.debug('errors: ' + result.errors);
} catch (Exception e) {
    System.debug('Error while renewing member policies: ' + e.getMessage());
}