---
schema_version: "1"
id: 4cfd1bd4b52ad8da97fc29f04e6bd4d75ef0108e7389370ba6cba629911d4df6
title: Shopper Promotions
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/commerce-api/references/generated-api-specs/shopper-promotions.md
canonical_url: https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-promotions
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1544fef848bf446c74c8c97cfd669b008fe675d41576d881d41b77f5a547591c
products:
  - B2C Commerce API
  - Salesforce APIs
---
Shopper Promotions

# Shopper Promotions

[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-promotions/shopper-promotions-oas-v1-public.yaml)

## API Overview

Retrieve information about active promotions within the context of a shopper and a site. You can use this API to retrieve promotions that you configured in the commerce platform by searching for specific promotion IDs or by searching for promotions associated with a campaign.

### Authentication & Authorization

The Shopper Promotions API requires a JSON Web Token acquired via the Shopper Customers endpoint:

```
https://{shortCode}.api.commercecloud.salesforce.com/customer/shopper-customers/v1/organizations/{organizationId}/customers/actions/login
```

You must include the relevant scope(s) in the client ID used to generate the SLAS token. For details, see [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html)

### Customization

#### Custom Properties

This API supports custom properties (prefixed with `c_`). For details, see [Custom Properties.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/custom-properties.html)

#### Hooks

For details on working with hooks, see [Extensibility with Hooks.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html)

### Request Details

#### URL Encoding

If resource identifiers in request parameters contain commas (`,`) or percent signs (`%`), they must be URL encoded. For details, see [Encode URL Special Characters.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/url-encode.html)

### Response Details

#### Personalization

Responses from this API can be personalized using the [Shopper Context API.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/shopper-context-api.html) By setting context attributes such as customer group, source code, or store ID, you can retrieve personalized promotions, pricing, and shipping methods. For details on how personalization interacts with caching, see [Personalized Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html#personalized-caching)

#### Caching

Caching is provided for this API. For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)

#### Timeouts

Shopper API requests must respond within 10 seconds, including any hook execution. If a response exceeds this threshold, an HTTP 504 status code is returned. For details, see [Timeouts and Limits.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/timeouts-limits.html)

#### Error Handling

Error responses follow the [RFC 7807](https://datatracker.ietf.org/doc/html/rfc7807) problem detail format. To trace errors, include a `correlation-id` header in your request — the response returns it as `x-correlation-id`. For details, see [HTTP Status Codes and Errors.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/error-response-codes.html)

### Use Cases

#### Get Promotions by ID

Retrieve one or more promotions by their IDs (comma-separated, max 50).

```sh
curl "https://{shortCode}.api.commercecloud.salesforce.com/pricing/shopper-promotions/v1/organizations/{organizationId}/promotions?ids=Buy5for50,free_shipping&siteId=RefArch" \
  -H "Authorization: Bearer {access_token}"
```

#### Get Promotion by Promotion ID

Use the Shopper Promotions API to find promotion information by the promotion ID.

For example, a customer who is browsing on a commerce shopping app built using Commerce Cloud APIs can see the details about the applied promotions in the cart.

#### Get Promotion by Campaign ID

Use the Shopper Promotions API to find promotion information by the campaign ID.

For example, a customer who is browsing on a commerce shopping app built using Commerce Cloud APIs can see the possible promotions that can be applied in the cart.

### Related APIs

*   [Promotions (Admin)](https://developer.salesforce.com/docs/commerce/commerce-api/references/promotions?meta=Summary) — Create and manage promotions, discounts, and qualifiers.

**Version:** 1.4.2

## Servers

*   `https://{shortCode}.api.commercecloud.salesforce.com/pricing/shopper-promotions/v1`
    *   `shortCode (default shortCode) An eight-character string assigned to a realm for routing purposes. See [Base URL and Request Formation.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html)`

## Security

*   `ShopperToken` (oauth2) ShopperToken authentication follows the authorization code grant flow, as defined by the OAuth 2.1 standard. Depending on the type of OAuth client (public or private), this authorization flow has further requirements. For a detailed description of the authorization flow, see the [SLAS overview](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-login:Summary). A shopper token allows you to access the Shopper API endpoints of both the Open Commerce API (OCAPI) and the B2C Commerce API. These endpoints can be used to build headless storefronts and other applications. The `ShopperToken` security scheme is a parent of other security schemes, such as `ShopperTokenTsob`. A Shopper API endpoint can require a specific child scheme (`ShopperTokenTsob`, for example) that cannot be accessed with a regular shopper token.
    *   OAuth flow clientCredentials (tokenUrl: https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/token)
    *   Scope sfcc.shopper-promotions: Allows read operations on shopper promotions
    *   OAuth flow authorizationCode (authorizationUrl: https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/authorize, tokenUrl: https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/token)
    *   Scope sfcc.shopper-promotions: Allows read operations on shopper promotions
*   `ShopperClientContextToken` (oauth2) ShopperClientContextToken is a separate security scheme used to track and validate client context information. It is valid for Guest shoppers flows only using SLAS private clients. For registered shoppers, use existing ShopperToken flows. For authentication details, see the [SLAS overview](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-login:Summary). This token allows access to Shopper API endpoints for guest shoppers only.
    *   OAuth flow clientCredentials (tokenUrl: https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/token?hint=client\_context)
    *   Scope sfcc.shopper-promotions: Allows read operations on shopper promotions

## Operations

### GET Return an array of enabled promotions for specified IDs.

`GET /organizations/{organizationId}/promotions`

Operation ID: `getPromotions`. Security: ShopperToken (sfcc.shopper-promotions, sfcc.shopper-standard); ShopperClientContextToken (sfcc.shopper-promotions, sfcc.shopper-standard).

In the request URL, you can specify up to 50 IDs. If you specify an ID that contains either parentheses or the separator characters, you must URL encode these characters. Each request returns only enabled promotions as the server does not consider promotion qualifiers or schedules.

#### Parameters

*   `organizationId` (path, OrganizationId, required) 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).
    
    _Example_
    
    ```
    f_ecom_zzxy_prd
    ```
    
*   `siteId` (query, SiteId, required) 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.
    
    _Example: SiteId_
    
    ```
    RefArch
    ```
    
*   `ids` (query, array of string, required) A comma-separated list of promotion identifiers. Maximum: 50.  
    Items: Maximum length: 256.
*   `locale` (query, LocaleCode) A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
    
    _Example: LanguageCountry_
    
    ```
    en-US
    ```
    
    _Example: CountryCode_
    
    ```
    US
    ```
    
*   `personalized` (query, string)
    
    Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
    
    When set to `none`, the server skips applying personalization to the response.
    
      
    Allowed values: `none`. Example: `none`.
*   `sfdc_usid` (header, string (uuid)) A unique shopper identifier (USID) for tracking client context. Used with endpoints secured with ShopperClientContextToken. This header is required for all endpoints secured with ShopperClientContextToken.  
    Example: `550e8400-e29b-41d4-a716-446655440000`.
*   `sfdc_shopper_context` (header, string) Shopper context information (for example clientIP, sourceCode, and customQualifiers) passed in from a trusted backend application.

#### Responses

*   **200** Promotion information retrieved successfully.
    
    Media type: `application/json`. Schema: `PromotionResult`.
    
    _Example: PromotionsResult_ Multiple promotions retrieved by ID
    
    ```
    {
      "limit": 2,
      "data": [
        {
          "id": "Buy5for50",
          "name": "Buy 5 for $50",
          "calloutMsg": "Buy 5 for $50",
          "details": "Buy any 5 qualifying items and pay only $50. Discount applied at checkout.",
          "currency": "USD",
          "startDate": "2025-01-01T00:00:00Z",
          "endDate": "2025-12-31T23:59:00Z"
        },
        {
          "id": "$5_off_ties_promotion",
          "name": "$5 Off Ties Promotion",
          "calloutMsg": "$5 off Men's Ties",
          "details": "$5 off Men's Ties when you apply coupon code TIES5.",
          "currency": "USD",
          "startDate": "2025-03-01T00:00:00Z",
          "endDate": "2025-06-30T23:59:00Z",
          "c_promoCategory": "apparel"
        }
      ],
      "total": 2
    }
    ```
    
*   **404** Returned when there is no promotion found with the given ID for the requested site.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example: getPromotions404_
    
    ```
    {
      "type": "/PromotionNotFoundException",
      "detail": "There is no promotion found with the given ID for the requested site.",
      "title": "Not Found",
      "instance": "/foo"
    }
    ```
    

### GET Return an array of enabled promotions matching the specified filter criteria.

`GET /organizations/{organizationId}/promotions/campaigns/{campaignId}`

Operation ID: `getPromotionsForCampaign`. Security: ShopperToken (sfcc.shopper-promotions, sfcc.shopper-standard); ShopperClientContextToken (sfcc.shopper-promotions, sfcc.shopper-standard).

Retrieves promotion information using filter criteria. In the request URL, you must provide a campaign\_id parameter, and you can optionally specify a date range by providing start\_date and end\_date parameters. Both parameters are required to specify a date range, and omitting one causes the server to return a MissingParameterException fault. Each request returns only enabled promotions, since the server does not consider promotion qualifiers or schedules.

#### Parameters

*   `campaignId` (path, string, required) Find the promotions assigned to this campaign (mandatory).  
    Minimum length: 1. Maximum length: 256.
*   `organizationId` (path, OrganizationId, required) 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).
    
    _Example_
    
    ```
    f_ecom_zzxy_prd
    ```
    
*   `siteId` (query, SiteId, required) 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.
    
    _Example: SiteId_
    
    ```
    RefArch
    ```
    
*   `startDate` (query, string) The start date of the promotion in ISO 8601 date time format.
*   `endDate` (query, string) The end date of the promotion in ISO 8601 date time format.
*   `currency` (query, CurrencyCode) The currency mnemonic specified for price. This parameter is effective only for product suggestions.
*   `personalized` (query, string)
    
    Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
    
    When set to `none`, the server skips applying personalization to the response.
    
      
    Allowed values: `none`. Example: `none`.
*   `sfdc_usid` (header, string (uuid)) A unique shopper identifier (USID) for tracking client context. Used with endpoints secured with ShopperClientContextToken. This header is required for all endpoints secured with ShopperClientContextToken.  
    Example: `550e8400-e29b-41d4-a716-446655440000`.
*   `sfdc_shopper_context` (header, string) Shopper context information (for example clientIP, sourceCode, and customQualifiers) passed in from a trusted backend application.

#### Responses

*   **200** Retrieved promotion information successfully.
    
    Media type: `application/json`. Schema: `PromotionResult`.
    
    _Example PromotionsResult: same as GET /organizations/{organizationId}/promotions 200 response._ Multiple promotions retrieved by ID
    
    _Example: PromotionsResult_ Multiple promotions retrieved by ID
    
*   **400** Returned when a start date is provided without an end date, when an end date is provided without a start date, or when an end date precedes the start date.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example: getPromotionsForCampaign400_
    
    ```
    {
      "type": "/InvalidDateException",
      "detail": "Invalid Start or End Date",
      "title": "Invalid Start or End Date",
      "instance": "/foo"
    }
    ```
    
*   **404** Returned when no promotion with the specified ID is found for the requested site.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example: getPromotions404_
    
    ```
    {
      "type": "/PromotionNotFoundException",
      "detail": "There is no promotion found with the given ID for the requested site.",
      "title": "Not Found",
      "instance": "/foo"
    }
    ```
    

## Schemas

### 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).

Type: `string`.

Pattern: ^f\_ecom\_\[a-z\]{4}\_(prd|stg|dev|s\[0-9\]{2}|\[0-9\]{3})$. Example: `f_ecom_zzxy_prd`.

### 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

Type: `string`.

Minimum length: 1. Maximum length: 32. Example: `RefArch`.

### LocaleCode

A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.

One of: `LanguageCountry`, `LanguageCode`, `DefaultFallback`.

### PromotionResult

Result document containing an array of promotions.

Includes all fields of `ResultBase`.

*   `data` (_array of Promotion_, required) The array of promotion documents.

_Example_

```
{
  "limit": 2,
  "data": [
    {
      "calloutMsg": "Buy5for50",
      "details": "Buy5for50",
      "id": "Buy5for50",
      "name": "Buy5for50"
    },
    {
      "calloutMsg": "$5 off Men's Ties",
      "details": "$5 off Men's Ties (with coupon)",
      "id": "$5_off_ties_promotion",
      "name": "5 Off Ties Promotion"
    }
  ],
  "total": 2
}
```

### ErrorResponse

*   `title` (_string_, required) A short, human-readable summary of the problem type. It will not change from occurrence to occurrence of the problem, except for purposes of localization  
    Maximum length: 256. Example: `You do not have enough credit`.
*   `type` (_string_, required) A URI reference \[RFC3986\] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML \[W3C.REC-html5-20141028\]). When this member is not present, its value is assumed to be "about:blank". It accepts relative URIs; this means that they must be resolved relative to the document's base URI, as per \[RFC3986\], Section 5.  
    Maximum length: 2048. Example: `NotEnoughMoney`.
*   `detail` (_string_, required) A human-readable explanation specific to this occurrence of the problem.  
    Example: `Your current balance is 30, but that costs 50`.
*   `instance` (_string_) A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. It accepts relative URIs; this means that they must be resolved relative to the document's base URI, as per \[RFC3986\], Section 5.  
    Maximum length: 2048. Example: `/account/12345/msgs/abc`.

### CurrencyCode

A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.

Type: `string`.

Pattern: ^(\[A-Z\]\[A-Z\]\[A-Z\]|N/A)$. Example: `USD`.

### LanguageCountry

A concatenated version of the standard Language and Country codes, combined with a hyphen '`-`'.

Type: `string`.

Pattern: ^\[a-z\]\[a-z\]-\[A-Z\]\[A-Z\]$. Example: `en-US`.

### LanguageCode

A two letter lowercase language code conforming to the [ISO 639-1](https://www.iso.org/iso-639-language-codes.html) standard. Additionally, this may be used to submit requests with the header parameter `Accept-Language`, following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766).

Type: `string`.

Pattern: ^\[a-z\]\[a-z\]$. Example: `en`.

### DefaultFallback

A specialized value indicating the system default values for locales.

Type: `string`.

Default: `default`. Pattern: ^default$. Example: `default`.

### ResultBase

Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. Additionally it needs to be defined what data is returned.

*   `limit` (_integer (int32)_, required) Maximum records to retrieve per request. The limit with its constraints (minimum, maximum, default) is defined by the request parameter `limit` of the endpoint returning this schema.  
    Example: `10`.
*   `total` (_Total_, required)

### Promotion

Document representing a promotion.

*   `calloutMsg` (_string_) The localized call-out message of the promotion.  
    Example: `$30 Fixed Shipping Amount Above 150`.
*   `currency` (_string_) The currency that a promotion can be applied to. A null value means that the promotion applies to all allowed currencies.  
    Example: `USD`.
*   `details` (_string_) The localized detailed description of the promotion.  
    Example: `$30 Fixed Shipping Amount Above 150`.
*   `endDate` (_string (date-time)_) The end date of the promotion. This property follows the ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ . The time zone of the date time is always UTC.  
    Example: `2015-07-04T21:00:00Z`.
*   `id` (_string_, required) The unique ID of the promotion.  
    Example: `$30FixedShippingAmountAbove150`.
*   `image` (_string_) The URL to the promotion image.
*   `name` (_string_) The localized name of the promotion.  
    Example: `$30 Fixed Shipping Amount Above 150`.
*   `startDate` (_string (date-time)_) The start date of the promotion. This property follows the ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ. The time zone of the date time is always UTC.  
    Example: `2015-07-04T21:00:00Z`.

Additional properties: `any`.

Additional Property Support

This type supports additional properties passed along with the defined properties of this API. To indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`. The type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix.

Example: `c_trackingId`.

### Total

The total number of hits that match the search's criteria. This can be greater than the number of results returned as search results are pagenated.

Type: `integer (int32)`.

Default: `0`. Minimum: 0. Example: `10`.