---
schema_version: "1"
id: a755247f7846f68ed920ea1e640cef806b48f609a351f19d1520cd98d3b67750
title: Cost Calculation (PATCH)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/connect_resources_cost_calculation.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/connect_resources_cost_calculation.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 217cc6b22672c596db5b1531f5433cb553f3b10f2e54ee113a6d159370d1b321
description: Calculate the premium, fee, or premium-equivalent amount at InsuranceRatePlanLineItem based on the underlying rate plan. The InsuranceRatePlanLineItem premium, fees, or premium equivalent amount is rolled up to the Insurance Rate Plan, Insurance Coverage, and Insurance Policy Premium Amount.
---
# Cost Calculation (PATCH)

Calculate the premium, fee, or premium-equivalent amount at InsuranceRatePlanLineItem based on the underlying rate plan. The InsuranceRatePlanLineItem premium, fees, or premium equivalent amount is rolled up to the Insurance Rate Plan, Insurance Coverage, and Insurance Policy Premium Amount.

## Resource

{policyId} is a placeholder.

/connect/insurance/brokerage/policies/{policyId}/expected-rates

## Resource Example

Replace {yourInstance} with the My Domain name of your Salesforce org.

https://{yourInstance}.salesforce.com/services/data/v68.0/connect/insurance/brokerage/policies/0YTSG0000000o9h4AA/expected-rates?businessSObjectType=InsuranceRatePlan&recordId=1CcSG00000000fx0AA

## Available Version

63.0

## HTTP Methods

PATCH

## Path Parameter for PATCH

| Name | Type | Description | Required or Optional | Available Version |
| --- | --- | --- | --- | --- |
| policyId | String | ID of parent policy for which the expected cost is calculated. | Required | 63.0 |

## Request Parameters for PATCH

<table class="featureTable sort_table" summary="">





            <thead class="thead sorted" align="left">
              <tr>
                <th class="featureTableHeader vertical-align-top " id="d33520e194">Parameter Name</th>

                <th class="featureTableHeader vertical-align-top " id="d33520e197">Type</th>

                <th class="featureTableHeader vertical-align-top " id="d33520e200">Description</th>

                <th class="featureTableHeader vertical-align-top " id="d33520e203">Required or Optional</th>

                <th class="featureTableHeader vertical-align-top " id="d33520e206">Available Version</th>

              </tr>

            </thead>

            <tbody class="tbody">
              <tr>
                <td class="entry" headers="d33520e194" data-title="Parameter Name">
                  <samp class="codeph nolang">businessSObjectType</samp>
                </td>

                <td class="entry" headers="d33520e197" data-title="Type">String</td>

                <td class="entry" headers="d33520e200" data-title="Description">Name of business SObject to calculate the premium for. Possible values
                  are: <ul class="ul bulletList">
                    <li class="li">
                      <samp class="codeph nolang">InsurancePolicy</samp>
                    </li>

                    <li class="li">
                      <samp class="codeph nolang">InsurancePolicyCoverage</samp>
                    </li>

                    <li class="li">
                      <samp class="codeph nolang">InsuranceRatePlan</samp>
                    </li>

                    <li class="li">
                      <samp class="codeph nolang">InsuranceRatePlanLineItem</samp>
                    </li>

                  </ul>

                </td>

                <td class="entry" headers="d33520e203" data-title="Required or Optional">Optional</td>

                <td class="entry" headers="d33520e206" data-title="Available Version">63.0</td>

              </tr>

              <tr>
                <td class="entry" headers="d33520e194" data-title="Parameter Name">
                  <samp class="codeph nolang">recordId</samp>
                </td>

                <td class="entry" headers="d33520e197" data-title="Type">String</td>

                <td class="entry" headers="d33520e200" data-title="Description">ID of business SObject to calculate the premium for. </td>

                <td class="entry" headers="d33520e203" data-title="Required or Optional">Optional</td>

                <td class="entry" headers="d33520e206" data-title="Available Version">63.0</td>

              </tr>

            </tbody>

          </table>

## Request Body for PATCH

### JSON Example

{
 "action": "rollup",
 "expressionSetName": "expressionSetName",
 "ratePlanLineItems": \[
  {
   "id": "xxxxxx",
   "rate": 100,
   "enrollmentCount": 1000,
   "custom\_field\_1": "xxxxxx"
  },
  {
   "id": "yyyyy",
   "rate": 50,
   "enrollmentCount": 200,
   "custom\_field\_1": "xxxxxx"
  }
 \]
}

### Properties

<table class="featureTable sort_table" summary="">





            <thead class="thead sorted" align="left">
              <tr>
                <th class="featureTableHeader vertical-align-top " id="d33520e328">Name</th>

                <th class="featureTableHeader vertical-align-top " id="d33520e331">Type</th>

                <th class="featureTableHeader vertical-align-top " id="d33520e334">Description</th>

                <th class="featureTableHeader vertical-align-top " id="d33520e337">Required or Optional</th>

                <th class="featureTableHeader vertical-align-top " id="d33520e340">Available Version</th>

              </tr>

            </thead>

            <tbody class="tbody">
              <tr>
                <td class="entry" headers="d33520e328" data-title="Name"><samp class="codeph nolang">action</samp></td>

                <td class="entry" headers="d33520e331" data-title="Type">String</td>

                <td class="entry" headers="d33520e334" data-title="Description">Action for processing <samp class="codeph nolang">RatePlanLineItems</samp>. Valid values are: <ul class="ul bulletList">
                    <li class="li">
                      <samp class="codeph nolang">rollup</samp>: Calculates premium and roll ups
                      it to Insurance Policy level.
                    </li>

                    <li class="li">
                      <samp class="codeph nolang">calculate</samp>: Calculates premium and
                      returns it in the output.
                    </li>

                  </ul>

                </td>

                <td class="entry" headers="d33520e337" data-title="Required or Optional">Optional</td>

                <td class="entry" headers="d33520e340" data-title="Available Version">63.0</td>

              </tr>

              <tr>
                <td class="entry" headers="d33520e328" data-title="Name"><samp class="codeph nolang">expressionSet​Name</samp></td>

                <td class="entry" headers="d33520e331" data-title="Type">String</td>

                <td class="entry" headers="d33520e334" data-title="Description">Name of the expression set for cost calculation. If not specified, the value from the <samp class="codeph nolang">InsPolicyManagementConfig</samp> setup object is
                  taken.</td>

                <td class="entry" headers="d33520e337" data-title="Required or Optional">Optional</td>

                <td class="entry" headers="d33520e340" data-title="Available Version">63.0</td>

              </tr>

              <tr>
                <td class="entry" headers="d33520e328" data-title="Name"><samp class="codeph nolang">ratePlan​LineItems</samp></td>

                <td class="entry" headers="d33520e331" data-title="Type">List&lt;Map&lt;String, Object&gt;&gt;</td>

                <td class="entry" headers="d33520e334" data-title="Description">List of insurance rate plan line items to include for calculation.
                  Items with an <samp class="codeph nolang">id</samp> represent existing records.
                  Items without an <samp class="codeph nolang">id</samp> are draft records. When
                  <samp class="codeph nolang">action</samp> is <samp class="codeph nolang">calculate</samp>, premiums for draft records are calculated and returned
                  without being saved. Use <samp class="codeph nolang">referenceId</samp> to
                  correlate draft records with their calculated premiums in the response.
                </td>

                <td class="entry" headers="d33520e337" data-title="Required or Optional">Optional</td>

                <td class="entry" headers="d33520e340" data-title="Available Version">63.0</td>

              </tr>

            </tbody>

          </table>

## Response Body for PATCH

[Cost Calculation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/connect_responses_cost_calculation_output.htm "Output representation details of the cost calculation.")