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.
postInsuranceIndividualEnrollment(insuranceIndividualEnrollmentInputParam, memberId)
API Version
65.0
Requires Chatter
No
Signature
public static ConnectApi.InsuranceIndividualEnrollmentOutputRepresentation postInsuranceIndividualEnrollment(ConnectApi.InsuranceIndividualEnrollmentInputRepresentation insuranceIndividualEnrollmentInputParam, String memberId)
Parameters
- insuranceIndividualEnrollmentInputParam
- Type: ConnectApi.InsuranceIndividualEnrollmentInputRepresentation
- Details of the plans to enroll the member in.
- memberId
- Type: String
- ID of the Group Census Member to enroll.
Return Value
Type: ConnectApi.InsuranceIndividualEnrollmentOutputRepresentation
Example
Here's an example of how to invoke the Individual Enrollment API from Apex code.
1// Individual Enrollment via Connect API (simple version)
2
3// 1) Create the top-level input
4ConnectApi.InsuranceIndividualEnrollmentInputRepresentation input =
5 new ConnectApi.InsuranceIndividualEnrollmentInputRepresentation();
6
7// Required: target plan (Contract Group Plan Id)
8input.plan = '0rgxx00000000CcAAI';
9
10// Optional: specify a processing flow if your org uses one
11// input.flowName = 'DefaultEnrollmentFlow';
12
13// 2) Execute the POST API with the Group Census Member Id
14String memberId = '0r6xx00000007G2AAI';
15
16try {
17 ConnectApi.InsuranceIndividualEnrollmentOutputRepresentation result =
18 ConnectApi.InsuranceGroupBenefitsFamily.postInsuranceIndividualEnrollment(input, memberId);
19
20 System.debug('Individual Enrollment result: ' + JSON.serializePretty(result));
21} catch (Exception e) {
22 System.debug('Error during individual enrollment: ' + e.getMessage());
23}