---
schema_version: "1"
id: 9a84fb0627d6311c65311416ace6b6a754a89ffd9e45e499903b1b81b4222948
title: Update Insurance Quote Action
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/actions_obj_update_insurance_quote.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/actions_obj_update_insurance_quote.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8bc546048fdcf8997015da8cdb6675fc81d84a77e3cb2fb565153c76eaee609b
description: Update an existing insurance quote by adding, updating, or deleting nodes and optionally executing pricing and rules.
---
# Update Insurance Quote Action

Update an existing insurance quote by adding, updating, or deleting nodes and optionally executing pricing and rules.

This action is available in API version 66.0 and later.

## Supported REST HTTP Methods

**URI**: /services/data/vXX.X/actions/standard/updateInsuranceQuote

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 |
| --- | --- | --- |
| addedNodes | string | JSON string that contains the set of nodes that must be added to the quote. |
| additionalFields | string | JSON string that contains additional fields that must be updated in the quote context. |
| contextId | string | ID of the context that's used to issue the quote update. |
| deletedNodes | string | JSON string that contains the set of nodes that must be deleted from the quote. |
| pricingProcedureApiName | string | API name of the pricing procedure that's used to price the product. |
| quoteId | string | Required. ID of the insurance quote that must be updated. |
| quoteOptions | Apex-defined | An Apex [runtime\_industries\_insurance.UpdateInsuranceQuoteOptions](https://developer.salesforce.com/docs/atlas.en-us.264.0.insurance_developer_guide.meta/insurance_developer_guide/apex_class_runtime_industries_insurance_UpdateInsuranceQuoteOptions.htm "HTML (New Window)") record that contains the configuration and execution options to update the quote. |
| updatedNodes | string | JSON string that contains the set of nodes that must be updated in the quote. |

## Outputs

| Output | Type | Description |
| --- | --- | --- |
| contextId | string | ID of the context that's used to issue the quote update. |
| errorsList | string | List of errors that occurred during the update operation. |
| isSuccess | boolean | Indicates whether the update operation is successful ( true ) or not ( false ). |
| quoteId | string | Required. ID of the insurance quote that's updated. |

## Example

**POST**

This sample request is for the Update Insurance Quote action.

{
  "inputs": \[
    {
      "quoteId": "0Q0xx000000001xAAA",
      "contextId": "11oxx000001G0lUAAS",
      "pricingProcedureApiName": "StandardPricing",
      "addedNodes": "\[{"productCode":"autoBundle","instanceKeys":\["multiAuto","autoBundle"\],"attributes":{"VehicleYear":"2024","VehicleMake":"Toyota"},"items":\[{"productCode":"auto","instanceKeys":\["multiAuto","autoBundle","auto"\],"attributes":{"VehicleType":"Sedan"}}\]}\]",
      "updatedNodes": "\[{"productCode":"driver","instanceKeys":\["multiAuto","autoBundle","driverTom"\],"attributes":{"DriverAge":"35","LicenseNumber":"D1234567"}}\]",
      "deletedNodes": "\[{"productCode":"coverage","instanceKeys":\["multiAuto","autoBundle","auto","collision"\]}\]",
      "additionalFields": "{"customField1":"value1","customField2":"value2"}",
      "quoteOptions": {
        "executePricing": true,
        "executeConfigurationRules": true,
        "executeQualificationRules": false,
        "validateProductCatalog": true,
        "saveQuote": false
      }
    }
  \]
}

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

// Sample Apex call for updateInsuranceQuote invocable action
public class UpdateInsuranceQuoteInvoke {
    private static final String ACTION\_NAME = 'updateInsuranceQuote';

    public static Boolean invokeMethod(Map<String, Object> inputs, Map<String, Object> output) {
        if (output == null) {
            output = new Map<String, Object>();
        }

        try {
            Invocable.Action action = Invocable.Action.createStandardAction(ACTION\_NAME);

            // Required input
            setInvocationParameter(action, inputs, 'quoteId', false);

            // Optional inputs
            setInvocationParameter(action, inputs, 'contextId', false);
            setInvocationParameter(action, inputs, 'addedNodes', true);
            setInvocationParameter(action, inputs, 'updatedNodes', true);
            setInvocationParameter(action, inputs, 'deletedNodes', true);
            setInvocationParameter(action, inputs, 'additionalFields', true);

            // quoteOptions is required by the IA contract
            if (inputs != null && inputs.containsKey('quoteOptions')) {
                Map<String, Object> optionsFromInput =
                    (Map<String, Object>) inputs.get('quoteOptions');
                if (optionsFromInput != null) {
                    runtime\_industries\_insurance.UpdateInsuranceQuoteOptions quoteOptions =
                        new runtime\_industries\_insurance.UpdateInsuranceQuoteOptions();
                    if (optionsFromInput.containsKey('executePricing')) {
                        quoteOptions.executePricing =
                            (Boolean) optionsFromInput.get('executePricing');
                    }
                    if (optionsFromInput.containsKey('validateProductCatalog')) {
                        quoteOptions.validateProductCatalog =
                            (Boolean) optionsFromInput.get('validateProductCatalog');
                    }
                    if (optionsFromInput.containsKey('executeConfigurationRules')) {
                        quoteOptions.executeConfigurationRules =
                            (Boolean) optionsFromInput.get('executeConfigurationRules');
                    }
                    if (optionsFromInput.containsKey('executeQualificationRules')) {
                        quoteOptions.executeQualificationRules =
                            (Boolean) optionsFromInput.get('executeQualificationRules');
                    }
                    if (optionsFromInput.containsKey('saveQuote')) {
                        quoteOptions.saveQuote =
                            (Boolean) optionsFromInput.get('saveQuote');
                    }
                    action.setInvocationParameter('quoteOptions', quoteOptions);
                }
            }

            List<Invocable.Action.Result> results = action.invoke();
            if (results != null && !results.isEmpty() && results\[0\].isSuccess()) {
                output.put('output', results\[0\].getOutputParameters());
                output.put('success', true);
                return true;
            }

            output.put('success', false);
            if (results != null && !results.isEmpty()) {
                output.put('errors', results\[0\].getErrors());
            }
            return false;
        } catch (Exception e) {
            output.put('success', false);
            output.put('errorMessage', e.getMessage());
            return false;
        }
    }

    private static void setInvocationParameter(
        Invocable.Action action,
        Map<String, Object> payload,
        String attribute,
        Boolean serializeJson
    ) {
        if (payload != null && payload.containsKey(attribute) && payload.get(attribute) != null) {
            if (serializeJson) {
                action.setInvocationParameter(attribute, JSON.serialize(payload.get(attribute)));
            } else {
                action.setInvocationParameter(attribute, payload.get(attribute));
            }
        }
    }
}

This sample response is for the Update Insurance Quote action.

\[
  {
    "actionName": "repriceInsuranceProduct",
    "errors": null,
    "invocationId": null,
    "isSuccess": true,
    "outcome": null,
    "outputValues": {
      "isSuccess": true,
      "quoteId": "0Q0xx000000001xAAA",
      "contextId": "11oxx000001G0lUAAS",
      "errorsList": "\[\]"
    },
    "sortOrder": -1,
    "version": 1
  }
\]