---
schema_version: "1"
id: 308455bf9fd1210ae6c70c4a100d1c935d52301d8178be1e20e8c30508c754e5
title: validatePricingSetup(insPricingSetupValidationInputRepresentation)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsuranceDesignAdvisorFamily_validatePricingSetup_1.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsuranceDesignAdvisorFamily_validatePricingSetup_1.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 925800d07838e6a36b026610ff59255537a28c0e8c2b2fc70a3d9e973993e2de
description: Validate pricing configuration, including transaction type resolution, procedure plan existence and effective dates, pricing procedure versions, and the context definition.
---
# validatePricingSetup(insPricingSetupValidationInputRepresentation)

Validate pricing configuration, including transaction type resolution, procedure plan existence and effective dates, pricing procedure versions, and the context definition.

## API Version

68.0

## Requires Chatter

No

## Signature

public static ConnectApi.InsPricingSetupValidationRepresentation validatePricingSetup(ConnectApi.InsPricingSetupValidationInputRepresentation insPricingSetupValidationInputRepresentation)

## Parameters

insPricingSetupValidationInputRepresentation

Type: [ConnectApi.InsPricing​Setup​Validation​InputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_input_ins_pricing_setup_validation.htm "Input representation of the quote, transaction type, and products to validate for pricing setup configuration.")

Required. Input that optionally identifies a quote, transaction type, and product IDs to validate for pricing setup configuration.

## Return Value

Type: [ConnectApi.InsPricing​Setup​Validation​Representation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_ins_pricing_setup_validation.htm "Output representation of the pricing setup validation result, including whether the pricing configuration is valid and any related errors.")

## Usage

Use this method at design time to confirm that pricing infrastructure is correctly configured before quote execution or product rating. Provide an optional quote ID, transaction type, and product IDs. The method validates procedure plans, pricing procedures, effective dates, and context definitions for the specified transaction.

When quoteId or transactionType is provided, quote-level checks confirm that the transaction type is valid and resolvable; that a quote-level procedure plan is defined; that procedure plan effective dates cover the quote’s date range; that the quote-level pricing procedure has an active version for the evaluation date; and that the procedure plan’s context definition is a valid Insurance context.

When productIds is provided, product-level checks confirm that a product-level procedure plan is defined for each product, that the product-level pricing procedure has an active version for the evaluation date, and that the product procedure plan’s context definition is a valid Insurance context.

When pricing setup is valid, isValid is true. When setup fails, isValid is false and errors lists the failures. Examples include:

- SF-INS-DSAV-00062 — the transaction type isn’t valid or couldn’t be resolved.
- SF-INS-DSAV-00063 — no quote-level procedure plan is defined for the transaction type.
- SF-INS-DSAV-00064 — procedure plan effective dates aren’t valid for the request.
- SF-INS-DSAV-00066 — no product-level procedure plan is defined for a submitted product.
- SF-INS-DSAV-00067 — the quote-level pricing procedure doesn’t have an active version for the evaluation date.
- SF-INS-DSAV-00068 — the product-level pricing procedure doesn’t have an active version for the evaluation date.

## Example

This sample validates pricing setup from Apex.

ConnectApi.InsPricingSetupValidationInputRepresentation input =
    new ConnectApi.InsPricingSetupValidationInputRepresentation();
input.productIds = new List<String\>{ '01txx0000006i3DAAQ' };

ConnectApi.InsPricingSetupValidationRepresentation result =
    ConnectApi.InsuranceDesignAdvisorFamily.validatePricingSetup(input);

System.debug('isValid=' + result.isValid);
System.debug('errors=' + result.errors);