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
- Type: ConnectApi.InsuranceMemberRatingInputRepresentation
- Input representation for rating the members.
- memberId
- Type: String
- ID of the group census member.
Return Value
Example
Here's an example of how to invoke the Insurance Member Rating API from Apex code.
1// Individual Member Rating via Connect API (simple version)
2
3// 1) Build the input
4ConnectApi.InsuranceMemberRatingInputRepresentation input =
5 new ConnectApi.InsuranceMemberRatingInputRepresentation();
6
7// Optional: Effective date (ISO-8601)
8input.effectiveDate = '2025-11-26T15:26:00.000';
9
10// Members to rate (one or more)
11ConnectApi.InsuranceMemberRatingDetailsInputRepresentation memberDetails =
12 new ConnectApi.InsuranceMemberRatingDetailsInputRepresentation();
13memberDetails.memberId = '0r6SG0000008n8XYAQ'; // member to rate
14
15// Plan(s) to rate for this member
16ConnectApi.InsuranceMemberRatingPlansInputRepresentation plan =
17 new ConnectApi.InsuranceMemberRatingPlansInputRepresentation();
18plan.planId = '0rgSG0000000fgIYAQ';
19plan.planCoverageIds = new List<String>{
20 '0rgSG0000000fgJYAQ'
21};
22
23// Assign plans to the member and add to input
24memberDetails.plans = new List<ConnectApi.InsuranceMemberRatingPlansInputRepresentation>{ plan };
25input.members = new List<ConnectApi.InsuranceMemberRatingDetailsInputRepresentation>{ memberDetails };
26
27// 2) Execute the POST API with the primary Group Census Member Id (family anchor)
28String primaryMemberId = '0r6SG0000008n8OYAQ';
29
30try {
31 ConnectApi.InsuranceMemberRatingRepresentation result =
32 ConnectApi.InsuranceGroupBenefitsFamily.postInsuranceMembersRating(
33 input,
34 primaryMemberId
35 );
36
37 System.debug('Member Rating ID: ' + result.id);
38 System.debug('Pricing Results: ' + JSON.serializePretty(result.pricingResults));
39 System.debug('Errors: ' + JSON.serializePretty(result.errors));
40} catch (Exception e) {
41 System.debug('Member Rating error: ' + e.getMessage());
42}