---
schema_version: "1"
id: 55d72822a37d1f009c28e08394c967c250c4bc4cf07a5c31044f3432638a049d
title: Store-Specific Price Books and Promotions
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/commerce-api/guides/shopper-context-api-store-specific.md
canonical_url: https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/shopper-context-api-store-specific.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 47e9ad2a27aa0b12f4ab7669924daca89c77da526003f2c8524f54d08e30c1e7
products:
  - Composable Storefront
  - Salesforce APIs
---
# Store-Specific Price Books and Promotions

This guide covers how to activate store-specific price books and promotions when the shopper sets their local store.

## Set the Shopper Context

1. Follow the instructions in [Set and Retrieve Shopper Context](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/shopper-context-api.md#set-and-retrieve-shopper-context).
2. Set the qualifier as key and value pair. Use the same qualifier name as in the assignment.
   - `customQualifiers`: Set when you want to trigger pricing and promotion experiences using a dynamic session-based customer group.
   - `assignmentQualifiers`: Set when using the assignment framework. Can be used to trigger pricing and promotion experiences on pages such as Products, Product Search, Basket, and Shipping method.

```json
{
  "assignmentQualifiers": {
    "storeId": "boston"
  }
}
```

## Create the Assignment in Business Manager

Create the assignments using the import and export feature of Business Manager.

Log in to the Business Manager and go to **Merchant Tools** > **Online Marketing** > **Import & Export**.

![Shopper context assignment configuration interface](https://developer.salesforce.com/docs/media/commerce-api/shopper-context-assignments.png)

Use the following sample `assignment.xml` file to import the assignment into B2C Commerce.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<assignments xmlns="http://www.demandware.com/xml/impex/assignment/2020-11-30">
    <assignment assignment-id="assignment_store_boston_promotion">
        <description xml:lang="x-default">Promotions assigned to Store Boston</description>
        <enabled-flag>true</enabled-flag>
        <assigned-sites>
            <site>SiteGenesis</site>
        </assigned-sites>
        <qualifiers match-mode="any">
            <qualifier type="storeId">boston</qualifier>
        </qualifiers>
        <experiences>
          <pricebooks>
            <pricebook-id>sale_pricebook</pricebook-id>
          </pricebooks>
            <promotions>
                <promotion-id>10_%_off_electronics</promotion-id>
            </promotions>
        </experiences>
    </assignment>
</assignments>
```

## See Also

- [createShopperContext](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-context?meta=createShopperContext)
- [Shopper Login (SLAS)](https://developer.salesforce.com/docs/commerce/commerce-api/references/auth?meta=Summary)
- [Assign a Price Book or Promotion to a Specific Store in B2C Commerce](https://help.salesforce.com/s/articleView?id=cc.b2c_assigning_a_pricebook_or_promotion_specific.htm&type=5) in _Salesforce Help_
