Get Eligible Insurance Clauses Action

Get eligible insurance clauses based on quote ID and context ID. You must specify either a quote ID or a context ID, and either an instance key or a quote line item ID to get the eligible insurance clauses.

This action is available in API version 65.0 and later.

Supported REST HTTP Methods 

URI: /services/data/vXX.X/actions/standard/getEligibleInsuranceClauses

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 

InputTypeDescription
contextIdstringRequired if quoteId isn’t specified. Context ID of the insurance quote.
instanceKeystringRequired if quoteLineItemId isn’t specified. Unique key that identifies the product to which a quote line item belongs.
quoteIdstringRequired if contextId isn’t specified. ID of the insurance quote to get eligible clauses.
quoteLineItemIdstringRequired if instanceKey isn’t specified. ID of the quote line items to get eligible clauses.

Outputs 

OutputTypeDescription
eligibleClausesstringDetails of insurance product clauses.
errorsListstringErrors that are encountered during the operation.
isSuccessbooleanIndicates whether the operation is successful ( true ) or not ( false ).

Example 

Sample Request

1{
2  "inputs": [
3    {
4      "contextId": "0000000i18tq18g0025175944829641764efd423f7dc44b98dd1e829086efc59",
5      "instanceKey": [
6        "a3Nxx000000CmikEAC"
7      ],
8      "quoteId": "0Q0xx000000Dm3jCAC",
9      "quoteLineItemId": "0QLxx000000E5d1OAC"
10    }
11  ]
12}

This is a sample request to call this invocable action from Apex code.

1// Sample Apex call for getEligibleInsuranceClauses invocable action
2public class GetEligibleInsuranceClausesInvoke {
3    private static final String ACTION_NAME = 'getEligibleInsuranceClauses';
4
5    public static Boolean invokeMethod(Map<String, Object> inputs, Map<String, Object> output) {
6        if (output == null) {
7            output = new Map<String, Object>();
8        }
9
10        try {
11            Invocable.Action action = Invocable.Action.createStandardAction(ACTION_NAME);
12
13            // Either quoteId or contextId is required
14            setInvocationParameter(action, inputs, 'quoteId', false);
15            setInvocationParameter(action, inputs, 'contextId', false);
16
17            // Either quoteLineItemId or instanceKey is required
18            setInvocationParameter(action, inputs, 'quoteLineItemId', false);
19            setInvocationParameter(action, inputs, 'instanceKey', false);
20
21            List<Invocable.Action.Result> results = action.invoke();
22            if (results != null && !results.isEmpty() && results[0].isSuccess()) {
23                output.put('output', results[0].getOutputParameters());
24                output.put('success', true);
25                return true;
26            }
27
28            output.put('success', false);
29            if (results != null && !results.isEmpty()) {
30                output.put('errors', results[0].getErrors());
31            }
32            return false;
33        } catch (Exception e) {
34            output.put('success', false);
35            output.put('errorMessage', e.getMessage());
36            return false;
37        }
38    }
39
40    private static void setInvocationParameter(
41        Invocable.Action action,
42        Map<String, Object> payload,
43        String attribute,
44        Boolean serializeJson
45    ) {
46        if (payload != null && payload.containsKey(attribute) && payload.get(attribute) != null) {
47            if (serializeJson) {
48                action.setInvocationParameter(attribute, JSON.serialize(payload.get(attribute)));
49            } else {
50                action.setInvocationParameter(attribute, payload.get(attribute));
51            }
52        }
53    }
54}

Sample Response

1[
2  {
3    "actionName": "getEligibleInsuranceClauses",
4    "errors": null,
5    "invocationId": null,
6    "isSuccess": true,
7    "outcome": null,
8    "outputValues": {
9      "getEligibleClausesOutputRep": {
10        "errors": [],
11        "insuranceProductClauses": [
12          {
13            "category": "Manual",
14            "clauseName": "mxtestIC",
15            "description": "two variable",
16            "effectiveDate": "2025-10-01",
17            "expirationDate": "2025-12-31",
18            "insuranceProductClauseId": "...",
19            "type": "Clause"
20          }
21        ],
22        "success": true
23      }
24    },
25    "sortOrder": -1,
26    "version": 1
27  }
28]