Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

postInsuranceGroupRating(gbGroupRatingInputParam, quoteId)

Rate a group benefits quote to calculate premiums for all quote line items.

API Version

65.0

Requires Chatter

No

Signature

public static ConnectApi.InsuranceGroupRatingOutputRepresentation postInsuranceGroupRating(ConnectApi.InsuranceGroupRatingInputRepresentation gbGroupRatingInputParam, String quoteId)

Parameters

gbGroupRatingInputParam
Type: ConnectApi.InsuranceGroupRatingInputRepresentation
The details required for the group rating process.
quoteId
Type: String
ID of the quote to perform the group rating on.

Example

Here's an example of how to invoke the Insurance Group Rating API from Apex code.

1// Group Rating via Connect API (simple version)
2
3// 1) Build the input
4ConnectApi.InsuranceGroupRatingInputRepresentation input =
5    new ConnectApi.InsuranceGroupRatingInputRepresentation();
6
7// Required: Quote Line Item Ids to rate
8// input.quoteLineItemIds = new List<String>{
9//     '0QLxx00000001A1AAY', '0QLxx00000001A2AAY'
10// };
11
12// Optional: Rating date (ISO-8601, e.g., 2025-11-26)
13input.ratingDate = '2025-11-26T14:19:30.000';
14
15// Optional: Batch size (process quote line items in batches)
16// input.batchSize = 100;
17
18// 2) Execute the POST API with the Quote Id
19String quoteId = '0Q0SG000000PcEz0AK'; // Quote Id (type 0Q0)
20
21try {
22    ConnectApi.InsuranceGroupRatingOutputRepresentation result =
23        ConnectApi.InsuranceGroupBenefitsFamily.postInsuranceGroupRating(
24            input,
25            quoteId
26        );
27
28    System.debug('Group Rating success: ' + result.isSuccess);
29    System.debug('Errors: ' + JSON.serializePretty(result.errors));
30} catch (Exception e) {
31    System.debug('Group Rating error: ' + e.getMessage());
32}