Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

Sandbox Commands

Commands for managing On-Demand Sandboxes.

Alias

These commands were previously available as b2c ods <command>. The ods prefix still works as a backward-compatible alias.

Sandbox ID Formats

Commands that operate on a specific sandbox (get, start, stop, restart, delete) accept two ID formats:

FormatExampleDescription
UUIDabc12345-1234-1234-1234-abc123456789Full sandbox UUID
Realm-instancezzzv-123 or zzzv_123Realm-instance format

The realm-instance format uses the 4-character realm code followed by a dash (-) or underscore (_) and the instance identifier. When using the realm-instance format, the CLI automatically looks up the corresponding sandbox UUID.

bash
# These are equivalent (assuming zzzv-123 resolves to the UUID)
b2c sandbox get abc12345-1234-1234-1234-abc123456789
b2c sandbox get zzzv-123

Global Sandbox Flags

These flags are available on all sandbox commands:

FlagEnvironment VariableDescription
--sandbox-api-hostSFCC_SANDBOX_API_HOSTSandbox API hostname (default: admin.dx.commercecloud.salesforce.com)

Authentication

Sandbox commands work out of the box using the CLI's built-in public client, which authenticates via browser login (implicit flow). No API client configuration is required for interactive use.

For automation or CI/CD, you can provide your own API client credentials.

Required Roles

Auth MethodRoleConfigured On
Built-in client (default)Sandbox API UserYour user account
User AuthenticationSandbox API UserYour user account
Client CredentialsSandbox API UserThe API client

The Sandbox API User role must have a tenant filter configured for the realm(s) you wish to manage.

Configuration

bash
# No configuration needed — opens browser for login
b2c sandbox list

# Or provide your own client ID
b2c sandbox list --client-id xxx

# Client Credentials (for automation)
export SFCC_CLIENT_ID=my-client
export SFCC_CLIENT_SECRET=my-secret
b2c sandbox list

For complete setup instructions, see the Authentication Guide.


b2c sandbox list

List all on-demand sandboxes accessible to your account.

Usage

bash
b2c sandbox list

Flags

FlagDescriptionDefault
--realm, -rFilter by realm ID (four-letter ID)
--filter-paramsRaw filter parameters (e.g., "realm=abcd&state=started")
--show-deletedInclude deleted sandboxes in the listfalse
--columns, -cColumns to display (comma-separated)
--extended, -xShow all columns including extended fieldsfalse

Available Columns

realm, instance, state, profile, created, eol, id, hostname, createdBy, autoScheduled

Examples

bash
# List all sandboxes
b2c sandbox list

# Filter by realm
b2c sandbox list --realm abcd

# Filter by state and realm
b2c sandbox list --filter-params "realm=abcd&state=started"

# Show extended information
b2c sandbox list --extended

# Custom columns
b2c sandbox list --columns realm,instance,state,hostname

# Output as JSON
b2c sandbox list --json

Output

Realm  Instance  State    Profile  Created              EOL
──────────────────────────────────────────────────────────────────────────
abcd   001       started  medium   12/20/2024, 10:00 AM 12/21/2024, 10:00 AM
abcd   002       stopped  large    12/19/2024, 2:30 PM  12/20/2024, 2:30 PM

b2c sandbox create

Create a new on-demand sandbox.

Usage

bash
b2c sandbox create --realm <REALM>

Flags

FlagDescriptionDefault
--realm, -r(Required) Realm ID (four-letter ID)
--ttlTime to live in hours (0 for infinite)24
--profileResource profile (medium, large, xlarge, xxlarge)medium
--auto-scheduledEnable automatic start/stop schedulingfalse
--wait, -wWait for sandbox to reach started or failed statefalse
--poll-intervalPolling interval in seconds when using --wait10
--timeoutMaximum wait time in seconds (0 for no timeout)600
--set-permissions / --no-set-permissionsAutomatically set OCAPI and WebDAV permissionstrue
--permissions-client-idClient ID to use for default OCAPI/WebDAV permissions (defaults to auth client ID)
--ocapi-settingsCustom OCAPI settings JSON array (replaces defaults)
--webdav-settingsCustom WebDAV settings JSON array (replaces defaults)
--start-schedulerStart schedule JSON
--stop-schedulerStop schedule JSON

Examples

bash
# Create a sandbox with default settings
b2c sandbox create --realm abcd

# Create with extended TTL
b2c sandbox create --realm abcd --ttl 48

# Create with larger resources
b2c sandbox create --realm abcd --profile large

# Create and wait for it to be ready
b2c sandbox create --realm abcd --wait

# Create with auto-scheduling enabled
b2c sandbox create --realm abcd --auto-scheduled

# Create without automatic permissions
b2c sandbox create --realm abcd --no-set-permissions

# Use a different client ID for permissions
b2c sandbox create --realm abcd --permissions-client-id my-other-client

# Custom OCAPI settings (replaces defaults)
b2c sandbox create --realm abcd --ocapi-settings '[{"client_id":"my-client","resources":[{"resource_id":"/code_versions","methods":["get"]}]}]'

# Custom start/stop scheduler
b2c sandbox create --realm abcd --start-scheduler '{"weekdays":["MONDAY","TUESDAY"],"time":"08:00:00Z"}' --stop-scheduler '{"weekdays":["MONDAY","TUESDAY"],"time":"19:00:00Z"}'

# Output as JSON
b2c sandbox create --realm abcd --json

Notes

  • Sandbox creation can take several minutes
  • Use --wait to block until the sandbox is ready
  • By default, OCAPI and WebDAV permissions are set for the auth client ID. Use --permissions-client-id to override the client ID, or --ocapi-settings/--webdav-settings to provide fully custom settings
  • The --start-scheduler and --stop-scheduler flags accept JSON objects with weekdays and time fields

b2c sandbox get

Get details of a specific sandbox.

Usage

bash
b2c sandbox get <SANDBOXID>

Arguments

ArgumentDescriptionRequired
SANDBOXIDSandbox ID (UUID or realm-instance, e.g., zzzv-123)Yes

Examples

bash
# Get sandbox details using UUID
b2c sandbox get abc12345-1234-1234-1234-abc123456789

# Get sandbox details using realm-instance format
b2c sandbox get zzzv-123

# Output as JSON
b2c sandbox get zzzv_123 --json

Output

Displays detailed information about the sandbox including:

  • Sandbox ID and instance
  • Realm and hostname
  • State and resource profile
  • Creation time and end-of-life
  • Links to BM and storefront

b2c sandbox info

Display sandbox user and system information.

Usage

bash
b2c sandbox info

Examples

bash
# Get sandbox info
b2c sandbox info

# Output as JSON
b2c sandbox info --json

Output

Displays information about:

  • Authenticated user
  • Available realms
  • System status and limits

b2c sandbox start

Start a stopped on-demand sandbox.

Usage

bash
b2c sandbox start <SANDBOXID>

Arguments

ArgumentDescriptionRequired
SANDBOXIDSandbox ID (UUID or realm-instance, e.g., zzzv-123)Yes

Examples

bash
# Start a sandbox using UUID
b2c sandbox start abc12345-1234-1234-1234-abc123456789

# Start a sandbox using realm-instance format
b2c sandbox start zzzv-123

# Output as JSON
b2c sandbox start zzzv_123 --json

b2c sandbox stop

Stop a running on-demand sandbox.

Usage

bash
b2c sandbox stop <SANDBOXID>

Arguments

ArgumentDescriptionRequired
SANDBOXIDSandbox ID (UUID or realm-instance, e.g., zzzv-123)Yes

Examples

bash
# Stop a sandbox using UUID
b2c sandbox stop abc12345-1234-1234-1234-abc123456789

# Stop a sandbox using realm-instance format
b2c sandbox stop zzzv-123

# Output as JSON
b2c sandbox stop zzzv_123 --json

b2c sandbox restart

Restart an on-demand sandbox.

Usage

bash
b2c sandbox restart <SANDBOXID>

Arguments

ArgumentDescriptionRequired
SANDBOXIDSandbox ID (UUID or realm-instance, e.g., zzzv-123)Yes

Examples

bash
# Restart a sandbox using UUID
b2c sandbox restart abc12345-1234-1234-1234-abc123456789

# Restart a sandbox using realm-instance format
b2c sandbox restart zzzv-123

# Output as JSON
b2c sandbox restart zzzv_123 --json

b2c sandbox delete

Delete an on-demand sandbox.

Usage

bash
b2c sandbox delete <SANDBOXID>

Arguments

ArgumentDescriptionRequired
SANDBOXIDSandbox ID (UUID or realm-instance, e.g., zzzv-123)Yes

Flags

FlagDescriptionDefault
--force, -fSkip confirmation promptfalse

Examples

bash
# Delete a sandbox using UUID (with confirmation prompt)
b2c sandbox delete abc12345-1234-1234-1234-abc123456789

# Delete a sandbox using realm-instance format
b2c sandbox delete zzzv-123

# Delete without confirmation
b2c sandbox delete zzzv_123 --force

Notes

  • The command will prompt for confirmation unless --force is used
  • Deleted sandboxes cannot be recovered

Released under the Apache-2.0 License.