---
schema_version: "1"
id: b94c9024f019fcf1287e6c39103eca79901d53bd98a68e71b2d816610292108e
title: |-
  postInsuranceGroupEndorsement(censusId,
        insuranceGroupEndorsementInputRepresentation)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsuranceGroupBenefitsFamily_postInsuranceGroupEndorsement.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsuranceGroupBenefitsFamily_postInsuranceGroupEndorsement.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 194613e63a1fe38d3ebda9065295137c618451c4b2b2a5bf1d47b7b40384b9f0
description: Apply mid-term contract adjustments to the eligible member policies in a group census. Use this method after an endorsed contract version is created so that member policies reflect the contract changes.
---
# postInsuranceGroupEndorsement(censusId, insuranceGroupEndorsementInputRepresentation)

Apply mid-term contract adjustments to the eligible member policies in a group census. Use this method after an endorsed contract version is created so that member policies reflect the contract changes.

## API Version

68.0

## Requires Chatter

No

## Signature

public static ConnectApi.InsuranceGroupEndorsementRepresentation postInsuranceGroupEndorsement(String censusId, ConnectApi.InsuranceGroupEndorsementInputRepresentation insuranceGroupEndorsementInputRepresentation)

## Parameters

**censusId**

- Type: String
- ID of the group census whose eligible member policies are updated based on the contract mid-term adjustment.

**insuranceGroupEndorsementInputRepresentation**

- Type: [ConnectApi.InsuranceGroupEndorsementInputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_input_insurance_group_endorsement.htm "Input representation of the optional flow and repricing settings that are used to apply mid-term contract adjustments to member policies in a group census.")
- Optional flow and repricing settings that are used to apply the contract adjustments to member policies.

## Return Value

Type: [ConnectApi.InsuranceGroupEndorsementRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_insurance_group_endorsement.htm "Output representation that's returned after a request to apply mid-term contract adjustments to 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 apply mid-term contract adjustments to the eligible member policies in a group census. Specify the census 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 ind\_ins\_grpben\_\_ApplyCntrAdjMbrPlcy. Set shouldReprice to false to keep the premiums from the existing GroupCensusMemberPlan records instead of recalculating them. The default value is true.

The census upload must be finished before you apply the adjustment. The method runs asynchronously. 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 applies mid-term contract adjustments to the eligible member policies in a group census and recalculates premiums. Complete the census upload before you run this method.

// Apply mid-term contract adjustments to eligible member policies.
// The census upload must be finished before adjusting.

final String CENSUS\_ID = '0rfxx000000022IAAQ';

ConnectApi.InsuranceGroupEndorsementInputRepresentation input =
    new ConnectApi.InsuranceGroupEndorsementInputRepresentation();
input.shouldReprice = true;
// input.flowName = 'ind\_ins\_grpben\_\_ApplyCntrAdjMbrPlcy';   // optional; omit to use the default flow

try {
    ConnectApi.InsuranceGroupEndorsementRepresentation result =
        ConnectApi.GroupBenefitsApi.postInsuranceGroupEndorsement(CENSUS\_ID, input);

    System.debug('requestId: ' + result.requestId);
    System.debug('errors: ' + result.errors);
} catch (Exception e) {
    System.debug('Error while applying contract adjustments: ' + e.getMessage());
}

This example uses the default flow and the default repricing behavior (shouldReprice is true).

// Apply mid-term contract adjustments with defaults: default flow, shouldReprice = true.

final String CENSUS\_ID = '0rfxx000000022IAAQ';

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

try {
    ConnectApi.InsuranceGroupEndorsementRepresentation result =
        ConnectApi.GroupBenefitsApi.postInsuranceGroupEndorsement(CENSUS\_ID, input);

    System.debug('requestId: ' + result.requestId);
    System.debug('errors: ' + result.errors);
} catch (Exception e) {
    System.debug('Error while applying contract adjustments: ' + e.getMessage());
}