import { BaseClient, ClientConfig, Response } from "@commerce-apps/core"; import type { CommonParameters } from "@commerce-apps/core"; import type { OperationOptions } from "retry"; import type { RequestInit } from "node-fetch"; import type { CompositeParameters, CustomRequestBody, QueryParameters, RequireParametersUnlessAllAreOptional } from "../../types"; import type { CustomPreferenceList, OrganizationPreferences, PreferenceValue, PreferenceValueSearchResult, SearchRequest, SitePreferences } from '../models/index'; export type GetGlobalPreferenceGroupInstanceTypeEnum = 'staging' | 'development' | 'sandbox' | 'production'; export type GetGlobalPreferenceGroupExpandEnum = 'sites'; export type GetSitePreferenceInstanceTypeEnum = 'staging' | 'development' | 'sandbox' | 'production'; export type GetSitePreferenceGroupInstanceTypeEnum = 'staging' | 'development' | 'sandbox' | 'production'; export type SearchSitePreferencesInstanceTypeEnum = 'staging' | 'development' | 'sandbox' | 'production'; export type SearchSitePreferencesExpandEnum = 'value'; export type UpdateGlobalPreferenceGroupInstanceTypeEnum = 'staging' | 'development' | 'sandbox' | 'production'; export type UpdateSitePreferenceInstanceTypeEnum = 'staging' | 'development' | 'sandbox' | 'production'; export type UpdateSitePreferenceGroupInstanceTypeEnum = 'staging' | 'development' | 'sandbox' | 'production'; /** * [Preferences](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=preferences:Summary) * ================================== * * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/preferences/preferences-oas-v1-public.yaml) # API Overview B2C Commerce teams must regularly configure site and environment-specific settings to support changing business needs and technical integrations. In many instances, Storefront Reference Architecture (SFRA)/SiteGenesis implementations rely on declarative Custom Site Preferences to alter these settings without the need for deployment or significant engineering support. Site preferences allow teams to adapt their sites with minimal effort. The following Preferences API endpoints retrieve preference-related information: - Global custom preferences: Retrieves all custom preferences at the organization level. - Site custom prefererences: Retrieves all custom preferences at the site level. The Preferences API first checks to see if custom values have been set, and if so, returns the custom settings. Otherwise, the Preferences API returns the default values provided in Business Manager. Note: The Preferences API sets custom preferences. For details on working with non-custom preferences, see [Global Preferences for B2C Commerce](https://help.salesforce.com/s/articleView?id=cc.b2c_global_preferences.htm&type=5) and [Site Preferences in B2C Commerce](https://help.salesforce.com/s/articleView?id=cc.b2c_site_preferences.htm&type=5). ## Authentication & Authorization For resource access, you must use a client ID and client secret from Account Manager to request an access token. The access token is used as a bearer token and added to the Authorization header of your API request. You must include `sfcc.preferences` in the client ID used to generate the token. For a full list of required permissions, see the [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html) For detailed setup instructions, see the [Authorization for Admin APIs guide.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html) ## Use Cases ### Global Custom Preference: A prominent private equity firm manages a diverse portfolio of brands, each operating its own site. Despite the individuality of these brands, they leverage shared third-party integrations for critical functionalities, such as payments and content management. Through a centralized approach, the firm establishes specifications for key components like the payments portal, ensuring consistency and efficiency across all sites. These specifications are meticulously crafted and undergo infrequent modifications to accommodate evolving needs while maintaining operational stability. ### Site Custom Preference: Site operators might have numerous tests or features tailored to their specific site. To facilitate streamlined control over these functionalities, they need a user-friendly mechanism for their merchant team to effortlessly toggle them on or off as needed. The site Preference API provides this mechanism. ### Caching Caching capabilities are available for the Preferences APIs. For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)*
* * For instructions on how to retrieve access token for admin APIs: https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html

* Example with admin auth * * ```typescript * import { Preferences, ClientConfig } from "commerce-sdk"; * // or * const { Preferences, ClientConfig } = require("commerce-sdk"); * * const clientConfig: ClientConfig = { * parameters: { * clientId: "XXXXXX", * organizationId: "XXXX", * shortCode: "XXX", * siteId: "XX" * } * }; * * token = { access_token: 'INSERT_ACCESS_TOKEN_HERE' }; * * clientConfig.headers['authorization'] = `Bearer ${token.access_token}`; * const preferencesClient = new Preferences(clientConfig); * ``` * * * API Version: 1.4.4
* Last Updated:
*
* */ export declare class Preferences extends BaseClient { constructor(config: ClientConfig); /** * * * If you would like to get a raw Response object use the other getGlobalCustomPreferenceList function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.maskPassword - Whether to mask password or not. * @param options.parameters.limit - Number of records to retrieve per request. Must be between 1 (minimum) and 200 (maximum). Defaults to 200. * @param options.parameters.offset - Used to retrieve the results based on a particular resource offset. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type CustomPreferenceList. */ getGlobalCustomPreferenceList(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; maskPassword?: boolean; limit?: number; offset?: number; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.maskPassword - Whether to mask password or not. * @param options.parameters.limit - Number of records to retrieve per request. Must be between 1 (minimum) and 200 (maximum). Defaults to 200. * @param options.parameters.offset - Used to retrieve the results based on a particular resource offset. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type CustomPreferenceList otherwise. */ getGlobalCustomPreferenceList(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; maskPassword?: boolean; limit?: number; offset?: number; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * For the specified instance, read the custom preferences in the preference group at the global (organization) level. Specify 'current' to retrieve the preferences for the instance on which this call is being made. The system will recognize its type. **Note:** If instance type sandbox is used, the preference values of development instance type will be returned as fallback. * * If you would like to get a raw Response object use the other getGlobalPreferenceGroup function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.parameters.expand - Expands the result document to include additional information. For global preference groups, the expansion "sites" retrieves the custom preferences for all the available sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type OrganizationPreferences. */ getGlobalPreferenceGroup(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: GetGlobalPreferenceGroupInstanceTypeEnum; maskPasswords?: boolean; expand?: Array; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * For the specified instance, read the custom preferences in the preference group at the global (organization) level. Specify 'current' to retrieve the preferences for the instance on which this call is being made. The system will recognize its type. **Note:** If instance type sandbox is used, the preference values of development instance type will be returned as fallback. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.parameters.expand - Expands the result document to include additional information. For global preference groups, the expansion "sites" retrieves the custom preferences for all the available sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type OrganizationPreferences otherwise. */ getGlobalPreferenceGroup(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: GetGlobalPreferenceGroupInstanceTypeEnum; maskPasswords?: boolean; expand?: Array; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * * * If you would like to get a raw Response object use the other getSiteCustomPreferenceList function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.maskPassword - Whether to mask password or not. * @param options.parameters.limit - Number of records to retrieve per request. Must be between 1 (minimum) and 200 (maximum). Defaults to 200. * @param options.parameters.offset - Used to retrieve the results based on a particular resource offset. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type CustomPreferenceList. */ getSiteCustomPreferenceList(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; siteId: string; maskPassword?: boolean; limit?: number; offset?: number; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.maskPassword - Whether to mask password or not. * @param options.parameters.limit - Number of records to retrieve per request. Must be between 1 (minimum) and 200 (maximum). Defaults to 200. * @param options.parameters.offset - Used to retrieve the results based on a particular resource offset. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type CustomPreferenceList otherwise. */ getSiteCustomPreferenceList(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; siteId: string; maskPassword?: boolean; limit?: number; offset?: number; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * Read a specific preference value identified by its ID within the given preference group and instance type. Returns the preference value for all sites. * * If you would like to get a raw Response object use the other getSitePreference function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.preferenceId - The preference attribute ID. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type PreferenceValue. */ getSitePreference(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: GetSitePreferenceInstanceTypeEnum; preferenceId: string; maskPasswords?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * Read a specific preference value identified by its ID within the given preference group and instance type. Returns the preference value for all sites. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.preferenceId - The preference attribute ID. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type PreferenceValue otherwise. */ getSitePreference(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: GetSitePreferenceInstanceTypeEnum; preferenceId: string; maskPasswords?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * For the specified site and instance, read the custom preferences in the preference group. Specify 'current' to retrieve the preferences for the instance on which this call is being made. The system will recognize its type. * * If you would like to get a raw Response object use the other getSitePreferenceGroup function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type SitePreferences. */ getSitePreferenceGroup(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: GetSitePreferenceGroupInstanceTypeEnum; siteId: string; maskPasswords?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * For the specified site and instance, read the custom preferences in the preference group. Specify 'current' to retrieve the preferences for the instance on which this call is being made. The system will recognize its type. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type SitePreferences otherwise. */ getSitePreferenceGroup(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: GetSitePreferenceGroupInstanceTypeEnum; siteId: string; maskPasswords?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * Search preferences across sites in the specified preference group and instance. The query attribute specifies a complex query that can be used to narrow down the search. The following is a list of searchable fields: | Field | Type | |---|---| | id | String | | display_name | Localized String | | description | Localized String | | value_type | Enum (see below) | Allowed value_type values: string, int, double, text, html, date, image, boolean, money, quantity, datetime, email, password, set_of_string, set_of_int, set_of_double, enum_of_string, enum_of_int. **Note:** value_type can only be joined with other attributes using a conjunction (AND). Only searchable attributes can be used in sorting. **Note:** If instance type sandbox is used, the preference values of development instance type will be returned as fallback. * * If you would like to get a raw Response object use the other searchSitePreferences function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.parameters.expand - Expands the result document to include additional information. For preference search, the expansion "value" retrieves the value definitions of the attribute definition. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type PreferenceValueSearchResult. */ searchSitePreferences(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: SearchSitePreferencesInstanceTypeEnum; maskPasswords?: boolean; expand?: Array; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: SearchRequest & CustomRequestBody; }>): Promise; /** * Search preferences across sites in the specified preference group and instance. The query attribute specifies a complex query that can be used to narrow down the search. The following is a list of searchable fields: | Field | Type | |---|---| | id | String | | display_name | Localized String | | description | Localized String | | value_type | Enum (see below) | Allowed value_type values: string, int, double, text, html, date, image, boolean, money, quantity, datetime, email, password, set_of_string, set_of_int, set_of_double, enum_of_string, enum_of_int. **Note:** value_type can only be joined with other attributes using a conjunction (AND). Only searchable attributes can be used in sorting. **Note:** If instance type sandbox is used, the preference values of development instance type will be returned as fallback. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.parameters.expand - Expands the result document to include additional information. For preference search, the expansion "value" retrieves the value definitions of the attribute definition. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type PreferenceValueSearchResult otherwise. */ searchSitePreferences(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: SearchSitePreferencesInstanceTypeEnum; maskPasswords?: boolean; expand?: Array; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: SearchRequest & CustomRequestBody; }>, rawResponse?: T): Promise; /** * For the specified instance, update one or more custom preferences in the preference group at the global (organization) level. **Note:** If instance type sandbox is used, the preference values of development instance type will be returned as fallback. * * If you would like to get a raw Response object use the other updateGlobalPreferenceGroup function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type OrganizationPreferences. */ updateGlobalPreferenceGroup(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: UpdateGlobalPreferenceGroupInstanceTypeEnum; maskPasswords?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OrganizationPreferences & CustomRequestBody; }>): Promise; /** * For the specified instance, update one or more custom preferences in the preference group at the global (organization) level. **Note:** If instance type sandbox is used, the preference values of development instance type will be returned as fallback. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type OrganizationPreferences otherwise. */ updateGlobalPreferenceGroup(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: UpdateGlobalPreferenceGroupInstanceTypeEnum; maskPasswords?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OrganizationPreferences & CustomRequestBody; }>, rawResponse?: T): Promise; /** * Update a specific preference value identified by its ID within the given preference group and instance type. The siteValues map specifies the new values per site. * * If you would like to get a raw Response object use the other updateSitePreference function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.preferenceId - The preference attribute ID. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type PreferenceValue. */ updateSitePreference(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: UpdateSitePreferenceInstanceTypeEnum; preferenceId: string; maskPasswords?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: PreferenceValue & CustomRequestBody; }>): Promise; /** * Update a specific preference value identified by its ID within the given preference group and instance type. The siteValues map specifies the new values per site. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.preferenceId - The preference attribute ID. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type PreferenceValue otherwise. */ updateSitePreference(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: UpdateSitePreferenceInstanceTypeEnum; preferenceId: string; maskPasswords?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: PreferenceValue & CustomRequestBody; }>, rawResponse?: T): Promise; /** * For the specified site and instance, update one or more custom preferences in the preference group. Preferences of type password cannot be set to "************" since it is a reserved value. * * If you would like to get a raw Response object use the other updateSitePreferenceGroup function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type SitePreferences. */ updateSitePreferenceGroup(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: UpdateSitePreferenceGroupInstanceTypeEnum; siteId: string; maskPasswords?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: SitePreferences & CustomRequestBody; }>): Promise; /** * For the specified site and instance, update one or more custom preferences in the preference group. Preferences of type password cannot be set to "************" since it is a reserved value. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.groupId - The preference group ID. * @param options.parameters.instanceType - The instance type for which to read or update preferences. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.maskPasswords - The preference values of type Password are masked when set. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type SitePreferences otherwise. */ updateSitePreferenceGroup(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; groupId: string; instanceType: UpdateSitePreferenceGroupInstanceTypeEnum; siteId: string; maskPasswords?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: SitePreferences & CustomRequestBody; }>, rawResponse?: T): Promise; }