---
schema_version: "1"
id: 5a21347daa9e4d955206940fdaf118eac3709245899682666c4bce6335f39ce4
title: getInsuranceMemberEligiblePlans(memberId, shouldIncludeDependents)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsuranceGroupBenefitsFamily_getInsuranceMemberEligiblePlans.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsuranceGroupBenefitsFamily_getInsuranceMemberEligiblePlans.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 511d4c4826ce235e048a823ac392efae7c0b14297b2eba17a60c1eba888a5768
description: Get the enrollment plans for which a group census member and their dependents are eligible.
---
# getInsuranceMemberEligiblePlans(memberId, shouldIncludeDependents)

Get the enrollment plans for which a group census member and their dependents are eligible.

## API Version

65.0

## Requires Chatter

No

## Signature

public static ConnectApi.InsuranceGetMembersPlans getInsuranceMemberEligiblePlans(String memberId, Boolean shouldIncludeDependents)

## Parameters

**memberId**

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

**shouldIncludeDependents**

- Type: Boolean
- Indicates whether to include eligible plans for the member's dependents in the response (true) or not (false).

## Return Value

Type: [ConnectApi.InsuranceGetMembersPlans](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_insurance_get_members_plans.htm "Output representation for a member's eligible plans.")

## Example

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

// Get Member Eligible Plans via Connect API (simple version)

// Replace with an existing Group Census Member Id
String memberId = '0r6xx00000007BrAAI';

// Optional: include dependents’ plans (requires API version >= 258)
Boolean includeDependents = true;

try {
    ConnectApi.InsuranceGetMembersPlans result =
        ConnectApi.InsuranceGroupBenefitsFamily.getInsuranceMemberEligiblePlans(memberId, includeDependents);

    System.debug('Eligible Plans response: ' + JSON.serializePretty(result));
} catch (Exception e) {
    System.debug('Error while fetching eligible plans: ' + e.getMessage());
}