Salesforce Commerce Cloud · Schema
ShopperContext
A shoppers' context represented as key-value string pairs.
CommerceE-CommerceHeadless CommerceSalesforceB2C CommerceB2B CommerceDemandware
Properties
| Name | Type | Description |
|---|---|---|
| effectiveDateTime | stringnull | 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. |
| sourceCode | stringnull | 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 |
| customerGroupIds | array | 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 grou |
| customQualifiers | object | 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 pair |
| assignmentQualifiers | object | 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 |
| clientIp | string | 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 | object | The geographic location of the client. When you set a geolocation, it is saved as context for subsequent requests. This overrides any geolocation context previously saved using `clientIp`. This proper |
| couponCodes | array | 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. |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-shopper-context-schema.json",
"title": "ShopperContext",
"description": "A shoppers' context represented as key-value string pairs.",
"x-generated": "2026-11-25",
"x-method": "derived",
"x-generator": "derive-json-schema.py",
"x-source": "openapi/salesforce-commerce-cloud-shopper-context-api-openapi.yml#/components/schemas/ShopperContext",
"type": "object",
"properties": {
"effectiveDateTime": {
"description": "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.",
"type": [
"string",
"null"
],
"format": "date-time"
},
"sourceCode": {
"description": "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).",
"type": [
"string",
"null"
]
},
"customerGroupIds": {
"items": {
"maxLength": 256,
"type": "string"
},
"type": "array",
"description": "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."
},
"customQualifiers": {
"type": "object",
"additionalProperties": {
"type": [
"string",
"null"
]
},
"description": "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)."
},
"assignmentQualifiers": {
"type": "object",
"additionalProperties": {
"type": [
"string",
"null"
]
},
"description": "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)."
},
"clientIp": {
"type": "string",
"description": "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.\n\nWhen `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.\n\nHowever, 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.\n\nThe query parameter `evaluateContextWithClientIp` determines whether to evaluate the context using the provided `clientIp`.\n - If `evaluateContextWithClientIp` is set to `true`:\n - The `clientIp` is saved and used in subsequent requests. \n \n Note: If `geoLocation` is also saved in the context, it takes precedence over the `clientIp`.\n - If `evaluateContextWithClientIp` is set to `false`:\n - The `clientIp` is not saved and is not used in subsequent requests."
},
"geoLocation": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "The city name associated with this location."
},
"country": {
"type": "string",
"description": "The country name associated with this location."
},
"countryCode": {
"type": "string",
"description": "The ISO country code associated with this location."
},
"latitude": {
"type": "number",
"description": "The latitude coordinate, which is a number between -90.0 and +90.0, associated with this location.",
"format": "double"
},
"longitude": {
"type": "number",
"description": "The longitude coordinate, which is a number between -180.0 and +180.0, associated with this location.",
"format": "double"
},
"metroCode": {
"type": "string",
"description": "The metro code associated with this location."
},
"postalCode": {
"type": "string",
"description": "The postal code associated with this location."
},
"region": {
"type": "string",
"description": "The region (subdivision) name for this location. Corresponds with \"state\" in the USA."
},
"regionCode": {
"type": "string",
"description": "The region (province or state) code for this location."
}
},
"description": "The geographic location of the client. When you set a geolocation, it is saved as context for subsequent requests. This overrides any geolocation context previously saved using `clientIp`. This property is available with B2C Commerce version 24.7."
},
"couponCodes": {
"items": {
"maxLength": 256,
"type": "string"
},
"type": "array",
"description": "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."
}
},
"additionalProperties": false
}
Work with this as data
Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for schemas
4 MCP tools reach this
find_json_schemasBrowse and filter every JSON Schema in the catalog.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/salesforce-commerce-cloud-shopper-context"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.