You are here:
InsPolicyService:cancelPoliciesInBulk
Use this service to cancel policy records (InsurancePolicy) in bulk. The service uses InsPolicyService:cancelPolicy service and Vlocity batch Framework to process the cancellation of multiple policies asynchronously.
This service uses Contract Group Plan and is specific to the Group Benefits feature.
Class: InsPolicyService
Method: cancelPoliciesInBulk
How It Works
The service takes a list of policy details (policyId and effectiveDate) and then creates batch job to cancel policies in bulk. The batchSize is provided as an input parameter in options. If no value is provided, the service takes 12 as the default batch size. The service only processes valid policy details from the list and returns the invalid ones in output. A policy is considered invalid for cancellation if the policyId or effectiveDate is null/empty.
The maximum batch size supported by the service is 12. Any batch size over 12 will throw an error.
Input Options
| Option | Description |
|---|---|
policyId
|
Required The ID of policy to be canceled. |
effectiveDate
|
Required The date on which policy cancellation becomes effective. The supported format is
|
batchSize
|
Optional The size of batches to be processed. The maximum batch size supported is 12. |
Remote Options
Option |
Description |
|---|---|
batchSize
|
Optional. The size of batches to be processed. The maximum batch size supported is 12. |
Sample Input and Output JSON Format
Input JSON
inputs :
{
"policies": [
{
"policyId" : "0YTR00000000000000",
"effectiveDate" : "12/22/2022"
},
{
"policyId" : "0YTR00000000000001",
"effectiveDate" : "12/22/2022"
},
{
"policyId" : null, //invalid policy detail
"effectiveDate" : "12/22/2022"
},
]
}
options :
{
"batchSize" : 1
}
Output JSON
{
"invalidPolicies" : [
{
"policyId" : null, //invalid policy detail
"effectiveDate" : "12/22/2022"
}
]
}Input JSON
inputs :
{
"policies": [
{
"policyId" : "0YTR00000000000000",
"effectiveDate" : "12/22/2022"
},
{
"policyId" : "0YTR00000000000001",
"effectiveDate" : "12/22/2022"
},
{
"policyId" : null, //invalid policy detail
"effectiveDate" : "12/22/2022"
},
]
}
options :
{
"batchSize" : 13
}Output JSON
{
"error": "batchSize should not be greater than 12/null/non-zero"
}
