import type { ShopperContextGeoLocation } from './ShopperContextGeoLocation'; /** * @type ShopperContext: A shoppers\' context represented as key-value string pairs. * * @property effectiveDateTime: Qualifier to set the effective date time for the context to apply. For example, \"Shop the Future\" use cases. If not provided, the current dateTime will be assumed. * * @property sourceCode: Qualifier to set the source code for the context to apply. Set the source code to evaluate source code group that triggers the promotion (campaign assignment) and Price books (assigned to Source code group). * * @property customerGroupIds: Qualifier to set the Customer Group Ids for the context to apply. Set the Customer Group Ids to evaluate customer groups that trigger the promotions (campaign assignment) assigned to the customer groups. * * @property customQualifiers: Map of custom qualifiers for the shopper context. Set this object to trigger pricing and promotion experiences using a dynamic session-based customer group. Object size is limited to 20 key-value pairs (properties). * * @property assignmentQualifiers: Map of assignment qualifiers for the shopper context. Set this object when using the assignment framework to activate experiences based on assignment qualifiers. Currently, only pricing and promotion experiences are supported. Object size is limited to 20 key-value pairs (properties). * * @property clientIp: The IP Address of the client. If the client IP is not a valid IPv4 address, a Bad Request (400) error is thrown. This property is available with B2C Commerce version 24.7. When `clientIp` is set, the geolocation based on the `clientIp` is returned in the `X-Geolocation` header in the response. Note: Use/retrieve this header in a case insensitive manner. However, if the `geoLocation` attribute is also set in the context, it takes precedence over the `clientIp`, and the `X-Geolocation` header returns the geolocation based on the `geoLocation` attribute. The query parameter `evaluateContextWithClientIp` determines whether to evaluate the context using the provided `clientIp`. - If `evaluateContextWithClientIp` is set to `true`: - The `clientIp` is saved and used in subsequent requests. Note: If `geoLocation` is also saved in the context, it takes precedence over the `clientIp`. - If `evaluateContextWithClientIp` is set to `false`: - The `clientIp` is not saved and is not used in subsequent requests. * * @property geoLocation: * * @property couponCodes: Array of coupon codes to be saved in the shopper context. Set the coupon codes to evaluate promotions that can be triggered by these codes. * */ export type ShopperContext = { effectiveDateTime?: string | null; sourceCode?: string | null; customerGroupIds?: Array; customQualifiers?: { [key: string]: string | null; }; assignmentQualifiers?: { [key: string]: string | null; }; clientIp?: string; geoLocation?: ShopperContextGeoLocation; couponCodes?: Array; } & { [key: string]: any; };