---
schema_version: "1"
id: 3bf788faeda2f8b22203912d337dd0c73aa1da99171d44c581e52be895c62c50
title: postInsuranceContractRenewal(contractRenewalInputParam)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsuranceGroupBenefitsFamily_postInsuranceContractRenewal.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsuranceGroupBenefitsFamily_postInsuranceContractRenewal.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: bf18326336d3195ae7ef3bd9ce10457485f2e089e527d443dbd8bbaca7d7a740
description: Create a renewed-term group benefits contract from a quote.
---
# postInsuranceContractRenewal(contractRenewalInputParam)

Create a renewed-term group benefits contract from a quote.

## API Version

68.0

## Requires Chatter

No

## Signature

public static ConnectApi.InsuranceContractRenewalRepresentation postInsuranceContractRenewal(ConnectApi.InsuranceContractRenewalInputRepresentation contractRenewalInputParam)

## Parameters

**contractRenewalInputParam**

- Type: [ConnectApi.InsuranceContractRenewalInputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_input_insurance_contract_renewal.htm "Input representation of the quote ID, renewal date, optional contract end date and term, and additional fields used to create a renewed-term contract from a quote.")
- Quote ID, renewal date, optional contract end date and term, and additional fields used to create the renewed contract.

## Return Value

Type: [ConnectApi.InsuranceContractRenewalRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_insurance_contract_renewal.htm "Output representation that's returned when a renewed-term contract is created from a quote.")

## Usage

Use this method to create a renewed insurance contract from a renewal quote. The method carries forward applicable contract details and line items for the next coverage term. Specify the quote in quoteId and the start of the renewed term in renewalDate using yyyy-MM-dd format.

To set the end of the renewed term, use contractEndDate in yyyy-MM-dd format, or set contractTerm in months. The default term is 12 months.

To stamp additional fields on Contract, InsuranceContract, or ContractGroupPlan, add items to additionalFields. For a contract group plan, set productPath to identify where in the product hierarchy the fields apply.

This method runs synchronously. Check isSuccess and contractId on the response. Errors are in the errors property.

## Example

This example creates a renewed-term contract from a quote, sets the renewal date, and stamps an enrollment start date on the insurance contract.

// Create a renewed-term contract from a quote.

final String SOURCE\_QUOTE\_ID = '0Q0xx0000004C92CAE';
final String RENEWAL\_DATE = '2027-01-01';   // yyyy-MM-dd

// Optional: additional fields for Contract / InsuranceContract / ContractGroupPlan.
ConnectApi.InsuranceApexStringRepresentation enrollmentStart =
    new ConnectApi.InsuranceApexStringRepresentation();
enrollmentStart.key = 'EnrollmentStartDate';
enrollmentStart.value = '2027-01-01';

ConnectApi.InsuranceContractItem insuranceContractItem = new ConnectApi.InsuranceContractItem();
insuranceContractItem.entity = 'InsuranceContract';
// insuranceContractItem.productPath = 'Health/Dental';
insuranceContractItem.fields = new List<ConnectApi.InsuranceApexStringRepresentation>{
    enrollmentStart
};

ConnectApi.InsuranceContractRenewalInputRepresentation input =
    new ConnectApi.InsuranceContractRenewalInputRepresentation();
input.quoteId = SOURCE\_QUOTE\_ID;
input.renewalDate = RENEWAL\_DATE;
// input.contractTerm = 12;                    // optional; term in months
// input.contractEndDate = '2027-12-31';       // optional; yyyy-MM-dd
input.additionalFields = new List<ConnectApi.InsuranceContractItem>{ insuranceContractItem };

try {
    ConnectApi.InsuranceContractRenewalRepresentation result =
        ConnectApi.InsuranceGroupBenefitsFamily.postInsuranceContractRenewal(input);

    System.debug('isSuccess: ' + result.isSuccess);
    System.debug('contractId: ' + result.contractId);
    System.debug('message: ' + result.message);
    System.debug('errors: ' + result.errors);
} catch (Exception e) {
    System.debug('Error while renewing the contract: ' + e.getMessage());
}