Architectural Overview
The WebStoreBundle metadata type represents a packaged storefront bundle for Salesforce B2B and D2C Commerce built natively on the core Salesforce platform. In modern digital commerce architectures, a storefront is not merely a collection of web pages; it is an integrated ecosystem encompassing catalog navigation structures, product discovery search schemas, cart and checkout workflows, pricing configurations, and branded digital experience templates.
Architecturally, WebStoreBundle enables enterprise architects to capture, version control, and deploy complete commerce storefront configurations as modular bundles. It bridges the gap between core commerce database models (such as WebStore, ProductCatalog, and CommerceEntitlementPolicy) and the presentation tier managed through Experience Cloud.
By leveraging WebStoreBundle, commerce development teams eliminate repetitive manual store setup across scratch orgs, staging environments, and production rollouts.
Directory and File Suffix
In a Salesforce DX project source structure, WebStoreBundle components are organized inside the webStoreBundles/ directory as a multi-file bundle structure:
- Bundle Directory:
force-app/main/default/webStoreBundles/<BundleName>/ - Metadata Configuration File:
force-app/main/default/webStoreBundles/<BundleName>/<BundleName>.webstorebundle-meta.xml
force-app/
└── main/
└── default/
└── webStoreBundles/
└── B2B_Global_Partner_Store/
├── B2B_Global_Partner_Store.webstorebundle-meta.xml
├── store-config.json
└── theme-settings.jsonKey Metadata Fields
The .webstorebundle-meta.xml metadata descriptor encapsulates administrative and operational parameters:
| Field Name | Type | Required | Description |
|---|---|---|---|
masterLabel |
string |
Yes | The human-readable title of the commerce bundle shown in setup wizards. |
description |
string |
No | Architectural description outlining target market, buyer personas, and currency rules. |
defaultCurrency |
string |
No | ISO currency code defining the primary storefront operating currency (e.g., USD, EUR). |
supportedCurrencies |
string[] |
No | Array of secondary transactional currencies supported by the storefront. |
experienceBundleName |
string |
No | Reference to the associated ExperienceBundle component rendering the storefront pages. |
Declarative XML Examples
Metadata XML Descriptor (webStoreBundles/B2B_Global_Partner_Store/B2B_Global_Partner_Store.webstorebundle-meta.xml)
<?xml version="1.0" encoding="UTF-8"?>
<WebStoreBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<defaultCurrency>USD</defaultCurrency>
<description>Enterprise B2B wholesale commerce storefront bundle with tiered discounting and multi-currency support.</description>
<masterLabel>B2B Global Partner Store</masterLabel>
<supportedCurrencies>
<currency>USD</currency>
<currency>EUR</currency>
<currency>GBP</currency>
</supportedCurrencies>
</WebStoreBundle>Manifest Definition (package.xml)
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>B2B_Global_Partner_Store</members>
<name>WebStoreBundle</name>
</types>
<version>68.0</version>
</Package>Retrieval and Deployment
Retrieving Store Bundles via Salesforce CLI
Retrieve the complete storefront bundle from your source environment:
# Retrieve a single WebStoreBundle component
sf project retrieve start --metadata "WebStoreBundle:B2B_Global_Partner_Store"
# Retrieve all store bundles in the target org
sf project retrieve start --metadata "WebStoreBundle"Deploying across Commerce Environments
Deploy the bundle into staging or production commerce orgs:
# Validate store bundle deployment
sf project deploy validate \
--metadata "WebStoreBundle:B2B_Global_Partner_Store" \
--target-org uat-sandbox
# Deploy the bundle to production
sf project deploy start \
--metadata "WebStoreBundle:B2B_Global_Partner_Store" \
--target-org production-orgQuerying WebStore Records via SOQL
Verify created storefront records and their active operational statuses:
sf data query --query \
"SELECT Id, Name, DefaultCurrencyIsoCode, Status, Type FROM WebStore WHERE Name = 'B2B Global Partner Store'"Architect Deployment Best Practices & Gotchas
Tip
Enable Commerce in Scratch Org Definitions: When building continuous integration pipelines for Commerce Cloud, include "Commerce" in the features array of your project-scratch-def.json file. Without this feature flag, WebStoreBundle deployments will immediately fail.
Warning
Sequence Catalog and Product Dependencies: A deployed storefront bundle requires underlying price books, products, and buyer groups to function. Ensure that standard catalog data and checkout Flows (metadata/flow-metadata-type) are provisioned as part of your deployment orchestration.
Note
ExperienceBundle Coupling: If your storefront utilizes a custom Lightning Web Runtime (LWR) template, ensure the associated ExperienceBundle is deployed in the same transaction or prior to activating the commerce store.
Frequently asked questions
What is the role of WebStoreBundle in Salesforce Commerce Cloud?
WebStoreBundle packages modular storefront configuration assets, theme references, and page templates for B2B and D2C Commerce sites built on the core platform.
Where are WebStoreBundle files stored in a Salesforce DX project?
WebStoreBundle components are located in the webStoreBundles directory of your project, organized by bundle name with associated metadata and asset files.
How does WebStoreBundle interact with ExperienceBundle?
WebStoreBundle defines commerce-specific store settings, layouts, and product discovery rules, linking directly with the underlying ExperienceBundle driving community site pages.
What prerequisites are needed before deploying WebStoreBundle?
The target org must have Commerce Cloud enabled, appropriate Commerce licenses provisioned, and the associated store community network or Experience site created.
Comments
Questions, corrections and tips are welcome. Comments are GitHub Discussions, so you sign in with GitHub.