The action retrieves member-specific coverage selections, validates them against the plan selection and checks for duplicate policies if specified in action parameter, and generates insurance policies, coverages, participants and related objects. The action returns list of insurance policy IDs that are generated or error if they occur during the processing.
This action is available in API version 65.0 and later.
Supported REST HTTP Methods
URI: /services/data/vXX.X/actions/standard/processMemberEnrollment
Where XX.X is the latest API version.
Formats: JSON, XML
HTTP Methods: POST
Authentication: Authorization: Bearer TOKEN
Where TOKEN is your OAuth access token.
Inputs
| Input | Type | Description |
|---|---|---|
| contractGroupPlanId | string | Required ID of the Contract Group Plan that's used to retrieve associated product and coverage details. |
| createRelatedObjectRecords | boolean | Indicates whether to create related records for each insurance policy participant ( true ) or not ( false ). If set to true , two insurance policy participant related object records are created per participant. The first record maps the participant to the associated Group Census Member, and the second record links the participant to either a Person Account or a Contact, based on their participant type. |
| duplicateCheckRequired | boolean | Indicates whether to check for duplicate policies ( true ) or not ( false ). The default value is true . If set to true and a policy already exists for the same member and product category, this invocable action shows an error. |
| groupCensusMembers | sobject | Collection of group census member records that represent the members that must be enrolled. |
| pricingResult | Apex-defined | Collection of Apex ConnectApi.MembersPlansRatingOutput records that contain pricing results for the requested members. |
Outputs
| Output | Type | Description |
|---|---|---|
| insurancePolicyIds | string | IDs of the insurance policy records that are created. |
Example
Sample Request
{
"inputs": [
{
"groupCensusMembers": [
{
"Id": "0r6SG00000093MrYAI",
"Name": "John Doe",
"FirstName": "John",
"LastName": "Doe",
"Email": "john.doe@example.com",
"BirthDate": "1998-03-15"
}
],
"contractGroupPlanId": "0rgSG0000000iaXYAQ",
"pricingResult": {
"pricingResults": [
{
"plans": [
{
"rates": [
{
"value": 60,
"key": "NetUnitPrice"
},
{
"value": 0,
"key": "StandardQLITaxAmount"
}
],
"proratedRates": [
{
"value": 60,
"key": "NetUnitPrice"
},
{
"value": 0,
"key": "StandardQLITaxAmount"
}
],
"planId": "0rgSG0000000iaXYAQ",
"errors": [],
"coverages": [
{
"rates": [
{
"value": 0,
"key": "StandardQLITaxAmount"
},
{
"value": 20,
"key": "NetUnitPrice"
}
],
"proratedRates": [
{
"value": 0,
"key": "StandardQLITaxAmount"
},
{
"value": 20,
"key": "NetUnitPrice"
}
],
"errors": [],
"coverageId": "0rgSG0000000iaZYAQ",
"contributions": {
"groupClassContributionId": "0rFSG0000000Beb2AE",
"errors": [],
"employerPremiumAmount": 2,
"employeePremiumAmount": 18
}
},
{
"rates": [
{
"value": 0,
"key": "StandardQLITaxAmount"
},
{
"value": 40,
"key": "NetUnitPrice"
}
],
"proratedRates": [
{
"value": 0,
"key": "StandardQLITaxAmount"
},
{
"value": 40,
"key": "NetUnitPrice"
}
],
"errors": [],
"coverageId": "0rgSG0000000iaaYAA",
"contributions": {
"groupClassContributionId": null,
"errors": [],
"employerPremiumAmount": 0,
"employeePremiumAmount": 40
}
}
],
"contributions": {
"groupClassContributionId": null,
"errors": [],
"employerPremiumAmount": 2,
"employeePremiumAmount": 58
}
}
],
"memberId": "0r6SG00000093MrYAI",
"errors": []
}
],
"errors": []
}
}
]
}
Sample Response
[
{
"actionName": "processMemberEnrollment",
"errors": null,
"invocationId": null,
"isSuccess": true,
"outcome": null,
"outputValues": {
"insurancePolicyIds": ["0YTSG000000QzO14AK"]
},
"sortOrder": -1,
"version": 1
}
]