Get Insurance Quote Details Action

Get the details of an insurance quote.

This action is available in API version 63.0 and later.

Supported REST HTTP Methods 

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

Where XX.X is the latest API version.

Formats: JSON

HTTP Methods: GET, POST

Authentication: Authorization: Bearer TOKEN

Where TOKEN is your OAuth access token.

Inputs 

InputTypeDescription
quoteIdStringRequired. ID of the insurance quote to get the details for.
filtersStringOptional. The filters used to filter the insurance quote or line items associated with the insurance quote.

Outputs 

OutputDetails
contextIdType
String
Description
Context ID of the insurance quote that’s created.
contextJsonType
Map<String, Object>
Description
List of insurance context details.

Example 

Sample Request

1{
2  "inputs": 
3  [
4      {
5        "quoteId": "0Q0xx0000004CXECA2"
6      }
7  ]
8}

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

1// Sample Apex call for getInsuranceQuoteDetails invocable action
2public class GetInsuranceQuoteDetailsInvoke {
3    private static final String ACTION_NAME = 'getInsuranceQuoteDetails';
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            // Optional inputs
14            setInvocationParameter(action, inputs, 'quoteId', false);
15            setInvocationParameter(action, inputs, 'filters', false);
16
17            List<Invocable.Action.Result> results = action.invoke();
18            if (results != null && !results.isEmpty() && results[0].isSuccess()) {
19                output.put('output', results[0].getOutputParameters());
20                output.put('success', true);
21                return true;
22            }
23
24            output.put('success', false);
25            if (results != null && !results.isEmpty()) {
26                output.put('errors', results[0].getErrors());
27            }
28            return false;
29        } catch (Exception e) {
30            output.put('success', false);
31            output.put('errorMessage', e.getMessage());
32            return false;
33        }
34    }
35
36    private static void setInvocationParameter(
37        Invocable.Action action,
38        Map<String, Object> payload,
39        String attribute,
40        Boolean serializeJson
41    ) {
42        if (payload != null && payload.containsKey(attribute) && payload.get(attribute) != null) {
43            if (serializeJson) {
44                action.setInvocationParameter(attribute, JSON.serialize(payload.get(attribute)));
45            } else {
46                action.setInvocationParameter(attribute, payload.get(attribute));
47            }
48        }
49    }
50}

Sample Response

1[
2  {
3    "actionName": "getInsuranceQuoteDetails",
4    "errors": null,
5    "invocationId": null,
6    "isSuccess": true,
7    "outcome": null,
8    "outputValues": {
9      "contextId": "0000000i18tq18g00291753491555889e8ef669a59f0453fade5acbe4595a3d6",
10      "contextJson": {
11        "SalesTransaction": [
12          {
13            "Status": "Draft",
14            "Account": null,
15            "BillingCity": null,
16            "Subtotal": 1350,
17            "businessObjectType": "Quote",
18            "SalesTransactionName": "Multi Auto",
19            "TotalAmount": 1350,
20            "ShippingStreet": null,
21            "SalesTransactionItem": [
22              {
23                "ProrationPolicy": "0muxx000000004sAAA",
24                "ProductName": "Medical Payments",
25                "ProductCode": "STA-3",
26                "ProductSellingModel": "0jPxx000000004sEAA",
27                "SpecificationType": "Coverage",
28                "TaxTreatment": "1ttxx000000004rAAA",
29                "SalesTransactionItemParent": "0Q0xx0000004CE1CAM",
30                "Quantity": 1,
31                "Product": "01txx0000006i7KAAQ",
32                "businessObjectType": "QuoteLineItem",
33                "PricebookEntry": "01uxx0000008ybrAAA",
34                "PricingTermCount": 1,
35                "StartDate": "2023-10-19T00:00:00Z",
36                "NetUnitPrice": 750,
37                "UnitPrice": 750,
38                "id": "0QLxx0000004CIpGAM"
39              },
40              {
41                "ProrationPolicy": null,
42                "ProductName": "Collision",
43                "ProductCode": "STA-2",
44                "ProductSellingModel": "0jPxx000000004tEAA",
45                "SpecificationType": "Coverage",
46                "TaxTreatment": "1ttxx000000004rAAA",
47                "SalesTransactionItemParent": "0Q0xx0000004CE1CAM",
48                "Quantity": 1,
49                "Product": "01txx0000006i7JAAQ",
50                "businessObjectType": "QuoteLineItem",
51                "PricebookEntry": "01uxx0000008ybsAAA",
52                "PricingTermCount": 1,
53                "StartDate": null,
54                "NetUnitPrice": 500,
55                "UnitPrice": 500,
56                "id": "0QLxx0000004CIqGAM"
57              }
58            ],
59            "BillingCountry": null,
60            "BillingStreet": null,
61            "Pricebook": "01sxx0000005pyfAAA",
62            "Opportunity": null,
63            "ShippingPostalCode": null,
64            "SalesTransactionSource": "0Q0xx0000004CE1CAM",
65            "ShippingCountry": null,
66            "ShippingCity": null,
67            "ShippingState": null,
68            "BillingPostalCode": null,
69            "id": "0Q0xx0000004CE1CAM",
70            "Contract": null,
71            "BillingState": null
72          }
73        ]
74      }
75    },
76    "sortOrder": -1,
77    "version": 1
78  }
79]