---
schema_version: "1"
id: a45ef78e8d2ec6040c7bf440aef646e1f14e47f26d5c3fcb434379f1845a584d
title: ExtensionInfo Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_CommerceExtension_ExtensionInfo.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_CommerceExtension_ExtensionInfo.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0f6def328e45413631029ca870c8da5a2ae2914b2e60e32c55f1dea535ae3c38
description: Contains static methods to expose extension-related context information.Returns the version number of the Client API for the extension context.Returns a custom parameter field value, if available, for the extension context. Returns the locale for the extension context.Indicates whether custom parameters are available for the extension context.
---
# ExtensionInfo Class

Contains static methods to expose extension-related context information.

## Namespace

[CommerceExtension](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_CommerceExtension.htm "Use the CommerceExtension namespace to define resolution strategies for registered Commerce extensions.")

## Example

public with sharing class TaxServiceExtensionResolverSample extends commercestoretax.TaxService implements CommerceExtension.ResolutionStrategy {
    public CommerceExtension.Resolution resolve() {
        // The Sample Extension Provider registered with developer name as
        // 'tax\_extension\_provider\_for\_us' will be selected for execution for en\_US locale
        if(CommerceExtension.ExtensionInfo.getLocaleString() == 'en\_US') {
            return new CommerceExtension.Resolution('tax\_extension\_provider\_for\_us');
        }
        // The Sample Extension Provider registered with developer name as
        // 'tax\_extension\_provider\_for\_canada' will be selected for execution for en\_CA locale
        if(CommerceExtension.ExtensionInfo.getLocaleString() == 'en\_CA') {
            return new CommerceExtension.Resolution('tax\_extension\_provider\_for\_canada');
        }
        // The default Salesforce Internal Tax Api will return an empty response for German locale
        if(CommerceExtension.ExtensionInfo.getLocaleString() == 'de') {
            return new CommerceExtension.Resolution(CommerceExtension.ResolutionStates.OFF);
        }
        // The default Salesforce Internal Tax Api will be selected for execution for
        // all other locales than US, Canada and Germany
        return new CommerceExtension.Resolution();
    }
}

- **[ExtensionInfo Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_CommerceExtension_ExtensionInfo.htm#apex_CommerceExtension_ExtensionInfo_methods)**

## ExtensionInfo Methods

The following are methods for ExtensionInfo.

- **[getClientApiVersion()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_CommerceExtension_ExtensionInfo.htm#apex_CommerceExtension_ExtensionInfo_getClientApiVersion)**  
    Returns the version number of the Client API for the extension context.
- **[getCustomParameterField(fieldName)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_CommerceExtension_ExtensionInfo.htm#apex_CommerceExtension_ExtensionInfo_getCustomParameterField)**  
    Returns a custom parameter field value, if available, for the extension context.
- **[getLocaleString()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_CommerceExtension_ExtensionInfo.htm#apex_CommerceExtension_ExtensionInfo_getLocaleString)**  
    Returns the locale for the extension context.
- **[isCustomParametersAvailable()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_CommerceExtension_ExtensionInfo.htm#apex_CommerceExtension_ExtensionInfo_isCustomParametersAvailable)**  
    Indicates whether custom parameters are available for the extension context.

### getClientApiVersion()

Returns the version number of the Client API for the extension context.

#### Signature

public static Double getClientApiVersion()

#### Return Value

Type: [Double](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_double.htm#apex_methods_system_double "Contains methods for the Double primitive data type.")

Version number of the Client API for the extension context.

### getCustomParameterField(fieldName)

Returns a custom parameter field value, if available, for the extension context.

#### Signature

public static String getCustomParameterField(String fieldName)

#### Parameters

- **fieldName**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Custom parameter field name.

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

Custom parameter field value for the extension context.

### getLocaleString()

Returns the locale for the extension context.

#### Signature

public static String getLocaleString()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

Locale for the extension context.

### isCustomParametersAvailable()

Indicates whether custom parameters are available for the extension context.

#### Signature

public static Boolean isCustomParametersAvailable()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

Value indicating if custom parameters are available in the extension context (true) or not (false).