postInsuranceMembersRating(insuranceMemberRatingInputParam, memberId)

Calculate pricing for individual members of a group census, with the support for plan and individual coverages within the plan.

API Version

65.0

Requires Chatter

No

Signature

public static ConnectApi.InsuranceMemberRatingRepresentation postInsuranceMembersRating(ConnectApi.InsuranceMemberRatingInputRepresentation insuranceMemberRatingInputParam, String memberId)

Parameters

insuranceMemberRatingInputParam

memberId

  • Type: String
  • ID of the group census member.

Example

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

// Individual Member Rating via Connect API (simple version)

// 1) Build the input
ConnectApi.InsuranceMemberRatingInputRepresentation input =
    new ConnectApi.InsuranceMemberRatingInputRepresentation();

// Optional: Effective date (ISO-8601)
input.effectiveDate = '2025-11-26T15:26:00.000';

// Members to rate (one or more)
ConnectApi.InsuranceMemberRatingDetailsInputRepresentation memberDetails =
    new ConnectApi.InsuranceMemberRatingDetailsInputRepresentation();
memberDetails.memberId = '0r6SG0000008n8XYAQ'; // member to rate

// Plan(s) to rate for this member
ConnectApi.InsuranceMemberRatingPlansInputRepresentation plan =
    new ConnectApi.InsuranceMemberRatingPlansInputRepresentation();
plan.planId = '0rgSG0000000fgIYAQ';
plan.planCoverageIds = new List<String>{
    '0rgSG0000000fgJYAQ'
};

// Assign plans to the member and add to input
memberDetails.plans = new List<ConnectApi.InsuranceMemberRatingPlansInputRepresentation>{ plan };
input.members = new List<ConnectApi.InsuranceMemberRatingDetailsInputRepresentation>{ memberDetails };

// 2) Execute the POST API with the primary Group Census Member Id (family anchor)
String primaryMemberId = '0r6SG0000008n8OYAQ';

try {
    ConnectApi.InsuranceMemberRatingRepresentation result =
        ConnectApi.InsuranceGroupBenefitsFamily.postInsuranceMembersRating(
            input,
            primaryMemberId
        );

    System.debug('Member Rating ID: ' + result.id);
    System.debug('Pricing Results: ' + JSON.serializePretty(result.pricingResults));
    System.debug('Errors: ' + JSON.serializePretty(result.errors));
} catch (Exception e) {
    System.debug('Member Rating error: ' + e.getMessage());
}