| description | Commands for listing and managing storefront sites on B2C Commerce instances. |
|---|
Commands for managing sites on B2C Commerce instances.
Sites commands require OAuth authentication with OCAPI permissions for the /sites resource.
| Resource | Methods |
|---|---|
/sites |
GET |
/sites/* |
GET |
/sites/*/cartridges |
POST, PUT, DELETE |
Cartridge path commands also work without the cartridge-specific OCAPI permissions — they automatically fall back to site archive import/export when direct OCAPI access is unavailable. The fallback requires job execution permissions for sfcc-site-archive-import and WebDAV write access to Impex/.
export SFCC_CLIENT_ID=your-client-id
export SFCC_CLIENT_SECRET=your-client-secretFor complete setup instructions, see the Authentication Guide.
List sites on a B2C Commerce instance.
b2c sites listUses global instance and authentication flags.
# List sites on an instance
b2c sites list --server my-sandbox.demandware.net --client-id xxx --client-secret yyy
# Using environment variables
export SFCC_SERVER=my-sandbox.demandware.net
export SFCC_CLIENT_ID=your-client-id
export SFCC_CLIENT_SECRET=your-client-secret
b2c sites listThe command displays a list of sites with their:
- Site ID
- Display name
- Status
Example output:
Found 2 site(s):
RefArch
Display Name: Reference Architecture
Status: online
SiteGenesis
Display Name: Site Genesis
Status: online
Manage the cartridge path for a site — the ordered list of cartridges that are active on a storefront. Use sites cartridges or the singular alias sites cartridge.
::: tip Business Manager
Use the --bm flag as a shorthand for --site-id Sites-Site to manage the Business Manager cartridge path. BM updates always use site archive import since OCAPI direct updates are not supported for the BM site.
:::
::: tip Automatic Fallback
If OCAPI permissions for /sites/*/cartridges are not available, cartridge commands automatically fall back to site archive import/export. This means the commands work even without specific cartridge OCAPI permissions, as long as job execution and WebDAV access are configured.
:::
List the cartridge path for a site.
b2c sites cartridges list --site-id <site-id>
b2c sites cartridges list --bm| Flag | Description |
|---|---|
--site-id <id> |
Site ID (e.g. RefArch) |
--bm |
Use Business Manager site (Sites-Site) |
--json |
Output as JSON |
One of --site-id or --bm is required.
# List cartridge path for a storefront site
b2c sites cartridges list --site-id RefArch
# List Business Manager cartridge path
b2c sites cartridges list --bm
# JSON output for automation
b2c sites cartridges list --site-id RefArch --jsonAdd a cartridge to a site's cartridge path.
b2c sites cartridges add <cartridge> --site-id <site-id> [--position <position>] [--target <target>]| Argument | Description |
|---|---|
cartridge |
Name of the cartridge to add |
| Flag | Description |
|---|---|
--site-id <id> |
Site ID (e.g. RefArch) |
--bm |
Use Business Manager site (Sites-Site) |
--position <pos> |
Position: first (default), last, before, after |
--target <name> |
Target cartridge (required when position is before or after) |
--json |
Output as JSON |
# Add to beginning of path (default)
b2c sites cartridges add plugin_applepay --site-id RefArch
# Add to end
b2c sites cartridges add plugin_applepay --site-id RefArch --position last
# Add after a specific cartridge
b2c sites cartridges add plugin_applepay --site-id RefArch --position after --target app_storefront_base
# Add to Business Manager
b2c sites cartridges add bm_extension --bm --position firstRemove a cartridge from a site's cartridge path.
::: warning Destructive Operation
This command modifies the site cartridge path. It is blocked in safe mode — use --safety-level off to allow it.
:::
b2c sites cartridges remove <cartridge> --site-id <site-id>| Argument | Description |
|---|---|
cartridge |
Name of the cartridge to remove |
| Flag | Description |
|---|---|
--site-id <id> |
Site ID (e.g. RefArch) |
--bm |
Use Business Manager site (Sites-Site) |
--json |
Output as JSON |
b2c sites cartridges remove old_cartridge --site-id RefArch
b2c sites cartridges remove bm_extension --bmReplace the entire cartridge path for a site.
::: warning Destructive Operation
This command replaces the entire cartridge path. It is blocked in safe mode — use --safety-level off to allow it.
:::
b2c sites cartridges set <cartridges> --site-id <site-id>| Argument | Description |
|---|---|
cartridges |
New cartridge path (colon-separated, e.g. cart1:cart2:cart3) |
| Flag | Description |
|---|---|
--site-id <id> |
Site ID (e.g. RefArch) |
--bm |
Use Business Manager site (Sites-Site) |
--json |
Output as JSON |
b2c sites cartridges set "app_storefront_base:plugin_applepay:plugin_wishlists" --site-id RefArch
b2c sites cartridges set "bm_ext1:bm_ext2" --bm